fix(compiler-sfc): handle nested :deep in selector pseudos#14725
Conversation
📝 WalkthroughWalkthroughDetects and correctly rewrites nested Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
|
I think there's a similar issue with |
4dee52f to
38a2847
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/compiler-sfc/src/style/pluginScoped.ts`:
- Around line 154-162: The current early return inside the condition checking
value === ':not' && !deep && !hasScopeAnchor && hasMixedSelectors &&
hasTrailingNodes silently skips selectors like :not(:deep(.foo), .bar) and
leaves :deep unresolved; update the branch that currently returns to instead
emit a compile-time warning (e.g., call an existing logger/warn helper or add a
new warnUnsupportedNotWithDeep helper) that includes the selector text and
explains :not(...) with mixed selectors and nested :deep() is unsupported, then
return; reference the variables value, deep, hasScopeAnchor, hasMixedSelectors,
hasTrailingNodes and the conditional block in pluginScoped.ts when implementing
this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: df43d668-90ab-4065-9af3-2fa2cfe4c591
📒 Files selected for processing (2)
packages/compiler-sfc/__tests__/compileStyle.spec.tspackages/compiler-sfc/src/style/pluginScoped.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/compiler-sfc/tests/compileStyle.spec.ts
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
close #14724
Summary by CodeRabbit
Bug Fixes
Tests
:deep()scenarios (single and comma-separated arguments), negation/has cases, and selector-splitting behavior.