Skip to content

Conversation

guybedford
Copy link
Collaborator

@guybedford guybedford commented Oct 7, 2025

As the final semantic gap for the ESM integration instance semantics, here's the initial spec for how Wasm instances may be able to import dependencies with phases in the source or deferstage (both at implementation stage at TC39, with defer moving stabilization currently).

The gist of it is that we use the import name value which is not necessary in these import use cases to instead indicate the phase (import "foo" "wasm-js:phase/source" (global (ref extern))) or (import "foo" "wasm-js:phase/defer" (global (ref extern))).

We can then obtain:

  • For defer, the namespace object directly, which can then be executed and used via a Reflect.get call.
  • For source, The WebAssembly.Module instance as an extern for the source phase for Wasm (and in due course for JS).

Again we need to figure out if we want to use wasm-js here or just use wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant