Skip to content

Support for Source Phase imports #77

@guybedford

Description

@guybedford

It's been great to see the updates here. While the instance phase imports per the wasm-bindgen style remain specified and supported, the ESM Integration now also supports source phase imports of WebAssembly modules of the form:

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

returning the compiled module which can be instantiated explicitly later on or many times.

It could be nice to allow this to be inlined by this plugin in the same way instance inlining is currently done, but to get a handle to the compiled webassembly module record.

Note that the builtins: ['js-string'] WebAssembly.compile option is also supposed to be passed to compilation now for both instance and source phases to allow string builtin imports.

Happy to engage in further implementation discussion as necessary here or otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions