When we rebase to the spec for deferred evaluation, the ESM integration should be updated to conform to the late execution semantics.
There are two aspects to the integration here:
- WebAssembly itself can be imported as a deferred namespace (
import defer * as ns from './mod.wasm'). This was already designed for previously when we switched to synchronous instantiation, so gets supported naturally.
- When WebAssembly imports from JavaScript or other WebAssembly that supports deferred evaluation, whether WebAssembly itself would want to be able to defer evaluation.
While (1) we get "for free", (2) would require some design work.
In particular, WebAssembly would need a way to (a) define an import phase, and (b) obtain a JS module namespace object import. A proposal for this is outlined in #119.
When we rebase to the spec for deferred evaluation, the ESM integration should be updated to conform to the late execution semantics.
There are two aspects to the integration here:
import defer * as ns from './mod.wasm'). This was already designed for previously when we switched to synchronous instantiation, so gets supported naturally.While (1) we get "for free", (2) would require some design work.
In particular, WebAssembly would need a way to (a) define an import phase, and (b) obtain a JS module namespace object import. A proposal for this is outlined in #119.