feat(minifier): fold switch stmt whose parent is not block stmt - #25403
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
armano2
force-pushed
the
feat/try_fold_switch-in-dce
branch
from
August 9, 2026 13:39
1a96331 to
bb57886
Compare
armano2
force-pushed
the
feat/try_fold_switch-in-dce
branch
from
August 20, 2026 22:37
a05d604 to
ce668f0
Compare
Member
|
@codex review |
Member
|
/monitor-oxc run |
Contributor
Monitor OxcCommit:
|
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Dunqing
force-pushed
the
feat/try_fold_switch-in-dce
branch
from
August 23, 2026 14:01
ce668f0 to
797c8ec
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Aug 24, 2026
### 🚀 Features - b6e9e5e minifier: Fold switch stmt whose parent is not block stmt (#25403) (Armano) ### 🐛 Bug Fixes - 8a9bdbd estree: Include decorators in `FormalParameterRest ` spans (#26021) (camc314) - 6f0c7cf minifier: Avoid merging `if` to `for` in sloppy mode when containing function declaration (#25638) (sapphi-red) - 2cde1f6 rust: Address nightly deprecations (#25998) (Boshen) - 6c5ad1b codegen: Only add mapping names for `PrivateIdentifier`s which have changed (#25958) (overlookmotel) - 2dad1e0 parser: Track irregular line terminators in trivia (#25947) (camc314) - 58ba651 minifier: Avoid merging `if` to `for` when the body contains a function declaration (#25637) (sapphi-red) - a185ac3 codegen: Print `#` before private identifier in TS signature key (#25938) (overlookmotel) - af82a07 minifier: Keep unary `+` when the other operand has side effects (#25645) (Kotaro Chikuba) ### ⚡ Performance - 53f6270 packages/codegen: Eagerly initialize `mapNames` (#25979) (overlookmotel) - 5b43c60 packages/codegen: Split recording mappings into multiple functions (#25978) (overlookmotel) - cc947b5 packages/codegen: Reduce property lookups (#25977) (overlookmotel) - c22a9cc packages/codegen: Combine condition checks (#25976) (overlookmotel) - 215a6a5 packages/codegen: Add functions for writing/marking unnamed mappings (#25975) (overlookmotel) - fe444cc codegen: Avoid allocations for single comment anchors (#25598) (camc314) - a0aee81 minifier: Do not rebuild expression when substituting void to null (#25964) (Armano) - 1004439 packages/codegen: Merge `mark` and `write` calls in `printImportAttributes` (#25972) (overlookmotel) - 94c8a34 packages/codegen: Remove `node` param from `printString` and `printNonNegativeFloat` (#25971) (overlookmotel) - 7e2b4b3 packages/codegen: `printNonNegativeFloat` write mapping directly (#25968) (overlookmotel) - f09c8ab minifier: Avoid creation of unnecessary conditional expressions (#25931) (Armano) - 53ff080 packages/codegen: Remove `lastWasPostfixClose` (#25888) (overlookmotel) ### 📚 Documentation - 07de646 packages/codegen: Fix JSDoc comments on `write*` methods (#25966) (overlookmotel) - 3b09c04 packages/codegen: Clarify comment (#25959) (overlookmotel)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move removal of dead code from switch stmts to remove_dead_code, this change enables processing of switch stmts whose parent is not list of stmts
current minification processes stmts whose parents are block stmts and they are last stmt of set block, this change also allows us to remove empty blocks and last break from switch cases whose parent is not block stmt
note: this change applies only dce, and dosn't substitute switch stmts with if'stmts
changes in stack:
main