Source phase imports
- Category
- JavaScript
- Type
- Chromium catches up
- Status
- In development (Chrome In development)
- Intent stage
- None
Summary
introduces the `import source` and `import.source` syntax. It allows modules to be imported as a representation of their compiled source, when the host supports such representation; currently, only WebAssembly modules are supported. This provides Wasm module fetching through the browser, including applying source-specific CSP policies for dynamic Wasm instantiation.
Motivation
TC39 proposal: https://github.com/tc39/proposal-source-phase-imports ECMA262 spec PR: https://arai-a.github.io/ecma262-compare/?pr=3492 HTML Standard "Fetch a single module script" section: https://html.spec.whatwg.org/#fetch-a-single-module-script Wasm "Module Records" section: https://webassembly.github.io/esm-integration/js-api/index.html#webassembly-module-record
Standards & signals
- Specification: https://arai-a.github.io/ecma262-compare/?pr=3492
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/42204365
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=source-phase-imports
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Source%20phase%20imports
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Source%20phase%20imports
- Baseline status: https://webstatus.dev/?q=Source%20phase%20imports