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
Add i64
to the set of JS-compatible wasm types in syncWebAssembly
mode
#16339
Conversation
… mode For quite a while now, it's been possible for WebAssembly `i64`s to be converted to/from JS bigints (as function parameters, results, etc.). However, `syncWebAssembly` mode currently rejects any modules that attempt to do so, because `i64` isn't in it's list of JS-compatible types. This fixes that by adding `i64` to that list. There was an existing test that used `i64` as an example of a non-JS-compatible type; I replaced that with `v128`.
|
For maintainers only:
|
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.
Thank you
The CI failure looks to be unrelated to my changes. |
Thanks |
Given that there hasn't been a v4 release in almost two years, is it safe to assume this won't be backported? |
Running into challenges. The Rust part compiles, but when building with Webpack, I get this error: ``` ERROR in ./pkg/index_bg.wasm Import "__wbindgen_bigint_from_u64" from "./index_bg.js" with Non-JS-compatible Func Sigurature (i64 as parameter) can only be used for direct wasm to wasm dependencies @ ./pkg/index.js @ ./js/index.js ℹ 「wdm」: Failed to compile. ``` This issue (rustwasm/wasm-bindgen#3095) talks about the same problem. The fix (webpack/webpack#16339) was merged but not backported into Webpack 4, so I'm going to have to try and upgrade to fix.
For quite a while now, it's been possible for WebAssembly
i64
s to be converted to/from JS bigints (as function parameters, results, etc.). However,syncWebAssembly
mode currently rejects any modules that attempt to do so, becausei64
isn't in it's list of JS-compatible types. This fixes that by addingi64
to that list.Fixes #8531, although that was already closed from inactivity.
(Note: this fix is mainly meant for being backported to webpack 4, since
syncWebAssembly
is deprecated anyway, but I've implemented it against webpack 5 first.)This caused rustwasm/wasm-bindgen#3095 when
wasm-bindgen
switched to directly pass 64-bit integers asi64
s rather than as a pair ofi32
s; that issue is mostly about webpack 4, though, so this'll need to be backported before that's fixed.There was an existing test that used
i64
as an example of a non-JS-compatible type; I replaced that withv128
.