Skip to content

Add a wasm-embed tool - #9127

Open
tlively wants to merge 1 commit into
reduce-jsfrom
wasm-embed
Open

tlively wants to merge 1 commit into
reduce-jsfrom
wasm-embed

Conversation

@tlively

@tlively tlively commented Sep 21, 2026

Copy link
Copy Markdown
Member

The tool embeds a given sequence of Wasm modules in place of the Wasm modules already present in a given JS file. Alternatively, with the --extract option, it extracts the embedded modules from the JS file and writes them as standalone Wasm files. This replaces the embed_wasms.py and extract_wasms.py scripts, reusing the C++ embedded module parsing logic added for wasm-reduce --js. The differences in behavior from the replaced scripts are that the new tool 1) can accept .wat files as input, assembling them before embedding, and 2) does not modify the original source when extracting modules and does not rely on a sentinel placeholder to determine where to embed new modules.

The tool embeds a given sequence of Wasm modules in place of the Wasm modules already present in a given JS file. Alternatively, with the --extract option, it extracts the embedded modules from the JS file and writes them as standalone Wasm files. This replaces the embed_wasms.py and extract_wasms.py scripts, reusing the C++ embedded module parsing logic added for wasm-reduce --js. The differences in behavior from the replaced scripts are that the new tool 1) can accept .wat files as input, assembling them before embedding, and 2) does not modify the original source when extracting modules and does not rely on a sentinel placeholder to determine where to embed new modules.
@tlively
tlively requested a review from a team as a code owner September 21, 2026 01:51
@tlively
tlively requested review from aheejin and removed request for a team September 21, 2026 01:51
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