-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
WASM hot module reload #2688
WASM hot module reload #2688
Conversation
Co-authored-by: Ben Cooper <bencooper222@gmail.com> Co-authored-by: Kwuang Tang <arctangent20@yahoo.com> Co-authored-by: Chris bell <chrisbelldevelopment@gmail.com>
This changes the hmr-runtime to update asynchronously, as the wasm runtime runs asynchronously. Co-authored-by: Ben Cooper <bencooper222@gmail.com> Co-authored-by: Kwuang Tang <arctangent20@yahoo.com> Co-authored-by: Chris Bell <chrisbelldevelopment@gmail.com>
Browsers without promise support and bundles without wasm will use the old synchronous style Co-authored-by: Ben Cooper <bencooper222@gmail.com> Co-authored-by: Kwuang Tang <arctangent20@yahoo.com> Co-authored-by: Chris Bell <chrisbelldevelopment@gmail.com>
Co-authored-by: Ben Cooper <bencooper222@gmail.com> Co-authored-by: Kwuang Tang <arctangent20@yahoo.com> Co-authored-by: Chris Bell <chrisbelldevelopment@gmail.com>
for (var i = 0; i < len; ++i) | ||
bytes[i] = binStr.charCodeAt(i); | ||
|
||
return WebAssembly.instantiate(bytes).then(function(wasmModule) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synchronous Wasm instantiation and inlining the file content is really not ideal. It's recommend to use instantiateStreaming
, is there any blocker to use it even for hmr?
Gonna close this as parcel 1 is in maintenance mode and this has been inactive for quite some time. Still a great reference for future work in Parcel 2, thanks :) |
↪️ Pull Request
Enables hot module reload for WASM.
Closes #2453
💻 Examples
🚨 Test instructions
We used https://github.com/jamiebuilds/parcel-rust-example to test HMR.
✔️ PR Todo