Skip to content

fix(runtime-vapor): guard default slot for createPlainElement#14422

Open
zhiyuanzmj wants to merge 5 commits intovuejs:minorfrom
zhiyuanzmj:ce-slots
Open

fix(runtime-vapor): guard default slot for createPlainElement#14422
zhiyuanzmj wants to merge 5 commits intovuejs:minorfrom
zhiyuanzmj:ce-slots

Conversation

@zhiyuanzmj
Copy link
Member

Copilot AI review requested due to automatic review settings February 5, 2026 16:30
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

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.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-vapor

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/runtime-vapor

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 04c92d6

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 86.4 kB 30.2 kB 26.6 kB
runtime-dom.global.prod.js 109 kB 41.4 kB 37.2 kB
vue.global.prod.js 169 kB 61.2 kB 54.5 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49.5 kB 19.4 kB 17.7 kB
createApp 58.5 kB 22.7 kB 20.7 kB
createApp + vaporInteropPlugin 81.5 kB 30.3 kB 27.4 kB
createVaporApp 28.7 kB 11.1 kB 10.2 kB
createSSRApp 62.8 kB 24.4 kB 22.2 kB
createVaporSSRApp 32.1 kB 12.4 kB 11.4 kB
defineCustomElement 64.5 kB 24.6 kB 22.3 kB
defineVaporCustomElement 39 kB 14.4 kB 13.2 kB
overall 73.3 kB 28 kB 25.4 kB

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash in createPlainElement when a default slot is not provided, which was causing issues in VaporRouterLink. The fix adds a null check before invoking the slot function.

Changes:

  • Modified createPlainElement to guard against undefined default slots by checking the slot exists before calling it
  • Updated existing test to properly pass slots through createPlainElement
  • Added new test to verify that empty slots don't cause crashes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/runtime-vapor/src/component.ts Added null check before invoking default slot function to prevent crashes when slot is undefined
packages/runtime-vapor/tests/customElement.spec.ts Updated existing test to pass slots parameter and added new test to verify empty slots handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant