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.
In order to support responsive applications written using WebAssembly it is necessary to provide functionality that allows WebAssembly programs to be suspended and resumed. The primary initial use case is to allow WebAssembly programs whose source relies on synchronous APIs to use asynchronous APIs that are increasingly common on the Web platform. The Promise integration proposal allows this to be done without changing the WebAssembly specification itself and without allowing JavaScript programs to be suspended (other than via existing async mechanisms).
Explainers: https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md