Skip to content

refactor(runtime-vapor): mount dynamic component vnodes through the interop and warn on invalid types - #15453

Merged
edison1105 merged 2 commits into
edison/refactor/dynamic-component-keyfrom
edison/refactor/dynamic-component-cleanup
Sep 8, 2026
Merged

edison1105 merged 2 commits into
edison/refactor/dynamic-component-keyfrom
edison/refactor/dynamic-component-cleanup

Conversation

@edison1105

@edison1105 edison1105 commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Improved dynamic component rendering when components are passed between rendering modes.
    • Preserved attribute inheritance for single-root and transition-based components.
    • Improved hydration and caching behavior for dynamically rendered components.
    • Invalid dynamic component values now render an empty branch and display a clear development warning.
  • Refactor

    • Simplified dynamic component mounting while preserving expected attribute inheritance behavior.

@edison1105 edison1105 added the scope: vapor related to vapor mode label Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: b4a0edd7-8f25-40d3-a890-bbf33ab923ba

📥 Commits

Reviewing files that changed from the base of the PR and between 2512951 and cae4b51.

📒 Files selected for processing (1)
  • packages/runtime-vapor/src/apiCreateDynamicComponent.ts

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


📝 Walkthrough

Walkthrough

The PR updates the VNode mounting interface, centralizes fallthrough ownership, adds dedicated dynamic VNode mounting with hydration support, skips unchanged updates, and validates unsupported dynamic component types.

Changes

Dynamic VNode interop

Layer / File(s) Summary
Fallthrough ownership contract
packages/runtime-core/src/apiCreateApp.ts, packages/runtime-vapor/src/component.ts
mountVNode now accepts isSingleRoot. resolveFallthroughOwner centralizes fallthrough owner selection, and createComponent uses it.
Dynamic component resolution
packages/runtime-vapor/src/apiCreateDynamicComponent.ts, packages/runtime-vapor/__tests__/apiCreateDynamicComponent.spec.ts
Dynamic values preserve blocks and interop VNodes. Other values are validated before rendering. Unchanged non-hydrating branches skip updates. Invalid boolean and number values render an empty branch and emit warnings.
Dynamic VNode mounting and hydration
packages/runtime-vapor/src/vdomInterop.ts
mountDynamicVNode handles KeepAlive lookup, fallthrough attributes, fragment boundaries, and hydration. The application VDOM binding now uses this mount path.

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

Merge Risk: ⚪ Minimal · up to cae4b

This change routes dynamic VNode mounting through the interop layer, preserves hydration updates, and warns for unsupported dynamic component types. No concrete merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant DynamicComponent
  participant resolveValue
  participant VdomMount
  DynamicComponent->>resolveValue: resolve dynamic component value
  resolveValue->>VdomMount: delegate interop VNode with isSingleRoot
  VdomMount-->>DynamicComponent: mounted dynamic branch
Loading
sequenceDiagram
  participant AppContext
  participant mountDynamicVNode
  participant mountVNode
  participant Hydration
  AppContext->>mountDynamicVNode: mount dynamic VNode
  mountDynamicVNode->>mountVNode: mount VNode with fallthrough attrs
  mountDynamicVNode->>Hydration: locate hydration node and fragment end
  Hydration-->>mountDynamicVNode: hydration position
  mountDynamicVNode-->>AppContext: mounted dynamic branch
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 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 summarizes the main changes: routing dynamic component VNodes through the interop and warning on invalid component types.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edison/refactor/dynamic-component-cleanup

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

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@15453
npm i https://pkg.pr.new/@vue/compiler-core@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@15453
npm i https://pkg.pr.new/@vue/compiler-dom@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@15453
npm i https://pkg.pr.new/@vue/compiler-sfc@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@15453
npm i https://pkg.pr.new/@vue/compiler-ssr@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@15453
npm i https://pkg.pr.new/@vue/compiler-vapor@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@15453
npm i https://pkg.pr.new/@vue/reactivity@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@15453
npm i https://pkg.pr.new/@vue/runtime-core@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@15453
npm i https://pkg.pr.new/@vue/runtime-dom@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@15453
npm i https://pkg.pr.new/@vue/runtime-vapor@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@15453
npm i https://pkg.pr.new/@vue/server-renderer@15453
yarn add https://pkg.pr.new/@vue/[email protected]

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@15453
npm i https://pkg.pr.new/@vue/shared@15453
yarn add https://pkg.pr.new/@vue/[email protected]

vue

pnpm add https://pkg.pr.new/vue@15453
npm i https://pkg.pr.new/vue@15453
yarn add https://pkg.pr.new/[email protected]

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@15453
npm i https://pkg.pr.new/@vue/compat@15453
yarn add https://pkg.pr.new/@vue/[email protected]

commit: cae4b51

@github-actions

github-actions Bot commented Sep 8, 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 116 kB 43.8 kB 39.2 kB
vue.global.prod.js 176 kB 63.9 kB 56.9 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.2 kB 20.6 kB 18.8 kB
createApp 62.2 kB 24 kB 21.8 kB
createApp + vaporInteropPlugin 118 kB (+267 B) 42.7 kB (+105 B) 38.4 kB (+151 B)
createVaporApp 30.7 kB (+72 B) 11.8 kB (+13 B) 10.8 kB (+16 B)
createSSRApp 67.4 kB 26 kB 23.6 kB
createVaporSSRApp 36.9 kB (+178 B) 14.1 kB (+65 B) 12.9 kB (+51 B)
defineCustomElement 68.7 kB 25.9 kB 23.6 kB
defineVaporCustomElement 46.1 kB (+72 B) 16.8 kB (+18 B) 15.4 kB (+16 B)
overall 77.6 kB 29.5 kB 26.7 kB

@edison1105
edison1105 merged commit 9bba26b into minor Sep 8, 2026
17 checks passed
@edison1105
edison1105 deleted the edison/refactor/dynamic-component-cleanup branch September 8, 2026 02:37
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.

1 participant