fix(runtime-vapor): track and restore slot owner context for DynamicFragment rendering#14193
fix(runtime-vapor): track and restore slot owner context for DynamicFragment rendering#14193edison1105 merged 3 commits intominorfrom
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.
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