Skip to content

Drop the WASM_BINDGEN wasmExports namespace import for ESM integration - #27676

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
guybedford:wasm-bindgen-0.2.128
Sep 5, 2026
Merged

Drop the WASM_BINDGEN wasmExports namespace import for ESM integration#27676
sbc100 merged 1 commit into
emscripten-core:mainfrom
guybedford:wasm-bindgen-0.2.128

Conversation

@guybedford

Copy link
Copy Markdown
Collaborator

This removes the WASM_ESM_INTEGRATION && WASM_BINDGEN namespace import of the wasm module added in #27208, resolves #27658.

wasm-bindgen 0.2.128 no longer reads wasmExports[...] inline in its emscripten glue; it binds the asmjs-mangled identifiers that assignWasmExports already provides for every export (wasm-bindgen/wasm-bindgen#5270), so the aggregate object is not needed.

  • Remove the conditional import * as wasmExports from src/postamble.js, leaving the plain var wasmExports declaration for all modes.
  • Bump the pinned wasm-bindgen library and CLI from 0.2.127 to 0.2.128 (test crates, cargo add calls, CircleCI install).
  • test_wasm_bindgen_tsd_multi_return now asserts the correct public surface: only wasm-bindgen's unwrapping wrapper multi_value_return(): number is typed, and the raw multi-value Result ABI export _multi_value_return stays internal. With 0.2.127 the raw export leaked into WasmModule, which is what the old [number, number, number] assertion was matching.

All test_wasm_bindgen_* tests pass against wasm-bindgen 0.2.128.

Made with AI assistance under my review

wasm-bindgen 0.2.128 binds the asmjs-mangled per-export identifiers directly
instead of reading wasmExports[...] inline, so the aggregate namespace import
added in emscripten-core#27208 is no longer needed. Bump the pinned wasm-bindgen to 0.2.128.

Fixes emscripten-core#27658
@sbc100
sbc100 merged commit e5a00cc into emscripten-core:main Sep 5, 2026
42 checks passed
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.

Remove hard-coded wasmExports namespace import from #27208

2 participants