diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 9840002b0bece..5a3a96c57330a 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -fc801116c80b68f7ebdaf66ac77d5f2dcd9e50eb +7f362de1588d98438787d652941533e21f2f332d diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 39553295e915f..1234c3dff4a2d 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-classic-a3146e4f"; +var ReactVersion = "18.3.0-www-classic-60aa7d44"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 474f64f2e2c64..6bd2ad6f9df2d 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-modern-f95d3ddd"; +var ReactVersion = "18.3.0-www-modern-fec65964"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index b548114aa9c23..69401e4107798 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -622,4 +622,4 @@ exports.useSyncExternalStore = function ( ); }; exports.useTransition = useTransition; -exports.version = "18.3.0-www-modern-0b35a427"; +exports.version = "18.3.0-www-modern-e397df4a"; diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index ed9c2b0e60c4c..5264d5f5bef78 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-a18a6ba5"; +var ReactVersion = "18.3.0-www-classic-9da53968"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -2165,7 +2165,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -2198,7 +2198,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -7347,21 +7347,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -7390,49 +7375,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -23748,13 +23695,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -24433,8 +24374,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -24467,7 +24407,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -24481,7 +24420,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -24492,7 +24430,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -24516,20 +24453,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -24592,49 +24523,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -24705,8 +24605,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -24832,7 +24731,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -25853,12 +25751,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -25871,7 +25764,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -25886,7 +25778,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -25962,9 +25853,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -26183,18 +26072,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -26689,18 +26567,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 8355c8f81baa5..7155d2fc3332d 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-modern-7d12a802"; +var ReactVersion = "18.3.0-www-modern-6b665042"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -2162,7 +2162,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -2195,7 +2195,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -7103,21 +7103,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -7146,49 +7131,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -23413,13 +23360,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -24098,8 +24039,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -24132,7 +24072,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -24146,7 +24085,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -24157,7 +24095,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -24181,20 +24118,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -24257,49 +24188,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -24370,8 +24270,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -24497,7 +24396,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -25513,12 +25411,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -25531,7 +25424,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -25546,7 +25438,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -25622,9 +25513,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -25843,18 +25732,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -26349,18 +26227,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 858c647c01121..6b5ca0a8e0551 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -556,6 +556,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1079,7 +1084,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -2276,21 +2286,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -2342,8 +2341,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -7983,8 +7981,6 @@ var DefaultCacheDispatcher = { workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8217,7 +8213,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -8229,7 +8224,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -8279,11 +8273,10 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -8319,15 +8312,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -8381,7 +8365,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -8874,12 +8857,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8889,7 +8867,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -8902,7 +8879,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -8920,7 +8896,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -8984,8 +8959,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -9128,10 +9101,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -9177,18 +9146,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -10137,19 +10094,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1134 = { + devToolsConfig$jscomp$inline_1129 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-classic-a3146e4f", + version: "18.3.0-www-classic-60aa7d44", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1309 = { - bundleType: devToolsConfig$jscomp$inline_1134.bundleType, - version: devToolsConfig$jscomp$inline_1134.version, - rendererPackageName: devToolsConfig$jscomp$inline_1134.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1134.rendererConfig, +var internals$jscomp$inline_1301 = { + bundleType: devToolsConfig$jscomp$inline_1129.bundleType, + version: devToolsConfig$jscomp$inline_1129.version, + rendererPackageName: devToolsConfig$jscomp$inline_1129.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1129.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10166,26 +10123,26 @@ var internals$jscomp$inline_1309 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1134.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1129.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-a3146e4f" + reconcilerVersion: "18.3.0-www-classic-60aa7d44" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1302 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1310.isDisabled && - hook$jscomp$inline_1310.supportsFiber + !hook$jscomp$inline_1302.isDisabled && + hook$jscomp$inline_1302.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1310.inject( - internals$jscomp$inline_1309 + (rendererID = hook$jscomp$inline_1302.inject( + internals$jscomp$inline_1301 )), - (injectedHook = hook$jscomp$inline_1310); + (injectedHook = hook$jscomp$inline_1302); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 517d51acc5a37..7df4f9bb0e978 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -440,6 +440,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -885,7 +890,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -2082,21 +2092,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -2148,8 +2147,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -7719,8 +7717,6 @@ var DefaultCacheDispatcher = { workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7953,7 +7949,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -7965,7 +7960,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -8015,11 +8009,10 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -8055,15 +8048,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -8117,7 +8101,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -8606,12 +8589,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8621,7 +8599,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -8634,7 +8611,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -8652,7 +8628,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -8716,8 +8691,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -8860,10 +8833,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -8909,18 +8878,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -9802,19 +9759,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1114 = { + devToolsConfig$jscomp$inline_1109 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-modern-00f6ca5a", + version: "18.3.0-www-modern-8ec61f4c", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1289 = { - bundleType: devToolsConfig$jscomp$inline_1114.bundleType, - version: devToolsConfig$jscomp$inline_1114.version, - rendererPackageName: devToolsConfig$jscomp$inline_1114.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1114.rendererConfig, +var internals$jscomp$inline_1281 = { + bundleType: devToolsConfig$jscomp$inline_1109.bundleType, + version: devToolsConfig$jscomp$inline_1109.version, + rendererPackageName: devToolsConfig$jscomp$inline_1109.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1109.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9831,26 +9788,26 @@ var internals$jscomp$inline_1289 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1114.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1109.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-00f6ca5a" + reconcilerVersion: "18.3.0-www-modern-8ec61f4c" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1290 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1282 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1290.isDisabled && - hook$jscomp$inline_1290.supportsFiber + !hook$jscomp$inline_1282.isDisabled && + hook$jscomp$inline_1282.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1290.inject( - internals$jscomp$inline_1289 + (rendererID = hook$jscomp$inline_1282.inject( + internals$jscomp$inline_1281 )), - (injectedHook = hook$jscomp$inline_1290); + (injectedHook = hook$jscomp$inline_1282); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index e7118b249ee6c..26089a4b126af 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -2338,7 +2338,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -2371,7 +2371,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -11820,21 +11820,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -11863,49 +11848,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -29233,13 +29180,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -29933,8 +29874,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -29967,7 +29907,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -29981,7 +29920,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -29992,7 +29930,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -30019,20 +29956,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -30095,49 +30026,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -30208,8 +30108,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -30373,7 +30272,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -31394,12 +31292,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -31412,7 +31305,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -31427,7 +31319,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -31503,9 +31394,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -31739,18 +31628,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -32277,18 +32155,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -34007,7 +33873,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-649b263b"; +var ReactVersion = "18.3.0-www-classic-1392da14"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 3ad0f28c090a4..5442cab2c62b0 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -1690,7 +1690,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -1723,7 +1723,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -11761,21 +11761,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -11804,49 +11789,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -29083,13 +29030,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -29783,8 +29724,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -29817,7 +29757,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -29831,7 +29770,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -29842,7 +29780,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -29869,20 +29806,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -29945,49 +29876,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -30058,8 +29958,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -30223,7 +30122,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -31239,12 +31137,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -31257,7 +31150,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -31272,7 +31164,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -31348,9 +31239,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -31584,18 +31473,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -32122,18 +32000,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -33852,7 +33718,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-7d12a802"; +var ReactVersion = "18.3.0-www-modern-6b665042"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 372399c6fc194..d3988e19da69d 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -600,6 +600,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1881,7 +1886,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3066,21 +3076,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$44 = firstScheduledRoot; null !== root$44; ) { if ( (!onlyLegacy || 0 === root$44.tag) && @@ -3131,8 +3130,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -9715,8 +9713,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -9952,7 +9948,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -9964,7 +9959,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -10013,7 +10007,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -10024,18 +10017,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -10071,15 +10058,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10168,7 +10146,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -10663,12 +10640,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -10678,7 +10650,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -10691,7 +10662,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -10709,7 +10679,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -10783,8 +10752,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -10944,10 +10911,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -10993,18 +10956,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -12688,14 +12639,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$370; if (canUseDOM) { - var isSupported$jscomp$inline_1555 = "oninput" in document; - if (!isSupported$jscomp$inline_1555) { - var element$jscomp$inline_1556 = document.createElement("div"); - element$jscomp$inline_1556.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1555 = - "function" === typeof element$jscomp$inline_1556.oninput; + var isSupported$jscomp$inline_1550 = "oninput" in document; + if (!isSupported$jscomp$inline_1550) { + var element$jscomp$inline_1551 = document.createElement("div"); + element$jscomp$inline_1551.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1550 = + "function" === typeof element$jscomp$inline_1551.oninput; } - JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1555; + JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1550; } else JSCompiler_inline_result$jscomp$370 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$370 && @@ -13007,20 +12958,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1596 = 0; - i$jscomp$inline_1596 < simpleEventPluginEvents.length; - i$jscomp$inline_1596++ + var i$jscomp$inline_1591 = 0; + i$jscomp$inline_1591 < simpleEventPluginEvents.length; + i$jscomp$inline_1591++ ) { - var eventName$jscomp$inline_1597 = - simpleEventPluginEvents[i$jscomp$inline_1596], - domEventName$jscomp$inline_1598 = - eventName$jscomp$inline_1597.toLowerCase(), - capitalizedEvent$jscomp$inline_1599 = - eventName$jscomp$inline_1597[0].toUpperCase() + - eventName$jscomp$inline_1597.slice(1); + var eventName$jscomp$inline_1592 = + simpleEventPluginEvents[i$jscomp$inline_1591], + domEventName$jscomp$inline_1593 = + eventName$jscomp$inline_1592.toLowerCase(), + capitalizedEvent$jscomp$inline_1594 = + eventName$jscomp$inline_1592[0].toUpperCase() + + eventName$jscomp$inline_1592.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1598, - "on" + capitalizedEvent$jscomp$inline_1599 + domEventName$jscomp$inline_1593, + "on" + capitalizedEvent$jscomp$inline_1594 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16624,17 +16575,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1803 = { +var devToolsConfig$jscomp$inline_1798 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-7412763a", + version: "18.3.0-www-classic-5f43d20f", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2165 = { - bundleType: devToolsConfig$jscomp$inline_1803.bundleType, - version: devToolsConfig$jscomp$inline_1803.version, - rendererPackageName: devToolsConfig$jscomp$inline_1803.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1803.rendererConfig, +var internals$jscomp$inline_2157 = { + bundleType: devToolsConfig$jscomp$inline_1798.bundleType, + version: devToolsConfig$jscomp$inline_1798.version, + rendererPackageName: devToolsConfig$jscomp$inline_1798.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1798.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16650,26 +16601,26 @@ var internals$jscomp$inline_2165 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1803.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1798.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-7412763a" + reconcilerVersion: "18.3.0-www-classic-5f43d20f" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2166 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2158 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2166.isDisabled && - hook$jscomp$inline_2166.supportsFiber + !hook$jscomp$inline_2158.isDisabled && + hook$jscomp$inline_2158.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2166.inject( - internals$jscomp$inline_2165 + (rendererID = hook$jscomp$inline_2158.inject( + internals$jscomp$inline_2157 )), - (injectedHook = hook$jscomp$inline_2166); + (injectedHook = hook$jscomp$inline_2158); } catch (err) {} } assign(Internals, { @@ -16885,4 +16836,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-7412763a"; +exports.version = "18.3.0-www-classic-5f43d20f"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 5236e914d253d..5a17d4edbc076 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -358,6 +358,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1774,7 +1779,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -2959,21 +2969,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$44 = firstScheduledRoot; null !== root$44; ) { if ( (!onlyLegacy || 0 === root$44.tag) && @@ -3024,8 +3023,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -9551,8 +9549,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -9788,7 +9784,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -9800,7 +9795,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -9849,7 +9843,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -9860,18 +9853,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -9907,15 +9894,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10004,7 +9982,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -10495,12 +10472,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -10510,7 +10482,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -10523,7 +10494,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -10541,7 +10511,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -10615,8 +10584,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -10776,10 +10743,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -10825,18 +10788,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -12934,14 +12885,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$368; if (canUseDOM) { - var isSupported$jscomp$inline_1554 = "oninput" in document; - if (!isSupported$jscomp$inline_1554) { - var element$jscomp$inline_1555 = document.createElement("div"); - element$jscomp$inline_1555.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1554 = - "function" === typeof element$jscomp$inline_1555.oninput; + var isSupported$jscomp$inline_1549 = "oninput" in document; + if (!isSupported$jscomp$inline_1549) { + var element$jscomp$inline_1550 = document.createElement("div"); + element$jscomp$inline_1550.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1549 = + "function" === typeof element$jscomp$inline_1550.oninput; } - JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1554; + JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1549; } else JSCompiler_inline_result$jscomp$368 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$368 && @@ -13253,20 +13204,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1595 = 0; - i$jscomp$inline_1595 < simpleEventPluginEvents.length; - i$jscomp$inline_1595++ + var i$jscomp$inline_1590 = 0; + i$jscomp$inline_1590 < simpleEventPluginEvents.length; + i$jscomp$inline_1590++ ) { - var eventName$jscomp$inline_1596 = - simpleEventPluginEvents[i$jscomp$inline_1595], - domEventName$jscomp$inline_1597 = - eventName$jscomp$inline_1596.toLowerCase(), - capitalizedEvent$jscomp$inline_1598 = - eventName$jscomp$inline_1596[0].toUpperCase() + - eventName$jscomp$inline_1596.slice(1); + var eventName$jscomp$inline_1591 = + simpleEventPluginEvents[i$jscomp$inline_1590], + domEventName$jscomp$inline_1592 = + eventName$jscomp$inline_1591.toLowerCase(), + capitalizedEvent$jscomp$inline_1593 = + eventName$jscomp$inline_1591[0].toUpperCase() + + eventName$jscomp$inline_1591.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1597, - "on" + capitalizedEvent$jscomp$inline_1598 + domEventName$jscomp$inline_1592, + "on" + capitalizedEvent$jscomp$inline_1593 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16154,17 +16105,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1762 = { +var devToolsConfig$jscomp$inline_1757 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-00f6ca5a", + version: "18.3.0-www-modern-8ec61f4c", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2129 = { - bundleType: devToolsConfig$jscomp$inline_1762.bundleType, - version: devToolsConfig$jscomp$inline_1762.version, - rendererPackageName: devToolsConfig$jscomp$inline_1762.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1762.rendererConfig, +var internals$jscomp$inline_2121 = { + bundleType: devToolsConfig$jscomp$inline_1757.bundleType, + version: devToolsConfig$jscomp$inline_1757.version, + rendererPackageName: devToolsConfig$jscomp$inline_1757.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1757.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16181,26 +16132,26 @@ var internals$jscomp$inline_2129 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1762.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1757.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-00f6ca5a" + reconcilerVersion: "18.3.0-www-modern-8ec61f4c" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2130 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2122 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2130.isDisabled && - hook$jscomp$inline_2130.supportsFiber + !hook$jscomp$inline_2122.isDisabled && + hook$jscomp$inline_2122.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2130.inject( - internals$jscomp$inline_2129 + (rendererID = hook$jscomp$inline_2122.inject( + internals$jscomp$inline_2121 )), - (injectedHook = hook$jscomp$inline_2130); + (injectedHook = hook$jscomp$inline_2122); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16344,4 +16295,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-00f6ca5a"; +exports.version = "18.3.0-www-modern-8ec61f4c"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index dcdcff1e5e0df..cd362b501c8b5 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -714,6 +714,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -2025,7 +2030,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3210,21 +3220,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$47 = firstScheduledRoot; null !== root$47; ) { if ( (!onlyLegacy || 0 === root$47.tag) && @@ -3277,8 +3276,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -10306,8 +10304,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -10562,7 +10558,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -10574,7 +10569,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -10623,7 +10617,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -10634,18 +10627,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -10681,15 +10668,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10778,7 +10756,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -11350,12 +11327,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -11365,7 +11337,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -11378,7 +11349,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -11402,7 +11372,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -11492,8 +11461,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates @@ -11682,10 +11649,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -11731,18 +11694,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -13462,14 +13413,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$391; if (canUseDOM) { - var isSupported$jscomp$inline_1640 = "oninput" in document; - if (!isSupported$jscomp$inline_1640) { - var element$jscomp$inline_1641 = document.createElement("div"); - element$jscomp$inline_1641.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1640 = - "function" === typeof element$jscomp$inline_1641.oninput; + var isSupported$jscomp$inline_1635 = "oninput" in document; + if (!isSupported$jscomp$inline_1635) { + var element$jscomp$inline_1636 = document.createElement("div"); + element$jscomp$inline_1636.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1635 = + "function" === typeof element$jscomp$inline_1636.oninput; } - JSCompiler_inline_result$jscomp$391 = isSupported$jscomp$inline_1640; + JSCompiler_inline_result$jscomp$391 = isSupported$jscomp$inline_1635; } else JSCompiler_inline_result$jscomp$391 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$391 && @@ -13781,20 +13732,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1681 = 0; - i$jscomp$inline_1681 < simpleEventPluginEvents.length; - i$jscomp$inline_1681++ + var i$jscomp$inline_1676 = 0; + i$jscomp$inline_1676 < simpleEventPluginEvents.length; + i$jscomp$inline_1676++ ) { - var eventName$jscomp$inline_1682 = - simpleEventPluginEvents[i$jscomp$inline_1681], - domEventName$jscomp$inline_1683 = - eventName$jscomp$inline_1682.toLowerCase(), - capitalizedEvent$jscomp$inline_1684 = - eventName$jscomp$inline_1682[0].toUpperCase() + - eventName$jscomp$inline_1682.slice(1); + var eventName$jscomp$inline_1677 = + simpleEventPluginEvents[i$jscomp$inline_1676], + domEventName$jscomp$inline_1678 = + eventName$jscomp$inline_1677.toLowerCase(), + capitalizedEvent$jscomp$inline_1679 = + eventName$jscomp$inline_1677[0].toUpperCase() + + eventName$jscomp$inline_1677.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1683, - "on" + capitalizedEvent$jscomp$inline_1684 + domEventName$jscomp$inline_1678, + "on" + capitalizedEvent$jscomp$inline_1679 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17398,10 +17349,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1888 = { +var devToolsConfig$jscomp$inline_1883 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-b8f50646", + version: "18.3.0-www-classic-58cd4bbe", rendererPackageName: "react-dom" }; (function (internals) { @@ -17419,10 +17370,10 @@ var devToolsConfig$jscomp$inline_1888 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1888.bundleType, - version: devToolsConfig$jscomp$inline_1888.version, - rendererPackageName: devToolsConfig$jscomp$inline_1888.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1888.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1883.bundleType, + version: devToolsConfig$jscomp$inline_1883.version, + rendererPackageName: devToolsConfig$jscomp$inline_1883.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1883.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17438,14 +17389,14 @@ var devToolsConfig$jscomp$inline_1888 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1888.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1883.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-b8f50646" + reconcilerVersion: "18.3.0-www-classic-58cd4bbe" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17660,7 +17611,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-b8f50646"; +exports.version = "18.3.0-www-classic-58cd4bbe"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 18f878440d0f2..98e7a6ab7d702 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -472,6 +472,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1918,7 +1923,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3103,21 +3113,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$47 = firstScheduledRoot; null !== root$47; ) { if ( (!onlyLegacy || 0 === root$47.tag) && @@ -3170,8 +3169,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -10136,8 +10134,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -10392,7 +10388,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -10404,7 +10399,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -10453,7 +10447,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -10464,18 +10457,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -10511,15 +10498,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10608,7 +10586,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -11176,12 +11153,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -11191,7 +11163,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -11204,7 +11175,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -11228,7 +11198,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -11318,8 +11287,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates @@ -11508,10 +11475,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -11557,18 +11520,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -13702,14 +13653,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$389; if (canUseDOM) { - var isSupported$jscomp$inline_1639 = "oninput" in document; - if (!isSupported$jscomp$inline_1639) { - var element$jscomp$inline_1640 = document.createElement("div"); - element$jscomp$inline_1640.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1639 = - "function" === typeof element$jscomp$inline_1640.oninput; + var isSupported$jscomp$inline_1634 = "oninput" in document; + if (!isSupported$jscomp$inline_1634) { + var element$jscomp$inline_1635 = document.createElement("div"); + element$jscomp$inline_1635.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1634 = + "function" === typeof element$jscomp$inline_1635.oninput; } - JSCompiler_inline_result$jscomp$389 = isSupported$jscomp$inline_1639; + JSCompiler_inline_result$jscomp$389 = isSupported$jscomp$inline_1634; } else JSCompiler_inline_result$jscomp$389 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$389 && @@ -14021,20 +13972,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1680 = 0; - i$jscomp$inline_1680 < simpleEventPluginEvents.length; - i$jscomp$inline_1680++ + var i$jscomp$inline_1675 = 0; + i$jscomp$inline_1675 < simpleEventPluginEvents.length; + i$jscomp$inline_1675++ ) { - var eventName$jscomp$inline_1681 = - simpleEventPluginEvents[i$jscomp$inline_1680], - domEventName$jscomp$inline_1682 = - eventName$jscomp$inline_1681.toLowerCase(), - capitalizedEvent$jscomp$inline_1683 = - eventName$jscomp$inline_1681[0].toUpperCase() + - eventName$jscomp$inline_1681.slice(1); + var eventName$jscomp$inline_1676 = + simpleEventPluginEvents[i$jscomp$inline_1675], + domEventName$jscomp$inline_1677 = + eventName$jscomp$inline_1676.toLowerCase(), + capitalizedEvent$jscomp$inline_1678 = + eventName$jscomp$inline_1676[0].toUpperCase() + + eventName$jscomp$inline_1676.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1682, - "on" + capitalizedEvent$jscomp$inline_1683 + domEventName$jscomp$inline_1677, + "on" + capitalizedEvent$jscomp$inline_1678 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16922,10 +16873,10 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1847 = { +var devToolsConfig$jscomp$inline_1842 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-c038d9d5", + version: "18.3.0-www-modern-d5a637b7", rendererPackageName: "react-dom" }; (function (internals) { @@ -16943,10 +16894,10 @@ var devToolsConfig$jscomp$inline_1847 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1847.bundleType, - version: devToolsConfig$jscomp$inline_1847.version, - rendererPackageName: devToolsConfig$jscomp$inline_1847.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1847.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1842.bundleType, + version: devToolsConfig$jscomp$inline_1842.version, + rendererPackageName: devToolsConfig$jscomp$inline_1842.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1842.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16963,14 +16914,14 @@ var devToolsConfig$jscomp$inline_1847 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1847.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1842.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-c038d9d5" + reconcilerVersion: "18.3.0-www-modern-d5a637b7" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -17113,7 +17064,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-c038d9d5"; +exports.version = "18.3.0-www-modern-d5a637b7"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 1523107c9496e..9c3b6f78eef03 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -2327,7 +2327,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -2360,7 +2360,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -11954,21 +11954,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -11997,49 +11982,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -29850,13 +29797,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -30550,8 +30491,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -30584,7 +30524,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -30598,7 +30537,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -30609,7 +30547,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -30636,20 +30573,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -30712,49 +30643,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -30825,8 +30725,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -30990,7 +30889,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -32011,12 +31909,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -32029,7 +31922,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -32044,7 +31936,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -32120,9 +32011,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -32356,18 +32245,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -32894,18 +32772,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -34624,7 +34490,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-f7e77e44"; +var ReactVersion = "18.3.0-www-classic-6b2ddccd"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 85045872093b2..c47a298f5b579 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -1679,7 +1679,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -1712,7 +1712,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -11895,21 +11895,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -11938,49 +11923,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -29700,13 +29647,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -30400,8 +30341,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -30434,7 +30374,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -30448,7 +30387,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -30459,7 +30397,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -30486,20 +30423,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -30562,49 +30493,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -30675,8 +30575,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -30840,7 +30739,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -31856,12 +31754,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -31874,7 +31767,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -31889,7 +31781,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -31965,9 +31856,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -32201,18 +32090,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -32739,18 +32617,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -34469,7 +34335,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-dc748ad1"; +var ReactVersion = "18.3.0-www-modern-d662697e"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index e6fb5c497bd1f..12aecb4ed4f75 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -600,6 +600,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1967,7 +1972,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3152,21 +3162,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$44 = firstScheduledRoot; null !== root$44; ) { if ( (!onlyLegacy || 0 === root$44.tag) && @@ -3217,8 +3216,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -9987,8 +9985,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -10224,7 +10220,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -10236,7 +10231,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -10285,7 +10279,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -10296,18 +10289,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -10343,15 +10330,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10440,7 +10418,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -10935,12 +10912,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -10950,7 +10922,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -10963,7 +10934,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -10981,7 +10951,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -11055,8 +11024,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -11216,10 +11183,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -11265,18 +11228,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -12960,14 +12911,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$372; if (canUseDOM) { - var isSupported$jscomp$inline_1584 = "oninput" in document; - if (!isSupported$jscomp$inline_1584) { - var element$jscomp$inline_1585 = document.createElement("div"); - element$jscomp$inline_1585.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1584 = - "function" === typeof element$jscomp$inline_1585.oninput; + var isSupported$jscomp$inline_1579 = "oninput" in document; + if (!isSupported$jscomp$inline_1579) { + var element$jscomp$inline_1580 = document.createElement("div"); + element$jscomp$inline_1580.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1579 = + "function" === typeof element$jscomp$inline_1580.oninput; } - JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1584; + JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1579; } else JSCompiler_inline_result$jscomp$372 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$372 && @@ -13279,20 +13230,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1625 = 0; - i$jscomp$inline_1625 < simpleEventPluginEvents.length; - i$jscomp$inline_1625++ + var i$jscomp$inline_1620 = 0; + i$jscomp$inline_1620 < simpleEventPluginEvents.length; + i$jscomp$inline_1620++ ) { - var eventName$jscomp$inline_1626 = - simpleEventPluginEvents[i$jscomp$inline_1625], - domEventName$jscomp$inline_1627 = - eventName$jscomp$inline_1626.toLowerCase(), - capitalizedEvent$jscomp$inline_1628 = - eventName$jscomp$inline_1626[0].toUpperCase() + - eventName$jscomp$inline_1626.slice(1); + var eventName$jscomp$inline_1621 = + simpleEventPluginEvents[i$jscomp$inline_1620], + domEventName$jscomp$inline_1622 = + eventName$jscomp$inline_1621.toLowerCase(), + capitalizedEvent$jscomp$inline_1623 = + eventName$jscomp$inline_1621[0].toUpperCase() + + eventName$jscomp$inline_1621.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1627, - "on" + capitalizedEvent$jscomp$inline_1628 + domEventName$jscomp$inline_1622, + "on" + capitalizedEvent$jscomp$inline_1623 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16953,17 +16904,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1832 = { +var devToolsConfig$jscomp$inline_1827 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-87e6ab39", + version: "18.3.0-www-classic-6d8264f8", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2199 = { - bundleType: devToolsConfig$jscomp$inline_1832.bundleType, - version: devToolsConfig$jscomp$inline_1832.version, - rendererPackageName: devToolsConfig$jscomp$inline_1832.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1832.rendererConfig, +var internals$jscomp$inline_2191 = { + bundleType: devToolsConfig$jscomp$inline_1827.bundleType, + version: devToolsConfig$jscomp$inline_1827.version, + rendererPackageName: devToolsConfig$jscomp$inline_1827.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1827.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16979,26 +16930,26 @@ var internals$jscomp$inline_2199 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1832.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1827.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-87e6ab39" + reconcilerVersion: "18.3.0-www-classic-6d8264f8" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2200 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2192 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2200.isDisabled && - hook$jscomp$inline_2200.supportsFiber + !hook$jscomp$inline_2192.isDisabled && + hook$jscomp$inline_2192.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2200.inject( - internals$jscomp$inline_2199 + (rendererID = hook$jscomp$inline_2192.inject( + internals$jscomp$inline_2191 )), - (injectedHook = hook$jscomp$inline_2200); + (injectedHook = hook$jscomp$inline_2192); } catch (err) {} } assign(Internals, { @@ -17365,4 +17316,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-87e6ab39"; +exports.version = "18.3.0-www-classic-6d8264f8"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 64f2b087422e9..30caf877be0ad 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -358,6 +358,11 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } +function markRootUpdated(root, updateLane) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); +} function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -1915,7 +1920,12 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + Error(formatProdErrorMessage(185))) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3100,21 +3110,10 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { var workInProgressRoot$jscomp$0 = workInProgressRoot, workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes, - nestedUpdatePasses = 0, errors = null; isFlushingWork = !0; do { var didPerformSomeWork = !1; - if (60 < ++nestedUpdatePasses) { - for (onlyLegacy = firstScheduledRoot; null !== onlyLegacy; ) - (workInProgressRoot$jscomp$0 = onlyLegacy.next), - (onlyLegacy.next = null), - (onlyLegacy = workInProgressRoot$jscomp$0); - firstScheduledRoot = lastScheduledRoot = null; - onlyLegacy = Error(formatProdErrorMessage(185)); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root$44 = firstScheduledRoot; null !== root$44; ) { if ( (!onlyLegacy || 0 === root$44.tag) && @@ -3165,8 +3164,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root); @@ -9878,8 +9876,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -10115,7 +10111,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -10127,7 +10122,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -10176,7 +10170,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { if ( @@ -10187,18 +10180,12 @@ function commitRootWhenReady( null !== finishedWork) ) { root.cancelPendingCommit = finishedWork( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -10234,15 +10221,6 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } -function markRootUpdated(root, updatedLanes) { - root.pendingLanes |= updatedLanes; - 536870912 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); -} function markRootSuspended(root, suspendedLanes) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -10331,7 +10309,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -10822,12 +10799,7 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$1.transition; try { @@ -10837,7 +10809,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -10850,7 +10821,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -10868,7 +10838,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -10942,8 +10911,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -11103,10 +11070,6 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; - executionContext & 2 - ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) - : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); - throwIfInfiniteUpdateLoopDetected(); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -11152,18 +11115,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) - throw ( - ((nestedUpdateCount = 0), - (rootWithNestedUpdates = null), - executionContext & 2 && - null !== workInProgressRoot && - (workInProgressRoot.errorRecoveryDisabledLanes |= - workInProgressRootRenderLanes), - Error(formatProdErrorMessage(185))) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -13261,14 +13212,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$370; if (canUseDOM) { - var isSupported$jscomp$inline_1583 = "oninput" in document; - if (!isSupported$jscomp$inline_1583) { - var element$jscomp$inline_1584 = document.createElement("div"); - element$jscomp$inline_1584.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1583 = - "function" === typeof element$jscomp$inline_1584.oninput; + var isSupported$jscomp$inline_1578 = "oninput" in document; + if (!isSupported$jscomp$inline_1578) { + var element$jscomp$inline_1579 = document.createElement("div"); + element$jscomp$inline_1579.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1578 = + "function" === typeof element$jscomp$inline_1579.oninput; } - JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1583; + JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1578; } else JSCompiler_inline_result$jscomp$370 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$370 && @@ -13580,20 +13531,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1624 = 0; - i$jscomp$inline_1624 < simpleEventPluginEvents.length; - i$jscomp$inline_1624++ + var i$jscomp$inline_1619 = 0; + i$jscomp$inline_1619 < simpleEventPluginEvents.length; + i$jscomp$inline_1619++ ) { - var eventName$jscomp$inline_1625 = - simpleEventPluginEvents[i$jscomp$inline_1624], - domEventName$jscomp$inline_1626 = - eventName$jscomp$inline_1625.toLowerCase(), - capitalizedEvent$jscomp$inline_1627 = - eventName$jscomp$inline_1625[0].toUpperCase() + - eventName$jscomp$inline_1625.slice(1); + var eventName$jscomp$inline_1620 = + simpleEventPluginEvents[i$jscomp$inline_1619], + domEventName$jscomp$inline_1621 = + eventName$jscomp$inline_1620.toLowerCase(), + capitalizedEvent$jscomp$inline_1622 = + eventName$jscomp$inline_1620[0].toUpperCase() + + eventName$jscomp$inline_1620.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1626, - "on" + capitalizedEvent$jscomp$inline_1627 + domEventName$jscomp$inline_1621, + "on" + capitalizedEvent$jscomp$inline_1622 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16538,17 +16489,17 @@ Internals.Events = [ restoreStateIfNeeded, batchedUpdates$1 ]; -var devToolsConfig$jscomp$inline_1791 = { +var devToolsConfig$jscomp$inline_1786 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-f95d3ddd", + version: "18.3.0-www-modern-fec65964", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2163 = { - bundleType: devToolsConfig$jscomp$inline_1791.bundleType, - version: devToolsConfig$jscomp$inline_1791.version, - rendererPackageName: devToolsConfig$jscomp$inline_1791.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1791.rendererConfig, +var internals$jscomp$inline_2155 = { + bundleType: devToolsConfig$jscomp$inline_1786.bundleType, + version: devToolsConfig$jscomp$inline_1786.version, + rendererPackageName: devToolsConfig$jscomp$inline_1786.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1786.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16565,26 +16516,26 @@ var internals$jscomp$inline_2163 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1791.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1786.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-f95d3ddd" + reconcilerVersion: "18.3.0-www-modern-fec65964" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2164 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2156 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2164.isDisabled && - hook$jscomp$inline_2164.supportsFiber + !hook$jscomp$inline_2156.isDisabled && + hook$jscomp$inline_2156.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2164.inject( - internals$jscomp$inline_2163 + (rendererID = hook$jscomp$inline_2156.inject( + internals$jscomp$inline_2155 )), - (injectedHook = hook$jscomp$inline_2164); + (injectedHook = hook$jscomp$inline_2156); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; @@ -16879,4 +16830,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-f95d3ddd"; +exports.version = "18.3.0-www-modern-fec65964"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 10d2a5ecdc094..107358a273faa 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -1686,7 +1686,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -1719,7 +1719,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -6300,21 +6300,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -6343,49 +6328,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -20355,13 +20302,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -20843,8 +20784,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if (includesOnlyRetries(lanes) && alwaysThrottleRetries) { @@ -20874,7 +20814,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -20888,7 +20827,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -20899,7 +20837,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -20923,20 +20860,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -20999,49 +20930,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -21112,8 +21012,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -21254,7 +21153,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -22169,12 +22067,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -22187,7 +22080,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -22202,7 +22094,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -22258,9 +22149,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -22441,18 +22330,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -22890,18 +22768,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -24392,7 +24258,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-f7e77e44"; +var ReactVersion = "18.3.0-www-classic-6b2ddccd"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index c4a0020658ffd..955991edec9df 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -1686,7 +1686,7 @@ function createLaneMap(initial) { return laneMap; } -function markRootUpdated$1(root, updateLane) { +function markRootUpdated(root, updateLane) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. @@ -1719,7 +1719,7 @@ function markRootSuspended$1(root, suspendedLanes) { lanes &= ~lane; } } -function markRootPinged$1(root, pingedLanes) { +function markRootPinged(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { @@ -6300,21 +6300,6 @@ function ensureRootIsScheduled(root) { ReactCurrentActQueue$2.didScheduleLegacyUpdate = true; } } - -function unscheduleAllRoots() { - // This is only done in a fatal error situation, as a last resort to prevent - // an infinite render loop. - var root = firstScheduledRoot; - - while (root !== null) { - var next = root.next; - root.next = null; - root = next; - } - - firstScheduledRoot = lastScheduledRoot = null; -} - function flushSyncWorkOnAllRoots() { // This is allowed to be called synchronously, but the caller should check // the execution context first. @@ -6343,49 +6328,11 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var workInProgressRootRenderLanes = getWorkInProgressRootRenderLanes(); // There may or may not be synchronous work scheduled. Let's check. var didPerformSomeWork; - var nestedUpdatePasses = 0; var errors = null; isFlushingWork = true; do { - didPerformSomeWork = false; // This outer loop re-runs if performing sync work on a root spawns - // additional sync work. If it happens too many times, it's very likely - // caused by some sort of infinite update loop. We already have a loop guard - // in place that will trigger an error on the n+1th update, but it's - // possible for that error to get swallowed if the setState is called from - // an unexpected place, like during the render phase. So as an added - // precaution, we also use a guard here. - // - // Ideally, there should be no known way to trigger this synchronous loop. - // It's really just here as a safety net. - // - // This limit is slightly larger than the one that throws inside setState, - // because that one is preferable because it includes a componens stack. - - if (++nestedUpdatePasses > 60) { - // This is a fatal error, so we'll unschedule all the roots. - unscheduleAllRoots(); // TODO: Change this error message to something different to distinguish - // it from the one that is thrown from setState. Those are less fatal - // because they usually will result in the bad component being unmounted, - // and an error boundary being triggered, rather than us having to - // forcibly stop the entire scheduler. - - var infiniteUpdateError = new Error( - "Maximum update depth exceeded. This can happen when a component " + - "repeatedly calls setState inside componentWillUpdate or " + - "componentDidUpdate. React limits the number of nested updates to " + - "prevent infinite loops." - ); - - if (errors === null) { - errors = [infiniteUpdateError]; - } else { - errors.push(infiniteUpdateError); - } - - break; - } - + didPerformSomeWork = false; var root = firstScheduledRoot; while (root !== null) { @@ -20355,13 +20302,7 @@ var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during th var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. -var workInProgressRootRecoverableErrors = null; // Tracks when an update occurs during the render phase. - -var workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Thacks when an update occurs during the commit phase. It's a separate -// variable from the one for renders because the commit phase may run -// concurrently to a render phase. - -var didIncludeCommitPhaseUpdate = false; // The most recent time we either committed a fallback, or when a fallback was +var workInProgressRootRecoverableErrors = null; // The most recent time we either committed a fallback, or when a fallback was // filled in with the resolved UI. This lets us throttle the appearance of new // content as it streams in, to minimize jank. // TODO: Think of a better name for this variable? @@ -20843,8 +20784,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if (includesOnlyRetries(lanes) && alwaysThrottleRetries) { @@ -20874,7 +20814,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -20888,7 +20827,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -20899,7 +20837,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -20923,20 +20860,14 @@ function commitRootWhenReady( // us that it's ready. This will be canceled if we start work on the // root again. root.cancelPendingCommit = schedulePendingCommit( - commitRoot.bind( - null, - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate - ) + commitRoot.bind(null, root, recoverableErrors, transitions) ); markRootSuspended(root, lanes); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate); + commitRoot(root, recoverableErrors, transitions); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -20999,49 +20930,18 @@ function isRenderConsistentWithExternalStores(finishedWork) { // eslint-disable-next-line no-unreachable return true; -} // The extra indirections around markRootUpdated and markRootSuspended is -// needed to avoid a circular dependency between this module and -// ReactFiberLane. There's probably a better way to split up these modules and -// avoid this problem. Perhaps all the root-marking functions should move into -// the work loop. - -function markRootUpdated(root, updatedLanes) { - markRootUpdated$1(root, updatedLanes); // Check for recursive updates - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); -} - -function markRootPinged(root, pingedLanes) { - markRootPinged$1(root, pingedLanes); // Check for recursive pings. Pings are conceptually different from updates in - // other contexts but we call it an "update" in this context because - // repeatedly pinging a suspended render can cause a recursive render loop. - // The relevant property is that it can result in a new render attempt - // being scheduled. - - if (executionContext & RenderContext) { - workInProgressRootDidIncludeRecursiveRenderUpdate = true; - } else if (executionContext & CommitContext) { - didIncludeCommitPhaseUpdate = true; - } - - throwIfInfiniteUpdateLoopDetected(); } function markRootSuspended(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. + // TODO: Lol maybe there's a better way to factor this besides this + // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes( suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); - markRootSuspended$1(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -21112,8 +21012,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -21254,7 +21153,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -22169,12 +22067,7 @@ function unwindUnitOfWork(unitOfWork) { workInProgress = null; } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate -) { +function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -22187,7 +22080,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -22202,7 +22094,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -22258,9 +22149,7 @@ function commitRootImpl( var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes); // Reset this before firing side effects so we can detect recursive updates. - - didIncludeCommitPhaseUpdate = false; + markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -22441,18 +22330,7 @@ function commitRootImpl( remainingLanes = root.pendingLanes; - if ( - // Check if there was a recursive update spawned by this render, in either - // the render phase or the commit phase. We track these explicitly because - // we can't infer from the remaining lanes alone. - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || // As an additional precaution, we also check if there's any remaining sync - // work. Theoretically this should be unreachable but if there's a mistake - // in React it helps to be overly defensive given how hard it is to debug - // those scenarios otherwise. This won't catch recursive async updates, - // though, which is why we check the flags above first. - includesSyncLane(remainingLanes) - ) { + if (includesSyncLane(remainingLanes)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without @@ -22890,18 +22768,6 @@ function throwIfInfiniteUpdateLoopDetected() { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; - - if (executionContext & RenderContext && workInProgressRoot !== null) { - // We're in the render phase. Disable the concurrent error recovery - // mechanism to ensure that the error we're about to throw gets handled. - // We need it to trigger the nearest error boundary so that the infinite - // update loop is broken. - workInProgressRoot.errorRecoveryDisabledLanes = mergeLanes( - workInProgressRoot.errorRecoveryDisabledLanes, - workInProgressRootRenderLanes - ); - } - throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -24392,7 +24258,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-0b35a427"; +var ReactVersion = "18.3.0-www-modern-e397df4a"; // Might add PROFILE later.