feat(minifier): evaluate .concat calls that has subsequent method calls#14074
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. |
CodSpeed Instrumentation Performance ReportMerging #14074 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull Request Overview
This PR enables the minifier to optimize chained .concat() calls when they are followed by other method calls, allowing the concatenation to be evaluated before the subsequent method is applied.
- Modified the condition that prevents concat optimization when followed by method calls
- Added test cases to verify the optimization works with subsequent method calls like
.join()and.split()
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_minifier/src/peephole/replace_known_methods.rs | Updated condition to allow concat optimization when followed by non-concat method calls and added comprehensive test cases |
| tasks/minsize/minsize.snap | Updated snapshot reflecting minor size improvement in antd.js |
| tasks/track_memory_allocations/allocs_minifier.snap | Updated memory allocation snapshot with minor changes in cal.com.tsx and antd.js |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
…alls (#14074) ```js x = ''.concat('a', ' ').concat('b').split(/[\\s\\n]+/) ``` was not compressed to ```js x = 'a b'.split(/[\\s\\n]+/) ``` . This PR changes the code to allow that.
e081f92 to
1337811
Compare

was not compressed to
. This PR changes the code to allow that.