Fix: Stylesheet in error UI suspends indefinitely (#27265)

This fixes the regression test added in the previous commit. The
"Suspensey commit" implementation relies on the
`shouldRemainOnPreviousScreen` function to determine whether to 1)
suspend the commit 2) activate a parent fallback and schedule a retry.
The issue was that we were sometimes attempting option 2 even when there
was no parent fallback.

Part of the reason this bug landed is due to how `throwException` is
structured. In the case of Suspensey commits, we pass a special "noop"
thenable to `throwException` as a way to trigger the Suspense path. This
special thenable must never have a listener attached to it. This is not
a great way to structure the logic, it's just a consequence of how the
code evolved over time. We should refactor it into multiple functions so
we can trigger a fallback directly without having to check the type. In
the meantime, I added an internal warning to help detect similar
mistakes in the future.

DiffTrain build for [dd480ef923](https://github.com/facebook/react/commit/dd480ef923930c8906a02664b01bcdea50707b5d)
This commit is contained in:
acdlite
2023-08-22 15:27:25 +00:00
parent ab3288b0d0
commit c1e19bbad3
21 changed files with 1731 additions and 1616 deletions
+1 -1
View File
@@ -1 +1 @@
98f3f14d2e06fb785103296318204cd154d5d0ed
dd480ef923930c8906a02664b01bcdea50707b5d
+1 -1
View File
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-www-classic-5c10ec1e";
var ReactVersion = "18.3.0-www-classic-66a3bd33";
// ATTENTION
// When adding new symbols to this file,
+1 -1
View File
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-www-modern-cfb2f865";
var ReactVersion = "18.3.0-www-modern-a61c0c27";
// ATTENTION
// When adding new symbols to this file,
+1 -1
View File
@@ -615,4 +615,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-5d9b9771";
exports.version = "18.3.0-www-modern-c4e10a32";
+52 -41
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-classic-04b4ce38";
var ReactVersion = "18.3.0-www-classic-9148dd07";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -5363,7 +5363,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -13158,10 +13165,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -13192,28 +13205,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -24935,9 +24941,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -24953,26 +24969,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
+52 -41
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-modern-dc24a33c";
var ReactVersion = "18.3.0-www-modern-293df28d";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -5119,7 +5119,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -12880,10 +12887,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -12914,28 +12927,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -24600,9 +24606,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -24618,26 +24634,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
+23 -26
View File
@@ -8369,23 +8369,20 @@ function handleThrow(root, thrownValue) {
ReactCurrentOwner.current = null;
thrownValue === SuspenseException
? ((thrownValue = getSuspendedThenable()),
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? (root = null === shellBoundary ? !0 : !1)
: ((root = suspenseHandlerStackCursor.current),
(root =
null === root ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: root === shellBoundary)),
(root = suspenseHandlerStackCursor.current),
(workInProgressSuspendedReason =
root &&
0 === (workInProgressRootSkippedLanes & 268435455) &&
0 === (workInProgressRootInterleavedUpdatedLanes & 268435455)
? 2
: 3))
(null !== root &&
((workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null !== shellBoundary
: ((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824)) ||
root !== shellBoundary)) ||
0 !== (workInProgressRootSkippedLanes & 268435455) ||
0 !== (workInProgressRootInterleavedUpdatedLanes & 268435455)
? 3
: 2))
: thrownValue === SuspenseyCommitException
? ((thrownValue = getSuspendedThenable()),
(workInProgressSuspendedReason = 4))
@@ -8720,8 +8717,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
}
break;
break a;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
@@ -8742,16 +8741,14 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$36.add(wakeable);
}
attachPingListener(root, wakeable, thrownValue);
}
break;
break a;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
@@ -10094,7 +10091,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-5c10ec1e",
version: "18.3.0-www-classic-66a3bd33",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1303 = {
@@ -10125,7 +10122,7 @@ var internals$jscomp$inline_1303 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-5c10ec1e"
reconcilerVersion: "18.3.0-www-classic-66a3bd33"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1304 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+23 -26
View File
@@ -8105,23 +8105,20 @@ function handleThrow(root, thrownValue) {
ReactCurrentOwner.current = null;
thrownValue === SuspenseException
? ((thrownValue = getSuspendedThenable()),
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? (root = null === shellBoundary ? !0 : !1)
: ((root = suspenseHandlerStackCursor.current),
(root =
null === root ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: root === shellBoundary)),
(root = suspenseHandlerStackCursor.current),
(workInProgressSuspendedReason =
root &&
0 === (workInProgressRootSkippedLanes & 268435455) &&
0 === (workInProgressRootInterleavedUpdatedLanes & 268435455)
? 2
: 3))
(null !== root &&
((workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null !== shellBoundary
: ((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824)) ||
root !== shellBoundary)) ||
0 !== (workInProgressRootSkippedLanes & 268435455) ||
0 !== (workInProgressRootInterleavedUpdatedLanes & 268435455)
? 3
: 2))
: thrownValue === SuspenseyCommitException
? ((thrownValue = getSuspendedThenable()),
(workInProgressSuspendedReason = 4))
@@ -8452,8 +8449,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
}
break;
break a;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
@@ -8474,16 +8473,14 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$36.add(wakeable);
}
attachPingListener(root, wakeable, thrownValue);
}
break;
break a;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
@@ -9759,7 +9756,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-1182ef25",
version: "18.3.0-www-modern-ce3b7ded",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1283 = {
@@ -9790,7 +9787,7 @@ var internals$jscomp$inline_1283 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-1182ef25"
reconcilerVersion: "18.3.0-www-modern-ce3b7ded"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1284 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+52 -41
View File
@@ -9799,7 +9799,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -17713,10 +17720,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -17747,28 +17760,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -30475,9 +30481,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -30493,26 +30509,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -33944,7 +33955,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-40cd88c9";
var ReactVersion = "18.3.0-www-classic-ca6e9201";
function createPortal$1(
children,
+52 -41
View File
@@ -9740,7 +9740,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -17620,10 +17627,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -17654,28 +17667,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -30325,9 +30331,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -30343,26 +30359,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -33789,7 +33800,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-dc24a33c";
var ReactVersion = "18.3.0-www-modern-293df28d";
function createPortal$1(
children,
+211 -206
View File
@@ -4658,6 +4658,159 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10173,18 +10326,19 @@ function handleThrow(root, thrownValue) {
(workInProgressRootFatalError = thrownValue));
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -10433,172 +10587,23 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$60 = offscreenQueue.retryQueue;
null === retryQueue$60
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$60.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$61 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$61) {
0 === (suspenseBoundary$61.flags & 65536) &&
(suspenseBoundary$61.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$61,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
unitOfWork = unitOfWork.return;
@@ -12635,14 +12640,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$368;
if (canUseDOM) {
var isSupported$jscomp$inline_1552 = "oninput" in document;
if (!isSupported$jscomp$inline_1552) {
var element$jscomp$inline_1553 = document.createElement("div");
element$jscomp$inline_1553.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1552 =
"function" === typeof element$jscomp$inline_1553.oninput;
var isSupported$jscomp$inline_1535 = "oninput" in document;
if (!isSupported$jscomp$inline_1535) {
var element$jscomp$inline_1536 = document.createElement("div");
element$jscomp$inline_1536.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1535 =
"function" === typeof element$jscomp$inline_1536.oninput;
}
JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1552;
JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1535;
} else JSCompiler_inline_result$jscomp$368 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$368 &&
@@ -12954,20 +12959,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1593 = 0;
i$jscomp$inline_1593 < simpleEventPluginEvents.length;
i$jscomp$inline_1593++
var i$jscomp$inline_1576 = 0;
i$jscomp$inline_1576 < simpleEventPluginEvents.length;
i$jscomp$inline_1576++
) {
var eventName$jscomp$inline_1594 =
simpleEventPluginEvents[i$jscomp$inline_1593],
domEventName$jscomp$inline_1595 =
eventName$jscomp$inline_1594.toLowerCase(),
capitalizedEvent$jscomp$inline_1596 =
eventName$jscomp$inline_1594[0].toUpperCase() +
eventName$jscomp$inline_1594.slice(1);
var eventName$jscomp$inline_1577 =
simpleEventPluginEvents[i$jscomp$inline_1576],
domEventName$jscomp$inline_1578 =
eventName$jscomp$inline_1577.toLowerCase(),
capitalizedEvent$jscomp$inline_1579 =
eventName$jscomp$inline_1577[0].toUpperCase() +
eventName$jscomp$inline_1577.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1595,
"on" + capitalizedEvent$jscomp$inline_1596
domEventName$jscomp$inline_1578,
"on" + capitalizedEvent$jscomp$inline_1579
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16663,17 +16668,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1800 = {
var devToolsConfig$jscomp$inline_1783 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-5cdf4bb8",
version: "18.3.0-www-classic-bbf92da7",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2159 = {
bundleType: devToolsConfig$jscomp$inline_1800.bundleType,
version: devToolsConfig$jscomp$inline_1800.version,
rendererPackageName: devToolsConfig$jscomp$inline_1800.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1800.rendererConfig,
var internals$jscomp$inline_2140 = {
bundleType: devToolsConfig$jscomp$inline_1783.bundleType,
version: devToolsConfig$jscomp$inline_1783.version,
rendererPackageName: devToolsConfig$jscomp$inline_1783.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1783.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -16689,26 +16694,26 @@ var internals$jscomp$inline_2159 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1800.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1783.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-5cdf4bb8"
reconcilerVersion: "18.3.0-www-classic-bbf92da7"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2160 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2141 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2160.isDisabled &&
hook$jscomp$inline_2160.supportsFiber
!hook$jscomp$inline_2141.isDisabled &&
hook$jscomp$inline_2141.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2160.inject(
internals$jscomp$inline_2159
(rendererID = hook$jscomp$inline_2141.inject(
internals$jscomp$inline_2140
)),
(injectedHook = hook$jscomp$inline_2160);
(injectedHook = hook$jscomp$inline_2141);
} catch (err) {}
}
assign(Internals, {
@@ -16932,4 +16937,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-5cdf4bb8";
exports.version = "18.3.0-www-classic-bbf92da7";
+211 -206
View File
@@ -4536,6 +4536,159 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10009,18 +10162,19 @@ function handleThrow(root, thrownValue) {
(workInProgressRootFatalError = thrownValue));
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -10265,172 +10419,23 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$60 = offscreenQueue.retryQueue;
null === retryQueue$60
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$60.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$61 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$61) {
0 === (suspenseBoundary$61.flags & 65536) &&
(suspenseBoundary$61.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$61,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
unitOfWork = unitOfWork.return;
@@ -12881,14 +12886,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$366;
if (canUseDOM) {
var isSupported$jscomp$inline_1551 = "oninput" in document;
if (!isSupported$jscomp$inline_1551) {
var element$jscomp$inline_1552 = document.createElement("div");
element$jscomp$inline_1552.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1551 =
"function" === typeof element$jscomp$inline_1552.oninput;
var isSupported$jscomp$inline_1534 = "oninput" in document;
if (!isSupported$jscomp$inline_1534) {
var element$jscomp$inline_1535 = document.createElement("div");
element$jscomp$inline_1535.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1534 =
"function" === typeof element$jscomp$inline_1535.oninput;
}
JSCompiler_inline_result$jscomp$366 = isSupported$jscomp$inline_1551;
JSCompiler_inline_result$jscomp$366 = isSupported$jscomp$inline_1534;
} else JSCompiler_inline_result$jscomp$366 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$366 &&
@@ -13200,20 +13205,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1592 = 0;
i$jscomp$inline_1592 < simpleEventPluginEvents.length;
i$jscomp$inline_1592++
var i$jscomp$inline_1575 = 0;
i$jscomp$inline_1575 < simpleEventPluginEvents.length;
i$jscomp$inline_1575++
) {
var eventName$jscomp$inline_1593 =
simpleEventPluginEvents[i$jscomp$inline_1592],
domEventName$jscomp$inline_1594 =
eventName$jscomp$inline_1593.toLowerCase(),
capitalizedEvent$jscomp$inline_1595 =
eventName$jscomp$inline_1593[0].toUpperCase() +
eventName$jscomp$inline_1593.slice(1);
var eventName$jscomp$inline_1576 =
simpleEventPluginEvents[i$jscomp$inline_1575],
domEventName$jscomp$inline_1577 =
eventName$jscomp$inline_1576.toLowerCase(),
capitalizedEvent$jscomp$inline_1578 =
eventName$jscomp$inline_1576[0].toUpperCase() +
eventName$jscomp$inline_1576.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1594,
"on" + capitalizedEvent$jscomp$inline_1595
domEventName$jscomp$inline_1577,
"on" + capitalizedEvent$jscomp$inline_1578
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16193,17 +16198,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1759 = {
var devToolsConfig$jscomp$inline_1742 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-1182ef25",
version: "18.3.0-www-modern-ce3b7ded",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2123 = {
bundleType: devToolsConfig$jscomp$inline_1759.bundleType,
version: devToolsConfig$jscomp$inline_1759.version,
rendererPackageName: devToolsConfig$jscomp$inline_1759.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1759.rendererConfig,
var internals$jscomp$inline_2104 = {
bundleType: devToolsConfig$jscomp$inline_1742.bundleType,
version: devToolsConfig$jscomp$inline_1742.version,
rendererPackageName: devToolsConfig$jscomp$inline_1742.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1742.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -16220,26 +16225,26 @@ var internals$jscomp$inline_2123 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1759.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1742.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-1182ef25"
reconcilerVersion: "18.3.0-www-modern-ce3b7ded"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2124 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2105 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2124.isDisabled &&
hook$jscomp$inline_2124.supportsFiber
!hook$jscomp$inline_2105.isDisabled &&
hook$jscomp$inline_2105.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2124.inject(
internals$jscomp$inline_2123
(rendererID = hook$jscomp$inline_2105.inject(
internals$jscomp$inline_2104
)),
(injectedHook = hook$jscomp$inline_2124);
(injectedHook = hook$jscomp$inline_2105);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
@@ -16391,4 +16396,4 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-1182ef25";
exports.version = "18.3.0-www-modern-ce3b7ded";
@@ -4876,6 +4876,160 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10812,18 +10966,19 @@ function handleThrow(root, thrownValue) {
}
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -11111,181 +11266,32 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
isDevToolsPresent && restorePendingUpdaters(root, thrownValue);
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$65 = offscreenQueue.retryQueue;
null === retryQueue$65
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$65.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$66 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$66) {
0 === (suspenseBoundary$66.flags & 65536) &&
(suspenseBoundary$66.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$66,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
if (0 !== (unitOfWork.mode & 2)) {
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1);
returnFiber = unitOfWork.actualDuration;
for (update = unitOfWork.child; null !== update; )
(returnFiber += update.actualDuration), (update = update.sibling);
unitOfWork.actualDuration = returnFiber;
thrownValue = unitOfWork.actualDuration;
for (returnFiber = unitOfWork.child; null !== returnFiber; )
(thrownValue += returnFiber.actualDuration),
(returnFiber = returnFiber.sibling);
unitOfWork.actualDuration = thrownValue;
}
unitOfWork = unitOfWork.return;
null !== unitOfWork &&
@@ -13409,14 +13415,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$389;
if (canUseDOM) {
var isSupported$jscomp$inline_1637 = "oninput" in document;
if (!isSupported$jscomp$inline_1637) {
var element$jscomp$inline_1638 = document.createElement("div");
element$jscomp$inline_1638.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1637 =
"function" === typeof element$jscomp$inline_1638.oninput;
var isSupported$jscomp$inline_1620 = "oninput" in document;
if (!isSupported$jscomp$inline_1620) {
var element$jscomp$inline_1621 = document.createElement("div");
element$jscomp$inline_1621.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1620 =
"function" === typeof element$jscomp$inline_1621.oninput;
}
JSCompiler_inline_result$jscomp$389 = isSupported$jscomp$inline_1637;
JSCompiler_inline_result$jscomp$389 = isSupported$jscomp$inline_1620;
} else JSCompiler_inline_result$jscomp$389 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$389 &&
@@ -13728,20 +13734,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1678 = 0;
i$jscomp$inline_1678 < simpleEventPluginEvents.length;
i$jscomp$inline_1678++
var i$jscomp$inline_1661 = 0;
i$jscomp$inline_1661 < simpleEventPluginEvents.length;
i$jscomp$inline_1661++
) {
var eventName$jscomp$inline_1679 =
simpleEventPluginEvents[i$jscomp$inline_1678],
domEventName$jscomp$inline_1680 =
eventName$jscomp$inline_1679.toLowerCase(),
capitalizedEvent$jscomp$inline_1681 =
eventName$jscomp$inline_1679[0].toUpperCase() +
eventName$jscomp$inline_1679.slice(1);
var eventName$jscomp$inline_1662 =
simpleEventPluginEvents[i$jscomp$inline_1661],
domEventName$jscomp$inline_1663 =
eventName$jscomp$inline_1662.toLowerCase(),
capitalizedEvent$jscomp$inline_1664 =
eventName$jscomp$inline_1662[0].toUpperCase() +
eventName$jscomp$inline_1662.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1680,
"on" + capitalizedEvent$jscomp$inline_1681
domEventName$jscomp$inline_1663,
"on" + capitalizedEvent$jscomp$inline_1664
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -17437,10 +17443,10 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1885 = {
var devToolsConfig$jscomp$inline_1868 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-32fb2121",
version: "18.3.0-www-classic-e408ab62",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -17458,10 +17464,10 @@ var devToolsConfig$jscomp$inline_1885 = {
} catch (err) {}
return hook.checkDCE ? !0 : !1;
})({
bundleType: devToolsConfig$jscomp$inline_1885.bundleType,
version: devToolsConfig$jscomp$inline_1885.version,
rendererPackageName: devToolsConfig$jscomp$inline_1885.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1885.rendererConfig,
bundleType: devToolsConfig$jscomp$inline_1868.bundleType,
version: devToolsConfig$jscomp$inline_1868.version,
rendererPackageName: devToolsConfig$jscomp$inline_1868.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1868.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -17477,14 +17483,14 @@ var devToolsConfig$jscomp$inline_1885 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1885.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1868.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-32fb2121"
reconcilerVersion: "18.3.0-www-classic-e408ab62"
});
assign(Internals, {
ReactBrowserEventEmitter: {
@@ -17707,7 +17713,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-32fb2121";
exports.version = "18.3.0-www-classic-e408ab62";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
+210 -204
View File
@@ -4754,6 +4754,160 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10642,18 +10796,19 @@ function handleThrow(root, thrownValue) {
}
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -10937,181 +11092,32 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
isDevToolsPresent && restorePendingUpdaters(root, thrownValue);
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$65 = offscreenQueue.retryQueue;
null === retryQueue$65
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$65.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$66 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$66) {
0 === (suspenseBoundary$66.flags & 65536) &&
(suspenseBoundary$66.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$66,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
if (0 !== (unitOfWork.mode & 2)) {
stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1);
returnFiber = unitOfWork.actualDuration;
for (update = unitOfWork.child; null !== update; )
(returnFiber += update.actualDuration), (update = update.sibling);
unitOfWork.actualDuration = returnFiber;
thrownValue = unitOfWork.actualDuration;
for (returnFiber = unitOfWork.child; null !== returnFiber; )
(thrownValue += returnFiber.actualDuration),
(returnFiber = returnFiber.sibling);
unitOfWork.actualDuration = thrownValue;
}
unitOfWork = unitOfWork.return;
null !== unitOfWork &&
@@ -13649,14 +13655,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$387;
if (canUseDOM) {
var isSupported$jscomp$inline_1636 = "oninput" in document;
if (!isSupported$jscomp$inline_1636) {
var element$jscomp$inline_1637 = document.createElement("div");
element$jscomp$inline_1637.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1636 =
"function" === typeof element$jscomp$inline_1637.oninput;
var isSupported$jscomp$inline_1619 = "oninput" in document;
if (!isSupported$jscomp$inline_1619) {
var element$jscomp$inline_1620 = document.createElement("div");
element$jscomp$inline_1620.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1619 =
"function" === typeof element$jscomp$inline_1620.oninput;
}
JSCompiler_inline_result$jscomp$387 = isSupported$jscomp$inline_1636;
JSCompiler_inline_result$jscomp$387 = isSupported$jscomp$inline_1619;
} else JSCompiler_inline_result$jscomp$387 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$387 &&
@@ -13968,20 +13974,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1677 = 0;
i$jscomp$inline_1677 < simpleEventPluginEvents.length;
i$jscomp$inline_1677++
var i$jscomp$inline_1660 = 0;
i$jscomp$inline_1660 < simpleEventPluginEvents.length;
i$jscomp$inline_1660++
) {
var eventName$jscomp$inline_1678 =
simpleEventPluginEvents[i$jscomp$inline_1677],
domEventName$jscomp$inline_1679 =
eventName$jscomp$inline_1678.toLowerCase(),
capitalizedEvent$jscomp$inline_1680 =
eventName$jscomp$inline_1678[0].toUpperCase() +
eventName$jscomp$inline_1678.slice(1);
var eventName$jscomp$inline_1661 =
simpleEventPluginEvents[i$jscomp$inline_1660],
domEventName$jscomp$inline_1662 =
eventName$jscomp$inline_1661.toLowerCase(),
capitalizedEvent$jscomp$inline_1663 =
eventName$jscomp$inline_1661[0].toUpperCase() +
eventName$jscomp$inline_1661.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1679,
"on" + capitalizedEvent$jscomp$inline_1680
domEventName$jscomp$inline_1662,
"on" + capitalizedEvent$jscomp$inline_1663
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16961,10 +16967,10 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1844 = {
var devToolsConfig$jscomp$inline_1827 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-84557740",
version: "18.3.0-www-modern-4c5a5509",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -16982,10 +16988,10 @@ var devToolsConfig$jscomp$inline_1844 = {
} catch (err) {}
return hook.checkDCE ? !0 : !1;
})({
bundleType: devToolsConfig$jscomp$inline_1844.bundleType,
version: devToolsConfig$jscomp$inline_1844.version,
rendererPackageName: devToolsConfig$jscomp$inline_1844.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1844.rendererConfig,
bundleType: devToolsConfig$jscomp$inline_1827.bundleType,
version: devToolsConfig$jscomp$inline_1827.version,
rendererPackageName: devToolsConfig$jscomp$inline_1827.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1827.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -17002,14 +17008,14 @@ var devToolsConfig$jscomp$inline_1844 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1844.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1827.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-84557740"
reconcilerVersion: "18.3.0-www-modern-4c5a5509"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
@@ -17160,7 +17166,7 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-84557740";
exports.version = "18.3.0-www-modern-4c5a5509";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -9933,7 +9933,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -17847,10 +17854,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -17881,28 +17894,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -31092,9 +31098,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -31110,26 +31126,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -34561,7 +34572,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-83b4bba5";
var ReactVersion = "18.3.0-www-classic-df81fbf5";
function createPortal$1(
children,
@@ -9874,7 +9874,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -17754,10 +17761,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -17788,28 +17801,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -30942,9 +30948,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -30960,26 +30976,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -34406,7 +34417,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-8d3adc88";
var ReactVersion = "18.3.0-www-modern-5039f5f3";
function createPortal$1(
children,
@@ -4744,6 +4744,159 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10445,18 +10598,19 @@ function handleThrow(root, thrownValue) {
(workInProgressRootFatalError = thrownValue));
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -10705,172 +10859,23 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$60 = offscreenQueue.retryQueue;
null === retryQueue$60
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$60.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$61 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$61) {
0 === (suspenseBoundary$61.flags & 65536) &&
(suspenseBoundary$61.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$61,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
unitOfWork = unitOfWork.return;
@@ -12907,14 +12912,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$370;
if (canUseDOM) {
var isSupported$jscomp$inline_1581 = "oninput" in document;
if (!isSupported$jscomp$inline_1581) {
var element$jscomp$inline_1582 = document.createElement("div");
element$jscomp$inline_1582.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1581 =
"function" === typeof element$jscomp$inline_1582.oninput;
var isSupported$jscomp$inline_1564 = "oninput" in document;
if (!isSupported$jscomp$inline_1564) {
var element$jscomp$inline_1565 = document.createElement("div");
element$jscomp$inline_1565.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1564 =
"function" === typeof element$jscomp$inline_1565.oninput;
}
JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1581;
JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1564;
} else JSCompiler_inline_result$jscomp$370 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$370 &&
@@ -13226,20 +13231,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1622 = 0;
i$jscomp$inline_1622 < simpleEventPluginEvents.length;
i$jscomp$inline_1622++
var i$jscomp$inline_1605 = 0;
i$jscomp$inline_1605 < simpleEventPluginEvents.length;
i$jscomp$inline_1605++
) {
var eventName$jscomp$inline_1623 =
simpleEventPluginEvents[i$jscomp$inline_1622],
domEventName$jscomp$inline_1624 =
eventName$jscomp$inline_1623.toLowerCase(),
capitalizedEvent$jscomp$inline_1625 =
eventName$jscomp$inline_1623[0].toUpperCase() +
eventName$jscomp$inline_1623.slice(1);
var eventName$jscomp$inline_1606 =
simpleEventPluginEvents[i$jscomp$inline_1605],
domEventName$jscomp$inline_1607 =
eventName$jscomp$inline_1606.toLowerCase(),
capitalizedEvent$jscomp$inline_1608 =
eventName$jscomp$inline_1606[0].toUpperCase() +
eventName$jscomp$inline_1606.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1624,
"on" + capitalizedEvent$jscomp$inline_1625
domEventName$jscomp$inline_1607,
"on" + capitalizedEvent$jscomp$inline_1608
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16992,17 +16997,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1829 = {
var devToolsConfig$jscomp$inline_1812 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-263bdb86",
version: "18.3.0-www-classic-3a93fd0f",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2193 = {
bundleType: devToolsConfig$jscomp$inline_1829.bundleType,
version: devToolsConfig$jscomp$inline_1829.version,
rendererPackageName: devToolsConfig$jscomp$inline_1829.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1829.rendererConfig,
var internals$jscomp$inline_2174 = {
bundleType: devToolsConfig$jscomp$inline_1812.bundleType,
version: devToolsConfig$jscomp$inline_1812.version,
rendererPackageName: devToolsConfig$jscomp$inline_1812.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1812.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -17018,26 +17023,26 @@ var internals$jscomp$inline_2193 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1829.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1812.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-263bdb86"
reconcilerVersion: "18.3.0-www-classic-3a93fd0f"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2194 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2175 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2194.isDisabled &&
hook$jscomp$inline_2194.supportsFiber
!hook$jscomp$inline_2175.isDisabled &&
hook$jscomp$inline_2175.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2194.inject(
internals$jscomp$inline_2193
(rendererID = hook$jscomp$inline_2175.inject(
internals$jscomp$inline_2174
)),
(injectedHook = hook$jscomp$inline_2194);
(injectedHook = hook$jscomp$inline_2175);
} catch (err) {}
}
assign(Internals, {
@@ -17412,4 +17417,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-classic-263bdb86";
exports.version = "18.3.0-www-classic-3a93fd0f";
@@ -4677,6 +4677,159 @@ function markSuspenseBoundaryShouldCapture(
suspenseBoundary.lanes = rootRenderLanes;
return suspenseBoundary;
}
function throwException(
root,
returnFiber,
sourceFiber,
value,
rootRenderLanes
) {
sourceFiber.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
if (enableLazyContextPropagation) {
var currentSourceFiber = sourceFiber.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
sourceFiber,
rootRenderLanes,
!0
);
}
currentSourceFiber = sourceFiber.tag;
0 !== (sourceFiber.mode & 1) ||
(0 !== currentSourceFiber &&
11 !== currentSourceFiber &&
15 !== currentSourceFiber) ||
((currentSourceFiber = sourceFiber.alternate)
? ((sourceFiber.updateQueue = currentSourceFiber.updateQueue),
(sourceFiber.memoizedState = currentSourceFiber.memoizedState),
(sourceFiber.lanes = currentSourceFiber.lanes))
: ((sourceFiber.updateQueue = null),
(sourceFiber.memoizedState = null)));
currentSourceFiber = suspenseHandlerStackCursor.current;
if (null !== currentSourceFiber) {
switch (currentSourceFiber.tag) {
case 13:
sourceFiber.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === currentSourceFiber.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
currentSourceFiber.flags &= -257;
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? (currentSourceFiber.updateQueue = new Set([value]))
: returnFiber.add(value),
currentSourceFiber.mode & 1 &&
attachPingListener(root, value, rootRenderLanes));
return;
case 22:
if (currentSourceFiber.mode & 1) {
currentSourceFiber.flags |= 65536;
value === noopSuspenseyCommitThenable
? (currentSourceFiber.flags |= 16384)
: ((returnFiber = currentSourceFiber.updateQueue),
null === returnFiber
? ((returnFiber = {
transitions: null,
markerInstances: null,
retryQueue: new Set([value])
}),
(currentSourceFiber.updateQueue = returnFiber))
: ((sourceFiber = returnFiber.retryQueue),
null === sourceFiber
? (returnFiber.retryQueue = new Set([value]))
: sourceFiber.add(value)),
attachPingListener(root, value, rootRenderLanes));
return;
}
}
throw Error(formatProdErrorMessage(435, currentSourceFiber.tag));
}
if (1 === root.tag) {
attachPingListener(root, value, rootRenderLanes);
renderDidSuspendDelayIfPossible();
return;
}
value = Error(formatProdErrorMessage(426));
}
if (
isHydrating &&
sourceFiber.mode & 1 &&
((currentSourceFiber = suspenseHandlerStackCursor.current),
null !== currentSourceFiber)
) {
0 === (currentSourceFiber.flags & 65536) &&
(currentSourceFiber.flags |= 256);
markSuspenseBoundaryShouldCapture(
currentSourceFiber,
returnFiber,
sourceFiber,
root,
rootRenderLanes
);
queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
return;
}
root = value = createCapturedValueAtFiber(value, sourceFiber);
4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createRootErrorUpdate(root, value, rootRenderLanes);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
case 1:
if (
((returnFiber = value),
(sourceFiber = root.type),
(currentSourceFiber = root.stateNode),
0 === (root.flags & 128) &&
("function" === typeof sourceFiber.getDerivedStateFromError ||
(null !== currentSourceFiber &&
"function" === typeof currentSourceFiber.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(
currentSourceFiber
)))))
) {
root.flags |= 65536;
rootRenderLanes &= -rootRenderLanes;
root.lanes |= rootRenderLanes;
rootRenderLanes = createClassErrorUpdate(
root,
returnFiber,
rootRenderLanes
);
enqueueCapturedUpdate(root, rootRenderLanes);
return;
}
}
root = root.return;
} while (null !== root);
}
function processTransitionCallbacks(pendingTransitions, endTime, callbacks) {
if (enableTransitionTracing && null !== pendingTransitions) {
var transitionStart = pendingTransitions.transitionStart,
@@ -10336,18 +10489,19 @@ function handleThrow(root, thrownValue) {
(workInProgressRootFatalError = thrownValue));
}
function shouldRemainOnPreviousScreen() {
if (
(workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
)
return null === shellBoundary ? !0 : !1;
var handler = suspenseHandlerStackCursor.current;
return null === handler ||
((workInProgressRootRenderLanes & 125829120) !==
workInProgressRootRenderLanes &&
0 === (workInProgressRootRenderLanes & 1073741824))
? !1
: handler === shellBoundary;
return null === handler
? !0
: (workInProgressRootRenderLanes & 8388480) ===
workInProgressRootRenderLanes
? null === shellBoundary
? !0
: !1
: (workInProgressRootRenderLanes & 125829120) ===
workInProgressRootRenderLanes ||
0 !== (workInProgressRootRenderLanes & 1073741824)
? handler === shellBoundary
: !1;
}
function pushDispatcher() {
var prevDispatcher = ReactCurrentDispatcher.current;
@@ -10592,172 +10746,23 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
(workInProgress = null);
else {
try {
a: {
var root = workInProgressRoot,
value = thrownValue;
thrownValue = workInProgressRootRenderLanes;
unitOfWork.flags |= 32768;
if (
null !== value &&
"object" === typeof value &&
"function" === typeof value.then
) {
var wakeable = value;
if (enableLazyContextPropagation) {
var currentSourceFiber = unitOfWork.alternate;
null !== currentSourceFiber &&
propagateParentContextChanges(
currentSourceFiber,
unitOfWork,
thrownValue,
!0
);
}
var tag = unitOfWork.tag;
if (
0 === (unitOfWork.mode & 1) &&
(0 === tag || 11 === tag || 15 === tag)
) {
var currentSource = unitOfWork.alternate;
currentSource
? ((unitOfWork.updateQueue = currentSource.updateQueue),
(unitOfWork.memoizedState = currentSource.memoizedState),
(unitOfWork.lanes = currentSource.lanes))
: ((unitOfWork.updateQueue = null),
(unitOfWork.memoizedState = null));
}
var suspenseBoundary = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary) {
switch (suspenseBoundary.tag) {
case 13:
unitOfWork.mode & 1 &&
(null === shellBoundary
? renderDidSuspendDelayIfPossible()
: null === suspenseBoundary.alternate &&
0 === workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 3));
suspenseBoundary.flags &= -257;
markSuspenseBoundaryShouldCapture(
suspenseBoundary,
returnFiber,
unitOfWork,
root,
thrownValue
);
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var retryQueue = suspenseBoundary.updateQueue;
null === retryQueue
? (suspenseBoundary.updateQueue = new Set([wakeable]))
: retryQueue.add(wakeable);
}
break;
case 22:
if (suspenseBoundary.mode & 1) {
suspenseBoundary.flags |= 65536;
if (wakeable === noopSuspenseyCommitThenable)
suspenseBoundary.flags |= 16384;
else {
var offscreenQueue = suspenseBoundary.updateQueue;
if (null === offscreenQueue) {
var newOffscreenQueue = {
transitions: null,
markerInstances: null,
retryQueue: new Set([wakeable])
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$60 = offscreenQueue.retryQueue;
null === retryQueue$60
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$60.add(wakeable);
}
}
break;
}
default:
throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
}
suspenseBoundary.mode & 1 &&
attachPingListener(root, wakeable, thrownValue);
break a;
} else if (1 === root.tag) {
attachPingListener(root, wakeable, thrownValue);
renderDidSuspendDelayIfPossible();
break a;
} else value = Error(formatProdErrorMessage(426));
}
if (isHydrating && unitOfWork.mode & 1) {
var suspenseBoundary$61 = suspenseHandlerStackCursor.current;
if (null !== suspenseBoundary$61) {
0 === (suspenseBoundary$61.flags & 65536) &&
(suspenseBoundary$61.flags |= 256);
markSuspenseBoundaryShouldCapture(
suspenseBoundary$61,
returnFiber,
unitOfWork,
root,
thrownValue
);
queueHydrationError(createCapturedValueAtFiber(value, unitOfWork));
break a;
}
}
root = value = createCapturedValueAtFiber(value, unitOfWork);
4 !== workInProgressRootExitStatus &&
(workInProgressRootExitStatus = 2);
null === workInProgressRootConcurrentErrors
? (workInProgressRootConcurrentErrors = [root])
: workInProgressRootConcurrentErrors.push(root);
root = returnFiber;
do {
switch (root.tag) {
case 3:
var errorInfo = value;
root.flags |= 65536;
thrownValue &= -thrownValue;
root.lanes |= thrownValue;
var update = createRootErrorUpdate(root, errorInfo, thrownValue);
enqueueCapturedUpdate(root, update);
break a;
case 1:
currentSourceFiber = value;
var ctor = root.type,
instance = root.stateNode;
if (
0 === (root.flags & 128) &&
("function" === typeof ctor.getDerivedStateFromError ||
(null !== instance &&
"function" === typeof instance.componentDidCatch &&
(null === legacyErrorBoundariesThatAlreadyFailed ||
!legacyErrorBoundariesThatAlreadyFailed.has(instance))))
) {
root.flags |= 65536;
update = thrownValue & -thrownValue;
root.lanes |= update;
errorInfo = createClassErrorUpdate(
root,
currentSourceFiber,
update
);
enqueueCapturedUpdate(root, errorInfo);
break a;
}
}
root = root.return;
} while (null !== root);
}
throwException(
workInProgressRoot,
returnFiber,
unitOfWork,
thrownValue,
workInProgressRootRenderLanes
);
} catch (error) {
throw ((workInProgress = returnFiber), error);
}
if (unitOfWork.flags & 32768)
a: {
do {
returnFiber = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== returnFiber) {
returnFiber.flags &= 32767;
workInProgress = returnFiber;
thrownValue = unwindWork(unitOfWork.alternate, unitOfWork);
if (null !== thrownValue) {
thrownValue.flags &= 32767;
workInProgress = thrownValue;
break a;
}
unitOfWork = unitOfWork.return;
@@ -13208,14 +13213,14 @@ var isInputEventSupported = !1;
if (canUseDOM) {
var JSCompiler_inline_result$jscomp$368;
if (canUseDOM) {
var isSupported$jscomp$inline_1580 = "oninput" in document;
if (!isSupported$jscomp$inline_1580) {
var element$jscomp$inline_1581 = document.createElement("div");
element$jscomp$inline_1581.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1580 =
"function" === typeof element$jscomp$inline_1581.oninput;
var isSupported$jscomp$inline_1563 = "oninput" in document;
if (!isSupported$jscomp$inline_1563) {
var element$jscomp$inline_1564 = document.createElement("div");
element$jscomp$inline_1564.setAttribute("oninput", "return;");
isSupported$jscomp$inline_1563 =
"function" === typeof element$jscomp$inline_1564.oninput;
}
JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1580;
JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1563;
} else JSCompiler_inline_result$jscomp$368 = !1;
isInputEventSupported =
JSCompiler_inline_result$jscomp$368 &&
@@ -13527,20 +13532,20 @@ function registerSimpleEvent(domEventName, reactName) {
registerTwoPhaseEvent(reactName, [domEventName]);
}
for (
var i$jscomp$inline_1621 = 0;
i$jscomp$inline_1621 < simpleEventPluginEvents.length;
i$jscomp$inline_1621++
var i$jscomp$inline_1604 = 0;
i$jscomp$inline_1604 < simpleEventPluginEvents.length;
i$jscomp$inline_1604++
) {
var eventName$jscomp$inline_1622 =
simpleEventPluginEvents[i$jscomp$inline_1621],
domEventName$jscomp$inline_1623 =
eventName$jscomp$inline_1622.toLowerCase(),
capitalizedEvent$jscomp$inline_1624 =
eventName$jscomp$inline_1622[0].toUpperCase() +
eventName$jscomp$inline_1622.slice(1);
var eventName$jscomp$inline_1605 =
simpleEventPluginEvents[i$jscomp$inline_1604],
domEventName$jscomp$inline_1606 =
eventName$jscomp$inline_1605.toLowerCase(),
capitalizedEvent$jscomp$inline_1607 =
eventName$jscomp$inline_1605[0].toUpperCase() +
eventName$jscomp$inline_1605.slice(1);
registerSimpleEvent(
domEventName$jscomp$inline_1623,
"on" + capitalizedEvent$jscomp$inline_1624
domEventName$jscomp$inline_1606,
"on" + capitalizedEvent$jscomp$inline_1607
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16577,17 +16582,17 @@ Internals.Events = [
restoreStateIfNeeded,
batchedUpdates$1
];
var devToolsConfig$jscomp$inline_1788 = {
var devToolsConfig$jscomp$inline_1771 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-cfb2f865",
version: "18.3.0-www-modern-a61c0c27",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2157 = {
bundleType: devToolsConfig$jscomp$inline_1788.bundleType,
version: devToolsConfig$jscomp$inline_1788.version,
rendererPackageName: devToolsConfig$jscomp$inline_1788.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1788.rendererConfig,
var internals$jscomp$inline_2138 = {
bundleType: devToolsConfig$jscomp$inline_1771.bundleType,
version: devToolsConfig$jscomp$inline_1771.version,
rendererPackageName: devToolsConfig$jscomp$inline_1771.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1771.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -16604,26 +16609,26 @@ var internals$jscomp$inline_2157 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1788.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1771.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-cfb2f865"
reconcilerVersion: "18.3.0-www-modern-a61c0c27"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2158 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_2139 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_2158.isDisabled &&
hook$jscomp$inline_2158.supportsFiber
!hook$jscomp$inline_2139.isDisabled &&
hook$jscomp$inline_2139.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_2158.inject(
internals$jscomp$inline_2157
(rendererID = hook$jscomp$inline_2139.inject(
internals$jscomp$inline_2138
)),
(injectedHook = hook$jscomp$inline_2158);
(injectedHook = hook$jscomp$inline_2139);
} catch (err) {}
}
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
@@ -16926,4 +16931,4 @@ exports.unstable_createEventHandle = function (type, options) {
return eventHandle;
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-www-modern-cfb2f865";
exports.version = "18.3.0-www-modern-a61c0c27";
@@ -4322,7 +4322,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -11359,10 +11366,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -11393,28 +11406,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -21327,9 +21333,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -21345,26 +21361,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -24328,7 +24339,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-83b4bba5";
var ReactVersion = "18.3.0-www-classic-df81fbf5";
// Might add PROFILE later.
@@ -4322,7 +4322,14 @@ var SuspenseyCommitException = new Error(
// for now this will do.
var noopSuspenseyCommitThenable = {
then: function () {}
then: function () {
{
error(
"Internal React error: A listener was unexpectedly attached to a " +
'"noop" thenable. This is a bug in React. Please file an issue.'
);
}
}
};
function createThenableState() {
// The ThenableState is created the first time a component suspends. If it
@@ -11359,10 +11366,16 @@ function throwException(
suspenseBoundary.updateQueue = new Set([wakeable]);
} else {
retryQueue.add(wakeable);
} // We only attach ping listeners in concurrent mode. Legacy
// Suspense always commits fallbacks synchronously, so there are
// no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
}
break;
return;
}
case OffscreenComponent: {
@@ -11393,28 +11406,21 @@ function throwException(
_retryQueue.add(wakeable);
}
}
attachPingListener(root, wakeable, rootRenderLanes);
}
break;
} // Fall through
return;
}
}
default: {
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
}
} // We only attach ping listeners in concurrent mode. Legacy Suspense always
// commits fallbacks synchronously, so there are no pings.
if (suspenseBoundary.mode & ConcurrentMode) {
attachPingListener(root, wakeable, rootRenderLanes);
}
return;
throw new Error(
"Unexpected Suspense handler tag (" +
suspenseBoundary.tag +
"). This " +
"is a bug in React."
);
} else {
// No boundary was found. Unless this is a sync update, this is OK.
// We can suspend and wait for more data to arrive.
@@ -21327,9 +21333,19 @@ function shouldRemainOnPreviousScreen() {
// on the previous screen, versus showing a fallback as soon as possible. It
// takes into account both the priority of render and also whether showing a
// fallback would produce a desirable user experience.
// TODO: Once `use` has fully replaced the `throw promise` pattern, we should
var handler = getSuspenseHandler();
if (handler === null) {
// There's no Suspense boundary that can provide a fallback. We have no
// choice but to remain on the previous screen.
// NOTE: We do this even for sync updates, for lack of any better option. In
// the future, we may change how we handle this, like by putting the whole
// root into a "detached" mode.
return true;
} // TODO: Once `use` has fully replaced the `throw promise` pattern, we should
// be able to remove the equivalent check in finishConcurrentRender, and rely
// just on this one.
if (includesOnlyTransitions(workInProgressRootRenderLanes)) {
if (getShellBoundary() === null) {
// We're rendering inside the "shell" of the app. Activating the nearest
@@ -21345,26 +21361,21 @@ function shouldRemainOnPreviousScreen() {
}
}
var handler = getSuspenseHandler();
if (handler === null);
else {
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
}
if (
includesOnlyRetries(workInProgressRootRenderLanes) || // In this context, an OffscreenLane counts as a Retry
// TODO: It's become increasingly clear that Retries and Offscreen are
// deeply connected. They probably can be unified further.
includesSomeLane(workInProgressRootRenderLanes, OffscreenLane)
) {
// During a retry, we can suspend rendering if the nearest Suspense boundary
// is the boundary of the "shell", because we're guaranteed not to block
// any new content from appearing.
//
// The reason we must check if this is a retry is because it guarantees
// that suspending the work loop won't block an actual update, because
// retries don't "update" anything; they fill in fallbacks that were left
// behind by a previous transition.
return handler === getShellBoundary();
} // For all other Lanes besides Transitions and Retries, we should not wait
// for the data to load.
@@ -24328,7 +24339,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-5d9b9771";
var ReactVersion = "18.3.0-www-modern-c4e10a32";
// Might add PROFILE later.
+1
View File
@@ -168,6 +168,7 @@
"Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
"Internal React Error: React expected bootstrap module with src \"%s\" to not have been preloaded already. please file an issue"
"Internal React Error: React expected bootstrap script with src \"%s\" to not have been preloaded already. please file an issue"
"Internal React error: A listener was unexpectedly attached to a \"noop\" thenable. This is a bug in React. Please file an issue."
"Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s"
"Internal React error: Expected static flag was missing. Please notify the React team."
"Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React."