Hi everyone!
This new tutorial goes a bit more in depth than the extant tutorials we’ve had for Rust and WebAssembly. The goal is to introduce all the topics you need when doing real Rust+Wasm development, all with a single running example to give continuity.
Topics covered include:
Every chapter also has exercises, if you want to challenge yourself.
If you follow along with the tutorial, please take notes along the way!! Your feedback would be incredibly valuable!
Thanks!
Is there any way to specify the current project is using the wasm target so one could just use
cargo buildinstead of relying onnpm? I triedrustup overridebut I keep having an error about the wasm target not found, even though I just installed it on nightly.If you look at what
npm run build-debugandnpm run build-releaseare doing, you’ll see that it isn’t very magic:So, yes, you can use
cargo buildto create the.wasmbinary, you just have to supply the--target wasm32-unknown-unknown. However, to get the generated JavaScript API glue, you need to also runwasm-bindgen.The
npm run build-*commands just package them both up in one step for convenience.