Skip to content

fix(compiler-vapor): detect svg elements by namespace in prop codegen - #15656

Merged
edison1105 merged 3 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-svg-namespace-props
Sep 28, 2026
Merged

edison1105 merged 3 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-svg-namespace-props

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

In a Vapor template, an <a> inside <svg> gets its props through the html helpers. :class throws on mount (Cannot set property className of #<SVGElement> which has only a getter) and :href / :xlink:href are written as DOM props, so the link ends up with no href. VDOM sets both as attributes. Links in inline svg are a common shape, e.g. the treemap tiles in sonda. Playground

The codegen decided svg by isSVGTag(tag), and a, style and script aren't in that list since they're html tags too. It now uses the namespace the parser already gives the element.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c1465418-aa71-40f9-ad08-604e773b2371

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15656
npm i https://pkg.pr.new/@vue/compiler-core@15656
yarn add https://pkg.pr.new/@vue/compiler-core@15656.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15656
npm i https://pkg.pr.new/@vue/compiler-dom@15656
yarn add https://pkg.pr.new/@vue/compiler-dom@15656.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15656
npm i https://pkg.pr.new/@vue/compiler-sfc@15656
yarn add https://pkg.pr.new/@vue/compiler-sfc@15656.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15656
npm i https://pkg.pr.new/@vue/compiler-ssr@15656
yarn add https://pkg.pr.new/@vue/compiler-ssr@15656.tgz

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@15656
npm i https://pkg.pr.new/@vue/compiler-vapor@15656
yarn add https://pkg.pr.new/@vue/compiler-vapor@15656.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15656
npm i https://pkg.pr.new/@vue/reactivity@15656
yarn add https://pkg.pr.new/@vue/reactivity@15656.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15656
npm i https://pkg.pr.new/@vue/runtime-core@15656
yarn add https://pkg.pr.new/@vue/runtime-core@15656.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15656
npm i https://pkg.pr.new/@vue/runtime-dom@15656
yarn add https://pkg.pr.new/@vue/runtime-dom@15656.tgz

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@15656
npm i https://pkg.pr.new/@vue/runtime-vapor@15656
yarn add https://pkg.pr.new/@vue/runtime-vapor@15656.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15656
npm i https://pkg.pr.new/@vue/server-renderer@15656
yarn add https://pkg.pr.new/@vue/server-renderer@15656.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15656
npm i https://pkg.pr.new/@vue/shared@15656
yarn add https://pkg.pr.new/@vue/shared@15656.tgz

vue

pnpm add https://pkg.pr.new/vue@15656
npm i https://pkg.pr.new/vue@15656
yarn add https://pkg.pr.new/vue@15656.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15656
npm i https://pkg.pr.new/@vue/compat@15656
yarn add https://pkg.pr.new/@vue/compat@15656.tgz

commit: 76fb9a8

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB 30.6 kB 26.9 kB
runtime-dom.global.prod.js 116 kB (+43 B) 43.9 kB (+14 B) 39.2 kB (-5 B)
vue.global.prod.js 176 kB (+43 B) 64 kB (+21 B) 57 kB (+13 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.1 kB (+43 B) 20.7 kB (+17 B) 18.9 kB (+16 B)
createApp 61.9 kB (+43 B) 23.9 kB (+15 B) 21.7 kB (+5 B)
createApp + vaporInteropPlugin 126 kB (+3.05 kB) 45.2 kB (+1.02 kB) 40.7 kB (+886 B)
createVaporApp 31.6 kB (+823 B) 12.2 kB (+333 B) 11.2 kB (+291 B)
createSSRApp 66.9 kB (+43 B) 25.9 kB (+15 B) 23.6 kB (+42 B)
createVaporSSRApp 38.2 kB (+1.1 kB) 14.5 kB (+436 B) 13.3 kB (+384 B)
defineCustomElement 68.4 kB (+43 B) 25.9 kB (+17 B) 23.5 kB (+20 B)
defineVaporCustomElement 47 kB (+823 B) 17.1 kB (+310 B) 15.7 kB (+299 B)
overall 77.4 kB (+43 B) 29.4 kB (+16 B) 26.7 kB (+24 B)

ValentinYoushkevich and others added 2 commits September 28, 2026 17:27
The prop helpers were picked with isSVGTag(tag), which misses svg
elements sharing a tag name with html (a, style, script). Inside <svg>,
`<a :class>` then threw on mount and `<a :href>` was written as a
read-only DOM prop. Use the parsed namespace instead, like the runtime
namespace check in vdom.
@edison1105
edison1105 force-pushed the fix/vapor-svg-namespace-props branch from d04005e to 48adc02 Compare September 28, 2026 09:29
Merge lowercase SVG event bindings and v-on objects into one dynamic prop update so they share a complete cache. Track expanded v-bind expressions when their props enter the merged path.
@edison1105
edison1105 merged commit 374a4f2 into vuejs:minor Sep 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants