mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Always warn if client component suspends with an uncached promise (#28159)
Previously we only warned during a synchronous update, because we
eventually want to support async client components in controlled
scenarios, like during navigations. However, we're going to warn in all
cases for now until we figure out how that should work.
DiffTrain build for [178f435194](https://github.com/facebook/react/commit/178f4351947a842ff0b56700e9115b25ae8f20d0)
This commit is contained in:
@@ -1 +1 @@
|
||||
554fc49f41465d914b15dc8eb2ec094f37824f7e
|
||||
178f4351947a842ff0b56700e9115b25ae8f20d0
|
||||
|
||||
@@ -24,7 +24,7 @@ if (__DEV__) {
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var ReactVersion = "18.3.0-www-classic-2277e96d";
|
||||
var ReactVersion = "18.3.0-www-classic-8a9e991a";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -572,4 +572,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-4ac70da3";
|
||||
exports.version = "18.3.0-www-classic-d6acec23";
|
||||
|
||||
@@ -66,7 +66,7 @@ if (__DEV__) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-09d28a0e";
|
||||
var ReactVersion = "18.3.0-www-classic-909c7c72";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -6101,7 +6101,14 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -6134,7 +6141,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -6148,16 +6160,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop, noop);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -8259,7 +8300,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -8271,43 +8312,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8390,6 +8408,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -8482,16 +8501,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -8615,7 +8631,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ if (__DEV__) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-416a65ea";
|
||||
var ReactVersion = "18.3.0-www-modern-4f70a13e";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -5851,7 +5851,14 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -5884,7 +5891,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -5898,16 +5910,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop, noop);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -8009,7 +8050,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -8021,43 +8062,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8140,6 +8158,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -8232,16 +8251,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -8365,7 +8381,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
@@ -10321,19 +10321,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1144 = {
|
||||
devToolsConfig$jscomp$inline_1146 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-28adafd1",
|
||||
version: "18.3.0-www-classic-625f3aa2",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1310 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1144.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1144.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1144.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1144.rendererConfig,
|
||||
var internals$jscomp$inline_1312 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1146.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1146.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1146.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1146.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10350,26 +10350,26 @@ var internals$jscomp$inline_1310 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1144.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1146.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-28adafd1"
|
||||
reconcilerVersion: "18.3.0-www-classic-625f3aa2"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1311 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1313 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1311.isDisabled &&
|
||||
hook$jscomp$inline_1311.supportsFiber
|
||||
!hook$jscomp$inline_1313.isDisabled &&
|
||||
hook$jscomp$inline_1313.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1311.inject(
|
||||
internals$jscomp$inline_1310
|
||||
(rendererID = hook$jscomp$inline_1313.inject(
|
||||
internals$jscomp$inline_1312
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1311);
|
||||
(injectedHook = hook$jscomp$inline_1313);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -9987,19 +9987,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1124 = {
|
||||
devToolsConfig$jscomp$inline_1126 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-62735364",
|
||||
version: "18.3.0-www-modern-5679160e",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1290 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1124.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1124.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1124.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1124.rendererConfig,
|
||||
var internals$jscomp$inline_1292 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1126.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1126.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1126.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1126.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10016,26 +10016,26 @@ var internals$jscomp$inline_1290 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1124.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1126.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-62735364"
|
||||
reconcilerVersion: "18.3.0-www-modern-5679160e"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1291 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1293 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1291.isDisabled &&
|
||||
hook$jscomp$inline_1291.supportsFiber
|
||||
!hook$jscomp$inline_1293.isDisabled &&
|
||||
hook$jscomp$inline_1293.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1291.inject(
|
||||
internals$jscomp$inline_1290
|
||||
(rendererID = hook$jscomp$inline_1293.inject(
|
||||
internals$jscomp$inline_1292
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1291);
|
||||
(injectedHook = hook$jscomp$inline_1293);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -10664,7 +10664,14 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -10697,7 +10704,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -10711,16 +10723,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop$2, noop$2);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -12861,7 +12902,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -12873,43 +12914,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12992,6 +13010,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -13084,16 +13103,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -13217,7 +13233,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -35039,7 +35055,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-dedd8149";
|
||||
var ReactVersion = "18.3.0-www-classic-fbcbe25e";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -10600,7 +10600,14 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -10633,7 +10640,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -10647,16 +10659,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop$2, noop$2);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -12797,7 +12838,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -12809,43 +12850,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12928,6 +12946,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -13020,16 +13039,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -13153,7 +13169,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -34860,7 +34876,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-57106b67";
|
||||
var ReactVersion = "18.3.0-www-modern-cd8a9bf8";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -12748,14 +12748,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$345;
|
||||
if (canUseDOM) {
|
||||
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;
|
||||
var isSupported$jscomp$inline_1536 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1536) {
|
||||
var element$jscomp$inline_1537 = document.createElement("div");
|
||||
element$jscomp$inline_1537.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1536 =
|
||||
"function" === typeof element$jscomp$inline_1537.oninput;
|
||||
}
|
||||
JSCompiler_inline_result$jscomp$345 = isSupported$jscomp$inline_1534;
|
||||
JSCompiler_inline_result$jscomp$345 = isSupported$jscomp$inline_1536;
|
||||
} else JSCompiler_inline_result$jscomp$345 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$345 &&
|
||||
@@ -13067,20 +13067,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1575 = 0;
|
||||
i$jscomp$inline_1575 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1575++
|
||||
var i$jscomp$inline_1577 = 0;
|
||||
i$jscomp$inline_1577 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1577++
|
||||
) {
|
||||
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);
|
||||
var eventName$jscomp$inline_1578 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1577],
|
||||
domEventName$jscomp$inline_1579 =
|
||||
eventName$jscomp$inline_1578.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1580 =
|
||||
eventName$jscomp$inline_1578[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1578.slice(1);
|
||||
registerSimpleEvent(
|
||||
domEventName$jscomp$inline_1577,
|
||||
"on" + capitalizedEvent$jscomp$inline_1578
|
||||
domEventName$jscomp$inline_1579,
|
||||
"on" + capitalizedEvent$jscomp$inline_1580
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -16634,17 +16634,17 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1801 = {
|
||||
var devToolsConfig$jscomp$inline_1803 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-aa2ac027",
|
||||
version: "18.3.0-www-classic-5c298e92",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2147 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1801.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1801.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1801.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1801.rendererConfig,
|
||||
var internals$jscomp$inline_2149 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1803.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1803.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1803.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1803.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -16660,26 +16660,26 @@ var internals$jscomp$inline_2147 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1801.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1803.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-aa2ac027"
|
||||
reconcilerVersion: "18.3.0-www-classic-5c298e92"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2148 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_2150 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_2148.isDisabled &&
|
||||
hook$jscomp$inline_2148.supportsFiber
|
||||
!hook$jscomp$inline_2150.isDisabled &&
|
||||
hook$jscomp$inline_2150.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_2148.inject(
|
||||
internals$jscomp$inline_2147
|
||||
(rendererID = hook$jscomp$inline_2150.inject(
|
||||
internals$jscomp$inline_2149
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_2148);
|
||||
(injectedHook = hook$jscomp$inline_2150);
|
||||
} catch (err) {}
|
||||
}
|
||||
assign(Internals, {
|
||||
@@ -17004,4 +17004,4 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-aa2ac027";
|
||||
exports.version = "18.3.0-www-classic-5c298e92";
|
||||
|
||||
@@ -12989,14 +12989,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$343;
|
||||
if (canUseDOM) {
|
||||
var isSupported$jscomp$inline_1533 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1533) {
|
||||
var element$jscomp$inline_1534 = document.createElement("div");
|
||||
element$jscomp$inline_1534.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1533 =
|
||||
"function" === typeof element$jscomp$inline_1534.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$343 = isSupported$jscomp$inline_1533;
|
||||
JSCompiler_inline_result$jscomp$343 = isSupported$jscomp$inline_1535;
|
||||
} else JSCompiler_inline_result$jscomp$343 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$343 &&
|
||||
@@ -13308,20 +13308,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1574 = 0;
|
||||
i$jscomp$inline_1574 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1574++
|
||||
var i$jscomp$inline_1576 = 0;
|
||||
i$jscomp$inline_1576 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1576++
|
||||
) {
|
||||
var eventName$jscomp$inline_1575 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1574],
|
||||
domEventName$jscomp$inline_1576 =
|
||||
eventName$jscomp$inline_1575.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1577 =
|
||||
eventName$jscomp$inline_1575[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1575.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_1576,
|
||||
"on" + capitalizedEvent$jscomp$inline_1577
|
||||
domEventName$jscomp$inline_1578,
|
||||
"on" + capitalizedEvent$jscomp$inline_1579
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -16157,17 +16157,17 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1760 = {
|
||||
var devToolsConfig$jscomp$inline_1762 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-571f606f",
|
||||
version: "18.3.0-www-modern-bef36890",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2111 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1760.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1760.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1760.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1760.rendererConfig,
|
||||
var internals$jscomp$inline_2113 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1762.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1762.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1762.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1762.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -16184,26 +16184,26 @@ var internals$jscomp$inline_2111 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1760.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1762.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-571f606f"
|
||||
reconcilerVersion: "18.3.0-www-modern-bef36890"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2112 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_2114 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_2112.isDisabled &&
|
||||
hook$jscomp$inline_2112.supportsFiber
|
||||
!hook$jscomp$inline_2114.isDisabled &&
|
||||
hook$jscomp$inline_2114.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_2112.inject(
|
||||
internals$jscomp$inline_2111
|
||||
(rendererID = hook$jscomp$inline_2114.inject(
|
||||
internals$jscomp$inline_2113
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_2112);
|
||||
(injectedHook = hook$jscomp$inline_2114);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
||||
@@ -16456,4 +16456,4 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-571f606f";
|
||||
exports.version = "18.3.0-www-modern-bef36890";
|
||||
|
||||
@@ -13517,14 +13517,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$366;
|
||||
if (canUseDOM) {
|
||||
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;
|
||||
var isSupported$jscomp$inline_1621 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1621) {
|
||||
var element$jscomp$inline_1622 = document.createElement("div");
|
||||
element$jscomp$inline_1622.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1621 =
|
||||
"function" === typeof element$jscomp$inline_1622.oninput;
|
||||
}
|
||||
JSCompiler_inline_result$jscomp$366 = isSupported$jscomp$inline_1619;
|
||||
JSCompiler_inline_result$jscomp$366 = isSupported$jscomp$inline_1621;
|
||||
} else JSCompiler_inline_result$jscomp$366 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$366 &&
|
||||
@@ -13836,20 +13836,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1660 = 0;
|
||||
i$jscomp$inline_1660 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1660++
|
||||
var i$jscomp$inline_1662 = 0;
|
||||
i$jscomp$inline_1662 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1662++
|
||||
) {
|
||||
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);
|
||||
var eventName$jscomp$inline_1663 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1662],
|
||||
domEventName$jscomp$inline_1664 =
|
||||
eventName$jscomp$inline_1663.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1665 =
|
||||
eventName$jscomp$inline_1663[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1663.slice(1);
|
||||
registerSimpleEvent(
|
||||
domEventName$jscomp$inline_1662,
|
||||
"on" + capitalizedEvent$jscomp$inline_1663
|
||||
domEventName$jscomp$inline_1664,
|
||||
"on" + capitalizedEvent$jscomp$inline_1665
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -17403,10 +17403,10 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1886 = {
|
||||
var devToolsConfig$jscomp$inline_1888 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-071ab715",
|
||||
version: "18.3.0-www-classic-8c6367b4",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function (internals) {
|
||||
@@ -17424,10 +17424,10 @@ var devToolsConfig$jscomp$inline_1886 = {
|
||||
} catch (err) {}
|
||||
return hook.checkDCE ? !0 : !1;
|
||||
})({
|
||||
bundleType: devToolsConfig$jscomp$inline_1886.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1886.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1886.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1886.rendererConfig,
|
||||
bundleType: devToolsConfig$jscomp$inline_1888.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1888.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1888.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1888.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -17443,14 +17443,14 @@ var devToolsConfig$jscomp$inline_1886 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1886.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1888.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-071ab715"
|
||||
reconcilerVersion: "18.3.0-www-classic-8c6367b4"
|
||||
});
|
||||
assign(Internals, {
|
||||
ReactBrowserEventEmitter: {
|
||||
@@ -17774,7 +17774,7 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-071ab715";
|
||||
exports.version = "18.3.0-www-classic-8c6367b4";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
@@ -13752,14 +13752,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$364;
|
||||
if (canUseDOM) {
|
||||
var isSupported$jscomp$inline_1618 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1618) {
|
||||
var element$jscomp$inline_1619 = document.createElement("div");
|
||||
element$jscomp$inline_1619.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1618 =
|
||||
"function" === typeof element$jscomp$inline_1619.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$364 = isSupported$jscomp$inline_1618;
|
||||
JSCompiler_inline_result$jscomp$364 = isSupported$jscomp$inline_1620;
|
||||
} else JSCompiler_inline_result$jscomp$364 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$364 &&
|
||||
@@ -14071,20 +14071,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1659 = 0;
|
||||
i$jscomp$inline_1659 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1659++
|
||||
var i$jscomp$inline_1661 = 0;
|
||||
i$jscomp$inline_1661 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1661++
|
||||
) {
|
||||
var eventName$jscomp$inline_1660 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1659],
|
||||
domEventName$jscomp$inline_1661 =
|
||||
eventName$jscomp$inline_1660.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1662 =
|
||||
eventName$jscomp$inline_1660[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1660.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_1661,
|
||||
"on" + capitalizedEvent$jscomp$inline_1662
|
||||
domEventName$jscomp$inline_1663,
|
||||
"on" + capitalizedEvent$jscomp$inline_1664
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -16920,10 +16920,10 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1845 = {
|
||||
var devToolsConfig$jscomp$inline_1847 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-416a65ea",
|
||||
version: "18.3.0-www-modern-4f70a13e",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function (internals) {
|
||||
@@ -16941,10 +16941,10 @@ var devToolsConfig$jscomp$inline_1845 = {
|
||||
} catch (err) {}
|
||||
return hook.checkDCE ? !0 : !1;
|
||||
})({
|
||||
bundleType: devToolsConfig$jscomp$inline_1845.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1845.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1845.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1845.rendererConfig,
|
||||
bundleType: devToolsConfig$jscomp$inline_1847.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1847.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1847.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1847.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -16961,14 +16961,14 @@ var devToolsConfig$jscomp$inline_1845 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1845.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1847.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-416a65ea"
|
||||
reconcilerVersion: "18.3.0-www-modern-4f70a13e"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
||||
exports.createPortal = function (children, container) {
|
||||
@@ -17220,7 +17220,7 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-416a65ea";
|
||||
exports.version = "18.3.0-www-modern-4f70a13e";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
@@ -10801,7 +10801,14 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -10834,7 +10841,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -10848,16 +10860,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop$2, noop$2);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -12998,7 +13039,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -13010,43 +13051,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13129,6 +13147,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -13221,16 +13240,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -13354,7 +13370,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -35663,7 +35679,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-49254bd7";
|
||||
var ReactVersion = "18.3.0-www-classic-32fc1691";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -10737,7 +10737,14 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -10770,7 +10777,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -10784,16 +10796,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop$2, noop$2);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -12934,7 +12975,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -12946,43 +12987,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13065,6 +13083,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -13157,16 +13176,13 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -13290,7 +13306,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -35484,7 +35500,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-94e6d325";
|
||||
var ReactVersion = "18.3.0-www-modern-9b2811c9";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
@@ -13020,14 +13020,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$347;
|
||||
if (canUseDOM) {
|
||||
var isSupported$jscomp$inline_1561 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1561) {
|
||||
var element$jscomp$inline_1562 = document.createElement("div");
|
||||
element$jscomp$inline_1562.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1561 =
|
||||
"function" === typeof element$jscomp$inline_1562.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$347 = isSupported$jscomp$inline_1561;
|
||||
JSCompiler_inline_result$jscomp$347 = isSupported$jscomp$inline_1563;
|
||||
} else JSCompiler_inline_result$jscomp$347 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$347 &&
|
||||
@@ -13339,20 +13339,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1602 = 0;
|
||||
i$jscomp$inline_1602 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1602++
|
||||
var i$jscomp$inline_1604 = 0;
|
||||
i$jscomp$inline_1604 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1604++
|
||||
) {
|
||||
var eventName$jscomp$inline_1603 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1602],
|
||||
domEventName$jscomp$inline_1604 =
|
||||
eventName$jscomp$inline_1603.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1605 =
|
||||
eventName$jscomp$inline_1603[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1603.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_1604,
|
||||
"on" + capitalizedEvent$jscomp$inline_1605
|
||||
domEventName$jscomp$inline_1606,
|
||||
"on" + capitalizedEvent$jscomp$inline_1607
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -16963,17 +16963,17 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1806 = {
|
||||
var devToolsConfig$jscomp$inline_1808 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-2277e96d",
|
||||
version: "18.3.0-www-classic-8a9e991a",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2159 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1806.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1806.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1806.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1806.rendererConfig,
|
||||
var internals$jscomp$inline_2161 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1808.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1808.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1808.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1808.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -16989,26 +16989,26 @@ var internals$jscomp$inline_2159 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1806.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1808.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-2277e96d"
|
||||
reconcilerVersion: "18.3.0-www-classic-8a9e991a"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2160 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_2162 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_2160.isDisabled &&
|
||||
hook$jscomp$inline_2160.supportsFiber
|
||||
!hook$jscomp$inline_2162.isDisabled &&
|
||||
hook$jscomp$inline_2162.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_2160.inject(
|
||||
internals$jscomp$inline_2159
|
||||
(rendererID = hook$jscomp$inline_2162.inject(
|
||||
internals$jscomp$inline_2161
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_2160);
|
||||
(injectedHook = hook$jscomp$inline_2162);
|
||||
} catch (err) {}
|
||||
}
|
||||
assign(Internals, {
|
||||
@@ -17484,4 +17484,4 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-2277e96d";
|
||||
exports.version = "18.3.0-www-classic-8a9e991a";
|
||||
|
||||
@@ -13315,14 +13315,14 @@ var isInputEventSupported = !1;
|
||||
if (canUseDOM) {
|
||||
var JSCompiler_inline_result$jscomp$345;
|
||||
if (canUseDOM) {
|
||||
var isSupported$jscomp$inline_1560 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1560) {
|
||||
var element$jscomp$inline_1561 = document.createElement("div");
|
||||
element$jscomp$inline_1561.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1560 =
|
||||
"function" === typeof element$jscomp$inline_1561.oninput;
|
||||
var isSupported$jscomp$inline_1562 = "oninput" in document;
|
||||
if (!isSupported$jscomp$inline_1562) {
|
||||
var element$jscomp$inline_1563 = document.createElement("div");
|
||||
element$jscomp$inline_1563.setAttribute("oninput", "return;");
|
||||
isSupported$jscomp$inline_1562 =
|
||||
"function" === typeof element$jscomp$inline_1563.oninput;
|
||||
}
|
||||
JSCompiler_inline_result$jscomp$345 = isSupported$jscomp$inline_1560;
|
||||
JSCompiler_inline_result$jscomp$345 = isSupported$jscomp$inline_1562;
|
||||
} else JSCompiler_inline_result$jscomp$345 = !1;
|
||||
isInputEventSupported =
|
||||
JSCompiler_inline_result$jscomp$345 &&
|
||||
@@ -13634,20 +13634,20 @@ function registerSimpleEvent(domEventName, reactName) {
|
||||
registerTwoPhaseEvent(reactName, [domEventName]);
|
||||
}
|
||||
for (
|
||||
var i$jscomp$inline_1601 = 0;
|
||||
i$jscomp$inline_1601 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1601++
|
||||
var i$jscomp$inline_1603 = 0;
|
||||
i$jscomp$inline_1603 < simpleEventPluginEvents.length;
|
||||
i$jscomp$inline_1603++
|
||||
) {
|
||||
var eventName$jscomp$inline_1602 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1601],
|
||||
domEventName$jscomp$inline_1603 =
|
||||
eventName$jscomp$inline_1602.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1604 =
|
||||
eventName$jscomp$inline_1602[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1602.slice(1);
|
||||
var eventName$jscomp$inline_1604 =
|
||||
simpleEventPluginEvents[i$jscomp$inline_1603],
|
||||
domEventName$jscomp$inline_1605 =
|
||||
eventName$jscomp$inline_1604.toLowerCase(),
|
||||
capitalizedEvent$jscomp$inline_1606 =
|
||||
eventName$jscomp$inline_1604[0].toUpperCase() +
|
||||
eventName$jscomp$inline_1604.slice(1);
|
||||
registerSimpleEvent(
|
||||
domEventName$jscomp$inline_1603,
|
||||
"on" + capitalizedEvent$jscomp$inline_1604
|
||||
domEventName$jscomp$inline_1605,
|
||||
"on" + capitalizedEvent$jscomp$inline_1606
|
||||
);
|
||||
}
|
||||
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
|
||||
@@ -16540,17 +16540,17 @@ Internals.Events = [
|
||||
restoreStateIfNeeded,
|
||||
batchedUpdates$1
|
||||
];
|
||||
var devToolsConfig$jscomp$inline_1765 = {
|
||||
var devToolsConfig$jscomp$inline_1767 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-79a03470",
|
||||
version: "18.3.0-www-modern-bf668d7c",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2122 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1765.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1765.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1765.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1765.rendererConfig,
|
||||
var internals$jscomp$inline_2124 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1767.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1767.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1767.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1767.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -16567,26 +16567,26 @@ var internals$jscomp$inline_2122 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1765.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1767.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-79a03470"
|
||||
reconcilerVersion: "18.3.0-www-modern-bf668d7c"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2123 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_2125 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_2123.isDisabled &&
|
||||
hook$jscomp$inline_2123.supportsFiber
|
||||
!hook$jscomp$inline_2125.isDisabled &&
|
||||
hook$jscomp$inline_2125.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_2123.inject(
|
||||
internals$jscomp$inline_2122
|
||||
(rendererID = hook$jscomp$inline_2125.inject(
|
||||
internals$jscomp$inline_2124
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_2123);
|
||||
(injectedHook = hook$jscomp$inline_2125);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
||||
@@ -16989,4 +16989,4 @@ exports.useFormState = function () {
|
||||
exports.useFormStatus = function () {
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-79a03470";
|
||||
exports.version = "18.3.0-www-modern-bf668d7c";
|
||||
|
||||
@@ -5099,7 +5099,14 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -5132,7 +5139,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -5146,16 +5158,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop, noop);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -7257,7 +7298,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -7269,43 +7310,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7388,6 +7406,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -7463,16 +7482,13 @@ if (__DEV__) {
|
||||
);
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -7574,7 +7590,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -26062,7 +26078,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4ac70da3";
|
||||
var ReactVersion = "18.3.0-www-classic-d6acec23";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -5099,7 +5099,14 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue; // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
var ReactCurrentActQueue$2 = ReactSharedInternals.ReactCurrentActQueue;
|
||||
|
||||
function getThenablesFromState(state) {
|
||||
{
|
||||
var devState = state;
|
||||
return devState.thenables;
|
||||
}
|
||||
} // An error that is thrown (e.g. by `use`) to trigger Suspense. If we
|
||||
// detect this is caught by userspace, we'll log a warning in development.
|
||||
|
||||
var SuspenseException = new Error(
|
||||
@@ -5132,7 +5139,12 @@ if (__DEV__) {
|
||||
function createThenableState() {
|
||||
// The ThenableState is created the first time a component suspends. If it
|
||||
// suspends again, we'll reuse the same state.
|
||||
return [];
|
||||
{
|
||||
return {
|
||||
didWarnAboutUncachedPromise: false,
|
||||
thenables: []
|
||||
};
|
||||
}
|
||||
}
|
||||
function isThenableResolved(thenable) {
|
||||
var status = thenable.status;
|
||||
@@ -5146,16 +5158,45 @@ if (__DEV__) {
|
||||
ReactCurrentActQueue$2.didUsePromise = true;
|
||||
}
|
||||
|
||||
var previous = thenableState[index];
|
||||
var trackedThenables = getThenablesFromState(thenableState);
|
||||
var previous = trackedThenables[index];
|
||||
|
||||
if (previous === undefined) {
|
||||
thenableState.push(thenable);
|
||||
trackedThenables.push(thenable);
|
||||
} else {
|
||||
if (previous !== thenable) {
|
||||
// Reuse the previous thenable, and drop the new one. We can assume
|
||||
// they represent the same value, because components are idempotent.
|
||||
// Avoid an unhandled rejection errors for the Promises that we'll
|
||||
{
|
||||
var thenableStateDev = thenableState;
|
||||
|
||||
if (!thenableStateDev.didWarnAboutUncachedPromise) {
|
||||
// We should only warn the first time an uncached thenable is
|
||||
// discovered per component, because if there are multiple, the
|
||||
// subsequent ones are likely derived from the first.
|
||||
//
|
||||
// We track this on the thenableState instead of deduping using the
|
||||
// component name like we usually do, because in the case of a
|
||||
// promise-as-React-node, the owner component is likely different from
|
||||
// the parent that's currently being reconciled. We'd have to track
|
||||
// the owner using state, which we're trying to move away from. Though
|
||||
// since this is dev-only, maybe that'd be OK.
|
||||
//
|
||||
// However, another benefit of doing it this way is we might
|
||||
// eventually have a thenableState per memo/Forget boundary instead
|
||||
// of per component, so this would allow us to have more
|
||||
// granular warnings.
|
||||
thenableStateDev.didWarnAboutUncachedPromise = true; // TODO: This warning should link to a corresponding docs page.
|
||||
|
||||
error(
|
||||
"A component was suspended by an uncached promise. Creating " +
|
||||
"promises inside a Client Component or hook is not yet " +
|
||||
"supported, except via a Suspense-compatible library or framework."
|
||||
);
|
||||
}
|
||||
} // Avoid an unhandled rejection errors for the Promises that we'll
|
||||
// intentionally ignore.
|
||||
|
||||
thenable.then(noop, noop);
|
||||
thenable = previous;
|
||||
}
|
||||
@@ -7257,7 +7298,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function warnIfAsyncClientComponent(Component, componentDoesIncludeHooks) {
|
||||
function warnIfAsyncClientComponent(Component) {
|
||||
{
|
||||
// This dev-only check only works for detecting native async functions,
|
||||
// not transpiled ones. There's also a prod check that we use to prevent
|
||||
@@ -7269,43 +7310,20 @@ if (__DEV__) {
|
||||
"[object AsyncFunction]";
|
||||
|
||||
if (isAsyncFunction) {
|
||||
// Encountered an async Client Component. This is not yet supported,
|
||||
// except in certain constrained cases, like during a route navigation.
|
||||
// Encountered an async Client Component. This is not yet supported.
|
||||
var componentName = getComponentNameFromFiber(
|
||||
currentlyRenderingFiber$1
|
||||
);
|
||||
|
||||
if (!didWarnAboutAsyncClientComponent.has(componentName)) {
|
||||
didWarnAboutAsyncClientComponent.add(componentName); // Check if this is a sync update. We use the "root" render lanes here
|
||||
// because the "subtree" render lanes may include additional entangled
|
||||
// lanes related to revealing previously hidden content.
|
||||
didWarnAboutAsyncClientComponent.add(componentName);
|
||||
|
||||
var root = getWorkInProgressRoot();
|
||||
var rootRenderLanes = getWorkInProgressRootRenderLanes();
|
||||
|
||||
if (root !== null && includesBlockingLane(root, rootRenderLanes)) {
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
} else {
|
||||
// This is a concurrent (Transition, Retry, etc) render. We don't
|
||||
// warn in these cases.
|
||||
//
|
||||
// However, Async Components are forbidden to include hooks, even
|
||||
// during a transition, so let's check for that here.
|
||||
//
|
||||
// TODO: Add a corresponding warning to Server Components runtime.
|
||||
if (componentDoesIncludeHooks) {
|
||||
error(
|
||||
"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."
|
||||
);
|
||||
}
|
||||
}
|
||||
error(
|
||||
"async/await is not yet supported in Client Components, only " +
|
||||
"Server Components. This error is often caused by accidentally " +
|
||||
"adding `'use client'` to a module that was originally written " +
|
||||
"for the server."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7388,6 +7406,7 @@ if (__DEV__) {
|
||||
|
||||
ignorePreviousDependencies =
|
||||
current !== null && current.type !== workInProgress.type;
|
||||
warnIfAsyncClientComponent(Component);
|
||||
}
|
||||
|
||||
workInProgress.memoizedState = null;
|
||||
@@ -7463,16 +7482,13 @@ if (__DEV__) {
|
||||
);
|
||||
}
|
||||
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
function finishRenderingHooks(current, workInProgress, Component) {
|
||||
{
|
||||
workInProgress._debugHookTypes = hookTypesDev;
|
||||
var componentDoesIncludeHooks =
|
||||
workInProgressHook !== null || thenableIndexCounter !== 0;
|
||||
warnIfAsyncClientComponent(Component, componentDoesIncludeHooks);
|
||||
} // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
@@ -7574,7 +7590,7 @@ if (__DEV__) {
|
||||
props,
|
||||
secondArg
|
||||
);
|
||||
finishRenderingHooks(current, workInProgress, Component);
|
||||
finishRenderingHooks(current, workInProgress);
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -26062,7 +26078,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-14e470ff";
|
||||
var ReactVersion = "18.3.0-www-modern-e1d67c4c";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ export default [
|
||||
"A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components",
|
||||
"A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components",
|
||||
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)",
|
||||
"A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.",
|
||||
"A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.",
|
||||
"A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",
|
||||
"A large precomputed chunk was passed to writeChunk without being copied. Large chunks get enqueued directly and are not copied. This is incompatible with precomputed chunks because you cannot enqueue the same precomputed chunk twice. Use \"cloneChunk\" to make a copy of this large precomputed chunk before writing it. This is a bug in React.",
|
||||
@@ -182,7 +183,6 @@ export default [
|
||||
"Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",
|
||||
"Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",
|
||||
"Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.",
|
||||
"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 script or module 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",
|
||||
|
||||
Reference in New Issue
Block a user