|
@@ -1474,6 +1474,7 @@ function baseCreateRenderer(
|
|
|
if (deferKeepAliveBranchUpdate(instance)) {
|
|
if (deferKeepAliveBranchUpdate(instance)) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ instance.keepAliveReplayJob = null
|
|
|
|
|
|
|
|
if (__FEATURE_SUSPENSE__) {
|
|
if (__FEATURE_SUSPENSE__) {
|
|
|
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance)
|
|
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance)
|
|
@@ -2614,6 +2615,7 @@ export function deferKeepAliveBranchUpdate(
|
|
|
const updates = deferredKeepAliveBranchUpdates.get(current)
|
|
const updates = deferredKeepAliveBranchUpdates.get(current)
|
|
|
if (updates) {
|
|
if (updates) {
|
|
|
updates.add(instance)
|
|
updates.add(instance)
|
|
|
|
|
+ instance.keepAliveReplayJob ||= createKeepAliveReplayJob(instance)
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
// Nested KeepAlive roots manage their own inactive branches.
|
|
// Nested KeepAlive roots manage their own inactive branches.
|
|
@@ -2625,6 +2627,26 @@ export function deferKeepAliveBranchUpdate(
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function createKeepAliveReplayJob(
|
|
|
|
|
+ instance: ComponentInternalInstance,
|
|
|
|
|
+): SchedulerJob {
|
|
|
|
|
+ const job = (() => {
|
|
|
|
|
+ if (instance.isUnmounted || instance.keepAliveReplayJob !== job) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (instance.job.flags! & SchedulerJobFlags.QUEUED) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!deferKeepAliveBranchUpdate(instance)) {
|
|
|
|
|
+ instance.keepAliveReplayJob = null
|
|
|
|
|
+ instance.update()
|
|
|
|
|
+ }
|
|
|
|
|
+ }) as SchedulerJob
|
|
|
|
|
+ job.id = instance.uid
|
|
|
|
|
+ job.i = instance
|
|
|
|
|
+ return job
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export function setKeepAliveBranchActive(
|
|
export function setKeepAliveBranchActive(
|
|
|
instance: ComponentInternalInstance,
|
|
instance: ComponentInternalInstance,
|
|
|
active: boolean,
|
|
active: boolean,
|