Skip to content

fix(runtime-vapor): stamp the owner scope id on a native slot outlet - #15594

Merged
edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-ce-slot-owner-scope-id
Sep 22, 2026
Merged

edison1105 merged 1 commit into
vuejs:minorfrom
ValentinYoushkevich:fix/vapor-ce-slot-owner-scope-id

Conversation

@ValentinYoushkevich

Copy link
Copy Markdown
Contributor

In a vapor custom element with a shadow root, <slot/> renders as a real <slot> element belonging to the owner's own template, so it should carry the owner's scope id like everything else in that template. vdom does exactly that: the custom element branch of renderSlot returns before the outlet's own -s id is assigned, so the native <slot> gets the owner id and the ambient slot ids and nothing else. Vapor wrote the outlet's -s id instead, and nothing at all for a NO_SLOTTED outlet, so a scoped slot { ... } rule never matched.

The outlet now carries the owner's id plus the ids of the enclosing slot context, the same pair vdom writes. Its own -s id scopes its content, not itself. ::slotted is unaffected — there the content is light DOM and the native pseudo does that job.

In a custom element with a shadow root, `<slot/>` renders as a real element
of the owner's own template, so it should carry the owner's scope id like the
rest of that template - vdom stamps it that way, because the custom element
branch of `renderSlot` returns before the outlet's own `-s` id is assigned.
Vapor instead wrote that `-s` id, and nothing at all for a `NO_SLOTTED`
outlet, so a scoped `slot { ... }` rule never matched.

The outlet now carries the owner's own id plus the ids of the enclosing slot
context it renders under, which is the pair vdom writes on the native `<slot>`
vnode. Its own `-s` id scopes its content, not the outlet itself.
@coderabbitai

coderabbitai Bot commented Sep 21, 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

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e1139f55-0bec-41fa-936f-1409a4c353c7

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

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

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 65ab16c

@github-actions

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB (-202 B) 30.6 kB (+2 B) 26.9 kB (-14 B)
runtime-dom.global.prod.js 117 kB (+1.49 kB) 44 kB (+486 B) 39.5 kB (+493 B)
vue.global.prod.js 177 kB (+1.23 kB) 64.1 kB (+471 B) 57.1 kB (+340 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.8 kB (+1.13 kB) 20.8 kB (+329 B) 19 kB (+324 B)
createApp 62.5 kB (+839 B) 24 kB (+204 B) 21.9 kB (+179 B)
createApp + vaporInteropPlugin 122 kB (+6.01 kB) 43.9 kB (+2.23 kB) 39.5 kB (+2.06 kB)
createVaporApp 30.8 kB (+1.45 kB) 11.8 kB (+415 B) 10.9 kB (+388 B)
createSSRApp 67.7 kB (+964 B) 26.1 kB (+242 B) 23.7 kB (+300 B)
createVaporSSRApp 37.2 kB (+2.57 kB) 14.1 kB (+819 B) 12.9 kB (+779 B)
defineCustomElement 69.1 kB (+702 B) 26 kB (+152 B) 23.7 kB (+148 B)
defineVaporCustomElement 46.2 kB (+1.03 kB) 16.8 kB (+323 B) 15.4 kB (+272 B)
overall 78.1 kB (+1.06 kB) 29.6 kB (+299 B) 26.8 kB (+248 B)

@edison1105
edison1105 merged commit 0f9d075 into vuejs:minor Sep 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants