fix(compiler-vapor): handling of class and style bindings on SVG elements#14383
fix(compiler-vapor): handling of class and style bindings on SVG elements#14383edison1105 merged 2 commits intominorfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
📝 WalkthroughWalkthroughThis change fixes SVG element styling in Vue's Vapor compiler by modifying how :class and :style bindings are handled. The compiler now prioritizes special helper functions (class, style, etc.) over generic attribute handling for SVG elements, ensuring proper property binding instead of string concatenation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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 unit tests (beta)
Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
88331ab to
427895a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/compiler-vapor/src/generators/prop.ts`:
- Around line 188-197: The special-helper branch currently returns helper
directly from getSpecialHelper(key, tagName) so SVG elements call helpers like
setClass without the isSVG flag; change the return path so when isSVG is true
you wrap/extend the returned helper with { isSVG: true } (e.g. for the helper
variable returned by getSpecialHelper in prop.ts) so functions like
setClass/setAttr receive the isSVG flag; ensure this wrapping is applied before
returning the helper (similar to how helpers.setAttr is extended) so SVG class
bindings use setAttribute instead of el.className.
close #14382
Summary by CodeRabbit
Tests
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.