Don't warn about Angular's ::ng-deep when optimizing generated CSS - #20437
Don't warn about Angular's ::ng-deep when optimizing generated CSS#20437koreahghg wants to merge 2 commits into
::ng-deep when optimizing generated CSS#20437Conversation
Lightning CSS's unknown-pseudo-element message quotes `ng-deep`, not `deep`, so the existing filter for `:deep()`/`:slotted()`/`:global()` never matched it and every Angular stylesheet using `::ng-deep` printed a spurious warning during `optimizeCss`.
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe CSS optimization warning filter now ignores Angular's Merge Risk: βͺ Minimal Β· up to This change suppresses a false warning for Angularβs supported π₯ 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 |
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or quality issues identified. The warning filter is narrowly extended for the intended Angular selector, and the added tests cover both suppression behavior and preservation of unrelated diagnostics. Reviews (1): Last reviewed commit: "Point changelog entry to PR #20437" | Re-trigger Greptile |
Summary
Fixes #20433.
optimizeCssfilters Lightning CSS warnings for the framework-specific deep selectors Vue emits (:deep(),:slotted(),:global()), but Angular's::ng-deepisn't covered by that filter, so every Angular stylesheet using it prints a warning during optimization:The existing regex (
/'(deep|slotted|global)' is not recognized as a valid pseudo-/) requires a'immediately beforedeep, but Lightning CSS's message quotes the full token'ng-deep', so the character beforedeepis-, not', and the filter never matches.::ng-deepis Angular's supported deep-selector spelling (aliased to>>>//deep/, which are already silently accepted vianonStandard.deepSelectorCombinator), and it's the spelling used in Angular's own docs, so it's hit by essentially every Angular codebase that uses view-encapsulation-piercing styles.Changes
packages/@tailwindcss-node/src/optimize.ts: addng-deepto the warning-suppression regex.packages/@tailwindcss-node/src/optimize.test.ts(new): covers that::ng-deepno longer warns, that the existing:deep()/:slotted()/:global()suppression still works, and that a genuinely unrecognized pseudo-element still warns (so the filter isn't overly broad).CHANGELOG.md: added an entry underUnreleased > Fixed.Test plan
packages/@tailwindcss-node/src/optimize.test.tsand ran it withvitest run packages/@tailwindcss-node/src/optimize.test.tsβ all 3 pass.::ng-deepcase fails) by temporarily reverting the regex change and re-running.@tailwindcss/nodepackage test suite (vitest run --project @tailwindcss/node) β all 10 tests pass, no regressions.pnpm run lint(prettier check) passes on the changed files.