Skip to content

fix(compiler-vapor): keep static camelCase dom props out of the template - #16259

Merged
edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-static-camelcase-dom-props
Nov 13, 2026
Merged

edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-static-camelcase-dom-props

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

compiler-vapor puts static props into the template string, and the HTML parser lowercases their names. A camelCase DOM property like defaultValue, className or htmlFor becomes a dead defaultvalue attribute, while VDOM sets the property (playground). For example, the PrimeVue sakai-vue starter has <div className="card">, and a reka-ui story has <textarea defaultValue>.

isRuntimeOnlyProp now keeps such a key out of the template outside SVG, unless the lowercased name is the attribute behind the property (tabIndex), the same isKnownHtmlAttr check that stringifyStatic uses. Templates without these keys compile as before.

@coderabbitai

coderabbitai Bot commented Nov 13, 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 06d6f3ce-06ae-4a15-b72c-5943f6e33b58

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@16259
npm i https://pkg.pr.new/@vue/compiler-core@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@16259
npm i https://pkg.pr.new/@vue/compiler-dom@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@16259
npm i https://pkg.pr.new/@vue/compiler-sfc@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@16259
npm i https://pkg.pr.new/@vue/compiler-ssr@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@16259
npm i https://pkg.pr.new/@vue/compiler-vapor@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@16259
npm i https://pkg.pr.new/@vue/reactivity@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@16259
npm i https://pkg.pr.new/@vue/runtime-core@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@16259
npm i https://pkg.pr.new/@vue/runtime-dom@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@16259
npm i https://pkg.pr.new/@vue/runtime-vapor@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@16259
npm i https://pkg.pr.new/@vue/server-renderer@16259
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@16259
npm i https://pkg.pr.new/@vue/shared@16259
yarn add https://pkg.pr.new/@vue/[email protected]

vue

pnpm add https://pkg.pr.new/vue@16259
npm i https://pkg.pr.new/vue@16259
yarn add https://pkg.pr.new/[email protected]

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@16259
npm i https://pkg.pr.new/@vue/compat@16259
yarn add https://pkg.pr.new/@vue/[email protected]

commit: 40ea473

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.5 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 124 kB 46.5 kB 41.6 kB
vue.global.prod.js 185 kB 66.8 kB 59.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 55.6 kB 21.6 kB 19.7 kB
createApp 64.9 kB 25 kB 22.7 kB
createApp + vaporInteropPlugin 121 kB 44.1 kB 39.7 kB
createVaporApp 35.8 kB 13.8 kB 12.6 kB
createSSRApp 69.8 kB 27 kB 24.5 kB
createVaporSSRApp 43.6 kB 16.6 kB 15.2 kB
defineCustomElement 71.4 kB 27 kB 24.5 kB
defineVaporCustomElement 50.8 kB 18.6 kB 17 kB
overall 81.8 kB 31 kB 28 kB

@edison1105

Copy link
Copy Markdown
Member

The compiler-side routing makes sense, but we also need to preserve numeric literals when these bindings are moved to runtime setters.

For example:

<input type="checkbox" :defaultChecked="0">

At e85bbbc, SFC compilation generates:

_setProp(n0, "defaultChecked", "0")

transformVBind has already converted 0 into a string because excludeNumber does not account for these runtime-only properties. Assigning "0" to the boolean DOM property makes both defaultChecked and checked become true, whereas VDOM and the PR base keep them false. The same issue affects <option :defaultSelected="0">.

Could we reuse isRuntimeOnlyProp in the non-.attr branch of excludeNumber? Static .camel arguments also need to be normalized before that check; otherwise :default-checked.camel="0" will still lose its numeric type.

Please add regression coverage for the direct and .camel forms, verifying that the generated setter receives 0 rather than "0" and that the resulting checked/selected state matches VDOM. With that addressed, the approach looks good to me.

@edison1105 edison1105 added the scope: vapor related to vapor mode label Nov 13, 2026
Normalize a static `.camel` argument before the check as well.
@edison1105
edison1105 merged commit 822ee29 into vuejs:minor Nov 13, 2026
11 checks passed
zhiyuanzmj added a commit to vuejs/vue-jsx-vapor that referenced this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants