WebAssembly is a new feature of the Open Web Platform. It’s a bytecode targeted by all sorts of languages – a new language layer that offers better, more predictable performance for applications that need it. It enables applications that were previously excluded from the Web to leverage the amazing discovery and delivery that the Web Platform offers.
Languages such as C, C++, AssemblyScript, and Go will eventually be supported, but currently, our documentation focuses on Rust.
Wrangler is a CLI tool that seeks to provide an end-to-end developer experience for building Rust-generated
WebAssembly Workers. Install Wrangler using
cargo install wrangler
Generate a new project:
Move into the new project directory:
Build your project:
Preview your project:
(optional) Configure with your Cloudflare account:
wrangler config <email> <api_key>
You must configure your account to be able to use the
publish step, which will push your Worker live to the
Cloudflare edge. If you don’t configure, you can still use
wrangler to generate, build, and preview
Check your configuration:
Publish your project:
wrangler publish <zone_id>
<zone_id> is replaced with the
id for the Cloudflare zone you are publishing to!