wasmbuild - Deno blog post
I recently wrote a post on Deno's blog which introduces a tool my coworkers and I wrote called wasmbuild.
Check it out here: https://deno.com/blog/wasmbuild
Additional Points
With this tool, we have:
- Removed a lot of duplicate Rust -> Wasm build scripts.
- Reduced our contribution setup instructions.
- Previously we had to tell people to globally install wasm-bindgen-cli and
wasm-opt as well as run
rustup target add wasm32-unknown-unknown
. Now they only need Rust's toolchain and Deno installed. - We had a lot of issues with the global wasm-bindgen-cli being out of sync
with the repo leading to cryptic errors.
- wasmbuild ensures the version of wasm-bindgen used in the repo is the same one used by the tool internally.
- Previously we had to tell people to globally install wasm-bindgen-cli and
wasm-opt as well as run
- Added the ability to easily verify the build output committed to the Repo
is up to date.
- We run wasmbuild with the
--check
flag on the CI. - Previously we would often forget to build the Wasm code.
- We did have this check in deno_std's repo, but it was shell code that
required running the build on Linux. Now we just add a
--check
flag to the task that runs wasmbuild, which is much simpler. The change for this was made in this PR.
- We run wasmbuild with the
Anyway, check out the blog post for more details.
P.S. This tool would not be as easily possible without the amazing work done by the wasm-bindgen contributors. Wasmbuild uses wasm-bindgen-cli-support under the hood via Wasm so wasm-bindgen-cli doesn't need to be downloaded or installed.