-
Notifications
You must be signed in to change notification settings - Fork 60
Tracking issue for javascript bundler integration #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(changed the title because I thought this was about ruby's Bundler, not the generic idea of a "bundler") |
I've added a diagram of the toolchain in #5 (comment) which includes bundlers. |
Relevant work: https://github.com/glimmerjs/broccoli-rust2wasm |
Relevant: Parcel another web bundler just added support to drop in |
Update: we met with the Parcel team and had a great discussion! The main focus was on how we ultimately want to support Rust libraries getting pulled in. The short story is: We should be able to publish an npm package that has:
The bundler is set up to allow you to import from .wasm files as if they were ES modules, so it will natively understand what's going on, and generate the appropriate code to instantiate the .wasm module. Parcel does not yet support imports from .wasm modules, but they will start working on that now. Note that this model is not in any way tied to Rust. In particular, the wasm-bindgen tool is ultimately intended to be language-agnostic. We intend to chat again with Webpack to see whether they are following a similar plan. |
I've updated wasm-bindgen with the results of the discussion ("everything is an ES6 module") and it's got some examples about how it all works!
Another point to add to this is that we're expecting bundlers will also resolve the imports of a wasm file itself as if it were an ES6 module. In that sense the bundler is the one that's ultimately responsible for resolving the wasm modules imports (in addition to instantiation) |
Webpack 4.0 beta supports wasm modules natively, and the README of wasm-bindgen was rewritten to exercise this like |
I'm gonna close this since webpack works quite well nowadays! |
Uh oh!
There was an error while loading. Please reload this page.
This is a point of coordination for work that JS bundlers are doing along two fronts:
The former is connected to our npm integration story, but will probably not be Rust-specific, since the npm packages will likely just contain a compiled .wasm blob.
The text was updated successfully, but these errors were encountered: