Skip to content

[wasm-reduce] Add --js mode for embedded modules - #9121

Open
tlively wants to merge 4 commits into
reduce-js-parsingfrom
reduce-js
Open

tlively wants to merge 4 commits into
reduce-js-parsingfrom
reduce-js

Conversation

@tlively

@tlively tlively commented Sep 18, 2026

Copy link
Copy Markdown
Member

In the new mode, parse the input JS file to find all its embedded modules, then run a full reduction on each of them in sequence. Add a new JSTestCaseHandler that handles splicing the module bytes into the JS at the correct location. Reducing each module in sequence is simple, but in principle can miss reduction opportunities that would require changing multiple modules at once, for example reducing types that are used in inter-module communication. Its expected that the current implementation will be good enough in the common case.

In the new mode, parse the input JS file to find all its embedded modules, then run a full reduction on each of them in sequence. Add a new JSTestCaseHandler that handles splicing the module bytes into the JS at the correct location. Reducing each module in sequence is simple, but in principle can miss reduction opportunities that would require changing multiple modules at once, for example reducing types that are used in inter-module communication. Its expected that the current implementation will be good enough in the common case.
@tlively
tlively requested a review from a team as a code owner September 18, 2026 23:53
@tlively
tlively requested review from kripken and stevenfontanella and removed request for a team September 18, 2026 23:53
@tlively tlively closed this Sep 18, 2026
@tlively tlively reopened this Sep 18, 2026
@tlively tlively changed the title move write_file to file.h/cpp [wasm-reduce] Add --js mode for embedded modules Sep 18, 2026
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