emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

[jspi] Switch to new JSPI API.

Open brendandahl opened this issue 1 year ago • 5 comments

Differences with the new API:

  • The JS engine now takes care of the suspender, so we don't need to modify the wasm file with binaryen.
  • Imports and exports and are now marked as async with WebAssembly.Suspending and WebAssembly.promising wrappers.

brendandahl avatar Apr 24 '24 00:04 brendandahl

We should wait for chrome unstable to include the new API (v126.0.6430) before we land this.

brendandahl avatar Apr 24 '24 00:04 brendandahl

This would make asyncify useless, right?

msqr1 avatar Apr 25 '24 05:04 msqr1

This would make asyncify useless, right?

Potentially, it will probably be awhile before JSPI is supported everywhere though. There's also a few areas where binaryen's asyncify is slightly different and may be preferred.

brendandahl avatar Apr 25 '24 17:04 brendandahl

This PR also depends on https://github.com/WebAssembly/binaryen/pull/6546

brendandahl avatar Apr 25 '24 17:04 brendandahl

It seems that we have to solve #21081 before completely going over.

msqr1 avatar Apr 26 '24 01:04 msqr1