Skip to content

Add a wasm-embed tool - #9127

Merged
tlively merged 4 commits into
mainfrom
wasm-embed
Sep 23, 2026
Merged

tlively merged 4 commits into
mainfrom
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.

@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

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with a changelog entry

@tlively
tlively added this pull request to stack #9137 September 22, 2026 20:35
Base automatically changed from reduce-js to main September 23, 2026 01:20
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 removed this pull request from stack #9137 September 23, 2026 01:28
@tlively
tlively enabled auto-merge (squash) September 23, 2026 01:28
@tlively
tlively merged commit 6c97a76 into main Sep 23, 2026
16 checks passed
@tlively
tlively deleted the wasm-embed branch September 23, 2026 01:58
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.

2 participants