-
-
Notifications
You must be signed in to change notification settings - Fork 9k
refactor(runtime-vapor): use dedicated currentSlotOwner instead of changing currentInstance in withVaporCtx #14166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@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: |
…anging currentInstance in withVaporCtx
…group` flag from transition hooks.
…ead of relying on a stored parentComponent property.
c779617 to
985209c
Compare
…scope owner retrieval
…hey contain components or slot outlets.
There was a problem hiding this 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 refactors the slot owner tracking mechanism in Vue Vapor runtime to use a dedicated currentSlotOwner variable instead of manipulating currentInstance within withVaporCtx. This provides cleaner separation of concerns and improves code maintainability.
Key changes:
- Introduces
currentSlotOwnerandgetScopeOwner()to track slot ownership separately from component instances - Removes the
parentInstanceparameter from component creation, usingcurrentInstancedirectly instead - Optimizes compiler to conditionally wrap slots with
withVaporCtxonly when needed (i.e., when slots contain components or slot outlets)
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/runtime-vapor/src/componentSlots.ts |
Introduces currentSlotOwner tracking and getScopeOwner() function; refactors withVaporCtx to only manage slot owner context |
packages/runtime-vapor/src/component.ts |
Removes parentInstance parameter from VaporComponentInstance constructor; uses currentInstance and getScopeOwner() directly |
packages/runtime-vapor/src/fragment.ts |
Simplifies DynamicFragment to capture currentInstance locally instead of storing parent component |
packages/runtime-vapor/src/vdomInterop.ts |
Updates to use getScopeOwner() for scopeId inheritance |
packages/runtime-vapor/src/components/Teleport.ts |
Updates to use currentInstance directly instead of getParentInstance() |
packages/runtime-vapor/src/components/TransitionGroup.ts |
Removes unused group flag and related update trigger logic |
packages/runtime-vapor/src/components/Transition.ts |
Removes group flag handling |
packages/runtime-vapor/src/apiCreateFor.ts |
Removes TransitionGroup update trigger logic |
packages/compiler-vapor/src/generators/component.ts |
Adds needsVaporCtx() optimization to conditionally wrap slots only when they contain components or slot outlets |
| Test files | Updates tests to remove unnecessary withVaporCtx wrappers where slots don't contain components |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.