Skip to content

fix(vapor): fall through cloneVNode extras to the vapor slot content root - #15989

Merged
edison1105 merged 2 commits into
minorfrom
edison/fix/15881
Oct 23, 2026
Merged

edison1105 merged 2 commits into
minorfrom
edison/fix/15881

Conversation

@edison1105

@edison1105 edison1105 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

close #15881

In vapor ↔ vdom interop a vdom component rendering slots.default() and
cloning the child with cloneVNode(child, extraProps) (Reka UI Slot /
asChild, used by Nuxt UI triggers) never got the extras onto the vapor
content: slots.default() returns one opaque VaporSlot vnode, and
cloneVaporSlotMeta merged the extras into the slot props.

The extras are now the fallthrough attrs of the content's single root,
reusing vapor's component-root fallthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved attribute, class, style, and event-listener fallthrough when Vapor and VDOM components are used together, including slot content and components with changing roots.
    • Fixed fallthrough behavior for single-root slot content and components hosted by Transition or KeepAlive.
    • Preserved slot props when additional attributes are applied to rendered slot content.

@edison1105 edison1105 added scope: vapor related to vapor mode interop vdom / vapor interop labels Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: 3a7c560c-b7fb-48b7-a8f2-00e43f215f4a

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ 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: 1be46d40-ee09-4ce1-aab6-e3f5ef592583
📥 Commits

Reviewing files that changed from the base of the PR and between 2f366ae and 14b879c.

⛔ Files ignored due to path filters: 2
  • packages/compiler-vapor/__tests__/transforms/__snapshots__/transformElement.spec.ts.snap is excluded by !**/*.snap
  • packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing: 19
  • packages/compiler-vapor/__tests__/transforms/transformElement.spec.ts
  • packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts
  • packages/compiler-vapor/src/generators/component.ts
  • packages/compiler-vapor/src/ir/index.ts
  • packages/compiler-vapor/src/transform.ts
  • packages/compiler-vapor/src/transforms/transformElement.ts
  • packages/compiler-vapor/src/transforms/transformSlotOutlet.ts
  • packages/compiler-vapor/src/transforms/vSlot.ts
  • packages/compiler-vapor/src/utils.ts
  • packages/runtime-core/src/apiCreateApp.ts
  • packages/runtime-core/src/vnode.ts
  • packages/runtime-vapor/__tests__/vdomInterop.spec.ts
  • packages/runtime-vapor/src/apiCreateDynamicComponent.ts
  • packages/runtime-vapor/src/component.ts
  • packages/runtime-vapor/src/componentSlots.ts
  • packages/runtime-vapor/src/dom/prop.ts
  • packages/runtime-vapor/src/slotBoundary.ts
  • packages/runtime-vapor/src/vdomInterop.ts
  • packages/shared/src/vaporFlags.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The compiler now marks single component roots in slot bodies with a distinct root mode. Runtime interop carries that mode and routes cloned slot-content attributes to the rendered root. Tests cover slot-root classification and AsChild fallthrough behavior.

Changes: Slot-root fallthrough

Layer / File(s) Summary
Compile and mark slot roots
packages/shared/src/vaporFlags.ts, packages/compiler-vapor/src/ir/index.ts, packages/compiler-vapor/src/utils.ts, packages/compiler-vapor/src/transform.ts, packages/compiler-vapor/src/transforms/*, packages/compiler-vapor/src/generators/component.ts, packages/compiler-vapor/__tests__/transforms/*
The compiler identifies qualifying single roots in slot bodies and carries a distinct root mode through component IR and generated flags. Tests cover slot-root conditions and generated component calls.
Resolve slot-root fallthrough ownership
packages/runtime-core/src/apiCreateApp.ts, packages/runtime-vapor/src/apiCreateDynamicComponent.ts, packages/runtime-vapor/src/component.ts, packages/runtime-vapor/src/componentSlots.ts, packages/runtime-vapor/src/dom/prop.ts, packages/runtime-vapor/src/slotBoundary.ts
Runtime root classifications distinguish component roots from slot roots. Fallthrough ownership can resolve slot owners and adopt an interop root before applying attributes.
Carry cloned attributes through VDOM slots
packages/runtime-core/src/vnode.ts, packages/runtime-vapor/src/vdomInterop.ts, packages/runtime-vapor/__tests__/vdomInterop.spec.ts
Vapor-slot metadata keeps cloned attributes separate from slot props. Interop tracks fallthrough owners and applies attributes to rendered content. Tests compare attribute, class, and listener behavior with VDOM rendering.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant AsChild
  participant cloneVaporSlotMeta
  participant renderVaporSlot
  participant applyFallthroughAttrs
  participant RootElement
  AsChild->>cloneVaporSlotMeta: Clone slot child with extra attributes
  cloneVaporSlotMeta->>renderVaporSlot: Pass cloned vnode attributes separately from slot props
  renderVaporSlot->>applyFallthroughAttrs: Apply tracked attributes under the root boundary
  applyFallthroughAttrs->>RootElement: Apply attributes to the rendered root
Loading

Suggested reviewers: valentinyoushkevich, zhiyuanzmj

Merge Risk: ⚪ Minimal · up to 14b87

No identified issue remains that should prevent merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 19 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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: propagating extra props from cloneVNode to the Vapor slot content root for fallthrough behavior.
Linked Issues check Passed Issue #15881 requires cloneVNode extras on slot content from a Vapor parent to reach the single rendered root, including data-cloned="yes" and click listeners. The changes add slot-root tracking, pr…
Out of Scope Changes check Passed The compiler, runtime, shared flags, and interop test changes support the same #15881 behavior. The compiler changes identify slot single roots, and the runtime changes route cloned attrs to those roo…
Full details: Linked Issues check

Explanation

Issue #15881 requires cloneVNode extras on slot content from a Vapor parent to reach the single rendered root, including data-cloned="yes" and click listeners. The changes add slot-root tracking, preserve cloned attrs separately from slot props, resolve a VDOM-interoperability fallthrough owner, and apply attrs to the rendered root. packages/runtime-vapor/__tests__/vdomInterop.spec.ts adds Vapor and VDOM comparisons for attributes and listeners, including root switches and related slot cases.

Full details: Out of Scope Changes check

Explanation

The compiler, runtime, shared flags, and interop test changes support the same #15881 behavior. The compiler changes identify slot single roots, and the runtime changes route cloned attrs to those roots. The added tests verify the affected interop and fallthrough cases. No unrelated change is established by the supplied whole-PR summary.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 538cd73

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.4 kB 30.7 kB 27 kB
runtime-dom.global.prod.js 119 kB (+77 B) 45 kB (+45 B) 40.3 kB (+43 B)
vue.global.prod.js 180 kB (+77 B) 65.2 kB (+44 B) 58.1 kB (+135 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 54.7 kB (+77 B) 21.3 kB (+38 B) 19.4 kB (+34 B)
createApp 63.6 kB (+77 B) 24.5 kB (+44 B) 22.3 kB (+7 B)
createApp + vaporInteropPlugin 144 kB (+1.06 kB) 52 kB (+431 B) 46.5 kB (+332 B)
createVaporApp 34.2 kB (+5 B) 13.2 kB (+3 B) 12.2 kB
createSSRApp 68.7 kB (+76 B) 26.6 kB (+43 B) 24.1 kB (+66 B)
createVaporSSRApp 41.5 kB (+5 B) 15.8 kB (+2 B) 14.5 kB (-29 B)
defineCustomElement 70.2 kB (+77 B) 26.5 kB (+41 B) 24.1 kB (+43 B)
defineVaporCustomElement 49.1 kB (+5 B) 18 kB (-1 B) 16.5 kB (-50 B)
overall 79.2 kB (+76 B) 30.1 kB (+44 B) 27.3 kB (+6 B)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interop vdom / vapor interop scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant