Skip to content

fix(compiler-vapor): set string native on* bindings of html elements as attributes - #15831

Merged
edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-native-on-string-attr
Oct 10, 2026
Merged

edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-native-on-string-attr

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

In a vapor component, a lowercase native handler bound to a string, such as <img :onerror="`this.src='${fallback}'`">, renders no attribute, so the inline handler never runs. VDOM sets a string on* value as an attribute and a function as the property. This image-fallback pattern shows up in real apps, e.g. SponsorAvatar.vue#L26 and UploadImagePreview.vue#L46.

The compiler sends a static on* key of an HTML element to setProp, which assigns the string to the property, where the browser ignores it. SVG elements already route these keys through the runtime prop/attribute check since 374a4f2 (#15656); this applies it to every native element, including the listener merge with a v-on object.

Playground

@coderabbitai

coderabbitai Bot commented Oct 9, 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: c5a2cdb7-f86d-4cd0-99b5-87edac502402

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

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 71e473d

@github-actions

github-actions Bot commented Oct 9, 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 117 kB 43.9 kB 39.4 kB
vue.global.prod.js 177 kB 64.1 kB 57 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.2 kB 20.7 kB 18.9 kB
createApp 62 kB 23.9 kB 21.8 kB
createApp + vaporInteropPlugin 132 kB (+56 B) 47.5 kB (+13 B) 42.7 kB (-45 B)
createVaporApp 34.5 kB (+56 B) 13.3 kB (+13 B) 12.2 kB (+11 B)
createSSRApp 67 kB 26 kB 23.6 kB
createVaporSSRApp 41.2 kB (+56 B) 15.7 kB (+16 B) 14.4 kB (+29 B)
defineCustomElement 68.5 kB 25.9 kB 23.6 kB
defineVaporCustomElement 49 kB (+56 B) 17.9 kB (+12 B) 16.4 kB (+15 B)
overall 77.6 kB 29.5 kB 26.7 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Oct 10, 2026
@edison1105
edison1105 merged commit 7d5e39e into vuejs:minor Oct 10, 2026
15 checks passed
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