Wrapping Up

In this chapter, you took the giant leap from manual and cumbersome communication between JavaScript and Rust-based WebAssembly modules to using the wasm_bindgen crate. With this library’s macros and command-line tooling, you have seamless, bi-directional invocations across the WebAssembly/JavaScript boundary.

To see this power in action, you built the Rogue WebAssembly game to help guide and inform your decisions about when code belongs in JavaScript versus when it belongs in Rust. Continuing this path toward more advanced tooling and libraries, in the next chapter, you’ll get to build a fully functional, networked, multi-user application almost entirely in Rust.

Get Programming WebAssembly with Rust now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.