-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(runtime-vapor): track and restore slot owner context for DynamicFragment rendering #14193
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 ✨ 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: |
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 fixes parent instance capturing for dynamic fragments by moving the capture logic from render time to construction time. This ensures correct parent instance resolution, especially in KeepAlive scenarios where components are cached and reused.
- Captures parent component instance in
DynamicFragmentconstructor usinggetScopeOwner() - Removes
instanceparameter fromrenderBranchmethod, simplifying the API - Skips
withVaporCtxwrapping for KeepAlive slot content in the compiler
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime-vapor/src/fragment.ts | Captures parent component at construction time in DynamicFragment and refactors renderBranch to use stored parent instance |
| packages/compiler-vapor/src/generators/component.ts | Adds KeepAlive check to skip unnecessary withVaporCtx wrapping for KeepAlive slot content |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0f33a7b to
542e0c8
Compare
f0c529a to
5e2af2d
Compare
5e2af2d to
809c494
Compare
close #14192