Skip to content

Tracing bindings through wasm #87

@ghost

Description

Has there been any discussion of whether to trace bindings through wasm modules?

If star exports find the same name twice, they consider it ambiguous and throw.

collide

But if multiple paths lead to the same place it's not ambiguous. ESM traces bindings to detect this and load successfully.

disambiguate-value

The proposal currently drops tracing at wasm nodes. This might be surprising for devs. It means there's different load time behavior for a wasm module. If you had a dual build gadget (wasm with a JS fallback), intuitively it seems they should both work. But with reexports they don't. In a less capable environment, the JS version works. In a more capable environment, the wasm version throws an error.

gadget

export { widget } from './widget.mjs'
(func (export "widget") (import "./widget.mjs" "widget"))

Where a package reexports, this means a wasm build can't be used as a drop in replacement for the JS version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions