Remove legacy hydration mode (#28440)

While Meta is still using legacy mode and we can't remove completely,
Meta is not using legacy hydration so we should be able to remove that.

This is just the first step. Once removed, we can vastly simplify the
DOMConfig for hydration.

This will have to be rebased when tests are upgraded.

DiffTrain build for [670d61bea2](https://github.com/facebook/react/commit/670d61bea23470e980ba13c1c8441e375779b0b8)
This commit is contained in:
sebmarkbage
2024-03-26 21:46:39 +00:00
parent eb7de0442f
commit 8ee89e3444
18 changed files with 4634 additions and 6869 deletions
+1 -1
View File
@@ -1 +1 @@
dbfbfb3312db019183ef92fd2ef110cc7d807e80
670d61bea23470e980ba13c1c8441e375779b0b8
+1 -10
View File
@@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}
var ReactVersion = "19.0.0-www-classic-36e84f9d";
var ReactVersion = "19.0.0-www-classic-841735f0";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -16852,15 +16852,6 @@ if (__DEV__) {
// This is the first render pass. Attempt to hydrate.
pushPrimaryTreeSuspenseHandler(workInProgress); // We should never be hydrating at this point because it is the first pass,
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback()) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
+1 -10
View File
@@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}
var ReactVersion = "19.0.0-www-modern-2edfe4d7";
var ReactVersion = "19.0.0-www-modern-37e2c118";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -16546,15 +16546,6 @@ if (__DEV__) {
// This is the first render pass. Attempt to hydrate.
pushPrimaryTreeSuspenseHandler(workInProgress); // We should never be hydrating at this point because it is the first pass,
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback()) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
+235 -260
View File
@@ -4990,20 +4990,21 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
JSCompiler_temp = 0 !== (workInProgress.flags & 32);
workInProgress.flags &= -33;
if (null === current) {
didSuspend = nextProps.children;
var nextFallbackChildren = nextProps.fallback;
var nextPrimaryChildren = nextProps.children;
didSuspend = nextProps.fallback;
if (showFallback)
return (
reuseSuspenseHandlerOnStack(workInProgress),
(nextProps = mountSuspenseFallbackChildren(
workInProgress,
nextPrimaryChildren,
didSuspend,
nextFallbackChildren,
renderLanes
)),
(showFallback = workInProgress.child),
(showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(showFallback.childLanes = getRemainingWorkInPrimaryTree(
(nextPrimaryChildren = workInProgress.child),
(nextPrimaryChildren.memoizedState =
mountSuspenseOffscreenState(renderLanes)),
(nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -5017,9 +5018,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
((renderLanes = enableTransitionTracing
? markerInstanceStack.current
: null),
(current = showFallback.updateQueue),
(current = nextPrimaryChildren.updateQueue),
null === current
? (showFallback.updateQueue = {
? (nextPrimaryChildren.updateQueue = {
transitions: workInProgress,
markerInstances: renderLanes,
retryQueue: null
@@ -5033,13 +5034,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
reuseSuspenseHandlerOnStack(workInProgress),
(nextProps = mountSuspenseFallbackChildren(
workInProgress,
nextPrimaryChildren,
didSuspend,
nextFallbackChildren,
renderLanes
)),
(showFallback = workInProgress.child),
(showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(showFallback.childLanes = getRemainingWorkInPrimaryTree(
(nextPrimaryChildren = workInProgress.child),
(nextPrimaryChildren.memoizedState =
mountSuspenseOffscreenState(renderLanes)),
(nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -5049,96 +5051,239 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
nextProps
);
pushPrimaryTreeSuspenseHandler(workInProgress);
return mountSuspensePrimaryChildren(workInProgress, didSuspend);
return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren);
}
nextFallbackChildren = current.memoizedState;
if (null !== nextFallbackChildren) {
var dehydrated = nextFallbackChildren.dehydrated;
if (null !== dehydrated)
return updateDehydratedSuspenseComponent(
nextPrimaryChildren = current.memoizedState;
if (null !== nextPrimaryChildren && null !== nextPrimaryChildren.dehydrated) {
if (didSuspend)
workInProgress.flags & 256
? (pushPrimaryTreeSuspenseHandler(workInProgress),
(workInProgress.flags &= -257),
(JSCompiler_temp = createCapturedValueFromError(
Error(formatProdErrorMessage(422))
)),
(workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
JSCompiler_temp
)))
: null !== workInProgress.memoizedState
? (reuseSuspenseHandlerOnStack(workInProgress),
(workInProgress.child = current.child),
(workInProgress.flags |= 128),
(workInProgress = null))
: (reuseSuspenseHandlerOnStack(workInProgress),
(nextPrimaryChildren = nextProps.fallback),
(showFallback = workInProgress.mode),
(nextProps = createFiberFromOffscreen(
{ mode: "visible", children: nextProps.children },
showFallback,
0,
null
)),
(nextPrimaryChildren = createFiberFromFragment(
nextPrimaryChildren,
showFallback,
renderLanes,
null
)),
(nextPrimaryChildren.flags |= 2),
(nextProps.return = workInProgress),
(nextPrimaryChildren.return = workInProgress),
(nextProps.sibling = nextPrimaryChildren),
(workInProgress.child = nextProps),
0 !== (workInProgress.mode & 1) &&
reconcileChildFibers(
workInProgress,
current.child,
null,
renderLanes
),
(nextProps = workInProgress.child),
(nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(nextProps.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
)),
(workInProgress.memoizedState = SUSPENDED_MARKER),
(workInProgress = nextPrimaryChildren));
else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2()))
(JSCompiler_temp = shim$2().digest),
(nextProps = Error(formatProdErrorMessage(419))),
(nextProps.digest = JSCompiler_temp),
(JSCompiler_temp = createCapturedValueFromError(
nextProps,
JSCompiler_temp,
void 0
)),
(workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
JSCompiler_temp
));
else if (
(enableLazyContextPropagation &&
!didReceiveUpdate &&
propagateParentContextChanges(current, workInProgress, renderLanes, !1),
(JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
didReceiveUpdate || JSCompiler_temp)
) {
JSCompiler_temp = workInProgressRoot;
if (null !== JSCompiler_temp) {
nextProps = renderLanes & -renderLanes;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
nextProps = 1;
break;
case 8:
nextProps = 4;
break;
case 32:
nextProps = 16;
break;
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
case 4194304:
case 8388608:
case 16777216:
case 33554432:
nextProps = 64;
break;
case 268435456:
nextProps = 134217728;
break;
default:
nextProps = 0;
}
nextProps =
0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
? 0
: nextProps;
if (0 !== nextProps && nextProps !== nextPrimaryChildren.retryLane)
throw (
((nextPrimaryChildren.retryLane = nextProps),
enqueueConcurrentRenderForLane(current, nextProps),
scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
SelectiveHydrationException)
);
}
shim$2() || renderDidSuspendDelayIfPossible();
workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
didSuspend,
JSCompiler_temp,
nextProps,
dehydrated,
nextFallbackChildren,
renderLanes
renderLanes,
null
);
} else
shim$2()
? ((workInProgress.flags |= 128),
(workInProgress.child = current.child),
retryDehydratedSuspenseBoundary.bind(null, current),
shim$2(),
(workInProgress = null))
: ((workInProgress = mountSuspensePrimaryChildren(
workInProgress,
nextProps.children
)),
(workInProgress.flags |= 4096));
return workInProgress;
}
if (showFallback) {
reuseSuspenseHandlerOnStack(workInProgress);
showFallback = nextProps.fallback;
didSuspend = workInProgress.mode;
nextFallbackChildren = current.child;
dehydrated = nextFallbackChildren.sibling;
var primaryChildProps = { mode: "hidden", children: nextProps.children };
0 === (didSuspend & 1) && workInProgress.child !== nextFallbackChildren
nextPrimaryChildren = nextProps.fallback;
showFallback = workInProgress.mode;
didSuspend = current.child;
var currentFallbackChildFragment = didSuspend.sibling,
primaryChildProps = { mode: "hidden", children: nextProps.children };
0 === (showFallback & 1) && workInProgress.child !== didSuspend
? ((nextProps = workInProgress.child),
(nextProps.childLanes = 0),
(nextProps.pendingProps = primaryChildProps),
(workInProgress.deletions = null))
: ((nextProps = createWorkInProgress(
nextFallbackChildren,
primaryChildProps
)),
(nextProps.subtreeFlags =
nextFallbackChildren.subtreeFlags & 31457280));
null !== dehydrated
? (showFallback = createWorkInProgress(dehydrated, showFallback))
: ((showFallback = createFiberFromFragment(
: ((nextProps = createWorkInProgress(didSuspend, primaryChildProps)),
(nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280));
null !== currentFallbackChildFragment
? (nextPrimaryChildren = createWorkInProgress(
currentFallbackChildFragment,
nextPrimaryChildren
))
: ((nextPrimaryChildren = createFiberFromFragment(
nextPrimaryChildren,
showFallback,
didSuspend,
renderLanes,
null
)),
(showFallback.flags |= 2));
showFallback.return = workInProgress;
(nextPrimaryChildren.flags |= 2));
nextPrimaryChildren.return = workInProgress;
nextProps.return = workInProgress;
nextProps.sibling = showFallback;
nextProps.sibling = nextPrimaryChildren;
workInProgress.child = nextProps;
nextProps = showFallback;
showFallback = workInProgress.child;
didSuspend = current.child.memoizedState;
null === didSuspend
? (didSuspend = mountSuspenseOffscreenState(renderLanes))
: ((nextFallbackChildren = didSuspend.cachePool),
null !== nextFallbackChildren
? ((dehydrated = CacheContext._currentValue2),
(nextFallbackChildren =
nextFallbackChildren.parent !== dehydrated
? { parent: dehydrated, pool: dehydrated }
: nextFallbackChildren))
: (nextFallbackChildren = getSuspendedCache()),
(didSuspend = {
baseLanes: didSuspend.baseLanes | renderLanes,
cachePool: nextFallbackChildren
nextProps = nextPrimaryChildren;
nextPrimaryChildren = workInProgress.child;
showFallback = current.child.memoizedState;
null === showFallback
? (showFallback = mountSuspenseOffscreenState(renderLanes))
: ((didSuspend = showFallback.cachePool),
null !== didSuspend
? ((currentFallbackChildFragment = CacheContext._currentValue2),
(didSuspend =
didSuspend.parent !== currentFallbackChildFragment
? {
parent: currentFallbackChildFragment,
pool: currentFallbackChildFragment
}
: didSuspend))
: (didSuspend = getSuspendedCache()),
(showFallback = {
baseLanes: showFallback.baseLanes | renderLanes,
cachePool: didSuspend
}));
showFallback.memoizedState = didSuspend;
nextPrimaryChildren.memoizedState = showFallback;
enableTransitionTracing &&
((didSuspend = enableTransitionTracing ? transitionStack.current : null),
null !== didSuspend &&
((nextFallbackChildren = enableTransitionTracing
((showFallback = enableTransitionTracing
? transitionStack.current
: null),
null !== showFallback &&
((didSuspend = enableTransitionTracing
? markerInstanceStack.current
: null),
(dehydrated = showFallback.updateQueue),
(currentFallbackChildFragment = nextPrimaryChildren.updateQueue),
(primaryChildProps = current.updateQueue),
null === dehydrated
? (showFallback.updateQueue = {
transitions: didSuspend,
markerInstances: nextFallbackChildren,
null === currentFallbackChildFragment
? (nextPrimaryChildren.updateQueue = {
transitions: showFallback,
markerInstances: didSuspend,
retryQueue: null
})
: dehydrated === primaryChildProps
? (showFallback.updateQueue = {
transitions: didSuspend,
markerInstances: nextFallbackChildren,
: currentFallbackChildFragment === primaryChildProps
? (nextPrimaryChildren.updateQueue = {
transitions: showFallback,
markerInstances: didSuspend,
retryQueue:
null !== primaryChildProps ? primaryChildProps.retryQueue : null
})
: ((dehydrated.transitions = didSuspend),
(dehydrated.markerInstances = nextFallbackChildren))));
showFallback.childLanes = getRemainingWorkInPrimaryTree(
: ((currentFallbackChildFragment.transitions = showFallback),
(currentFallbackChildFragment.markerInstances = didSuspend))));
nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -5224,176 +5369,6 @@ function retrySuspenseComponentWithoutHydrating(
workInProgress.memoizedState = null;
return current;
}
function updateDehydratedSuspenseComponent(
current,
workInProgress,
didSuspend,
didPrimaryChildrenDefer,
nextProps,
suspenseInstance,
suspenseState,
renderLanes
) {
if (didSuspend) {
if (workInProgress.flags & 256)
return (
pushPrimaryTreeSuspenseHandler(workInProgress),
(workInProgress.flags &= -257),
(didPrimaryChildrenDefer = createCapturedValueFromError(
Error(formatProdErrorMessage(422))
)),
retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
didPrimaryChildrenDefer
)
);
if (null !== workInProgress.memoizedState)
return (
reuseSuspenseHandlerOnStack(workInProgress),
(workInProgress.child = current.child),
(workInProgress.flags |= 128),
null
);
reuseSuspenseHandlerOnStack(workInProgress);
suspenseState = nextProps.fallback;
didSuspend = workInProgress.mode;
nextProps = createFiberFromOffscreen(
{ mode: "visible", children: nextProps.children },
didSuspend,
0,
null
);
suspenseState = createFiberFromFragment(
suspenseState,
didSuspend,
renderLanes,
null
);
suspenseState.flags |= 2;
nextProps.return = workInProgress;
suspenseState.return = workInProgress;
nextProps.sibling = suspenseState;
workInProgress.child = nextProps;
0 !== (workInProgress.mode & 1) &&
reconcileChildFibers(workInProgress, current.child, null, renderLanes);
nextProps = workInProgress.child;
nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes);
nextProps.childLanes = getRemainingWorkInPrimaryTree(
current,
didPrimaryChildrenDefer,
renderLanes
);
workInProgress.memoizedState = SUSPENDED_MARKER;
return suspenseState;
}
pushPrimaryTreeSuspenseHandler(workInProgress);
if (0 === (workInProgress.mode & 1))
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
if (shim$2())
return (
(didPrimaryChildrenDefer = shim$2().digest),
(suspenseState = Error(formatProdErrorMessage(419))),
(suspenseState.digest = didPrimaryChildrenDefer),
(didPrimaryChildrenDefer = createCapturedValueFromError(
suspenseState,
didPrimaryChildrenDefer,
void 0
)),
retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
didPrimaryChildrenDefer
)
);
enableLazyContextPropagation &&
!didReceiveUpdate &&
propagateParentContextChanges(current, workInProgress, renderLanes, !1);
didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes);
if (didReceiveUpdate || didPrimaryChildrenDefer) {
didPrimaryChildrenDefer = workInProgressRoot;
if (null !== didPrimaryChildrenDefer) {
nextProps = renderLanes & -renderLanes;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
nextProps = 1;
break;
case 8:
nextProps = 4;
break;
case 32:
nextProps = 16;
break;
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
case 4194304:
case 8388608:
case 16777216:
case 33554432:
nextProps = 64;
break;
case 268435456:
nextProps = 134217728;
break;
default:
nextProps = 0;
}
nextProps =
0 !==
(nextProps & (didPrimaryChildrenDefer.suspendedLanes | renderLanes))
? 0
: nextProps;
if (0 !== nextProps && nextProps !== suspenseState.retryLane)
throw (
((suspenseState.retryLane = nextProps),
enqueueConcurrentRenderForLane(current, nextProps),
scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps),
SelectiveHydrationException)
);
}
shim$2() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (shim$2())
return (
(workInProgress.flags |= 128),
(workInProgress.child = current.child),
retryDehydratedSuspenseBoundary.bind(null, current),
shim$2(),
null
);
current = mountSuspensePrimaryChildren(workInProgress, nextProps.children);
current.flags |= 4096;
return current;
}
function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
fiber.lanes |= renderLanes;
var alternate = fiber.alternate;
@@ -10634,19 +10609,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1140 = {
devToolsConfig$jscomp$inline_1133 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-c169ad53",
version: "19.0.0-www-classic-a714d6cd",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1320 = {
bundleType: devToolsConfig$jscomp$inline_1140.bundleType,
version: devToolsConfig$jscomp$inline_1140.version,
rendererPackageName: devToolsConfig$jscomp$inline_1140.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1140.rendererConfig,
var internals$jscomp$inline_1338 = {
bundleType: devToolsConfig$jscomp$inline_1133.bundleType,
version: devToolsConfig$jscomp$inline_1133.version,
rendererPackageName: devToolsConfig$jscomp$inline_1133.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1133.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -10663,26 +10638,26 @@ var internals$jscomp$inline_1320 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1140.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1133.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-c169ad53"
reconcilerVersion: "19.0.0-www-classic-a714d6cd"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1321 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1339 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1321.isDisabled &&
hook$jscomp$inline_1321.supportsFiber
!hook$jscomp$inline_1339.isDisabled &&
hook$jscomp$inline_1339.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1321.inject(
internals$jscomp$inline_1320
(rendererID = hook$jscomp$inline_1339.inject(
internals$jscomp$inline_1338
)),
(injectedHook = hook$jscomp$inline_1321);
(injectedHook = hook$jscomp$inline_1339);
} catch (err) {}
}
var Path = Mode$1.Path;
+235 -260
View File
@@ -4739,20 +4739,21 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
JSCompiler_temp = 0 !== (workInProgress.flags & 32);
workInProgress.flags &= -33;
if (null === current) {
didSuspend = nextProps.children;
var nextFallbackChildren = nextProps.fallback;
var nextPrimaryChildren = nextProps.children;
didSuspend = nextProps.fallback;
if (showFallback)
return (
reuseSuspenseHandlerOnStack(workInProgress),
(nextProps = mountSuspenseFallbackChildren(
workInProgress,
nextPrimaryChildren,
didSuspend,
nextFallbackChildren,
renderLanes
)),
(showFallback = workInProgress.child),
(showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(showFallback.childLanes = getRemainingWorkInPrimaryTree(
(nextPrimaryChildren = workInProgress.child),
(nextPrimaryChildren.memoizedState =
mountSuspenseOffscreenState(renderLanes)),
(nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -4766,9 +4767,9 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
((renderLanes = enableTransitionTracing
? markerInstanceStack.current
: null),
(current = showFallback.updateQueue),
(current = nextPrimaryChildren.updateQueue),
null === current
? (showFallback.updateQueue = {
? (nextPrimaryChildren.updateQueue = {
transitions: workInProgress,
markerInstances: renderLanes,
retryQueue: null
@@ -4782,13 +4783,14 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
reuseSuspenseHandlerOnStack(workInProgress),
(nextProps = mountSuspenseFallbackChildren(
workInProgress,
nextPrimaryChildren,
didSuspend,
nextFallbackChildren,
renderLanes
)),
(showFallback = workInProgress.child),
(showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(showFallback.childLanes = getRemainingWorkInPrimaryTree(
(nextPrimaryChildren = workInProgress.child),
(nextPrimaryChildren.memoizedState =
mountSuspenseOffscreenState(renderLanes)),
(nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -4798,96 +4800,239 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
nextProps
);
pushPrimaryTreeSuspenseHandler(workInProgress);
return mountSuspensePrimaryChildren(workInProgress, didSuspend);
return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren);
}
nextFallbackChildren = current.memoizedState;
if (null !== nextFallbackChildren) {
var dehydrated = nextFallbackChildren.dehydrated;
if (null !== dehydrated)
return updateDehydratedSuspenseComponent(
nextPrimaryChildren = current.memoizedState;
if (null !== nextPrimaryChildren && null !== nextPrimaryChildren.dehydrated) {
if (didSuspend)
workInProgress.flags & 256
? (pushPrimaryTreeSuspenseHandler(workInProgress),
(workInProgress.flags &= -257),
(JSCompiler_temp = createCapturedValueFromError(
Error(formatProdErrorMessage(422))
)),
(workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
JSCompiler_temp
)))
: null !== workInProgress.memoizedState
? (reuseSuspenseHandlerOnStack(workInProgress),
(workInProgress.child = current.child),
(workInProgress.flags |= 128),
(workInProgress = null))
: (reuseSuspenseHandlerOnStack(workInProgress),
(nextPrimaryChildren = nextProps.fallback),
(showFallback = workInProgress.mode),
(nextProps = createFiberFromOffscreen(
{ mode: "visible", children: nextProps.children },
showFallback,
0,
null
)),
(nextPrimaryChildren = createFiberFromFragment(
nextPrimaryChildren,
showFallback,
renderLanes,
null
)),
(nextPrimaryChildren.flags |= 2),
(nextProps.return = workInProgress),
(nextPrimaryChildren.return = workInProgress),
(nextProps.sibling = nextPrimaryChildren),
(workInProgress.child = nextProps),
0 !== (workInProgress.mode & 1) &&
reconcileChildFibers(
workInProgress,
current.child,
null,
renderLanes
),
(nextProps = workInProgress.child),
(nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)),
(nextProps.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
)),
(workInProgress.memoizedState = SUSPENDED_MARKER),
(workInProgress = nextPrimaryChildren));
else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2()))
(JSCompiler_temp = shim$2().digest),
(nextProps = Error(formatProdErrorMessage(419))),
(nextProps.digest = JSCompiler_temp),
(JSCompiler_temp = createCapturedValueFromError(
nextProps,
JSCompiler_temp,
void 0
)),
(workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
JSCompiler_temp
));
else if (
(enableLazyContextPropagation &&
!didReceiveUpdate &&
propagateParentContextChanges(current, workInProgress, renderLanes, !1),
(JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
didReceiveUpdate || JSCompiler_temp)
) {
JSCompiler_temp = workInProgressRoot;
if (null !== JSCompiler_temp) {
nextProps = renderLanes & -renderLanes;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
nextProps = 1;
break;
case 8:
nextProps = 4;
break;
case 32:
nextProps = 16;
break;
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
case 4194304:
case 8388608:
case 16777216:
case 33554432:
nextProps = 64;
break;
case 268435456:
nextProps = 134217728;
break;
default:
nextProps = 0;
}
nextProps =
0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
? 0
: nextProps;
if (0 !== nextProps && nextProps !== nextPrimaryChildren.retryLane)
throw (
((nextPrimaryChildren.retryLane = nextProps),
enqueueConcurrentRenderForLane(current, nextProps),
scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
SelectiveHydrationException)
);
}
shim$2() || renderDidSuspendDelayIfPossible();
workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
didSuspend,
JSCompiler_temp,
nextProps,
dehydrated,
nextFallbackChildren,
renderLanes
renderLanes,
null
);
} else
shim$2()
? ((workInProgress.flags |= 128),
(workInProgress.child = current.child),
retryDehydratedSuspenseBoundary.bind(null, current),
shim$2(),
(workInProgress = null))
: ((workInProgress = mountSuspensePrimaryChildren(
workInProgress,
nextProps.children
)),
(workInProgress.flags |= 4096));
return workInProgress;
}
if (showFallback) {
reuseSuspenseHandlerOnStack(workInProgress);
showFallback = nextProps.fallback;
didSuspend = workInProgress.mode;
nextFallbackChildren = current.child;
dehydrated = nextFallbackChildren.sibling;
var primaryChildProps = { mode: "hidden", children: nextProps.children };
0 === (didSuspend & 1) && workInProgress.child !== nextFallbackChildren
nextPrimaryChildren = nextProps.fallback;
showFallback = workInProgress.mode;
didSuspend = current.child;
var currentFallbackChildFragment = didSuspend.sibling,
primaryChildProps = { mode: "hidden", children: nextProps.children };
0 === (showFallback & 1) && workInProgress.child !== didSuspend
? ((nextProps = workInProgress.child),
(nextProps.childLanes = 0),
(nextProps.pendingProps = primaryChildProps),
(workInProgress.deletions = null))
: ((nextProps = createWorkInProgress(
nextFallbackChildren,
primaryChildProps
)),
(nextProps.subtreeFlags =
nextFallbackChildren.subtreeFlags & 31457280));
null !== dehydrated
? (showFallback = createWorkInProgress(dehydrated, showFallback))
: ((showFallback = createFiberFromFragment(
: ((nextProps = createWorkInProgress(didSuspend, primaryChildProps)),
(nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280));
null !== currentFallbackChildFragment
? (nextPrimaryChildren = createWorkInProgress(
currentFallbackChildFragment,
nextPrimaryChildren
))
: ((nextPrimaryChildren = createFiberFromFragment(
nextPrimaryChildren,
showFallback,
didSuspend,
renderLanes,
null
)),
(showFallback.flags |= 2));
showFallback.return = workInProgress;
(nextPrimaryChildren.flags |= 2));
nextPrimaryChildren.return = workInProgress;
nextProps.return = workInProgress;
nextProps.sibling = showFallback;
nextProps.sibling = nextPrimaryChildren;
workInProgress.child = nextProps;
nextProps = showFallback;
showFallback = workInProgress.child;
didSuspend = current.child.memoizedState;
null === didSuspend
? (didSuspend = mountSuspenseOffscreenState(renderLanes))
: ((nextFallbackChildren = didSuspend.cachePool),
null !== nextFallbackChildren
? ((dehydrated = CacheContext._currentValue2),
(nextFallbackChildren =
nextFallbackChildren.parent !== dehydrated
? { parent: dehydrated, pool: dehydrated }
: nextFallbackChildren))
: (nextFallbackChildren = getSuspendedCache()),
(didSuspend = {
baseLanes: didSuspend.baseLanes | renderLanes,
cachePool: nextFallbackChildren
nextProps = nextPrimaryChildren;
nextPrimaryChildren = workInProgress.child;
showFallback = current.child.memoizedState;
null === showFallback
? (showFallback = mountSuspenseOffscreenState(renderLanes))
: ((didSuspend = showFallback.cachePool),
null !== didSuspend
? ((currentFallbackChildFragment = CacheContext._currentValue2),
(didSuspend =
didSuspend.parent !== currentFallbackChildFragment
? {
parent: currentFallbackChildFragment,
pool: currentFallbackChildFragment
}
: didSuspend))
: (didSuspend = getSuspendedCache()),
(showFallback = {
baseLanes: showFallback.baseLanes | renderLanes,
cachePool: didSuspend
}));
showFallback.memoizedState = didSuspend;
nextPrimaryChildren.memoizedState = showFallback;
enableTransitionTracing &&
((didSuspend = enableTransitionTracing ? transitionStack.current : null),
null !== didSuspend &&
((nextFallbackChildren = enableTransitionTracing
((showFallback = enableTransitionTracing
? transitionStack.current
: null),
null !== showFallback &&
((didSuspend = enableTransitionTracing
? markerInstanceStack.current
: null),
(dehydrated = showFallback.updateQueue),
(currentFallbackChildFragment = nextPrimaryChildren.updateQueue),
(primaryChildProps = current.updateQueue),
null === dehydrated
? (showFallback.updateQueue = {
transitions: didSuspend,
markerInstances: nextFallbackChildren,
null === currentFallbackChildFragment
? (nextPrimaryChildren.updateQueue = {
transitions: showFallback,
markerInstances: didSuspend,
retryQueue: null
})
: dehydrated === primaryChildProps
? (showFallback.updateQueue = {
transitions: didSuspend,
markerInstances: nextFallbackChildren,
: currentFallbackChildFragment === primaryChildProps
? (nextPrimaryChildren.updateQueue = {
transitions: showFallback,
markerInstances: didSuspend,
retryQueue:
null !== primaryChildProps ? primaryChildProps.retryQueue : null
})
: ((dehydrated.transitions = didSuspend),
(dehydrated.markerInstances = nextFallbackChildren))));
showFallback.childLanes = getRemainingWorkInPrimaryTree(
: ((currentFallbackChildFragment.transitions = showFallback),
(currentFallbackChildFragment.markerInstances = didSuspend))));
nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree(
current,
JSCompiler_temp,
renderLanes
@@ -4973,176 +5118,6 @@ function retrySuspenseComponentWithoutHydrating(
workInProgress.memoizedState = null;
return current;
}
function updateDehydratedSuspenseComponent(
current,
workInProgress,
didSuspend,
didPrimaryChildrenDefer,
nextProps,
suspenseInstance,
suspenseState,
renderLanes
) {
if (didSuspend) {
if (workInProgress.flags & 256)
return (
pushPrimaryTreeSuspenseHandler(workInProgress),
(workInProgress.flags &= -257),
(didPrimaryChildrenDefer = createCapturedValueFromError(
Error(formatProdErrorMessage(422))
)),
retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
didPrimaryChildrenDefer
)
);
if (null !== workInProgress.memoizedState)
return (
reuseSuspenseHandlerOnStack(workInProgress),
(workInProgress.child = current.child),
(workInProgress.flags |= 128),
null
);
reuseSuspenseHandlerOnStack(workInProgress);
suspenseState = nextProps.fallback;
didSuspend = workInProgress.mode;
nextProps = createFiberFromOffscreen(
{ mode: "visible", children: nextProps.children },
didSuspend,
0,
null
);
suspenseState = createFiberFromFragment(
suspenseState,
didSuspend,
renderLanes,
null
);
suspenseState.flags |= 2;
nextProps.return = workInProgress;
suspenseState.return = workInProgress;
nextProps.sibling = suspenseState;
workInProgress.child = nextProps;
0 !== (workInProgress.mode & 1) &&
reconcileChildFibers(workInProgress, current.child, null, renderLanes);
nextProps = workInProgress.child;
nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes);
nextProps.childLanes = getRemainingWorkInPrimaryTree(
current,
didPrimaryChildrenDefer,
renderLanes
);
workInProgress.memoizedState = SUSPENDED_MARKER;
return suspenseState;
}
pushPrimaryTreeSuspenseHandler(workInProgress);
if (0 === (workInProgress.mode & 1))
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
if (shim$2())
return (
(didPrimaryChildrenDefer = shim$2().digest),
(suspenseState = Error(formatProdErrorMessage(419))),
(suspenseState.digest = didPrimaryChildrenDefer),
(didPrimaryChildrenDefer = createCapturedValueFromError(
suspenseState,
didPrimaryChildrenDefer,
void 0
)),
retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
didPrimaryChildrenDefer
)
);
enableLazyContextPropagation &&
!didReceiveUpdate &&
propagateParentContextChanges(current, workInProgress, renderLanes, !1);
didPrimaryChildrenDefer = 0 !== (renderLanes & current.childLanes);
if (didReceiveUpdate || didPrimaryChildrenDefer) {
didPrimaryChildrenDefer = workInProgressRoot;
if (null !== didPrimaryChildrenDefer) {
nextProps = renderLanes & -renderLanes;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
nextProps = 1;
break;
case 8:
nextProps = 4;
break;
case 32:
nextProps = 16;
break;
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
case 4194304:
case 8388608:
case 16777216:
case 33554432:
nextProps = 64;
break;
case 268435456:
nextProps = 134217728;
break;
default:
nextProps = 0;
}
nextProps =
0 !==
(nextProps & (didPrimaryChildrenDefer.suspendedLanes | renderLanes))
? 0
: nextProps;
if (0 !== nextProps && nextProps !== suspenseState.retryLane)
throw (
((suspenseState.retryLane = nextProps),
enqueueConcurrentRenderForLane(current, nextProps),
scheduleUpdateOnFiber(didPrimaryChildrenDefer, current, nextProps),
SelectiveHydrationException)
);
}
shim$2() || renderDidSuspendDelayIfPossible();
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (shim$2())
return (
(workInProgress.flags |= 128),
(workInProgress.child = current.child),
retryDehydratedSuspenseBoundary.bind(null, current),
shim$2(),
null
);
current = mountSuspensePrimaryChildren(workInProgress, nextProps.children);
current.flags |= 4096;
return current;
}
function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
fiber.lanes |= renderLanes;
var alternate = fiber.alternate;
@@ -10289,19 +10264,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1120 = {
devToolsConfig$jscomp$inline_1113 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-f507f6fc",
version: "19.0.0-www-modern-3c09b75a",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1300 = {
bundleType: devToolsConfig$jscomp$inline_1120.bundleType,
version: devToolsConfig$jscomp$inline_1120.version,
rendererPackageName: devToolsConfig$jscomp$inline_1120.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1120.rendererConfig,
var internals$jscomp$inline_1318 = {
bundleType: devToolsConfig$jscomp$inline_1113.bundleType,
version: devToolsConfig$jscomp$inline_1113.version,
rendererPackageName: devToolsConfig$jscomp$inline_1113.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1113.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -10318,26 +10293,26 @@ var internals$jscomp$inline_1300 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1120.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1113.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-f507f6fc"
reconcilerVersion: "19.0.0-www-modern-3c09b75a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1301 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1301.isDisabled &&
hook$jscomp$inline_1301.supportsFiber
!hook$jscomp$inline_1319.isDisabled &&
hook$jscomp$inline_1319.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1301.inject(
internals$jscomp$inline_1300
(rendererID = hook$jscomp$inline_1319.inject(
internals$jscomp$inline_1318
)),
(injectedHook = hook$jscomp$inline_1301);
(injectedHook = hook$jscomp$inline_1319);
} catch (err) {}
}
var Path = Mode$1.Path;
+36 -384
View File
@@ -8222,14 +8222,11 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotHydrateInstance(
returnFiber.type,
returnFiber.memoizedProps,
returnFiber.stateNode,
instance, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
instance
);
break;
}
@@ -8247,20 +8244,6 @@ if (__DEV__) {
}
}
function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion();
childToDelete.stateNode = instance;
childToDelete.return = returnFiber;
var deletions = returnFiber.deletions;
if (deletions === null) {
returnFiber.deletions = [childToDelete];
returnFiber.flags |= ChildDeletion;
} else {
deletions.push(childToDelete);
}
}
function warnNonHydratedInstance(returnFiber, fiber) {
{
if (didSuspendOrErrorDEV) {
@@ -8306,32 +8289,22 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var _type = fiber.type;
var _props = fiber.pendingProps;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableInstance(
parentType,
parentProps,
parentInstance,
_type,
_props, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
_type
);
break;
}
case HostText: {
var _text = fiber.pendingProps;
var _isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
_text, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode
_text
);
break;
}
@@ -8371,10 +8344,6 @@ if (__DEV__) {
}
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & ~Hydrating) | Placement;
}
function tryHydrateInstance(fiber, nextInstance) {
// fiber is a HostComponent Fiber
var instance = canHydrateInstance(
@@ -8447,13 +8416,6 @@ if (__DEV__) {
return false;
}
function shouldClientRenderOnMismatch(fiber) {
return (
(fiber.mode & ConcurrentMode) !== NoMode &&
(fiber.flags & DidCapture) === NoFlags$1
);
}
function throwOnHydrationMismatch(fiber) {
throw new Error(
"Hydration failed because the initial UI does not match what was " +
@@ -8493,77 +8455,14 @@ if (__DEV__) {
fiber.pendingProps,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateInstance(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateInstance(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateInstance(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8580,79 +8479,14 @@ if (__DEV__) {
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateText(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateText(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateText(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8661,60 +8495,11 @@ if (__DEV__) {
return;
}
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateSuspense(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateSuspense(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8774,20 +8559,14 @@ if (__DEV__) {
switch (returnFiber.tag) {
case HostRoot: {
var parentContainer = returnFiber.stateNode.containerInfo;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedContainerTextInstance(
parentContainer,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode,
textContent,
shouldWarnIfMismatchDev
);
if (
isConcurrentMode &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8801,24 +8580,16 @@ if (__DEV__) {
var parentType = returnFiber.type;
var parentProps = returnFiber.memoizedProps;
var parentInstance = returnFiber.stateNode;
var _isConcurrentMode2 =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedTextInstance(
parentType,
parentProps,
parentInstance,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode2,
textContent,
shouldWarnIfMismatchDev
);
if (
_isConcurrentMode2 &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8922,16 +8693,8 @@ if (__DEV__) {
var nextInstance = nextHydratableInstance;
if (nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
} else {
while (nextInstance) {
warnUnhydratedInstance(fiber, nextInstance);
deleteHydratableInstance(fiber, nextInstance);
nextInstance = getNextHydratableSibling(nextInstance);
}
}
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
}
}
@@ -22025,19 +21788,7 @@ if (__DEV__) {
) {
// During the first pass, we'll bail out and not drill into the children.
// Instead, we'll leave the content in place and try to hydrate it later.
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
{
error(
"Cannot hydrate Suspense in legacy mode. Switch from " +
"ReactDOM.hydrate(element, container) to " +
"ReactDOMClient.hydrateRoot(container, <App />)" +
".render(element) or remove the Suspense components from " +
"the server rendered components."
);
}
workInProgress.lanes = laneToLanes(SyncLane);
} else if (isSuspenseInstanceFallback(suspenseInstance)) {
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This is a client-only boundary. Since we won't get any content from the server
// for this, we need to schedule that at a higher priority based on when it would
// have timed out. In theory we could render it in this pass but it would have the
@@ -22076,15 +21827,6 @@ if (__DEV__) {
warnIfHydrating();
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -35672,11 +35414,6 @@ if (__DEV__) {
fiber.lanes = lanes;
return fiber;
}
function createFiberFromHostInstanceForDeletion() {
var fiber = createFiber(HostComponent, null, null, NoMode);
fiber.elementType = "DELETED";
return fiber;
}
function createFiberFromDehydratedFragment(dehydratedNode) {
var fiber = createFiber(DehydratedFragment, null, null, NoMode);
fiber.stateNode = dehydratedNode;
@@ -35845,7 +35582,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-classic-7b93bfeb";
var ReactVersion = "19.0.0-www-classic-08e73f78";
function createPortal$1(
children,
@@ -40600,12 +40337,7 @@ if (__DEV__) {
.replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(
serverText,
clientText,
isConcurrentMode,
shouldWarnDev
) {
function checkForUnmatchedText(serverText, clientText, shouldWarnDev) {
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
@@ -40627,7 +40359,7 @@ if (__DEV__) {
}
}
if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.
throw new Error("Text content does not match server-rendered HTML.");
@@ -43381,7 +43113,6 @@ if (__DEV__) {
domElement,
tag,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
) {
@@ -43517,12 +43248,11 @@ if (__DEV__) {
checkForUnmatchedText(
domElement.textContent,
children,
isConcurrentMode,
shouldWarnDev
);
}
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
if (!enableClientRenderFallbackOnTextMismatch) {
// We really should be patching this in the commit phase but since
// this only affects legacy mode hydration which is deprecated anyway
// we can get away with it.
@@ -43600,7 +43330,7 @@ if (__DEV__) {
}
}
}
function diffHydratedText(textNode, text, isConcurrentMode) {
function diffHydratedText(textNode, text) {
var isDifferent = textNode.nodeValue !== text;
return isDifferent;
}
@@ -44845,19 +44575,8 @@ if (__DEV__) {
precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
// get attached.
updateFiberProps(instance, props); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
// when the legacy root API is removed.
var isConcurrentMode =
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
diffHydratedProperties(
instance,
type,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
);
updateFiberProps(instance, props);
diffHydratedProperties(instance, type, props, shouldWarnDev, hostContext);
}
function validateHydratableTextInstance(text, hostContext) {
{
@@ -44877,7 +44596,7 @@ if (__DEV__) {
internalInstanceHandle,
shouldWarnDev
) {
precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
precacheFiberNode(internalInstanceHandle, textInstance);
return diffHydratedText(textInstance, text);
}
function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
@@ -44963,15 +44682,9 @@ if (__DEV__) {
parentContainer,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
function didNotMatchHydratedTextInstance(
parentType,
@@ -44979,16 +44692,10 @@ if (__DEV__) {
parentInstance,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
if (parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
}
function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
@@ -45023,20 +44730,14 @@ if (__DEV__) {
parentType,
parentProps,
parentInstance,
instance,
isConcurrentMode
instance
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
}
}
@@ -45084,32 +44785,20 @@ if (__DEV__) {
parentProps,
parentInstance,
type,
props,
isConcurrentMode
props
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedElement(parentInstance, type);
}
warnForInsertedHydratedElement(parentInstance, type);
}
}
function didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
text,
isConcurrentMode
text
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedText(parentInstance, text);
}
warnForInsertedHydratedText(parentInstance, text);
}
}
function errorHydratingContainer(parentContainer) {
@@ -48491,42 +48180,6 @@ if (__DEV__) {
return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
}
}
function hydrate(element, container, callback) {
{
error(
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
);
}
if (!isValidContainerLegacy(container)) {
throw new Error("Target container is not a DOM element.");
}
{
var isModernRoot =
isContainerMarkedAsRoot(container) &&
container._reactRootContainer === undefined;
if (isModernRoot) {
error(
"You are calling ReactDOM.hydrate() on a container that was previously " +
"passed to ReactDOMClient.createRoot(). This is not supported. " +
"Did you mean to call hydrateRoot(container, element)?"
);
}
} // TODO: throw or warn if we couldn't hydrate?
return legacyRenderSubtreeIntoContainer(
null,
element,
container,
true,
callback
);
}
function render(element, container, callback) {
{
error(
@@ -49289,7 +48942,6 @@ if (__DEV__) {
exports.createRoot = createRoot;
exports.findDOMNode = findDOMNode;
exports.flushSync = flushSync;
exports.hydrate = hydrate;
exports.hydrateRoot = hydrateRoot;
exports.preconnect = preconnect;
exports.prefetchDNS = prefetchDNS;
+36 -347
View File
@@ -8184,14 +8184,11 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotHydrateInstance(
returnFiber.type,
returnFiber.memoizedProps,
returnFiber.stateNode,
instance, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
instance
);
break;
}
@@ -8209,20 +8206,6 @@ if (__DEV__) {
}
}
function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion();
childToDelete.stateNode = instance;
childToDelete.return = returnFiber;
var deletions = returnFiber.deletions;
if (deletions === null) {
returnFiber.deletions = [childToDelete];
returnFiber.flags |= ChildDeletion;
} else {
deletions.push(childToDelete);
}
}
function warnNonHydratedInstance(returnFiber, fiber) {
{
if (didSuspendOrErrorDEV) {
@@ -8268,32 +8251,22 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var _type = fiber.type;
var _props = fiber.pendingProps;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableInstance(
parentType,
parentProps,
parentInstance,
_type,
_props, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
_type
);
break;
}
case HostText: {
var _text = fiber.pendingProps;
var _isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
_text, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode
_text
);
break;
}
@@ -8333,10 +8306,6 @@ if (__DEV__) {
}
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & ~Hydrating) | Placement;
}
function tryHydrateInstance(fiber, nextInstance) {
// fiber is a HostComponent Fiber
var instance = canHydrateInstance(
@@ -8409,13 +8378,6 @@ if (__DEV__) {
return false;
}
function shouldClientRenderOnMismatch(fiber) {
return (
(fiber.mode & ConcurrentMode) !== NoMode &&
(fiber.flags & DidCapture) === NoFlags$1
);
}
function throwOnHydrationMismatch(fiber) {
throw new Error(
"Hydration failed because the initial UI does not match what was " +
@@ -8455,77 +8417,14 @@ if (__DEV__) {
fiber.pendingProps,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateInstance(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateInstance(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateInstance(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8542,79 +8441,14 @@ if (__DEV__) {
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateText(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateText(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateText(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8623,60 +8457,11 @@ if (__DEV__) {
return;
}
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateSuspense(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateSuspense(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8736,20 +8521,14 @@ if (__DEV__) {
switch (returnFiber.tag) {
case HostRoot: {
var parentContainer = returnFiber.stateNode.containerInfo;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedContainerTextInstance(
parentContainer,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode,
textContent,
shouldWarnIfMismatchDev
);
if (
isConcurrentMode &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8763,24 +8542,16 @@ if (__DEV__) {
var parentType = returnFiber.type;
var parentProps = returnFiber.memoizedProps;
var parentInstance = returnFiber.stateNode;
var _isConcurrentMode2 =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedTextInstance(
parentType,
parentProps,
parentInstance,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode2,
textContent,
shouldWarnIfMismatchDev
);
if (
_isConcurrentMode2 &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8884,16 +8655,8 @@ if (__DEV__) {
var nextInstance = nextHydratableInstance;
if (nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
} else {
while (nextInstance) {
warnUnhydratedInstance(fiber, nextInstance);
deleteHydratableInstance(fiber, nextInstance);
nextInstance = getNextHydratableSibling(nextInstance);
}
}
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
}
}
@@ -21916,19 +21679,7 @@ if (__DEV__) {
) {
// During the first pass, we'll bail out and not drill into the children.
// Instead, we'll leave the content in place and try to hydrate it later.
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
{
error(
"Cannot hydrate Suspense in legacy mode. Switch from " +
"ReactDOM.hydrate(element, container) to " +
"ReactDOMClient.hydrateRoot(container, <App />)" +
".render(element) or remove the Suspense components from " +
"the server rendered components."
);
}
workInProgress.lanes = laneToLanes(SyncLane);
} else if (isSuspenseInstanceFallback(suspenseInstance)) {
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This is a client-only boundary. Since we won't get any content from the server
// for this, we need to schedule that at a higher priority based on when it would
// have timed out. In theory we could render it in this pass but it would have the
@@ -21967,15 +21718,6 @@ if (__DEV__) {
warnIfHydrating();
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -35519,11 +35261,6 @@ if (__DEV__) {
fiber.lanes = lanes;
return fiber;
}
function createFiberFromHostInstanceForDeletion() {
var fiber = createFiber(HostComponent, null, null, NoMode);
fiber.elementType = "DELETED";
return fiber;
}
function createFiberFromDehydratedFragment(dehydratedNode) {
var fiber = createFiber(DehydratedFragment, null, null, NoMode);
fiber.stateNode = dehydratedNode;
@@ -35692,7 +35429,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-modern-6d2d5280";
var ReactVersion = "19.0.0-www-modern-f82757b9";
function createPortal$1(
children,
@@ -41253,12 +40990,7 @@ if (__DEV__) {
.replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(
serverText,
clientText,
isConcurrentMode,
shouldWarnDev
) {
function checkForUnmatchedText(serverText, clientText, shouldWarnDev) {
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
@@ -41280,7 +41012,7 @@ if (__DEV__) {
}
}
if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.
throw new Error("Text content does not match server-rendered HTML.");
@@ -44031,7 +43763,6 @@ if (__DEV__) {
domElement,
tag,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
) {
@@ -44162,12 +43893,11 @@ if (__DEV__) {
checkForUnmatchedText(
domElement.textContent,
children,
isConcurrentMode,
shouldWarnDev
);
}
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
if (!enableClientRenderFallbackOnTextMismatch) {
// We really should be patching this in the commit phase but since
// this only affects legacy mode hydration which is deprecated anyway
// we can get away with it.
@@ -44245,7 +43975,7 @@ if (__DEV__) {
}
}
}
function diffHydratedText(textNode, text, isConcurrentMode) {
function diffHydratedText(textNode, text) {
var isDifferent = textNode.nodeValue !== text;
return isDifferent;
}
@@ -45471,19 +45201,8 @@ if (__DEV__) {
precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
// get attached.
updateFiberProps(instance, props); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
// when the legacy root API is removed.
var isConcurrentMode =
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
diffHydratedProperties(
instance,
type,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
);
updateFiberProps(instance, props);
diffHydratedProperties(instance, type, props, shouldWarnDev, hostContext);
}
function validateHydratableTextInstance(text, hostContext) {
{
@@ -45503,7 +45222,7 @@ if (__DEV__) {
internalInstanceHandle,
shouldWarnDev
) {
precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
precacheFiberNode(internalInstanceHandle, textInstance);
return diffHydratedText(textInstance, text);
}
function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
@@ -45589,15 +45308,9 @@ if (__DEV__) {
parentContainer,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
function didNotMatchHydratedTextInstance(
parentType,
@@ -45605,16 +45318,10 @@ if (__DEV__) {
parentInstance,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
if (parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
}
function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
@@ -45649,20 +45356,14 @@ if (__DEV__) {
parentType,
parentProps,
parentInstance,
instance,
isConcurrentMode
instance
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
}
}
@@ -45710,32 +45411,20 @@ if (__DEV__) {
parentProps,
parentInstance,
type,
props,
isConcurrentMode
props
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedElement(parentInstance, type);
}
warnForInsertedHydratedElement(parentInstance, type);
}
}
function didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
text,
isConcurrentMode
text
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedText(parentInstance, text);
}
warnForInsertedHydratedText(parentInstance, text);
}
}
function errorHydratingContainer(parentContainer) {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -8359,14 +8359,11 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotHydrateInstance(
returnFiber.type,
returnFiber.memoizedProps,
returnFiber.stateNode,
instance, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
instance
);
break;
}
@@ -8384,20 +8381,6 @@ if (__DEV__) {
}
}
function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion();
childToDelete.stateNode = instance;
childToDelete.return = returnFiber;
var deletions = returnFiber.deletions;
if (deletions === null) {
returnFiber.deletions = [childToDelete];
returnFiber.flags |= ChildDeletion;
} else {
deletions.push(childToDelete);
}
}
function warnNonHydratedInstance(returnFiber, fiber) {
{
if (didSuspendOrErrorDEV) {
@@ -8443,32 +8426,22 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var _type = fiber.type;
var _props = fiber.pendingProps;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableInstance(
parentType,
parentProps,
parentInstance,
_type,
_props, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
_type
);
break;
}
case HostText: {
var _text = fiber.pendingProps;
var _isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
_text, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode
_text
);
break;
}
@@ -8508,10 +8481,6 @@ if (__DEV__) {
}
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & ~Hydrating) | Placement;
}
function tryHydrateInstance(fiber, nextInstance) {
// fiber is a HostComponent Fiber
var instance = canHydrateInstance(
@@ -8584,13 +8553,6 @@ if (__DEV__) {
return false;
}
function shouldClientRenderOnMismatch(fiber) {
return (
(fiber.mode & ConcurrentMode) !== NoMode &&
(fiber.flags & DidCapture) === NoFlags$1
);
}
function throwOnHydrationMismatch(fiber) {
throw new Error(
"Hydration failed because the initial UI does not match what was " +
@@ -8630,77 +8592,14 @@ if (__DEV__) {
fiber.pendingProps,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateInstance(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateInstance(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateInstance(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8717,79 +8616,14 @@ if (__DEV__) {
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateText(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateText(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateText(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8798,60 +8632,11 @@ if (__DEV__) {
return;
}
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateSuspense(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateSuspense(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8911,20 +8696,14 @@ if (__DEV__) {
switch (returnFiber.tag) {
case HostRoot: {
var parentContainer = returnFiber.stateNode.containerInfo;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedContainerTextInstance(
parentContainer,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode,
textContent,
shouldWarnIfMismatchDev
);
if (
isConcurrentMode &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8938,24 +8717,16 @@ if (__DEV__) {
var parentType = returnFiber.type;
var parentProps = returnFiber.memoizedProps;
var parentInstance = returnFiber.stateNode;
var _isConcurrentMode2 =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedTextInstance(
parentType,
parentProps,
parentInstance,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode2,
textContent,
shouldWarnIfMismatchDev
);
if (
_isConcurrentMode2 &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -9059,16 +8830,8 @@ if (__DEV__) {
var nextInstance = nextHydratableInstance;
if (nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
} else {
while (nextInstance) {
warnUnhydratedInstance(fiber, nextInstance);
deleteHydratableInstance(fiber, nextInstance);
nextInstance = getNextHydratableSibling(nextInstance);
}
}
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
}
}
@@ -22162,19 +21925,7 @@ if (__DEV__) {
) {
// During the first pass, we'll bail out and not drill into the children.
// Instead, we'll leave the content in place and try to hydrate it later.
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
{
error(
"Cannot hydrate Suspense in legacy mode. Switch from " +
"ReactDOM.hydrate(element, container) to " +
"ReactDOMClient.hydrateRoot(container, <App />)" +
".render(element) or remove the Suspense components from " +
"the server rendered components."
);
}
workInProgress.lanes = laneToLanes(SyncLane);
} else if (isSuspenseInstanceFallback(suspenseInstance)) {
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This is a client-only boundary. Since we won't get any content from the server
// for this, we need to schedule that at a higher priority based on when it would
// have timed out. In theory we could render it in this pass but it would have the
@@ -22213,15 +21964,6 @@ if (__DEV__) {
warnIfHydrating();
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -36296,11 +36038,6 @@ if (__DEV__) {
fiber.lanes = lanes;
return fiber;
}
function createFiberFromHostInstanceForDeletion() {
var fiber = createFiber(HostComponent, null, null, NoMode);
fiber.elementType = "DELETED";
return fiber;
}
function createFiberFromDehydratedFragment(dehydratedNode) {
var fiber = createFiber(DehydratedFragment, null, null, NoMode);
fiber.stateNode = dehydratedNode;
@@ -36469,7 +36206,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-classic-7628a4df";
var ReactVersion = "19.0.0-www-classic-9b26c97a";
function createPortal$1(
children,
@@ -41224,12 +40961,7 @@ if (__DEV__) {
.replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(
serverText,
clientText,
isConcurrentMode,
shouldWarnDev
) {
function checkForUnmatchedText(serverText, clientText, shouldWarnDev) {
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
@@ -41251,7 +40983,7 @@ if (__DEV__) {
}
}
if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.
throw new Error("Text content does not match server-rendered HTML.");
@@ -44005,7 +43737,6 @@ if (__DEV__) {
domElement,
tag,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
) {
@@ -44141,12 +43872,11 @@ if (__DEV__) {
checkForUnmatchedText(
domElement.textContent,
children,
isConcurrentMode,
shouldWarnDev
);
}
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
if (!enableClientRenderFallbackOnTextMismatch) {
// We really should be patching this in the commit phase but since
// this only affects legacy mode hydration which is deprecated anyway
// we can get away with it.
@@ -44224,7 +43954,7 @@ if (__DEV__) {
}
}
}
function diffHydratedText(textNode, text, isConcurrentMode) {
function diffHydratedText(textNode, text) {
var isDifferent = textNode.nodeValue !== text;
return isDifferent;
}
@@ -45469,19 +45199,8 @@ if (__DEV__) {
precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
// get attached.
updateFiberProps(instance, props); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
// when the legacy root API is removed.
var isConcurrentMode =
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
diffHydratedProperties(
instance,
type,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
);
updateFiberProps(instance, props);
diffHydratedProperties(instance, type, props, shouldWarnDev, hostContext);
}
function validateHydratableTextInstance(text, hostContext) {
{
@@ -45501,7 +45220,7 @@ if (__DEV__) {
internalInstanceHandle,
shouldWarnDev
) {
precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
precacheFiberNode(internalInstanceHandle, textInstance);
return diffHydratedText(textInstance, text);
}
function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
@@ -45587,15 +45306,9 @@ if (__DEV__) {
parentContainer,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
function didNotMatchHydratedTextInstance(
parentType,
@@ -45603,16 +45316,10 @@ if (__DEV__) {
parentInstance,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
if (parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
}
function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
@@ -45647,20 +45354,14 @@ if (__DEV__) {
parentType,
parentProps,
parentInstance,
instance,
isConcurrentMode
instance
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
}
}
@@ -45708,32 +45409,20 @@ if (__DEV__) {
parentProps,
parentInstance,
type,
props,
isConcurrentMode
props
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedElement(parentInstance, type);
}
warnForInsertedHydratedElement(parentInstance, type);
}
}
function didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
text,
isConcurrentMode
text
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedText(parentInstance, text);
}
warnForInsertedHydratedText(parentInstance, text);
}
}
function errorHydratingContainer(parentContainer) {
@@ -49247,42 +48936,6 @@ if (__DEV__) {
return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
}
}
function hydrate(element, container, callback) {
{
error(
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot " +
"instead. Until you switch to the new API, your app will behave as " +
"if it's running React 17. Learn " +
"more: https://react.dev/link/switch-to-createroot"
);
}
if (!isValidContainerLegacy(container)) {
throw new Error("Target container is not a DOM element.");
}
{
var isModernRoot =
isContainerMarkedAsRoot(container) &&
container._reactRootContainer === undefined;
if (isModernRoot) {
error(
"You are calling ReactDOM.hydrate() on a container that was previously " +
"passed to ReactDOMClient.createRoot(). This is not supported. " +
"Did you mean to call hydrateRoot(container, element)?"
);
}
} // TODO: throw or warn if we couldn't hydrate?
return legacyRenderSubtreeIntoContainer(
null,
element,
container,
true,
callback
);
}
function render(element, container, callback) {
{
error(
@@ -50082,7 +49735,6 @@ if (__DEV__) {
exports.focusWithin = focusWithin;
exports.getFindAllNodesFailureDescription =
getFindAllNodesFailureDescription;
exports.hydrate = hydrate;
exports.hydrateRoot = hydrateRoot;
exports.observeVisibleRects = observeVisibleRects;
exports.preconnect = preconnect;
@@ -8321,14 +8321,11 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotHydrateInstance(
returnFiber.type,
returnFiber.memoizedProps,
returnFiber.stateNode,
instance, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
instance
);
break;
}
@@ -8346,20 +8343,6 @@ if (__DEV__) {
}
}
function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion();
childToDelete.stateNode = instance;
childToDelete.return = returnFiber;
var deletions = returnFiber.deletions;
if (deletions === null) {
returnFiber.deletions = [childToDelete];
returnFiber.flags |= ChildDeletion;
} else {
deletions.push(childToDelete);
}
}
function warnNonHydratedInstance(returnFiber, fiber) {
{
if (didSuspendOrErrorDEV) {
@@ -8405,32 +8388,22 @@ if (__DEV__) {
case HostSingleton:
case HostComponent: {
var _type = fiber.type;
var _props = fiber.pendingProps;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableInstance(
parentType,
parentProps,
parentInstance,
_type,
_props, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode
_type
);
break;
}
case HostText: {
var _text = fiber.pendingProps;
var _isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
_text, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode
_text
);
break;
}
@@ -8470,10 +8443,6 @@ if (__DEV__) {
}
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.flags = (fiber.flags & ~Hydrating) | Placement;
}
function tryHydrateInstance(fiber, nextInstance) {
// fiber is a HostComponent Fiber
var instance = canHydrateInstance(
@@ -8546,13 +8515,6 @@ if (__DEV__) {
return false;
}
function shouldClientRenderOnMismatch(fiber) {
return (
(fiber.mode & ConcurrentMode) !== NoMode &&
(fiber.flags & DidCapture) === NoFlags$1
);
}
function throwOnHydrationMismatch(fiber) {
throw new Error(
"Hydration failed because the initial UI does not match what was " +
@@ -8592,77 +8554,14 @@ if (__DEV__) {
fiber.pendingProps,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateInstance(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateInstance(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateInstance(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8679,79 +8578,14 @@ if (__DEV__) {
text,
currentHostContext
);
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
// We exclude non hydrabable text because we know there are no matching hydratables.
// We either throw or insert depending on the render mode.
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateText(fiber, nextInstance)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateText(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateText(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (shouldKeepWarning) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
}
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
if (shouldKeepWarning) {
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
}
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8760,60 +8594,11 @@ if (__DEV__) {
return;
}
var initialInstance = nextHydratableInstance;
var nextInstance = nextHydratableInstance;
if (!nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
if (!nextInstance || !tryHydrateSuspense(fiber, nextInstance)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
}
var firstAttemptedInstance = nextInstance;
if (!tryHydrateSuspense(fiber, nextInstance)) {
if (shouldClientRenderOnMismatch(fiber)) {
warnNonHydratedInstance(hydrationParentFiber, fiber);
throwOnHydrationMismatch();
} // If we can't hydrate this instance let's try the next one.
// We use this as a heuristic. It's based on intuition and not data so it
// might be flawed or unnecessary.
nextHydratableInstance = getNextHydratableSibling(nextInstance);
var prevHydrationParentFiber = hydrationParentFiber;
if (
!nextHydratableInstance ||
!tryHydrateSuspense(fiber, nextHydratableInstance)
) {
// Nothing to hydrate. Make it an insertion.
insertNonHydratedInstance(hydrationParentFiber, fiber);
warnNonHydratedInstance(hydrationParentFiber, fiber);
isHydrating = false;
hydrationParentFiber = fiber;
nextHydratableInstance = initialInstance;
return;
} // We matched the next one, we'll now assume that the first one was
// superfluous and we'll delete it. Since we can't eagerly delete it
// we'll have to schedule a deletion. To do that, this node needs a dummy
// fiber associated with it.
warnUnhydratedInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
deleteHydratableInstance(
prevHydrationParentFiber,
firstAttemptedInstance
);
throwOnHydrationMismatch();
}
}
@@ -8873,20 +8658,14 @@ if (__DEV__) {
switch (returnFiber.tag) {
case HostRoot: {
var parentContainer = returnFiber.stateNode.containerInfo;
var isConcurrentMode =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedContainerTextInstance(
parentContainer,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
isConcurrentMode,
textContent,
shouldWarnIfMismatchDev
);
if (
isConcurrentMode &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -8900,24 +8679,16 @@ if (__DEV__) {
var parentType = returnFiber.type;
var parentProps = returnFiber.memoizedProps;
var parentInstance = returnFiber.stateNode;
var _isConcurrentMode2 =
(returnFiber.mode & ConcurrentMode) !== NoMode;
didNotMatchHydratedTextInstance(
parentType,
parentProps,
parentInstance,
textInstance,
textContent, // TODO: Delete this argument when we remove the legacy root API.
_isConcurrentMode2,
textContent,
shouldWarnIfMismatchDev
);
if (
_isConcurrentMode2 &&
enableClientRenderFallbackOnTextMismatch
) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent mode we never update the mismatched text,
// even if the error was ignored.
return false;
@@ -9021,16 +8792,8 @@ if (__DEV__) {
var nextInstance = nextHydratableInstance;
if (nextInstance) {
if (shouldClientRenderOnMismatch(fiber)) {
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
} else {
while (nextInstance) {
warnUnhydratedInstance(fiber, nextInstance);
deleteHydratableInstance(fiber, nextInstance);
nextInstance = getNextHydratableSibling(nextInstance);
}
}
warnIfUnhydratedTailNodes(fiber);
throwOnHydrationMismatch();
}
}
@@ -22053,19 +21816,7 @@ if (__DEV__) {
) {
// During the first pass, we'll bail out and not drill into the children.
// Instead, we'll leave the content in place and try to hydrate it later.
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
{
error(
"Cannot hydrate Suspense in legacy mode. Switch from " +
"ReactDOM.hydrate(element, container) to " +
"ReactDOMClient.hydrateRoot(container, <App />)" +
".render(element) or remove the Suspense components from " +
"the server rendered components."
);
}
workInProgress.lanes = laneToLanes(SyncLane);
} else if (isSuspenseInstanceFallback(suspenseInstance)) {
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This is a client-only boundary. Since we won't get any content from the server
// for this, we need to schedule that at a higher priority based on when it would
// have timed out. In theory we could render it in this pass but it would have the
@@ -22104,15 +21855,6 @@ if (__DEV__) {
warnIfHydrating();
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback(suspenseInstance)) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -36143,11 +35885,6 @@ if (__DEV__) {
fiber.lanes = lanes;
return fiber;
}
function createFiberFromHostInstanceForDeletion() {
var fiber = createFiber(HostComponent, null, null, NoMode);
fiber.elementType = "DELETED";
return fiber;
}
function createFiberFromDehydratedFragment(dehydratedNode) {
var fiber = createFiber(DehydratedFragment, null, null, NoMode);
fiber.stateNode = dehydratedNode;
@@ -36316,7 +36053,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-modern-6d858044";
var ReactVersion = "19.0.0-www-modern-c1b9cb5d";
function createPortal$1(
children,
@@ -41877,12 +41614,7 @@ if (__DEV__) {
.replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(
serverText,
clientText,
isConcurrentMode,
shouldWarnDev
) {
function checkForUnmatchedText(serverText, clientText, shouldWarnDev) {
var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
@@ -41904,7 +41636,7 @@ if (__DEV__) {
}
}
if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
if (enableClientRenderFallbackOnTextMismatch) {
// In concurrent roots, we throw when there's a text mismatch and revert to
// client rendering, up to the nearest Suspense boundary.
throw new Error("Text content does not match server-rendered HTML.");
@@ -44655,7 +44387,6 @@ if (__DEV__) {
domElement,
tag,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
) {
@@ -44786,12 +44517,11 @@ if (__DEV__) {
checkForUnmatchedText(
domElement.textContent,
children,
isConcurrentMode,
shouldWarnDev
);
}
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
if (!enableClientRenderFallbackOnTextMismatch) {
// We really should be patching this in the commit phase but since
// this only affects legacy mode hydration which is deprecated anyway
// we can get away with it.
@@ -44869,7 +44599,7 @@ if (__DEV__) {
}
}
}
function diffHydratedText(textNode, text, isConcurrentMode) {
function diffHydratedText(textNode, text) {
var isDifferent = textNode.nodeValue !== text;
return isDifferent;
}
@@ -46095,19 +45825,8 @@ if (__DEV__) {
precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
// get attached.
updateFiberProps(instance, props); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
// when the legacy root API is removed.
var isConcurrentMode =
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
diffHydratedProperties(
instance,
type,
props,
isConcurrentMode,
shouldWarnDev,
hostContext
);
updateFiberProps(instance, props);
diffHydratedProperties(instance, type, props, shouldWarnDev, hostContext);
}
function validateHydratableTextInstance(text, hostContext) {
{
@@ -46127,7 +45846,7 @@ if (__DEV__) {
internalInstanceHandle,
shouldWarnDev
) {
precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete
precacheFiberNode(internalInstanceHandle, textInstance);
return diffHydratedText(textInstance, text);
}
function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
@@ -46213,15 +45932,9 @@ if (__DEV__) {
parentContainer,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
function didNotMatchHydratedTextInstance(
parentType,
@@ -46229,16 +45942,10 @@ if (__DEV__) {
parentInstance,
textInstance,
text,
isConcurrentMode,
shouldWarnDev
) {
if (parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
checkForUnmatchedText(
textInstance.nodeValue,
text,
isConcurrentMode,
shouldWarnDev
);
checkForUnmatchedText(textInstance.nodeValue, text, shouldWarnDev);
}
}
function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
@@ -46273,20 +45980,14 @@ if (__DEV__) {
parentType,
parentProps,
parentInstance,
instance,
isConcurrentMode
instance
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
if (instance.nodeType === ELEMENT_NODE) {
warnForDeletedHydratableElement(parentInstance, instance);
} else if (instance.nodeType === COMMENT_NODE);
else {
warnForDeletedHydratableText(parentInstance, instance);
}
}
}
@@ -46334,32 +46035,20 @@ if (__DEV__) {
parentProps,
parentInstance,
type,
props,
isConcurrentMode
props
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedElement(parentInstance, type);
}
warnForInsertedHydratedElement(parentInstance, type);
}
}
function didNotFindHydratableTextInstance(
parentType,
parentProps,
parentInstance,
text,
isConcurrentMode
text
) {
{
if (
isConcurrentMode ||
parentProps[SUPPRESS_HYDRATION_WARNING] !== true
) {
warnForInsertedHydratedText(parentInstance, text);
}
warnForInsertedHydratedText(parentInstance, text);
}
}
function errorHydratingContainer(parentContainer) {
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -14910,15 +14910,6 @@ if (__DEV__) {
// This is the first render pass. Attempt to hydrate.
pushPrimaryTreeSuspenseHandler(workInProgress); // We should never be hydrating at this point because it is the first pass,
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback()) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -26119,7 +26110,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-classic-3977f999";
var ReactVersion = "19.0.0-www-classic-b116d297";
// Might add PROFILE later.
@@ -14910,15 +14910,6 @@ if (__DEV__) {
// This is the first render pass. Attempt to hydrate.
pushPrimaryTreeSuspenseHandler(workInProgress); // We should never be hydrating at this point because it is the first pass,
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
return retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
renderLanes,
null
);
}
if (isSuspenseInstanceFallback()) {
// This boundary is in a permanent fallback state. In this case, we'll never
// get an update and we'll never be able to hydrate the final content. Let's just try the
@@ -26119,7 +26110,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "19.0.0-www-modern-3977f999";
var ReactVersion = "19.0.0-www-modern-b116d297";
// Might add PROFILE later.
@@ -99,7 +99,6 @@ export default [
"Cannot bind \"this\" of a Server Action. Pass null or undefined as the first argument to .bind().",
"Cannot call startTransition while rendering.",
"Cannot find single active touch.",
"Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.",
"Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.",
"Cannot record touch end without a touch start.\nTouch End: %s\nTouch Bank: %s",
"Cannot record touch move without a touch start.\nTouch Move: %s\nTouch Bank: %s",
@@ -243,8 +242,6 @@ export default [
"React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.",
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.",
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
"ReactDOM.hydrate has not been supported since React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.hydrate was removed in React 19. Use hydrateRoot instead",
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
@@ -337,7 +334,6 @@ export default [
"We should not be hydrating here. This is a bug in React. Please file a bug.",
"When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
"You are accessing \"digest\" from the errorInfo object passed to onRecoverableError. This property is deprecated and will be removed in a future version of React. To access the digest of an Error look for this property on the Error instance itself.",
"You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?",
"You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?",
"You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?",
"You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.",