Skip to content

fix(runtime-vapor): cache KeepAlive branches rendered after an out-in leave - #16352

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-keepalive-out-in-nested-branch
Nov 19, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-keepalive-out-in-nested-branch

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

With <Transition mode="out-in"><KeepAlive> around a v-if / v-else-if / v-else chain (real example), Vapor mounts the third tab again each time it comes from the second one, and the old instance is never unmounted (playground). VDOM mounts each tab once. <KeepAlive><slot /></KeepAlive> hits the same.

out-in renders the next branch after KeepAlive's updated, so it gets cached by an update hook that KeepAlive puts on its root fragment only. The rest of a v-else-if chain is a nested fragment.

I made a fragment that renders a branch under a transition cache it once mounted, as it already does after a deferred removal.

@coderabbitai

coderabbitai Bot commented Nov 19, 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 22353b4a-ea38-4806-b5b8-903d9cba236f

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 7d49cdf

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.5 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 124 kB 46.6 kB 41.8 kB
vue.global.prod.js 185 kB 66.9 kB 59.6 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 55.6 kB 21.6 kB 19.7 kB
createApp 64.9 kB 25 kB 22.7 kB
createApp + vaporInteropPlugin 126 kB 46 kB 41.3 kB
createVaporApp 36.1 kB 13.9 kB 12.7 kB
createSSRApp 69.8 kB 27 kB 24.5 kB
createVaporSSRApp 44.4 kB 16.9 kB 15.5 kB
defineCustomElement 71.4 kB 27 kB 24.5 kB
defineVaporCustomElement 51.2 kB 18.7 kB 17.2 kB
overall 81.8 kB 31 kB 28 kB

@edison1105 edison1105 added the scope: vapor related to vapor mode label Nov 19, 2026
@edison1105
edison1105 merged commit 3b3ced0 into vuejs:minor Nov 19, 2026
11 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