Skip to content

fix(compiler-vapor): do not fold a constant prop the template string cannot carry - #15587

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-fold-runtime-only-props
Sep 22, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-fold-runtime-only-props

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

A constant :innerHTML or :textContent is folded into the static template string, where it lands as a content attribute and the content is never written — <div innerhtml="<b>x</b>"> instead of <div><b>x</b></div>. A constant .prop binding folds the same way, so :foo.prop="'bar'" sets an attribute where it was asked for a dom property. Dynamic values were already correct, as is v-text / v-html.

https://play.vuejs.org/#eNp9Ul2L1TAQ/SuHPOwq9EMQBLu1IL6I6JP7GFjS2/E2mDsJydx2F/G/S1Kv213Up4HJmfMxmR/qfQjNcibVqT4dog2CRHIOWEzwcdDctqCF4gMW486EkZxfYRMMDp6TGBbUkNlIbspM8OweILPl49Y+GRGKCTNF0ty3m8qgWXMvdArOCA2agT4MSz3LycHwhKUWupcKq4/fLR+7vg0barILNtw7ra77cRi9m/p2HK61QrvHZIKMmck5f3n9rdRZZoofb798Lmpdxn7wLMRSlRjJnAiy+j8xE2qw34JF4oliemrqkfL/xvZa/7LXhOgDPO/WXMG45C8W/iZ9S/dSBjNrrs9Ic0EJ95hppUhIEi0f7TdLEyyLL5jL38CkjM9uYUSiHc9CqULyT/jKu03gfC1YoxUhbuADcYF8+goxI8QjEW2TdxeJF1pdObnJSfa7KYu5OsqNVi+bkqFk7tvd2ahK3S0Uk/WsOvW6edO8quOheat+/gLmyfdC

isRuntimeOnlyProp already holds back the props a template string cannot carry — value on <textarea>, the checkbox value pair — and these two belong in the same list. .prop opts out of the fold entirely, while .attr keeps folding, which is what the modifier means. Two details came out of testing it: a number bound with .prop has to stay a number, and $html has to start out undefined, otherwise the property cache swallows the first setHtml(el, '') exactly as it used to for $txt.

Two things worth naming. A .prop that reflects back to an attribute now appears after the attributes that stayed folded, so outerHTML assertions can move; the DOM is the same and matches vdom. And under SSR a constant :textContent now warns about a hydration mismatch — vdom emits the same warning and the same DOM, because compiler-ssr bakes the value in as an attribute, so that is a separate parity gap rather than a change here.

…cannot carry

`innerHTML` and `textContent` write the element's content, and a `.prop`
binding forces a dom property, so a constant value has to reach the runtime
setter instead of being stringified into the static template as a content
attribute. A number bound with `.prop` keeps its type for the same reason,
and `$html` starts out undefined so the property cache does not swallow the
first empty write.
@coderabbitai

coderabbitai Bot commented Sep 21, 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: c6f77836-1623-4cf9-926e-ba62859c6395

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 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 9ebc151

@github-actions

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 117 kB 44 kB 39.5 kB
vue.global.prod.js 177 kB 64.1 kB 57.1 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.8 kB 20.8 kB 19 kB
createApp 62.5 kB 24 kB 21.9 kB
createApp + vaporInteropPlugin 122 kB 43.9 kB 39.5 kB
createVaporApp 30.8 kB 11.8 kB 10.9 kB
createSSRApp 67.7 kB 26.1 kB 23.7 kB
createVaporSSRApp 37.2 kB 14.1 kB 13 kB
defineCustomElement 69.1 kB 26 kB 23.7 kB
defineVaporCustomElement 46.2 kB 16.8 kB 15.4 kB
overall 78.1 kB 29.6 kB 26.8 kB

@edison1105
edison1105 merged commit b68a37a into vuejs:minor Sep 22, 2026
15 checks passed
zhiyuanzmj added a commit to vuejs/vue-jsx-vapor that referenced this pull request Sep 25, 2026
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