Skip to content

fix(runtime-vapor): make vdom wrappers follow the vapor root element - #16319

Merged
edison1105 merged 2 commits into
vuejs:minorfrom
jrandolf:fix/vapor-interop-hydration-el
Nov 19, 2026
Merged

edison1105 merged 2 commits into
vuejs:minorfrom
jrandolf:fix/vapor-interop-hydration-el

Conversation

@jrandolf

@jrandolf jrandolf commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16313

hydrateNode gives a vdom component the first server node as its el. When its root is a Vapor component that starts with a marker (<!--[1-->, <!--{-->), the component kept the marker: $el and a ref on a functional wrapper got a comment. Mount copies subTree.el; hydration did not.

Hydration now takes subTree.el and updates the parents (updateHOCHostEl). When a Vapor root changes its root element later, the interop updates the vdom components above it too.

Tests: stateful and functional wrappers, a chain of wrappers, multi-root and component roots, lazy hydration, async setup in Suspense, and a root that changes after hydration and after mount. 27 of 33 fail without the fix.

#16314 also exports updateHOCHostEl as internal: the second PR to merge has a one-line conflict in runtime-core/src/index.ts.

@coderabbitai

coderabbitai Bot commented Nov 17, 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: 64b83d60-306f-405e-8628-5624890dc2d3

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

@jrandolf
jrandolf force-pushed the fix/vapor-interop-hydration-el branch from 11c959c to 2fa0219 Compare November 18, 2026 03:54
After hydration, a vdom component whose root is a Vapor component kept
the range marker that the server rendered before the Vapor root as its
el. Hydration now takes the el of the subtree, as mount does, and
updates the parent components when the hydration is deferred.

When a Vapor root changes its root element, the interop now updates the
vdom components whose root is that Vapor component, as a vdom self
update does.

close vuejs#16313
@jrandolf
jrandolf force-pushed the fix/vapor-interop-hydration-el branch from 2fa0219 to ca84e04 Compare November 18, 2026 03:59
@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 6c930d6

@github-actions

github-actions Bot commented Nov 18, 2026 •

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.5 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 (+104 B) 45.9 kB (+21 B) 41.2 kB (+61 B)
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 18, 2026
@edison1105
edison1105 merged commit b3c37b3 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