← Back to release summary

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

Ecosystem

View on chromestatus.com