-
-
Notifications
You must be signed in to change notification settings - Fork 85
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 4kb limit #1
Comments
For more details, see WebAssembly/esm-integration#1. For your information, we could workaround that in Webpack by changing the binary ahead of time:
|
@xtuc ok, this could certainly be something that we support in the Rollup output for Web Assembly when targetting Rollup code splitting. |
(as an option) |
I think moving forward on this the best thing may just be to look into using an async function for execution, and then allowing webassembly execution to be a promise. This will mean that any WASM in the module graph will break the synchronous execution invariant for that WASM tick, but I think that is an ok tradeoff given WASM is basically unusable with the 4KB limit anyway and this won't affect graphs without WASM. |
The problem here of course is that we can't use an async function in the ES module execution until top-level await is supported. I haven't worked out all the details but I believe it should be possible to "shim" top-level await support in this project too, in which case the Web Assembly work would be dependent on such a top-level await shim. |
Closing as Wasm has been removed for now in #84. |
The 4KB limit on
new WebAssembly.instance
means that this project cannot implement Web Assembly integration when hitting this limit unfortunately, as we would either (1) execute the Web Assembly too early before its imports are ready or (2) execute the Web Assembly too late as we can't ensure it happens synchronously in a module body as would be required for semantic support (any importer wouldn't be able to read the exports).SystemJS could get around this by handling
WebAssembly.instantiate
as if it were a top-level await, but because this project executes only within native module bodies that isn't possible.So unfortunately that may shatter any hopes of this project providing WASM polyfill-style workflow support, all because of this 4KB limit.
The text was updated successfully, but these errors were encountered: