Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/runtime-core/src/components/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ function createSuspenseBoundary(
effects,
parentComponent,
container,
isInFallback,
} = suspense

// if there's a transition happening we need to wait it to finish.
Expand All @@ -551,6 +552,10 @@ function createSuspenseBoundary(
MoveType.ENTER,
)
queuePostFlushCb(effects)
// clear el reference from fallback vnode to allow GC after transition
if (isInFallback && vnode.ssFallback) {
vnode.ssFallback.el = null
}
}
}
}
Expand All @@ -570,6 +575,11 @@ function createSuspenseBoundary(
anchor = next(activeBranch)
}
unmount(activeBranch, parentComponent, suspense, true)
// clear el reference from fallback vnode to allow GC
// only clear immediately if there's no delayed transition
if (!delayEnter && isInFallback && vnode.ssFallback) {
vnode.ssFallback.el = null
}
}
if (!delayEnter) {
// move content from off-dom container to actual container
Expand Down Expand Up @@ -728,6 +738,8 @@ function createSuspenseBoundary(
optimized,
)
if (placeholder) {
// clean up placeholder reference
vnode.placeholder = null
remove(placeholder)
}
updateHOCHostEl(instance, vnode.el)
Expand Down
Loading