fix(teleport): avoid requeue loop during suspense branch swap#14642
fix(teleport): avoid requeue loop during suspense branch swap#14642edison1105 wants to merge 2 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTeleport's update/remove logic was changed to postpone patching during updates only when the teleport's target element is still unmounted and the teleport is explicitly deferred or resides in a parent Suspense with a pendingBranch. remove now tracks a pending mount flag to avoid removing teleported children when a previously-cleared mount effect would have caused deferral. Changes
Sequence Diagram(s)sequenceDiagram
participant App as "App / Component"
participant Suspense as "Suspense"
participant Teleport as "TeleportImpl"
participant Scheduler as "Scheduler / postFlush"
participant Target as "Teleport Target (DOM)"
rect rgba(0,128,0,0.5)
App->>Suspense: render (async branch + teleport in default)
end
rect rgba(0,0,255,0.5)
Suspense->>Teleport: patch/update vnode
Teleport->>Teleport: check target.__isMounted
Teleport->>Teleport: check isTeleportDeferred(props) OR parentSuspense.pendingBranch
alt should defer
Teleport->>Scheduler: queuePostFlushCb (defer patch)
else immediate
Teleport->>Target: mount/patch children
end
end
rect rgba(128,0,128,0.5)
Scheduler->>Teleport: run deferred patch (post-flush)
Teleport->>Target: mount/patch children (if still applicable)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
close #14640
Summary by CodeRabbit