Skip to content

refactor(vapor): split NON_STABLE slot marker out of VaporSlotFlags - #15391

Merged
edison1105 merged 15 commits into
minorfrom
edison/refactor/slots
Sep 1, 2026
Merged

refactor(vapor): split NON_STABLE slot marker out of VaporSlotFlags#15391
edison1105 merged 15 commits into
minorfrom
edison/refactor/slots

Conversation

@edison1105

@edison1105 edison1105 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Improved forwarded-slot handling across Vapor and VDOM interoperability.
    • Added faster rendering for eligible stable slot content.
    • Improved fallback ownership and boundary behavior for nested slots.
  • Bug Fixes

    • Fixed hydration anchors and updates for nested forwarded slots.
    • Improved slot behavior with teleportation, cloned components, custom elements, and scope IDs.
  • Refactor

    • Simplified slot configuration into unified flags, improving consistency across rendering paths.

@coderabbitai

coderabbitai Bot commented Sep 1, 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: f581d903-1c89-4f4d-859a-97aeb0357e20

📥 Commits

Reviewing files that changed from the base of the PR and between b79d0f0 and d671254.

📒 Files selected for processing (2)
  • packages/compiler-vapor/src/generators/component.ts
  • packages/compiler-vapor/src/generators/if.ts

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


📝 Walkthrough

Walkthrough

Vapor slot handling now uses encoded forwarding and fallback flags with separate stability metadata. Compiler output, VDOM interop, runtime fragments, boundary tracking, hydration, scope IDs, and tests were updated.

Changes

Vapor slot flags and boundary handling

Layer / File(s) Summary
Flag contract and compiler emission
packages/shared/src/vaporFlags.ts, packages/runtime-core/src/apiCreateApp.ts, packages/compiler-vapor/src/generators/*, packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts
Slot flags now use FORWARDED and SHARED_FALLBACK. Slot stability uses VaporSlotStability.NON_STABLE. Compiler generators share flag serialization. VDOM slot options now use a numeric flags property.
Slot fragment runtime model
packages/runtime-vapor/src/componentSlots.ts, packages/runtime-vapor/src/fragment.ts, packages/runtime-vapor/src/fragmentFlags.ts
Slot creation and SlotFragment construction now use encoded flags. SLOT_RESOLVER identifies fragments that perform slot resolution. Fast-path fragments clear their slot boundary.
VDOM interop boundary flow
packages/runtime-vapor/src/vdomInterop.ts, packages/runtime-vapor/src/vdomInteropState.ts
VDOM slot interop derives boundary behavior from decoded flags. Content boundaries separate arbitrating outlets from fast-path outlets. Slot ownership uses isSlotResolver.
Slot behavior validation
packages/runtime-vapor/__tests__/*
Tests cover forwarded slots, fallback ownership, fast-path rendering, hydration anchors, scope IDs, teleportation, and stability markers.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to d6712

This refactor has no actionable merge-blocking risk at the current head and is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant VDOMSlot
  participant VaporSlotFlags
  participant ComponentSlots
  participant SlotFragment
  participant DynamicFragment
  VDOMSlot->>VaporSlotFlags: Decode forwarding and fallback flags
  VDOMSlot->>ComponentSlots: Pass flags and content boundary
  ComponentSlots->>SlotFragment: Create fragment when fallback arbitration is required
  ComponentSlots->>DynamicFragment: Create fast-path fragment otherwise
  DynamicFragment-->>VDOMSlot: Render content outside the slot boundary
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 19 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.
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.
Title check ✅ Passed The title clearly and concisely describes the central change: moving the NON_STABLE slot marker out of VaporSlotFlags into a separate stability enum. This change is reflected across the compiler, runt…
Full details: Title check

Explanation

The title clearly and concisely describes the central change: moving the NON_STABLE slot marker out of VaporSlotFlags into a separate stability enum. This change is reflected across the compiler, runtime, shared flags, and tests.

  • 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/slots

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

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: d671254

@github-actions

github-actions Bot commented Sep 1, 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 117 kB 43.8 kB 39.2 kB
vue.global.prod.js 177 kB 64 kB 57 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.3 kB 20.7 kB 18.9 kB
createApp 62.3 kB 24 kB 21.8 kB
createApp + vaporInteropPlugin 118 kB (+147 B) 42.7 kB (+39 B) 38.4 kB (+70 B)
createVaporApp 30.8 kB 11.8 kB 10.8 kB
createSSRApp 67.5 kB 26.1 kB 23.6 kB
createVaporSSRApp 36.6 kB 13.9 kB 12.8 kB
defineCustomElement 69 kB 26 kB 23.7 kB
defineVaporCustomElement 46.6 kB 16.9 kB 15.5 kB
overall 77.7 kB 29.5 kB 26.7 kB

@edison1105
edison1105 marked this pull request as ready for review September 1, 2026 07:54
@edison1105
edison1105 merged commit 9fde9ac into minor Sep 1, 2026
17 checks passed
@edison1105
edison1105 deleted the edison/refactor/slots branch September 1, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant