Visitar URL original
fix(runtime-vapor): isolate props of a cached VDOM child in a Vapor KeepAlive by ValentinYoushkevich · Pull Request #15560 · vuejs/core · GitHub
Skip to content

fix(runtime-vapor): isolate props of a cached VDOM child in a Vapor KeepAlive - #15560

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-keepalive-interop-props
Sep 18, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-keepalive-interop-props

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

A VDOM page cached by a Vapor KeepAlive keeps receiving the parent's props: its watch fires while the page is off screen, and oldValue is wrong when it comes back (playground — press each step button once; the vdom log stays empty). In dev a required prop can also warn about a transient value of a component nobody can see. Pure vdom and pure vapor are both fine.

The interop mount branch in createComponent returns before the input-isolation block, so a vdom child never gets the isolated rawProps that #15251 added for vapor children. I moved it below and paused that scope on deactivation.

Only the inputs freeze — the cached child still re-renders on its own dependencies, as in vdom. That is what separates this from #15237, which paused the whole scope and was dropped for it.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed KeepAlive components retaining stale or leaked prop values when switching between cached branches.
    • Prevented cached or evicted components from receiving updates while inactive.
    • Preserved component-local reactive effects while cached.
    • Fixed prop isolation for nested components and dynamic bindings.
    • Ensured cached components correctly pause and resume updates when deactivated and reactivated.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c0cd6b83-f0c7-499e-a177-17edb08a8af5

📥 Commits

Reviewing files that changed from the base of the PR and between d62491d and 7bab48c.

📒 Files selected for processing (4)
  • packages/runtime-vapor/__tests__/vdomInterop.spec.ts
  • packages/runtime-vapor/src/component.ts
  • packages/runtime-vapor/src/fragment.ts
  • packages/runtime-vapor/src/vdomInterop.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

KeepAlive now isolates raw inputs for VDOM children mounted through Vapor interop. The input scope pauses while cached, resumes on activation, and stops on unmount. Tests cover prop updates, eviction, pruning, nested children, and VDOM/Vapor parity.

Changes

KeepAlive VDOM input isolation

Layer / File(s) Summary
VDOM interop input-scope ownership
packages/runtime-vapor/src/component.ts, packages/runtime-vapor/src/fragment.ts
The interop mount path now runs after input isolation, uses isolated props and slots, and stores the input scope on VaporFragment.
KeepAlive input-scope lifecycle
packages/runtime-vapor/src/vdomInterop.ts
KeepAlive pauses the input scope during deactivation, resumes it during activation, and stops it during unmount.
KeepAlive isolation validation
packages/runtime-vapor/__tests__/vdomInterop.spec.ts
Tests cover regular props, reactive v-bind, branch switches, pruning, max eviction, nested Vapor children, and VDOM/Vapor parity.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: edison1105

Merge Risk: ⚪ Minimal · up to 7bab4

The KeepAlive input-isolation lifecycle is consistently wired for deactivation, reactivation, pruning, eviction, and teardown. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: isolating props for cached VDOM children in Vapor KeepAlive.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 7bab48c

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB 30.6 kB 27 kB
runtime-dom.global.prod.js 117 kB 44 kB 39.4 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.9 kB 19 kB
createApp 62.5 kB 24 kB 21.9 kB
createApp + vaporInteropPlugin 121 kB (+129 B) 43.6 kB (+21 B) 39.3 kB (+67 B)
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 added the scope: vapor related to vapor mode label Sep 18, 2026
@edison1105
edison1105 merged commit ca300cd into vuejs:minor Sep 18, 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