fix(transformer/styled-components): remove repeat whitespace in CSS minification#13369
Merged
graphite-app[bot] merged 1 commit intomainfrom Aug 29, 2025
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes CSS minification in the styled-components transformer by removing multiple consecutive whitespace characters before CSS delimiters ({, }, ,, ;), not just single spaces as the previous implementation did.
- Enhanced whitespace compression logic to consume all consecutive whitespace characters
- Added test case to verify the fix handles multiple spaces and various whitespace patterns
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_transformer/src/plugins/styled_components.rs | Updated minification logic to consume all consecutive whitespace instead of single characters |
| tasks/transform_conformance/tests/plugin-styled-components/test/fixtures/minify-whitespace-repeated/input.js | Test input with multiple spaces and whitespace patterns before CSS delimiters |
| tasks/transform_conformance/tests/plugin-styled-components/test/fixtures/minify-whitespace-repeated/output.js | Expected output showing properly minified CSS with whitespace removed |
| tasks/transform_conformance/tests/plugin-styled-components/test/fixtures/minify-whitespace-repeated/options.json | Babel configuration for the test case |
| tasks/transform_conformance/snapshots/oxc.snap.md | Updated test count reflecting the new passing test |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13369 will degrade performances by 10.72%Comparing Summary
Benchmarks breakdown
Footnotes |
This was referenced Aug 28, 2025
Merged
refactor(transformer/styled-components): clarify whitespace removal logic in CSS minification
#13375
Merged
f5196e5 to
0b252d8
Compare
Contributor
Merge activity
|
0b252d8 to
35d83ca
Compare
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.

Follow-on after #13346. Remove multiple spaces preceding
{,},,, or;.Previously we removed a single space, but wouldn't remove multiple whitespace characters in a row.