JavaScript Promise Integration (JSPI) is an API that allows WebAssembly applications to integrate with JavaScript Promises. It allows a WebAssembly program to act as the generator of a Promise, and it allows the WebAssembly program to interact with Promise-bearing APIs. In particular, when an application uses JSPI to call a Promise-bearing (JavaScript) API, the WebAssembly code is suspended; and the original caller to the WebAssembly program is given a Promise that will be fulfilled when the WebAssembly program finally completes. JSPI is described in more detail in https://github.com/WebAssembly/js-promise-integration which is part of the W3C WebAssembly standards track. See also https://github.com/WebAssembly/stack-switching and https://github.com/WebAssembly/meetings/tree/main/stack.
This spec is backed by a standardization effort. We do not plan to ship the JSPI until it has been standardized by the W3C Wasm WG. However, post standardization, we will depend on all browsers implementing the standard.
Making use of JSPI requires some changes by WebAssembly-based developers (no impact on JavaScript developers). Depending on their toolchain usage a developer will need to modify their code. For Emscripten users, this is likely to be minimal as support for JSPI exists in Emscripten.
1. Control flow integrity. 2. Ensuring that JavaScript programs cannot suspend via JSPI. 3. Ensuring that heap sandbox escapes are not possible.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
No.
Developers can piggyback on existing DevTools support for Promises to help with debugging JSPI applications. In particular the existing mechanisms for constructing extended stack traces from so-called Promise chains will also include stack traces from JSPI applications.
https://wpt.fyi/results/wasm/jsapi/jspi
Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?
no.Shipping on desktop | 137 |
Origin trial desktop first | 123 |
Origin trial desktop last | 131 |
Origin trial extension 1 end milestone | 131 |
Origin trial extension 2 end milestone | 133 |
Origin trial extension 3 end milestone | 136 |
DevTrial on desktop | 109 |
Shipping on Android | 137 |
Origin trial Android first | 123 |
Origin trial Android last | 131 |
Shipping on WebView | 137 |
Origin trial WebView first | 123 |
Origin trial WebView last | 131 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
No spec changes anticipated. JSPI is part of a W3C standards process (see https://github.com/WebAssembly). We plan to ship after this spec reaches 'stage 4' which represents a completed specification.--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67f54f82.170a0220.374483.0000.GAE%40google.com.
LGTM3