feat(minifier): logical assignment with sequential#12957
feat(minifier): logical assignment with sequential#12957graphite-app[bot] merged 1 commit intomainfrom
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a minifier optimization to compress logical assignment expressions with sequential expressions. The feature transforms patterns like x || (a, x = 3) into x ||= (a, 3), which reduces code size by using logical assignment operators more effectively.
Key changes:
- Enhanced logical expression compression to handle sequence expressions containing assignments
- Added comprehensive test coverage for the new optimization pattern
- Updated minification benchmarks showing improved compression ratios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tasks/minsize/minsize.snap | Updated benchmark results showing improved compression ratios across multiple JavaScript libraries |
| crates/oxc_minifier/src/peephole/minimize_logical_expression.rs | Added logic to handle sequence expressions in logical assignment compression |
| crates/oxc_minifier/src/peephole/minimize_conditions.rs | Added test cases covering the new optimization pattern and edge cases |
CodSpeed Instrumentation Performance ReportMerging #12957 will not alter performanceComparing Summary
Footnotes |
Merge activity
|
Compress `x || (a, x = 3)` into `x ||= (a, 3)`. refs #8315
386a8c3 to
577d742
Compare
Compress `x || (a, x = 3)` into `x ||= (a, 3)`. refs oxc-project#8315

Compress
x || (a, x = 3)intox ||= (a, 3).refs #8315