-
-
Notifications
You must be signed in to change notification settings - Fork 721
feat(minifier): .minify and .dce methods; run dce in loop
#13026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(minifier): .minify and .dce methods; run dce in loop
#13026
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
12f4e5f to
78fa81e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the minifier API by introducing new .minify() and .dce() methods to replace the existing .build() method, and implements dead code elimination (DCE) to run in a loop for better optimization. The changes improve the minifier's API clarity and enhance dead code elimination effectiveness.
Key changes:
- Replace
.build()method calls with.minify()across the codebase - Add
.dce()method for dead code elimination only - Implement loop-based DCE execution with iteration tracking
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/minsize/src/lib.rs | Updates method call from .build() to .minify() |
| napi/playground/src/lib.rs | Updates method call from .build() to .minify() |
| napi/minify/src/lib.rs | Updates method call from .build() to .minify() |
| crates/oxc_minifier/tests/peephole/dead_code_elimination.rs | Comments out test cases and adds new complex test case |
| crates/oxc_minifier/src/peephole/remove_dead_code.rs | Removes manual state change tracking |
| crates/oxc_minifier/src/peephole/mod.rs | Refactors DCE to run in loop with iteration tracking |
| crates/oxc_minifier/src/lib.rs | Adds new .minify() and .dce() methods |
| crates/oxc_minifier/src/compressor.rs | Updates DCE methods to return iteration count |
| crates/oxc_minifier/examples/minifier.rs | Updates method call from .build() to .minify() |
CodSpeed Instrumentation Performance ReportMerging #13026 will not alter performanceComparing Summary
|
c84365b to
78fa81e
Compare
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
78fa81e to
993db89
Compare

fixes rolldown/rolldown#5712
closes #13027