Skip to content

fix(runtime-vapor): support hasOwnProperty on props, attrs and slot props - #15841

Merged
edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-props-attrs-has-own-property
Oct 12, 2026
Merged

edison1105 merged 2 commits into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-props-attrs-has-own-property

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Oct 11, 2026 •

Copy link
Copy Markdown

In a vapor component, useAttrs().hasOwnProperty('id'), $attrs.hasOwnProperty(...) in the template and props.hasOwnProperty(...) throw TypeError: ... is not a function, while in VDOM attrs and props are plain objects and the call works. The same happens to a VDOM component rendered by a vapor parent, since its attrs read through the vapor proxy. Real code relies on it, e.g. mixpost (playground).

Component props/attrs and scoped-slot props now fall back to Object.prototype when their own sources do not supply a value, while declared component props and explicit own undefined values retain precedence. Like #15835 did for slots, this restores prototype methods without adding inherited members to the own keys. The component props/attrs in behavior and successful prop read path are unchanged. This also updates the assertion from #15708 that expected attrs.toString to be undefined.

For Vapor slot content invoked by a VDOM child, the slot props proxy now uses hasOwn in its property descriptor trap. Previously, the in check incorrectly reported inherited members such as toString as own properties.

The regression tests compile real SFCs and cover props/attrs and scoped-slot props, static and dynamic slot bindings, both interop directions, own undefined shadowing, and dynamic addition/removal.

Validation:

  • Runtime Vapor unit suite: 74 files passed; 3091 passed, 2 expected failures, and 15 TODOs.
  • Focused prototype/own-property tests: 13 passed with both __DEV__=true and __DEV__=false.
  • Full project type check, scoped lint, formatting, and git diff --check passed.

Closes #15840

@coderabbitai

coderabbitai Bot commented Oct 11, 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: 956f4618-997e-40d9-8167-18482d4f90ce

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 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 9f1f55e

@github-actions

github-actions Bot commented Oct 11, 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.3 kB
vue.global.prod.js 177 kB 64.1 kB 57.1 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 134 kB (+50 B) 48.1 kB (+17 B) 43.3 kB (+68 B)
createVaporApp 33.8 kB (+31 B) 13.1 kB (+8 B) 12 kB (+7 B)
createSSRApp 67 kB 26 kB 23.6 kB
createVaporSSRApp 40.6 kB (+31 B) 15.5 kB (+8 B) 14.2 kB (-4 B)
defineCustomElement 68.5 kB 25.9 kB 23.6 kB
defineVaporCustomElement 48.4 kB (+31 B) 17.8 kB (+9 B) 16.3 kB (+10 B)
overall 77.6 kB 29.5 kB 26.7 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Oct 12, 2026
@edison1105 edison1105 changed the title fix(runtime-vapor): support hasOwnProperty on props and attrs like vdom fix(runtime-vapor): support hasOwnProperty on props, attrs and slot props Oct 12, 2026
@edison1105
edison1105 merged commit d47d313 into vuejs:minor Oct 12, 2026
14 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