wasm-tool/rollup-plugin-rust

Consider using wasm-bindgen-cli directly

domoritz opened this issue · 3 comments

https://github.com/rustwasm/wasm-pack hasn't been updated in a while and there are a number of important features missing. Maybe I am missing something but I wonder what value wasm pack brings over wasm-bindgen-cli.

Pauan commented

wasm-pack does a few important things:

  • It automatically installs the wasm32-unknown-unknown target.
  • It parses the Cargo.lock and downloads a version of wasm-bindgen-cli which exactly matches your project's version of wasm-bindgen. This is super important, the versions must match exactly.
  • It downloads and runs wasm-opt, which produces smaller binaries.

And it's available via an npm package, so it is automatically downloaded and used (without the user needing to manually install wasm-bindgen-cli separately).

I am aware of the state of wasm-pack (I used to be a Wasm Core team member, and I have heavily contributed to Rust Wasm), and I am prepared to create a replacement for wasm-pack if it ever breaks.

There has been talk about integrating wasm-pack's features into wasm-bindgen-cli:

rustwasm/wasm-bindgen#1674

But I don't contribute to Rust anymore, and Alex hasn't been very active lately, so I wouldn't expect it to happen anytime soon.

Thank you for the background and linking to the wasm bindgen issue. That's really helpful to understand. rustwasm/wasm-bindgen#1674 is pointing in a good direction from a user perspective.

Feel free to close this issue as it seems like the general tooling needs to improve rather than this particular rollup plugin.

Closing since improvements are better made at the source so everyone benefits.