-
Notifications
You must be signed in to change notification settings - Fork 404
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
Mark snippets and the bundler target's main file as having side effects #1224
Conversation
This is a less extreme version of rustwasm#1208, which only marks snippets and the main file on the bundler target as having side effects instead of all files. This means that the shim file which contains the vast majority of the JS code is still properly marked as having no side effects, allowing bundlers to get rid of things like unused `new TextEncoder` calls which could theoretically have side effects but don't. Fixes rustwasm#972.
I tried testing out your branch, but unfortunately I ran into this issue here: #650 (comment) It's unrelated to what's solved here, but if I can solve that, I can test if this resolves rustwasm/wasm-bindgen#3306 and #1230. |
I think only |
It's already effectively The reason why snippets are marked as having side effects is because they're arbitrary user code; we've got no idea what they do, and we don't want to assume that they have no side effects and cause them to break. |
I've tested this branch (after a merge with master) and it fixed the issue for me. |
What's missing to move this forward? It's an annoying bug right now |
It's just waiting on a review from @drager. |
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.
Thanks a lot!
Thank you for doing that! |
Thanks! 🙏 |
* Fixed the HDR Histogram build for webpack - rustwasm/wasm-bindgen#3276 (comment) - rustwasm/wasm-pack#1224 * Updated Viewer dependencies
- Bump wasm-bindgen to 0.2.91. - Enable side effects for the wasm module to prevent webpack from removing code and breaking the build. See rustwasm/wasm-pack#1224. - Build flux-next's wasm package in Nix.
This is a less extreme version of #1208, which only marks snippets and the main file on the bundler target as having side effects instead of all files.
This means that the JS shim file which contains the vast majority of the JS code is still properly marked as having no side effects, allowing bundlers to get rid of things like unused
new TextEncoder
calls which could theoretically have side effects but don't.Fixes #972
Fixes rustwasm/wasm-bindgen#3276