fix(runtime-vapor): guard default slot for createPlainElement#14422
fix(runtime-vapor): guard default slot for createPlainElement#14422zhiyuanzmj wants to merge 5 commits intovuejs:minorfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
There was a problem hiding this comment.
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
createPlainElementto 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.
Fix
VaporRouterLink: https://github.com/vuejs/router/pull/2509/changes#diff-5bd820c9af09743190b2fce76977fc80da74307c554a4403f55a8c30a599214bR78