1 of 5

Source phase

imports update

Luca Casonato - Jul 2024 TC39 meeting

2 of 5

Wasm imports

  • The integration of source phase imports is tied to Wasm ESM integration��import { fib } from "./fibonacci.wasm";�// Uses default options.

or�import source mod from "./fibonacci.wasm";�// You can pass options to the constructor below.const instance = new WebAssembly.Instance(mod);�const { fib } = instance.exports;

3 of 5

Wasm imports are now approved by WasmCG

Wasm imports reached Stage 3 of the WebAssembly process on 2024-04-09

4 of 5

HTML integration

HTML integration is complete, and LGTM from Gecko and WebKit.

Just waiting on a final approval from V8/Chromium: https://github.com/whatwg/html/pull/10380

  • type: wasm import attribute is not needed
  • Wasm can import JS
    • but not JSON, because Wasm doesn’t support import attributes
  • Wasm js-string-builtins will be enabled by default

5 of 5

Hopefully shipping soon!

Questions?