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 ArrayBuffer fallback for #7918 #7983
Conversation
|
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.
That's a great solution.
In the issue I thought you wanted to inline the binary, which I would be against to.
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Alright, continued working with this, and bad news - this patch works fine for
Character 2658 is the actual call to |
Can confirm that #7732 does in fact fix the issues I saw. |
@xtuc - Anything further needed on this? Everything seems to be working from my end, want to make sure I didn't miss something. |
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.
Could you please add tests on that?
I guess you can overide the WebAssembly.instantiateStreaming
function to make it throw and test the fallback?
@xtuc How's this looking. Passes tests. |
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.
@TheLarkInn do we know if that's a common issue in pratice?
I'm not personally blocking it, but i'm not happy with the solution. There are many reasons for TypeErrors during instantiateStreaming
.
However, the worst case would be to call instantiate twice. I'm pretty sure it won't run two compilations, most of the type mismatch are coming from the ImportObject, which is checked before.
Ideally, either Electron should figure out a way to correctly load Wasm or the mime-type restriction needs to change.
Given that both Electron is unlikely to substantively change Blink to allow this, and the spec is unlikely to change, is this option acceptable? If not, I'd rather close out the request for now to clean things up. |
As noted in #7918, this is fixed simply by using Webpack 5 (and enabling the |
What kind of change does this PR introduce?
Adds a failure case so Electron-style apps can easily use WebAssembly
Did you add tests for your changes?
Doesn't run a headless test, not sure how best to add test support (is tested using a local Electron app)
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
Hopefully nothing? Think there may be a README example that needs updating, but this should be something that "just fixes" some background issues.