WebAssembly / esm-integration

ECMAScript module integration
https://webassembly.github.io/esm-integration/js-api/index.html#esm-integration
Other
377 stars 32 forks source link

Integrate with Module Source Imports proposal #70

Closed lucacasonato closed 1 year ago

lucacasonato commented 1 year ago

This commit integrates the Wasm ESM integration with the TC39 Module Source Imports proposal. The Module Source Imports proposal allows performing a JS import that early returns from the module loader at an earlier stage than evaluation, specifically after "fetch/compile".

import source mod from "./test.wasm";
mod instanceof WebAssembly.Module; // true

This enables Wasm-ESM integration for tooling that can not adopt "full" ESM because of the need for manual instantiation.