fix(transformer/styled-components): remove leading whitespace when literal starts with block comment containing interpolation in CSS minification#13391
Merged
Conversation
Member
Author
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 #13391 will improve performances by 3.1%Comparing Summary
Benchmarks breakdown
Footnotes |
Member
Merge activity
|
…teral starts with block comment containing interpolation in CSS minification (#13391) Remove leading whitespace when template literal starts with a block comment which contains interpolations. Previously we didn't remove it because we checked if we're at start of the template literal with `quasi_index == 0`, but that wasn't right because the 1st quasi gets merged into the 2nd. So the 2nd quasi is the 1st *output* quasi. Introduce `is_first_output` var to track this state. Input: ```js styled.div` /* ${x} */ color: red; `; ``` Previous output post-minification: ```js styled.div` color:red;`; ``` After this PR: ```js styled.div`color:red;`; ```
ac79d7a to
cf5175c
Compare
905c7d3 to
7ee19e2
Compare
Base automatically changed from
08-29-fix_transformer_styled-components_remove_unnecessary_whitespace_when_removing_block_comments_in_css_minification
to
main
August 30, 2025 04:29
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.

Remove leading whitespace when template literal starts with a block comment which contains interpolations.
Previously we didn't remove it because we checked if we're at start of the template literal with
quasi_index == 0, but that wasn't right because the 1st quasi gets merged into the 2nd. So the 2nd quasi is the 1st output quasi. Introduceis_first_outputvar to track this state.Input:
Previous output post-minification:
After this PR: