Skip to content

fix(runtime-core): prevent merging model listener when value is null or undefined#14629

Merged
edison1105 merged 1 commit intomainfrom
edison/fix/mergeProps
Mar 25, 2026
Merged

fix(runtime-core): prevent merging model listener when value is null or undefined#14629
edison1105 merged 1 commit intomainfrom
edison/fix/mergeProps

Conversation

@edison1105
Copy link
Copy Markdown
Member

@edison1105 edison1105 commented Mar 25, 2026

fix https://github.com/vuejs/ecosystem-ci/actions/runs/23529115737/job/68488818862

Summary by CodeRabbit

  • Bug Fixes
    • Fixed model listener property handling in prop merging: null or undefined model listener properties are now correctly omitted from the merged result instead of being preserved.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a2a6bf8-605c-4b05-bffb-1dce2396de1b

📥 Commits

Reviewing files that changed from the base of the PR and between 88ed045 and c878a8f.

📒 Files selected for processing (2)
  • packages/runtime-core/__tests__/vnode.spec.ts
  • packages/runtime-core/src/vnode.ts

📝 Walkthrough

Walkthrough

The PR modifies mergeProps in the vnode utility to conditionally omit model listener properties (like onUpdate:modelValue) when both incoming and existing values are null, preventing these null entries from persisting in merged props. The test suite is updated with assertions to verify this new behavior.

Changes

Cohort / File(s) Summary
Model Listener Null Handling
packages/runtime-core/src/vnode.ts
Updated mergeProps to skip assigning null model listener properties identified via isModelListener(key), preventing unwanted preservation of onUpdate:modelValue and similar model listeners.
Test Coverage
packages/runtime-core/__tests__/vnode.spec.ts
Added assertions verifying that model listener properties set to undefined or null are not retained in merged props, contrasting with regular event handler behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

ready to merge, :hammer: p3-minor-bug

Poem

🐰 A model listener null, now wisely dismissed,
No longer preserved when both values have missed.
Event handlers stay true, but these special ones bend—
Clean props for clean models, our merger's best friend! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: preventing merging of model listeners when their values are null or undefined, which matches the implementation in both the test and source changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edison/fix/mergeProps

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 25, 2026

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: c878a8f

@github-actions
Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 105 kB (+6 B) 39.8 kB (+8 B) 35.7 kB (-48 B)
vue.global.prod.js 164 kB (+6 B) 59.8 kB (+5 B) 53.2 kB (-33 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.3 kB (+6 B) 18.8 kB (+3 B) 17.2 kB (+4 B)
createApp 56.4 kB (+6 B) 21.8 kB (+5 B) 19.9 kB (+12 B)
createSSRApp 60.6 kB (+6 B) 23.6 kB (+5 B) 21.5 kB (+9 B)
defineCustomElement 62.6 kB (+6 B) 23.8 kB 21.6 kB (+5 B)
overall 70.9 kB (+6 B) 27.2 kB (+4 B) 24.8 kB (+69 B)

@edison1105
Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Copy Markdown
Contributor

vue-bot commented Mar 25, 2026

📝 Ran ecosystem CI: Open

suite result latest scheduled
quasar failure failure
language-tools failure failure
vue-i18n success success
router success success
vuetify success success
vite-plugin-vue success success
vant success success
nuxt success success
vue-macros success success
primevue success success
radix-vue success success
vue-simple-compiler success success
vueuse success success
vitepress success success
pinia success success
test-utils success success

@edison1105 edison1105 merged commit b39e032 into main Mar 25, 2026
16 checks passed
@edison1105 edison1105 deleted the edison/fix/mergeProps branch March 25, 2026 08:18
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