fix: prevent !important from being renamed in CSS modules#20798
fix: prevent !important from being renamed in CSS modules#20798alexander-akait merged 3 commits intomainfrom
Conversation
Adds animation/color declarations with !important to css-modules test to reproduce the issue where !important gets treated as a local identifier and renamed (e.g. !my-app-style_module_css-important). Ref: #20794
Add a delim callback to track exclamation marks during CSS declaration value parsing, so the subsequent "important" identifier is skipped instead of being collected as a renameable local identifier. Fixes #20794
🦋 Changeset detectedLatest commit: d4cc69f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (c0e8cf4). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@c0e8cf4
yarn add -D webpack@https://pkg.pr.new/webpack@c0e8cf4
pnpm add -D webpack@https://pkg.pr.new/webpack@c0e8cf4 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20798 +/- ##
=======================================
Coverage 91.38% 91.38%
=======================================
Files 560 560
Lines 55298 55306 +8
Branches 14595 14596 +1
=======================================
+ Hits 50533 50541 +8
Misses 4765 4765
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 89.27%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | benchmark "many-modules-esm", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
298 KB | 804.9 KB | -62.97% |
| ❌ | Memory | benchmark "json-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
412.7 KB | 994.1 KB | -58.48% |
| ❌ | Memory | benchmark "many-modules-commonjs", scenario '{"name":"mode-production","mode":"production"}' |
7.2 MB | 9 MB | -20.07% |
| ⚡ | Memory | benchmark "asset-modules-source", scenario '{"name":"mode-development","mode":"development"}' |
660.9 KB | 505.7 KB | +30.7% |
| ⚡ | Memory | benchmark "react", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
865 KB | 645.6 KB | +33.99% |
| ❌ | Memory | benchmark "asset-modules-inline", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
734.6 KB | 6,847.9 KB | -89.27% |
| ⚡ | Memory | benchmark "concatenate-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
776.3 KB | 555.4 KB | +39.78% |
| ⚡ | Memory | benchmark "asset-modules-resource", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
996.7 KB | 733.3 KB | +35.92% |
| ⚡ | Memory | benchmark "asset-modules-source", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
339.3 KB | 265.6 KB | +27.72% |
Comparing fix/css-important-rename (d4cc69f) with main (e370b76)
Summary
What kind of change does this PR introduce?
fixes #20794
Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing
Use of AI
Partial