Repository navigation
fix(css): read a block's at-rule name with the shared helper when ordering declarations - #22590
Conversation
…ering declarations #22569 removed path.atKeyword while the declaration order change was in review, so minifying any at-rule holding declarations, such as @font-face, threw. Read the name with _atKeywordOf, as the rest of the printer does.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe nested-group at-rule check now reads the owner’s name with ChangesCSS declaration ordering
Suggested labels: Suggested reviewers: Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to The declaration-order fix matches the parser’s at-rule classification, with tests covering nested media ordering and font-face descriptor preservation. No concrete merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR is packaged and the instant preview is available (a7e5a84). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@a7e5a84
yarn add -D webpack@https://pkg.pr.new/webpack@a7e5a84
pnpm add -D webpack@https://pkg.pr.new/webpack@a7e5a84 |
Types CoverageCoverage after merging fix/css-at-rule-declaration-order into main will be
Coverage Report |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22590 +/- ##
==========================================
+ Coverage 95.54% 96.19% +0.64%
==========================================
Files 774 774
Lines 128230 128374 +144
Branches 42484 42525 +41
==========================================
+ Hits 122514 123485 +971
+ Misses 5716 4889 -827
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Generated code sizeComparing base ( Warning The baseline is
Read 34 asset(s) changed size, test untouched, biggest 20 by raw or gzip change
1 asset(s) changed size, test edited
No runtime gained or lost a runtime module. Built |
Summary
#22569 removed
path.atKeywordwhile #22513 was in review, so onmainminifying any at-rule that holds declarations throws. The declaration order now reads the name with_atKeywordOf, as the rest of the printer does.No changeset: the order change has not been released yet.
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes, two unit cases (
@font-faceand a nested@media); both throw onmain.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?
n/a
Use of AI
Written with Claude Code, which found the crash by running
yarn benchmark:css-toolsonmain, wrote the fix and tests, and ran unit tests, CSS/HTML config cases andyarn lint; reviewed by the author.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
@font-facerules.