Remove JND delay for non-transition updates (#26597)

Updates that are marked as part of a transition are allowed to block a
render from committing. Generally, other updates cannot — however,
there's one exception that's leftover from a previous iteration of our
Suspense architecture. If an update is not the result of a known urgent
event type — known as "Default" updates — then we allow it to suspend
briefly, as long as the delay is short enough that the user won't
notice. We refer to this delay as a "Just Noticable Difference" (JND)
delay. To illustrate, if the user has already waited 400ms for an update
to be reflected on the screen, the theory is that they won't notice if
you wait an additional 100ms. So React can suspend for a bit longer in
case more data comes in. The longer the user has already waited, the
longer the JND.

While we still believe this theory is sound from a UX perspective, we no
longer think the implementation complexity is worth it. The main thing
that's changed is how we handle Default updates. We used to render
Default updates concurrently (i.e. they were time sliced, and were
scheduled with postTask), but now they are blocking. Soon, they will
also be scheduled with rAF, too, which means by the end of the next rAF,
they will have either finished rendering or the main thread will be
blocked until they do. There are various motivations for this but part
of the rationale is that anything that can be made non-blocking should
be marked as a Transition, anyway, so it's not worth adding
implementation complexity to Default.

This commit removes the JND delay for Default updates. They will now
commit immediately once the render phase is complete, even if a
component suspends.

DiffTrain build for [0b931f90e8](https://github.com/facebook/react/commit/0b931f90e8964183f08ac328e7350d847abb08f9)
This commit is contained in:
acdlite
2023-04-11 04:24:45 +00:00
parent d7b570e955
commit be590ddd8f
18 changed files with 2767 additions and 3687 deletions
+1 -1
View File
@@ -1 +1 @@
ac43bf6870a15566507477a4504f22160835c8d3
0b931f90e8964183f08ac328e7350d847abb08f9
+1 -1
View File
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-www-modern-82c50b6a";
var ReactVersion = "18.3.0-www-modern-d66c88c7";
// ATTENTION
// When adding new symbols to this file,
+1 -76
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-classic-26b068f9";
var ReactVersion = "18.3.0-www-classic-ab122236";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -1924,24 +1924,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -23498,7 +23480,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -24319,37 +24300,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -26523,32 +26473,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
+1 -76
View File
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}
var ReactVersion = "18.3.0-www-modern-ae1f3bca";
var ReactVersion = "18.3.0-www-modern-22d10e56";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -1921,24 +1921,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -23163,7 +23145,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -23984,37 +23965,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -26183,32 +26133,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
+144 -184
View File
@@ -575,19 +575,19 @@ function markRootFinished(root, remainingLanes) {
var eventTimes = root.eventTimes,
expirationTimes = root.expirationTimes;
for (root = root.hiddenUpdates; 0 < noLongerPendingLanes; ) {
var index$5 = 31 - clz32(noLongerPendingLanes),
lane = 1 << index$5;
remainingLanes[index$5] = 0;
eventTimes[index$5] = -1;
expirationTimes[index$5] = -1;
var hiddenUpdatesForLane = root[index$5];
var index$4 = 31 - clz32(noLongerPendingLanes),
lane = 1 << index$4;
remainingLanes[index$4] = 0;
eventTimes[index$4] = -1;
expirationTimes[index$4] = -1;
var hiddenUpdatesForLane = root[index$4];
if (null !== hiddenUpdatesForLane)
for (
root[index$5] = null, index$5 = 0;
index$5 < hiddenUpdatesForLane.length;
index$5++
root[index$4] = null, index$4 = 0;
index$4 < hiddenUpdatesForLane.length;
index$4++
) {
var update = hiddenUpdatesForLane[index$5];
var update = hiddenUpdatesForLane[index$4];
null !== update && (update.lane &= -1073741825);
}
noLongerPendingLanes &= ~lane;
@@ -596,21 +596,21 @@ function markRootFinished(root, remainingLanes) {
function markRootEntangled(root, entangledLanes) {
var rootEntangledLanes = (root.entangledLanes |= entangledLanes);
for (root = root.entanglements; rootEntangledLanes; ) {
var index$6 = 31 - clz32(rootEntangledLanes),
lane = 1 << index$6;
(lane & entangledLanes) | (root[index$6] & entangledLanes) &&
(root[index$6] |= entangledLanes);
var index$5 = 31 - clz32(rootEntangledLanes),
lane = 1 << index$5;
(lane & entangledLanes) | (root[index$5] & entangledLanes) &&
(root[index$5] |= entangledLanes);
rootEntangledLanes &= ~lane;
}
}
function getTransitionsForLanes(root, lanes) {
if (!enableTransitionTracing) return null;
for (var transitionsForLanes = []; 0 < lanes; ) {
var index$8 = 31 - clz32(lanes),
lane = 1 << index$8;
index$8 = root.transitionLanes[index$8];
null !== index$8 &&
index$8.forEach(function (transition) {
var index$7 = 31 - clz32(lanes),
lane = 1 << index$7;
index$7 = root.transitionLanes[index$7];
null !== index$7 &&
index$7.forEach(function (transition) {
transitionsForLanes.push(transition);
});
lanes &= ~lane;
@@ -620,10 +620,10 @@ function getTransitionsForLanes(root, lanes) {
function clearTransitionsForLanes(root, lanes) {
if (enableTransitionTracing)
for (; 0 < lanes; ) {
var index$9 = 31 - clz32(lanes),
lane = 1 << index$9;
null !== root.transitionLanes[index$9] &&
(root.transitionLanes[index$9] = null);
var index$8 = 31 - clz32(lanes),
lane = 1 << index$8;
null !== root.transitionLanes[index$8] &&
(root.transitionLanes[index$8] = null);
lanes &= ~lane;
}
}
@@ -845,16 +845,16 @@ function describeNativeComponentFrame(fn, construct) {
} else {
try {
construct.call();
} catch (x$10) {
control = x$10;
} catch (x$9) {
control = x$9;
}
fn.call(construct.prototype);
}
else {
try {
throw Error();
} catch (x$11) {
control = x$11;
} catch (x$10) {
control = x$10;
}
fn();
}
@@ -2421,10 +2421,10 @@ createFunctionComponentUpdateQueue = function () {
function use(usable) {
if (null !== usable && "object" === typeof usable) {
if ("function" === typeof usable.then) {
var index$28 = thenableIndexCounter;
var index$27 = thenableIndexCounter;
thenableIndexCounter += 1;
null === thenableState && (thenableState = []);
usable = trackUsedThenable(thenableState, usable, index$28);
usable = trackUsedThenable(thenableState, usable, index$27);
null === currentlyRenderingFiber$1.alternate &&
(null === workInProgressHook
? null === currentlyRenderingFiber$1.memoizedState
@@ -5266,14 +5266,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
break;
case "collapsed":
lastTailNode = renderState.tail;
for (var lastTailNode$73 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode),
for (var lastTailNode$72 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$72 = lastTailNode),
(lastTailNode = lastTailNode.sibling);
null === lastTailNode$73
null === lastTailNode$72
? hasRenderedATailFallback || null === renderState.tail
? (renderState.tail = null)
: (renderState.tail.sibling = null)
: (lastTailNode$73.sibling = null);
: (lastTailNode$72.sibling = null);
}
}
function bubbleProperties(completedWork) {
@@ -5283,19 +5283,19 @@ function bubbleProperties(completedWork) {
newChildLanes = 0,
subtreeFlags = 0;
if (didBailout)
for (var child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags & 31457280),
(subtreeFlags |= child$74.flags & 31457280),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
for (var child$73 = completedWork.child; null !== child$73; )
(newChildLanes |= child$73.lanes | child$73.childLanes),
(subtreeFlags |= child$73.subtreeFlags & 31457280),
(subtreeFlags |= child$73.flags & 31457280),
(child$73.return = completedWork),
(child$73 = child$73.sibling);
else
for (child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags),
(subtreeFlags |= child$74.flags),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
for (child$73 = completedWork.child; null !== child$73; )
(newChildLanes |= child$73.lanes | child$73.childLanes),
(subtreeFlags |= child$73.subtreeFlags),
(subtreeFlags |= child$73.flags),
(child$73.return = completedWork),
(child$73 = child$73.sibling);
completedWork.subtreeFlags |= subtreeFlags;
completedWork.childLanes = newChildLanes;
return didBailout;
@@ -5477,11 +5477,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(instance = newProps.alternate.memoizedState.cachePool.pool);
var cache$78 = null;
var cache$77 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
(cache$78 = newProps.memoizedState.cachePool.pool);
cache$78 !== instance && (newProps.flags |= 2048);
(cache$77 = newProps.memoizedState.cachePool.pool);
cache$77 !== instance && (newProps.flags |= 2048);
}
renderLanes !== current &&
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
@@ -5511,8 +5511,8 @@ function completeWork(current, workInProgress, renderLanes) {
instance = workInProgress.memoizedState;
if (null === instance) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
cache$78 = instance.rendering;
if (null === cache$78)
cache$77 = instance.rendering;
if (null === cache$77)
if (newProps) cutOffTailIfNeeded(instance, !1);
else {
if (
@@ -5520,11 +5520,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
cache$78 = findFirstSuspended(current);
if (null !== cache$78) {
cache$77 = findFirstSuspended(current);
if (null !== cache$77) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(instance, !1);
current = cache$78.updateQueue;
current = cache$77.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -5549,7 +5549,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
if (((current = findFirstSuspended(cache$78)), null !== current)) {
if (((current = findFirstSuspended(cache$77)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -5559,7 +5559,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !0),
null === instance.tail &&
"hidden" === instance.tailMode &&
!cache$78.alternate)
!cache$77.alternate)
)
return bubbleProperties(workInProgress), null;
} else
@@ -5571,13 +5571,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !1),
(workInProgress.lanes = 8388608));
instance.isBackwards
? ((cache$78.sibling = workInProgress.child),
(workInProgress.child = cache$78))
? ((cache$77.sibling = workInProgress.child),
(workInProgress.child = cache$77))
: ((current = instance.last),
null !== current
? (current.sibling = cache$78)
: (workInProgress.child = cache$78),
(instance.last = cache$78));
? (current.sibling = cache$77)
: (workInProgress.child = cache$77),
(instance.last = cache$77));
}
if (null !== instance.tail)
return (
@@ -5837,8 +5837,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
else if ("function" === typeof ref)
try {
ref(null);
} catch (error$96) {
captureCommitPhaseError(current, nearestMountedAncestor, error$96);
} catch (error$95) {
captureCommitPhaseError(current, nearestMountedAncestor, error$95);
}
else ref.current = null;
}
@@ -6040,11 +6040,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
current,
finishedRoot.__reactInternalSnapshotBeforeUpdate
);
} catch (error$97) {
} catch (error$96) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$97
error$96
);
}
}
@@ -6637,8 +6637,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
}
try {
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
} catch (error$105) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
} catch (error$104) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$104);
}
}
break;
@@ -6674,11 +6674,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
if (null !== updatePayload || diffInCommitPhase)
try {
flags._applyProps(flags, newProps, current);
} catch (error$108) {
} catch (error$107) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$108
error$107
);
}
}
@@ -6715,8 +6715,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
null !== retryQueue && suspenseCallback(new Set(retryQueue));
}
}
} catch (error$110) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
} catch (error$109) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
}
flags = finishedWork.updateQueue;
null !== flags &&
@@ -6856,12 +6856,12 @@ function commitReconciliationEffects(finishedWork) {
break;
case 3:
case 4:
var parent$100 = JSCompiler_inline_result.stateNode.containerInfo,
before$101 = getHostSibling(finishedWork);
var parent$99 = JSCompiler_inline_result.stateNode.containerInfo,
before$100 = getHostSibling(finishedWork);
insertOrAppendPlacementNodeIntoContainer(
finishedWork,
before$101,
parent$100
before$100,
parent$99
);
break;
default:
@@ -7322,9 +7322,9 @@ function recursivelyTraverseReconnectPassiveEffects(
);
break;
case 22:
var instance$119 = finishedWork.stateNode;
var instance$118 = finishedWork.stateNode;
null !== finishedWork.memoizedState
? instance$119._visibility & 4
? instance$118._visibility & 4
? recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7337,7 +7337,7 @@ function recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork
)
: ((instance$119._visibility |= 4),
: ((instance$118._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7345,7 +7345,7 @@ function recursivelyTraverseReconnectPassiveEffects(
committedTransitions,
includeWorkInProgressEffects
))
: ((instance$119._visibility |= 4),
: ((instance$118._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7358,7 +7358,7 @@ function recursivelyTraverseReconnectPassiveEffects(
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork,
instance$119
instance$118
);
break;
case 24:
@@ -7801,12 +7801,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) {
0 < lanes;
) {
var index$3 = 31 - clz32(lanes),
lane = 1 << index$3,
expirationTime = expirationTimes[index$3];
var index$2 = 31 - clz32(lanes),
lane = 1 << index$2,
expirationTime = expirationTimes[index$2];
if (-1 === expirationTime) {
if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
expirationTimes[index$3] = computeExpirationTime(lane, currentTime);
expirationTimes[index$2] = computeExpirationTime(lane, currentTime);
} else expirationTime <= currentTime && (root.expiredLanes |= lane);
lanes &= ~lane;
}
@@ -7863,8 +7863,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) {
root.callbackNode = suspendedLanes;
return currentTime;
}
var ceil = Math.ceil,
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
@@ -8000,11 +7999,11 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
enableTransitionTracing))
) {
var transitionLanesMap = root.transitionLanes,
index$7 = 31 - clz32(lane),
transitions = transitionLanesMap[index$7];
index$6 = 31 - clz32(lane),
transitions = transitionLanesMap[index$6];
null === transitions && (transitions = new Set());
transitions.add(eventTime);
transitionLanesMap[index$7] = transitions;
transitionLanesMap[index$6] = transitions;
}
root === workInProgressRoot &&
(0 === (executionContext & 2) &&
@@ -8031,28 +8030,28 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
root === workInProgressRoot ? workInProgressRootRenderLanes : 0
);
if (0 === lanes) return null;
var exitStatus =
didTimeout =
includesBlockingLane(root, lanes) ||
0 !== (lanes & root.expiredLanes) ||
didTimeout
? renderRootSync(root, lanes)
: renderRootConcurrent(root, lanes);
if (0 !== exitStatus) {
if (2 === exitStatus) {
didTimeout = lanes;
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(
root,
didTimeout
);
if (0 !== didTimeout) {
if (2 === didTimeout) {
var originallyAttemptedLanes = lanes,
errorRetryLanes = getLanesToRetrySynchronouslyOnError(
root,
originallyAttemptedLanes
);
0 !== errorRetryLanes &&
((lanes = errorRetryLanes),
(exitStatus = recoverFromConcurrentError(
(didTimeout = recoverFromConcurrentError(
root,
didTimeout,
originallyAttemptedLanes,
errorRetryLanes
)));
}
if (1 === exitStatus)
if (1 === didTimeout)
throw (
((originalCallbackNode = workInProgressRootFatalError),
prepareFreshStack(root, 0),
@@ -8060,30 +8059,30 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
ensureRootIsScheduled(root),
originalCallbackNode)
);
if (6 === exitStatus) markRootSuspended(root, lanes);
if (6 === didTimeout) markRootSuspended(root, lanes);
else {
errorRetryLanes = !includesBlockingLane(root, lanes);
didTimeout = root.current.alternate;
originallyAttemptedLanes = root.current.alternate;
if (
errorRetryLanes &&
!isRenderConsistentWithExternalStores(didTimeout)
!isRenderConsistentWithExternalStores(originallyAttemptedLanes)
) {
exitStatus = renderRootSync(root, lanes);
if (2 === exitStatus) {
didTimeout = renderRootSync(root, lanes);
if (2 === didTimeout) {
errorRetryLanes = lanes;
var errorRetryLanes$129 = getLanesToRetrySynchronouslyOnError(
var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError(
root,
errorRetryLanes
);
0 !== errorRetryLanes$129 &&
((lanes = errorRetryLanes$129),
(exitStatus = recoverFromConcurrentError(
0 !== errorRetryLanes$128 &&
((lanes = errorRetryLanes$128),
(didTimeout = recoverFromConcurrentError(
root,
errorRetryLanes,
errorRetryLanes$129
errorRetryLanes$128
)));
}
if (1 === exitStatus)
if (1 === didTimeout)
throw (
((originalCallbackNode = workInProgressRootFatalError),
prepareFreshStack(root, 0),
@@ -8092,16 +8091,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
originalCallbackNode)
);
}
root.finishedWork = didTimeout;
root.finishedWork = originallyAttemptedLanes;
root.finishedLanes = lanes;
switch (exitStatus) {
switch (didTimeout) {
case 0:
case 1:
throw Error(formatProdErrorMessage(345));
case 2:
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -8111,26 +8110,26 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
markRootSuspended(root, lanes);
if (
(lanes & 125829120) === lanes &&
((exitStatus = globalMostRecentFallbackTime + 500 - now()),
10 < exitStatus)
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
10 < didTimeout)
) {
if (0 !== getNextLanes(root, 0)) break;
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
exitStatus
didTimeout
);
break;
}
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -8139,48 +8138,9 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
case 4:
markRootSuspended(root, lanes);
if ((lanes & 8388480) === lanes) break;
exitStatus = lanes;
errorRetryLanes = root.eventTimes;
for (errorRetryLanes$129 = -1; 0 < exitStatus; ) {
var index$2 = 31 - clz32(exitStatus),
lane = 1 << index$2;
index$2 = errorRetryLanes[index$2];
index$2 > errorRetryLanes$129 && (errorRetryLanes$129 = index$2);
exitStatus &= ~lane;
}
exitStatus = errorRetryLanes$129;
exitStatus = now() - exitStatus;
exitStatus =
(120 > exitStatus
? 120
: 480 > exitStatus
? 480
: 1080 > exitStatus
? 1080
: 1920 > exitStatus
? 1920
: 3e3 > exitStatus
? 3e3
: 4320 > exitStatus
? 4320
: 1960 * ceil(exitStatus / 1960)) - exitStatus;
if (10 < exitStatus) {
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
didTimeout,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
exitStatus
);
break;
}
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -8189,7 +8149,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
case 5:
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -8293,9 +8253,9 @@ function markRootSuspended(root, suspendedLanes) {
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
for (root = root.expirationTimes; 0 < suspendedLanes; ) {
var index$4 = 31 - clz32(suspendedLanes),
lane = 1 << index$4;
root[index$4] = -1;
var index$3 = 31 - clz32(suspendedLanes),
lane = 1 << index$3;
root[index$3] = -1;
suspendedLanes &= ~lane;
}
}
@@ -8423,8 +8383,8 @@ function renderRootSync(root, lanes) {
}
workLoopSync();
break;
} catch (thrownValue$132) {
handleThrow(root, thrownValue$132);
} catch (thrownValue$130) {
handleThrow(root, thrownValue$130);
}
while (1);
resetContextDependencies();
@@ -8528,8 +8488,8 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
} catch (thrownValue$134) {
handleThrow(root, thrownValue$134);
} catch (thrownValue$132) {
handleThrow(root, thrownValue$132);
}
while (1);
resetContextDependencies();
@@ -8706,10 +8666,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$35 = offscreenQueue.retryQueue;
null === retryQueue$35
var retryQueue$34 = offscreenQueue.retryQueue;
null === retryQueue$34
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$35.add(wakeable);
: retryQueue$34.add(wakeable);
}
}
break;
@@ -10073,19 +10033,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1170 = {
devToolsConfig$jscomp$inline_1164 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-9e45a6d4",
version: "18.3.0-www-classic-390b1cd2",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1344 = {
bundleType: devToolsConfig$jscomp$inline_1170.bundleType,
version: devToolsConfig$jscomp$inline_1170.version,
rendererPackageName: devToolsConfig$jscomp$inline_1170.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1170.rendererConfig,
var internals$jscomp$inline_1329 = {
bundleType: devToolsConfig$jscomp$inline_1164.bundleType,
version: devToolsConfig$jscomp$inline_1164.version,
rendererPackageName: devToolsConfig$jscomp$inline_1164.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1164.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -10102,26 +10062,26 @@ var internals$jscomp$inline_1344 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1170.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1164.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-9e45a6d4"
reconcilerVersion: "18.3.0-www-classic-390b1cd2"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1345 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1330 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1345.isDisabled &&
hook$jscomp$inline_1345.supportsFiber
!hook$jscomp$inline_1330.isDisabled &&
hook$jscomp$inline_1330.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1345.inject(
internals$jscomp$inline_1344
(rendererID = hook$jscomp$inline_1330.inject(
internals$jscomp$inline_1329
)),
(injectedHook = hook$jscomp$inline_1345);
(injectedHook = hook$jscomp$inline_1330);
} catch (err) {}
}
var Path = Mode$1.Path;
+144 -184
View File
@@ -459,19 +459,19 @@ function markRootFinished(root, remainingLanes) {
var eventTimes = root.eventTimes,
expirationTimes = root.expirationTimes;
for (root = root.hiddenUpdates; 0 < noLongerPendingLanes; ) {
var index$5 = 31 - clz32(noLongerPendingLanes),
lane = 1 << index$5;
remainingLanes[index$5] = 0;
eventTimes[index$5] = -1;
expirationTimes[index$5] = -1;
var hiddenUpdatesForLane = root[index$5];
var index$4 = 31 - clz32(noLongerPendingLanes),
lane = 1 << index$4;
remainingLanes[index$4] = 0;
eventTimes[index$4] = -1;
expirationTimes[index$4] = -1;
var hiddenUpdatesForLane = root[index$4];
if (null !== hiddenUpdatesForLane)
for (
root[index$5] = null, index$5 = 0;
index$5 < hiddenUpdatesForLane.length;
index$5++
root[index$4] = null, index$4 = 0;
index$4 < hiddenUpdatesForLane.length;
index$4++
) {
var update = hiddenUpdatesForLane[index$5];
var update = hiddenUpdatesForLane[index$4];
null !== update && (update.lane &= -1073741825);
}
noLongerPendingLanes &= ~lane;
@@ -480,21 +480,21 @@ function markRootFinished(root, remainingLanes) {
function markRootEntangled(root, entangledLanes) {
var rootEntangledLanes = (root.entangledLanes |= entangledLanes);
for (root = root.entanglements; rootEntangledLanes; ) {
var index$6 = 31 - clz32(rootEntangledLanes),
lane = 1 << index$6;
(lane & entangledLanes) | (root[index$6] & entangledLanes) &&
(root[index$6] |= entangledLanes);
var index$5 = 31 - clz32(rootEntangledLanes),
lane = 1 << index$5;
(lane & entangledLanes) | (root[index$5] & entangledLanes) &&
(root[index$5] |= entangledLanes);
rootEntangledLanes &= ~lane;
}
}
function getTransitionsForLanes(root, lanes) {
if (!enableTransitionTracing) return null;
for (var transitionsForLanes = []; 0 < lanes; ) {
var index$8 = 31 - clz32(lanes),
lane = 1 << index$8;
index$8 = root.transitionLanes[index$8];
null !== index$8 &&
index$8.forEach(function (transition) {
var index$7 = 31 - clz32(lanes),
lane = 1 << index$7;
index$7 = root.transitionLanes[index$7];
null !== index$7 &&
index$7.forEach(function (transition) {
transitionsForLanes.push(transition);
});
lanes &= ~lane;
@@ -504,10 +504,10 @@ function getTransitionsForLanes(root, lanes) {
function clearTransitionsForLanes(root, lanes) {
if (enableTransitionTracing)
for (; 0 < lanes; ) {
var index$9 = 31 - clz32(lanes),
lane = 1 << index$9;
null !== root.transitionLanes[index$9] &&
(root.transitionLanes[index$9] = null);
var index$8 = 31 - clz32(lanes),
lane = 1 << index$8;
null !== root.transitionLanes[index$8] &&
(root.transitionLanes[index$8] = null);
lanes &= ~lane;
}
}
@@ -729,16 +729,16 @@ function describeNativeComponentFrame(fn, construct) {
} else {
try {
construct.call();
} catch (x$10) {
control = x$10;
} catch (x$9) {
control = x$9;
}
fn.call(construct.prototype);
}
else {
try {
throw Error();
} catch (x$11) {
control = x$11;
} catch (x$10) {
control = x$10;
}
fn();
}
@@ -2227,10 +2227,10 @@ createFunctionComponentUpdateQueue = function () {
function use(usable) {
if (null !== usable && "object" === typeof usable) {
if ("function" === typeof usable.then) {
var index$28 = thenableIndexCounter;
var index$27 = thenableIndexCounter;
thenableIndexCounter += 1;
null === thenableState && (thenableState = []);
usable = trackUsedThenable(thenableState, usable, index$28);
usable = trackUsedThenable(thenableState, usable, index$27);
null === currentlyRenderingFiber$1.alternate &&
(null === workInProgressHook
? null === currentlyRenderingFiber$1.memoizedState
@@ -5021,14 +5021,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
break;
case "collapsed":
lastTailNode = renderState.tail;
for (var lastTailNode$73 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode),
for (var lastTailNode$72 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$72 = lastTailNode),
(lastTailNode = lastTailNode.sibling);
null === lastTailNode$73
null === lastTailNode$72
? hasRenderedATailFallback || null === renderState.tail
? (renderState.tail = null)
: (renderState.tail.sibling = null)
: (lastTailNode$73.sibling = null);
: (lastTailNode$72.sibling = null);
}
}
function bubbleProperties(completedWork) {
@@ -5038,19 +5038,19 @@ function bubbleProperties(completedWork) {
newChildLanes = 0,
subtreeFlags = 0;
if (didBailout)
for (var child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags & 31457280),
(subtreeFlags |= child$74.flags & 31457280),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
for (var child$73 = completedWork.child; null !== child$73; )
(newChildLanes |= child$73.lanes | child$73.childLanes),
(subtreeFlags |= child$73.subtreeFlags & 31457280),
(subtreeFlags |= child$73.flags & 31457280),
(child$73.return = completedWork),
(child$73 = child$73.sibling);
else
for (child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags),
(subtreeFlags |= child$74.flags),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
for (child$73 = completedWork.child; null !== child$73; )
(newChildLanes |= child$73.lanes | child$73.childLanes),
(subtreeFlags |= child$73.subtreeFlags),
(subtreeFlags |= child$73.flags),
(child$73.return = completedWork),
(child$73 = child$73.sibling);
completedWork.subtreeFlags |= subtreeFlags;
completedWork.childLanes = newChildLanes;
return didBailout;
@@ -5226,11 +5226,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(instance = newProps.alternate.memoizedState.cachePool.pool);
var cache$78 = null;
var cache$77 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
(cache$78 = newProps.memoizedState.cachePool.pool);
cache$78 !== instance && (newProps.flags |= 2048);
(cache$77 = newProps.memoizedState.cachePool.pool);
cache$77 !== instance && (newProps.flags |= 2048);
}
renderLanes !== current &&
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
@@ -5256,8 +5256,8 @@ function completeWork(current, workInProgress, renderLanes) {
instance = workInProgress.memoizedState;
if (null === instance) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
cache$78 = instance.rendering;
if (null === cache$78)
cache$77 = instance.rendering;
if (null === cache$77)
if (newProps) cutOffTailIfNeeded(instance, !1);
else {
if (
@@ -5265,11 +5265,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
cache$78 = findFirstSuspended(current);
if (null !== cache$78) {
cache$77 = findFirstSuspended(current);
if (null !== cache$77) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(instance, !1);
current = cache$78.updateQueue;
current = cache$77.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -5294,7 +5294,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
if (((current = findFirstSuspended(cache$78)), null !== current)) {
if (((current = findFirstSuspended(cache$77)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -5304,7 +5304,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !0),
null === instance.tail &&
"hidden" === instance.tailMode &&
!cache$78.alternate)
!cache$77.alternate)
)
return bubbleProperties(workInProgress), null;
} else
@@ -5316,13 +5316,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !1),
(workInProgress.lanes = 8388608));
instance.isBackwards
? ((cache$78.sibling = workInProgress.child),
(workInProgress.child = cache$78))
? ((cache$77.sibling = workInProgress.child),
(workInProgress.child = cache$77))
: ((current = instance.last),
null !== current
? (current.sibling = cache$78)
: (workInProgress.child = cache$78),
(instance.last = cache$78));
? (current.sibling = cache$77)
: (workInProgress.child = cache$77),
(instance.last = cache$77));
}
if (null !== instance.tail)
return (
@@ -5573,8 +5573,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
else if ("function" === typeof ref)
try {
ref(null);
} catch (error$95) {
captureCommitPhaseError(current, nearestMountedAncestor, error$95);
} catch (error$94) {
captureCommitPhaseError(current, nearestMountedAncestor, error$94);
}
else ref.current = null;
}
@@ -5776,11 +5776,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
current,
finishedRoot.__reactInternalSnapshotBeforeUpdate
);
} catch (error$96) {
} catch (error$95) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$96
error$95
);
}
}
@@ -6373,8 +6373,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
}
try {
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
} catch (error$104) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$104);
} catch (error$103) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$103);
}
}
break;
@@ -6410,11 +6410,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
if (null !== updatePayload || diffInCommitPhase)
try {
flags._applyProps(flags, newProps, current);
} catch (error$107) {
} catch (error$106) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$107
error$106
);
}
}
@@ -6451,8 +6451,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
null !== retryQueue && suspenseCallback(new Set(retryQueue));
}
}
} catch (error$109) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
} catch (error$108) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$108);
}
flags = finishedWork.updateQueue;
null !== flags &&
@@ -6592,12 +6592,12 @@ function commitReconciliationEffects(finishedWork) {
break;
case 3:
case 4:
var parent$99 = JSCompiler_inline_result.stateNode.containerInfo,
before$100 = getHostSibling(finishedWork);
var parent$98 = JSCompiler_inline_result.stateNode.containerInfo,
before$99 = getHostSibling(finishedWork);
insertOrAppendPlacementNodeIntoContainer(
finishedWork,
before$100,
parent$99
before$99,
parent$98
);
break;
default:
@@ -7058,9 +7058,9 @@ function recursivelyTraverseReconnectPassiveEffects(
);
break;
case 22:
var instance$118 = finishedWork.stateNode;
var instance$117 = finishedWork.stateNode;
null !== finishedWork.memoizedState
? instance$118._visibility & 4
? instance$117._visibility & 4
? recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7073,7 +7073,7 @@ function recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork
)
: ((instance$118._visibility |= 4),
: ((instance$117._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7081,7 +7081,7 @@ function recursivelyTraverseReconnectPassiveEffects(
committedTransitions,
includeWorkInProgressEffects
))
: ((instance$118._visibility |= 4),
: ((instance$117._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -7094,7 +7094,7 @@ function recursivelyTraverseReconnectPassiveEffects(
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork,
instance$118
instance$117
);
break;
case 24:
@@ -7537,12 +7537,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) {
0 < lanes;
) {
var index$3 = 31 - clz32(lanes),
lane = 1 << index$3,
expirationTime = expirationTimes[index$3];
var index$2 = 31 - clz32(lanes),
lane = 1 << index$2,
expirationTime = expirationTimes[index$2];
if (-1 === expirationTime) {
if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
expirationTimes[index$3] = computeExpirationTime(lane, currentTime);
expirationTimes[index$2] = computeExpirationTime(lane, currentTime);
} else expirationTime <= currentTime && (root.expiredLanes |= lane);
lanes &= ~lane;
}
@@ -7599,8 +7599,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) {
root.callbackNode = suspendedLanes;
return currentTime;
}
var ceil = Math.ceil,
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
@@ -7736,11 +7735,11 @@ function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
enableTransitionTracing))
) {
var transitionLanesMap = root.transitionLanes,
index$7 = 31 - clz32(lane),
transitions = transitionLanesMap[index$7];
index$6 = 31 - clz32(lane),
transitions = transitionLanesMap[index$6];
null === transitions && (transitions = new Set());
transitions.add(eventTime);
transitionLanesMap[index$7] = transitions;
transitionLanesMap[index$6] = transitions;
}
root === workInProgressRoot &&
(0 === (executionContext & 2) &&
@@ -7767,28 +7766,28 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
root === workInProgressRoot ? workInProgressRootRenderLanes : 0
);
if (0 === lanes) return null;
var exitStatus =
didTimeout =
includesBlockingLane(root, lanes) ||
0 !== (lanes & root.expiredLanes) ||
didTimeout
? renderRootSync(root, lanes)
: renderRootConcurrent(root, lanes);
if (0 !== exitStatus) {
if (2 === exitStatus) {
didTimeout = lanes;
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(
root,
didTimeout
);
if (0 !== didTimeout) {
if (2 === didTimeout) {
var originallyAttemptedLanes = lanes,
errorRetryLanes = getLanesToRetrySynchronouslyOnError(
root,
originallyAttemptedLanes
);
0 !== errorRetryLanes &&
((lanes = errorRetryLanes),
(exitStatus = recoverFromConcurrentError(
(didTimeout = recoverFromConcurrentError(
root,
didTimeout,
originallyAttemptedLanes,
errorRetryLanes
)));
}
if (1 === exitStatus)
if (1 === didTimeout)
throw (
((originalCallbackNode = workInProgressRootFatalError),
prepareFreshStack(root, 0),
@@ -7796,30 +7795,30 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
ensureRootIsScheduled(root),
originalCallbackNode)
);
if (6 === exitStatus) markRootSuspended(root, lanes);
if (6 === didTimeout) markRootSuspended(root, lanes);
else {
errorRetryLanes = !includesBlockingLane(root, lanes);
didTimeout = root.current.alternate;
originallyAttemptedLanes = root.current.alternate;
if (
errorRetryLanes &&
!isRenderConsistentWithExternalStores(didTimeout)
!isRenderConsistentWithExternalStores(originallyAttemptedLanes)
) {
exitStatus = renderRootSync(root, lanes);
if (2 === exitStatus) {
didTimeout = renderRootSync(root, lanes);
if (2 === didTimeout) {
errorRetryLanes = lanes;
var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError(
var errorRetryLanes$127 = getLanesToRetrySynchronouslyOnError(
root,
errorRetryLanes
);
0 !== errorRetryLanes$128 &&
((lanes = errorRetryLanes$128),
(exitStatus = recoverFromConcurrentError(
0 !== errorRetryLanes$127 &&
((lanes = errorRetryLanes$127),
(didTimeout = recoverFromConcurrentError(
root,
errorRetryLanes,
errorRetryLanes$128
errorRetryLanes$127
)));
}
if (1 === exitStatus)
if (1 === didTimeout)
throw (
((originalCallbackNode = workInProgressRootFatalError),
prepareFreshStack(root, 0),
@@ -7828,16 +7827,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
originalCallbackNode)
);
}
root.finishedWork = didTimeout;
root.finishedWork = originallyAttemptedLanes;
root.finishedLanes = lanes;
switch (exitStatus) {
switch (didTimeout) {
case 0:
case 1:
throw Error(formatProdErrorMessage(345));
case 2:
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -7847,26 +7846,26 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
markRootSuspended(root, lanes);
if (
(lanes & 125829120) === lanes &&
((exitStatus = globalMostRecentFallbackTime + 500 - now()),
10 < exitStatus)
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
10 < didTimeout)
) {
if (0 !== getNextLanes(root, 0)) break;
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
exitStatus
didTimeout
);
break;
}
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -7875,48 +7874,9 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
case 4:
markRootSuspended(root, lanes);
if ((lanes & 8388480) === lanes) break;
exitStatus = lanes;
errorRetryLanes = root.eventTimes;
for (errorRetryLanes$128 = -1; 0 < exitStatus; ) {
var index$2 = 31 - clz32(exitStatus),
lane = 1 << index$2;
index$2 = errorRetryLanes[index$2];
index$2 > errorRetryLanes$128 && (errorRetryLanes$128 = index$2);
exitStatus &= ~lane;
}
exitStatus = errorRetryLanes$128;
exitStatus = now() - exitStatus;
exitStatus =
(120 > exitStatus
? 120
: 480 > exitStatus
? 480
: 1080 > exitStatus
? 1080
: 1920 > exitStatus
? 1920
: 3e3 > exitStatus
? 3e3
: 4320 > exitStatus
? 4320
: 1960 * ceil(exitStatus / 1960)) - exitStatus;
if (10 < exitStatus) {
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
didTimeout,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
exitStatus
);
break;
}
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -7925,7 +7885,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
case 5:
commitRootWhenReady(
root,
didTimeout,
originallyAttemptedLanes,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
@@ -8029,9 +7989,9 @@ function markRootSuspended(root, suspendedLanes) {
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes;
for (root = root.expirationTimes; 0 < suspendedLanes; ) {
var index$4 = 31 - clz32(suspendedLanes),
lane = 1 << index$4;
root[index$4] = -1;
var index$3 = 31 - clz32(suspendedLanes),
lane = 1 << index$3;
root[index$3] = -1;
suspendedLanes &= ~lane;
}
}
@@ -8159,8 +8119,8 @@ function renderRootSync(root, lanes) {
}
workLoopSync();
break;
} catch (thrownValue$131) {
handleThrow(root, thrownValue$131);
} catch (thrownValue$129) {
handleThrow(root, thrownValue$129);
}
while (1);
resetContextDependencies();
@@ -8264,8 +8224,8 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
} catch (thrownValue$133) {
handleThrow(root, thrownValue$133);
} catch (thrownValue$131) {
handleThrow(root, thrownValue$131);
}
while (1);
resetContextDependencies();
@@ -8438,10 +8398,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
};
suspenseBoundary.updateQueue = newOffscreenQueue;
} else {
var retryQueue$35 = offscreenQueue.retryQueue;
null === retryQueue$35
var retryQueue$34 = offscreenQueue.retryQueue;
null === retryQueue$34
? (offscreenQueue.retryQueue = new Set([wakeable]))
: retryQueue$35.add(wakeable);
: retryQueue$34.add(wakeable);
}
}
break;
@@ -9738,19 +9698,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1150 = {
devToolsConfig$jscomp$inline_1144 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-910e3a9f",
version: "18.3.0-www-modern-8ad04cf7",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1324 = {
bundleType: devToolsConfig$jscomp$inline_1150.bundleType,
version: devToolsConfig$jscomp$inline_1150.version,
rendererPackageName: devToolsConfig$jscomp$inline_1150.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1150.rendererConfig,
var internals$jscomp$inline_1309 = {
bundleType: devToolsConfig$jscomp$inline_1144.bundleType,
version: devToolsConfig$jscomp$inline_1144.version,
rendererPackageName: devToolsConfig$jscomp$inline_1144.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1144.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -9767,26 +9727,26 @@ var internals$jscomp$inline_1324 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1150.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1144.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-910e3a9f"
reconcilerVersion: "18.3.0-www-modern-8ad04cf7"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1325.isDisabled &&
hook$jscomp$inline_1325.supportsFiber
!hook$jscomp$inline_1310.isDisabled &&
hook$jscomp$inline_1310.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1325.inject(
internals$jscomp$inline_1324
(rendererID = hook$jscomp$inline_1310.inject(
internals$jscomp$inline_1309
)),
(injectedHook = hook$jscomp$inline_1325);
(injectedHook = hook$jscomp$inline_1310);
} catch (err) {}
}
var Path = Mode$1.Path;
+1 -76
View File
@@ -2084,24 +2084,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -29019,7 +29001,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -29855,37 +29836,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -32149,32 +32099,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -33899,7 +33824,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-f8663d04";
var ReactVersion = "18.3.0-www-classic-7c0aabad";
function createPortal$1(
children,
+1 -76
View File
@@ -1388,24 +1388,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -28860,7 +28842,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -29696,37 +29677,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -31985,32 +31935,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -33735,7 +33660,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-910e3a9f";
var ReactVersion = "18.3.0-www-modern-8ad04cf7";
function createPortal$1(
children,
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
@@ -2073,24 +2073,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -32742,7 +32724,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -33578,37 +33559,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -35872,32 +35822,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -37622,7 +37547,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-01e3a587";
var ReactVersion = "18.3.0-www-classic-e96410ff";
function createPortal$1(
children,
@@ -1377,24 +1377,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -29479,7 +29461,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -30315,37 +30296,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -32604,32 +32554,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -34354,7 +34279,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-ffbb36ea";
var ReactVersion = "18.3.0-www-modern-1d5f900e";
function createPortal$1(
children,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1444,24 +1444,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -20363,7 +20345,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -20987,37 +20968,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -22957,32 +22907,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -24482,7 +24407,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-classic-3b456806";
var ReactVersion = "18.3.0-www-classic-31ab641e";
// Might add PROFILE later.
@@ -1444,24 +1444,6 @@ function getNextLanes(root, wipLanes) {
return nextLanes;
}
function getMostRecentEventTime(root, lanes) {
var eventTimes = root.eventTimes;
var mostRecentEventTime = NoTimestamp;
while (lanes > 0) {
var index = pickArbitraryLaneIndex(lanes);
var lane = 1 << index;
var eventTime = eventTimes[index];
if (eventTime > mostRecentEventTime) {
mostRecentEventTime = eventTime;
}
lanes &= ~lane;
}
return mostRecentEventTime;
}
function computeExpirationTime(lane, currentTime) {
switch (lane) {
@@ -20363,7 +20345,6 @@ function scheduleImmediateTask(cb) {
}
}
var ceil = Math.ceil;
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
@@ -20987,37 +20968,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
// placeholder and without scheduling a timeout. Delay indefinitely
// until we receive more data.
break;
}
if (!shouldForceFlushFallbacksInDEV()) {
// This is not a transition, but we did trigger an avoided state.
// Schedule a placeholder to display after a short delay, using the Just
// Noticeable Difference.
// TODO: Is the JND optimization worth the added complexity? If this is
// the only reason we track the event time, then probably not.
// Consider removing.
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
var eventTimeMs = mostRecentEventTime;
var timeElapsedMs = now$1() - eventTimeMs;
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time.
if (_msUntilTimeout > 10) {
// Instead of committing the fallback immediately, wait for more data
// to arrive.
root.timeoutHandle = scheduleTimeout(
commitRootWhenReady.bind(
null,
root,
finishedWork,
workInProgressRootRecoverableErrors,
workInProgressTransitions,
lanes
),
_msUntilTimeout
);
break;
}
} // Commit the placeholder.
commitRootWhenReady(
@@ -22957,32 +22907,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) {
}
retryTimedOutBoundary(boundaryFiber, retryLane);
} // Computes the next Just Noticeable Difference (JND) boundary.
// The theory is that a person can't tell the difference between small differences in time.
// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
// difference in the experience. However, waiting for longer might mean that we can avoid
// showing an intermediate loading state. The longer we have already waited, the harder it
// is to tell small differences in time. Therefore, the longer we've already waited,
// the longer we can wait additionally. At some point we have to give up though.
// We pick a train model where the next boundary commits at a consistent schedule.
// These particular numbers are vague estimates. We expect to adjust them based on research.
function jnd(timeElapsed) {
return timeElapsed < 120
? 120
: timeElapsed < 480
? 480
: timeElapsed < 1080
? 1080
: timeElapsed < 1920
? 1920
: timeElapsed < 3000
? 3000
: timeElapsed < 4320
? 4320
: ceil(timeElapsed / 1960) * 1960;
}
function throwIfInfiniteUpdateLoopDetected() {
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
nestedUpdateCount = 0;
@@ -24482,7 +24407,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-www-modern-82c50b6a";
var ReactVersion = "18.3.0-www-modern-d66c88c7";
// Might add PROFILE later.