mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Move suspended render logic to ensureRootIsScheduled (#26328)
When the work loop is suspended, we shouldn't schedule a new render task
until the promise has resolved. When I originally implemented this, I
wasn't sure where to put this logic — `ensureRootIsScheduled` is the
more natural place for it, but that's also a really hot path, so I chose
to do it elsewhere, and left a TODO to reconsider later.
Now it's later. I'm working on a refactor to move the
`ensureRootIsScheduled` call to always happen in a microtask, so that if
there are multiple updates/pings in a single event, they get batched
into a single operation. Which means I can put the logic in that
function where it belongs.
DiffTrain build for [6e1756a5a9](https://github.com/facebook/react/commit/6e1756a5a9bb0d95ec17983f7dc38cd2c2663b39)
This commit is contained in:
@@ -1 +1 @@
|
||||
1528c5ccdf5c61a08adab31116156df6503e26ce
|
||||
6e1756a5a9bb0d95ec17983f7dc38cd2c2663b39
|
||||
|
||||
@@ -1 +1 @@
|
||||
1528c5ccdf5c61a08adab31116156df6503e26ce
|
||||
6e1756a5a9bb0d95ec17983f7dc38cd2c2663b39
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -646,4 +646,4 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
@@ -638,4 +638,4 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
@@ -657,7 +657,7 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -649,7 +649,7 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -22862,7 +22862,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -23363,6 +23363,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -23603,21 +23614,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -24199,7 +24195,7 @@ function handleThrow(root, thrownValue) {
|
||||
case SuspendedOnData:
|
||||
case SuspendedOnImmediate:
|
||||
case SuspendedOnDeprecatedThrowPromise:
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var wakeable = thrownValue;
|
||||
markComponentSuspended(
|
||||
erroredWork,
|
||||
@@ -24538,6 +24534,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -24549,11 +24556,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -22522,7 +22522,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -23023,6 +23023,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -23263,21 +23274,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -23859,7 +23855,7 @@ function handleThrow(root, thrownValue) {
|
||||
case SuspendedOnData:
|
||||
case SuspendedOnImmediate:
|
||||
case SuspendedOnDeprecatedThrowPromise:
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var wakeable = thrownValue;
|
||||
markComponentSuspended(
|
||||
erroredWork,
|
||||
@@ -24198,6 +24194,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -24209,11 +24216,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
|
||||
@@ -7723,6 +7723,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = suspendedLanes & -suspendedLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -7936,9 +7938,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -8229,6 +8229,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -9780,7 +9783,7 @@ var slice = Array.prototype.slice,
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-classic-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1300 = {
|
||||
@@ -9811,7 +9814,7 @@ var internals$jscomp$inline_1300 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1301 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
@@ -7455,6 +7455,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = suspendedLanes & -suspendedLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -7668,9 +7670,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -7961,6 +7961,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -9445,7 +9448,7 @@ var slice = Array.prototype.slice,
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-modern-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1280 = {
|
||||
@@ -9476,7 +9479,7 @@ var internals$jscomp$inline_1280 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1281 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
@@ -37317,7 +37317,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -37833,6 +37833,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -38093,21 +38104,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -38764,7 +38760,7 @@ function handleThrow(root, thrownValue) {
|
||||
case SuspendedOnData:
|
||||
case SuspendedOnImmediate:
|
||||
case SuspendedOnDeprecatedThrowPromise:
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var wakeable = thrownValue;
|
||||
markComponentSuspended(
|
||||
erroredWork,
|
||||
@@ -39105,6 +39101,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -39116,11 +39123,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -42117,7 +42124,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -36921,7 +36921,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -37437,6 +37437,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -37697,21 +37708,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -38368,7 +38364,7 @@ function handleThrow(root, thrownValue) {
|
||||
case SuspendedOnData:
|
||||
case SuspendedOnImmediate:
|
||||
case SuspendedOnDeprecatedThrowPromise:
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var wakeable = thrownValue;
|
||||
markComponentSuspended(
|
||||
erroredWork,
|
||||
@@ -38709,6 +38705,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -38720,11 +38727,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -41721,7 +41728,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -12961,6 +12961,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -13169,9 +13171,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -13502,6 +13502,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -15490,7 +15493,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1741 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-classic-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2108 = {
|
||||
@@ -15520,7 +15523,7 @@ var internals$jscomp$inline_2108 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2109 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -15776,4 +15779,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
@@ -12706,6 +12706,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -12914,9 +12916,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -13247,6 +13247,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -15019,7 +15022,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1700 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-modern-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2072 = {
|
||||
@@ -15050,7 +15053,7 @@ var internals$jscomp$inline_2072 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2073 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -15235,4 +15238,4 @@ exports.unstable_flushControlled = function (fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
@@ -13568,6 +13568,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -13777,9 +13779,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -14162,6 +14162,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
memoizedUpdaters.then(lanes, lanes);
|
||||
@@ -16267,7 +16270,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1821 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-classic-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function (internals) {
|
||||
@@ -16311,7 +16314,7 @@ var devToolsConfig$jscomp$inline_1821 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
});
|
||||
assign(Internals, {
|
||||
ReactBrowserEventEmitter: {
|
||||
@@ -16554,7 +16557,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -13303,6 +13303,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -13512,9 +13514,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -13897,6 +13897,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
memoizedUpdaters.then(lanes, lanes);
|
||||
@@ -15786,7 +15789,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1780 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-modern-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function (internals) {
|
||||
@@ -15831,7 +15834,7 @@ var devToolsConfig$jscomp$inline_1780 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
||||
exports.createPortal = function (children, container) {
|
||||
@@ -16003,7 +16006,7 @@ exports.unstable_flushControlled = function (fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
|
||||
@@ -3771,4 +3771,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
@@ -3669,4 +3669,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
@@ -27279,7 +27279,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -27591,6 +27591,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -27848,21 +27859,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -28752,6 +28748,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
|
||||
@@ -28763,11 +28770,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -31246,7 +31253,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -33770,7 +33770,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -34082,6 +34082,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -34339,21 +34350,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -35243,6 +35239,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
|
||||
@@ -35254,11 +35261,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -37737,7 +37744,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -9089,6 +9089,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -9297,9 +9299,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -9629,6 +9629,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -11521,7 +11524,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1535 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-classic-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2058 = {
|
||||
@@ -11551,7 +11554,7 @@ var internals$jscomp$inline_2058 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2059 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -14782,4 +14785,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
@@ -11710,6 +11710,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
null !== existingCallbackNode && cancelCallback$1(existingCallbackNode),
|
||||
(root.callbackNode = null),
|
||||
(root.callbackPriority = 0);
|
||||
else if (2 === workInProgressSuspendedReason && workInProgressRoot === root)
|
||||
(root.callbackPriority = 0), (root.callbackNode = null);
|
||||
else if (
|
||||
((currentTime = nextLanes & -nextLanes),
|
||||
root.callbackPriority !== currentTime)
|
||||
@@ -11918,9 +11920,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
}
|
||||
ensureRootIsScheduled(root, now());
|
||||
return root.callbackNode === originalCallbackNode
|
||||
? 2 === workInProgressSuspendedReason && workInProgressRoot === root
|
||||
? ((root.callbackPriority = 0), (root.callbackNode = null))
|
||||
: performConcurrentWorkOnRoot.bind(null, root)
|
||||
? performConcurrentWorkOnRoot.bind(null, root)
|
||||
: null;
|
||||
}
|
||||
function recoverFromConcurrentError(
|
||||
@@ -12250,6 +12250,9 @@ function renderRootConcurrent(root, lanes) {
|
||||
break;
|
||||
}
|
||||
lanes = function () {
|
||||
2 === workInProgressSuspendedReason &&
|
||||
workInProgressRoot === root &&
|
||||
(workInProgressSuspendedReason = 5);
|
||||
ensureRootIsScheduled(root, now());
|
||||
};
|
||||
thrownValue.then(lanes, lanes);
|
||||
@@ -13881,7 +13884,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1652 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-1528c5ccd-20230306",
|
||||
version: "18.3.0-www-modern-6e1756a5a-20230306",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2032 = {
|
||||
@@ -13912,7 +13915,7 @@ var internals$jscomp$inline_2032 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-1528c5ccd-20230306"
|
||||
reconcilerVersion: "18.3.0-next-6e1756a5a-20230306"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2033 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -14240,4 +14243,4 @@ exports.unstable_flushControlled = function (fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-1528c5ccd-20230306";
|
||||
exports.version = "18.3.0-next-6e1756a5a-20230306";
|
||||
|
||||
@@ -19757,7 +19757,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -20055,6 +20055,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -20295,21 +20306,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -21155,6 +21151,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -21166,11 +21173,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -23762,7 +23769,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-classic-6e1756a5a-20230306";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -19757,7 +19757,7 @@ var SuspendedOnError = 1;
|
||||
var SuspendedOnData = 2;
|
||||
var SuspendedOnImmediate = 3;
|
||||
var SuspendedOnDeprecatedThrowPromise = 4;
|
||||
var SuspendedAndReadyToUnwind = 5;
|
||||
var SuspendedAndReadyToContinue = 5;
|
||||
var SuspendedOnHydration = 6; // When this is true, the work-in-progress fiber just suspended (or errored) and
|
||||
// we've yet to unwind the stack. In some cases, we may yield to the main thread
|
||||
// after this happens. If the fiber is pinged before we resume, we can retry
|
||||
@@ -20055,6 +20055,17 @@ function ensureRootIsScheduled(root, currentTime) {
|
||||
root.callbackNode = null;
|
||||
root.callbackPriority = NoLane;
|
||||
return;
|
||||
} // If this root is currently suspended and waiting for data to resolve, don't
|
||||
// schedule a task to render it. We'll either wait for a ping, or wait to
|
||||
// receive an update.
|
||||
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return;
|
||||
} // We use the highest priority lane to represent the priority of the callback.
|
||||
|
||||
var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it.
|
||||
@@ -20295,21 +20306,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
if (root.callbackNode === originalCallbackNode) {
|
||||
// The task node scheduled for this root is the same one that's
|
||||
// currently executed. Need to return a continuation.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Special case: The work loop is currently suspended and waiting for
|
||||
// data to resolve. Unschedule the current task.
|
||||
//
|
||||
// TODO: The factoring is a little weird. Arguably this should be checked
|
||||
// in ensureRootIsScheduled instead. I went back and forth, not totally
|
||||
// sure yet.
|
||||
root.callbackPriority = NoLane;
|
||||
root.callbackNode = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return performConcurrentWorkOnRoot.bind(null, root);
|
||||
}
|
||||
|
||||
@@ -21155,6 +21151,17 @@ function renderRootConcurrent(root, lanes) {
|
||||
// have added a listener until right here.
|
||||
|
||||
var onResolution = function () {
|
||||
// Check if the root is still suspended on this promise.
|
||||
if (
|
||||
workInProgressSuspendedReason === SuspendedOnData &&
|
||||
workInProgressRoot === root
|
||||
) {
|
||||
// Mark the root as ready to continue rendering.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
} // Ensure the root is scheduled. We should do this even if we're
|
||||
// currently working on a different root, so that we resume
|
||||
// rendering later.
|
||||
|
||||
ensureRootIsScheduled(root, now$1());
|
||||
};
|
||||
|
||||
@@ -21166,11 +21173,11 @@ function renderRootConcurrent(root, lanes) {
|
||||
// If this fiber just suspended, it's possible the data is already
|
||||
// cached. Yield to the main thread to give it a chance to ping. If
|
||||
// it does, we can retry immediately without unwinding the stack.
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToUnwind;
|
||||
workInProgressSuspendedReason = SuspendedAndReadyToContinue;
|
||||
break outer;
|
||||
}
|
||||
|
||||
case SuspendedAndReadyToUnwind: {
|
||||
case SuspendedAndReadyToContinue: {
|
||||
var _thenable = thrownValue;
|
||||
|
||||
if (isThenableResolved(_thenable)) {
|
||||
@@ -23762,7 +23769,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-1528c5ccd-20230306";
|
||||
var ReactVersion = "18.3.0-www-modern-6e1756a5a-20230306";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user