Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 28, 2025

Fix handling block comments which contain an expression. Previously if that block comment ended exactly before another expression, the comment wouldn't be considered closed, and all remaining parts of the template literal would be removed.

Input:

styled.div`${x}/* ${y} */${z}`

Previous output post-minification:

styled.div`${x}`

After this PR:

styled.div`${x}${z}`

This bug was introduced way back in #12224 (my fault!), but had gone unnoticed.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Aug 28, 2025
Copy link
Member Author

overlookmotel commented Aug 28, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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-hq
Copy link

codspeed-hq bot commented Aug 28, 2025

CodSpeed Instrumentation Performance Report

Merging #13370 will not alter performance

Comparing 08-28-fix_transformer_styled-components_fix_block_comment_containing_expression_in_css_minification (a7a06b7) with main (8f98841)1

Summary

✅ 38 untouched benchmarks

Footnotes

  1. No successful run was found on main (a7a06b7) during the generation of this report, so 8f98841 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel marked this pull request as ready for review August 28, 2025 22:35
@overlookmotel overlookmotel requested a review from Dunqing as a code owner August 28, 2025 22:35
@overlookmotel overlookmotel force-pushed the 08-28-fix_transformer_styled-components_fix_block_comment_containing_expression_in_css_minification branch from 99b0af8 to 4caa808 Compare August 29, 2025 01:17
@overlookmotel overlookmotel force-pushed the 08-28-fix_transformer_styled-components_remove_repeat_whitespace_in_css_minification branch from f5196e5 to 0b252d8 Compare August 29, 2025 01:17
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 29, 2025

Merge activity

…ession in CSS minification (#13370)

Fix handling block comments which contain an expression. Previously if that block comment ended exactly before another expression, the comment wouldn't be considered closed, and all remaining parts of the template literal would be removed.

Input:

```js
styled.div`${x}/* ${y} */${z}`
```

Previous output post-minification:

```js
styled.div`${x}`
```

After this PR:

```js
styled.div`${x}${z}`
```

This bug was introduced way back in #12224 (my fault!), but had gone unnoticed.
@graphite-app graphite-app bot force-pushed the 08-28-fix_transformer_styled-components_remove_repeat_whitespace_in_css_minification branch from 0b252d8 to 35d83ca Compare August 29, 2025 03:15
@graphite-app graphite-app bot force-pushed the 08-28-fix_transformer_styled-components_fix_block_comment_containing_expression_in_css_minification branch from 4caa808 to a7a06b7 Compare August 29, 2025 03:16
Base automatically changed from 08-28-fix_transformer_styled-components_remove_repeat_whitespace_in_css_minification to main August 29, 2025 03:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 29, 2025
@graphite-app graphite-app bot merged commit a7a06b7 into main Aug 29, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-28-fix_transformer_styled-components_fix_block_comment_containing_expression_in_css_minification branch August 29, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants