From b2dc5de01df3d4a3c71611cc733cde611854989f Mon Sep 17 00:00:00 2001 From: kassens Date: Fri, 30 Jun 2023 16:56:44 +0000 Subject: [PATCH] Revert "Fix: Detect infinite update loops caused by render phase updates (#26625)" (#27027) This reverts commit 822386f252fd1f0e949efa904a1ed790133329f7. This broke a number of tests when synced internally. We'll need to investigate the breakages before relanding this. DiffTrain build for commit https://github.com/facebook/react/commit/7f362de1588d98438787d652941533e21f2f332d. --- .../cjs/ReactTestRenderer-dev.js | 164 ++---------------- .../cjs/ReactTestRenderer-prod.js | 109 ++++-------- .../cjs/ReactTestRenderer-profiling.js | 109 ++++-------- .../RKJSModules/vendor/react/cjs/React-dev.js | 2 +- .../vendor/react/cjs/React-prod.js | 2 +- .../vendor/react/cjs/React-profiling.js | 2 +- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 164 ++---------------- .../implementations/ReactFabric-prod.fb.js | 109 ++++-------- .../ReactFabric-profiling.fb.js | 95 +++------- .../ReactNativeRenderer-dev.fb.js | 164 ++---------------- .../ReactNativeRenderer-prod.fb.js | 109 ++++-------- .../ReactNativeRenderer-profiling.fb.js | 95 +++------- 13 files changed, 227 insertions(+), 899 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index 9007f22a31b6b..d154ee0e5d059 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ 'use strict'; @@ -1584,7 +1584,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. @@ -1617,7 +1617,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) { @@ -6031,21 +6031,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. @@ -6074,49 +6059,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) { @@ -20018,13 +19965,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? @@ -20506,8 +20447,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if (includesOnlyRetries(lanes) && alwaysThrottleRetries) { @@ -20537,7 +20477,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -20551,7 +20490,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -20562,7 +20500,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -20586,20 +20523,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) { @@ -20662,49 +20593,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 @@ -20775,8 +20675,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -20917,7 +20816,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -21832,12 +21730,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(); @@ -21850,7 +21743,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -21865,7 +21757,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -21921,9 +21812,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. @@ -22104,18 +21993,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 @@ -22553,18 +22431,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 " + @@ -24037,7 +23903,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-canary-fc801116c-20230629"; +var ReactVersion = "18.3.0-canary-7f362de15-20230630"; // Might add PROFILE later. diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index 490760e8d2abd..f892d76a84783 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<6619e9e4c84d9d98c2974ba039dd316b>> + * @generated SignedSource<<205a70046761c0bf48d4a1e41c13f041>> */ "use strict"; @@ -466,6 +466,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; @@ -754,7 +759,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -1970,23 +1982,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -2038,8 +2037,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -6397,8 +6395,6 @@ var DefaultCacheDispatcher = { workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -6552,7 +6548,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { originallyAttemptedLanes, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), didTimeout @@ -6564,7 +6559,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { originallyAttemptedLanes, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -6614,11 +6608,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; ; ) { @@ -6654,15 +6647,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; @@ -6739,7 +6723,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -7227,12 +7210,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 { @@ -7242,7 +7220,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -7255,7 +7232,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -7277,7 +7253,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -7341,8 +7316,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -7477,10 +7450,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 || @@ -7528,20 +7497,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -8656,19 +8611,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1036 = { +var devToolsConfig$jscomp$inline_1031 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-fc801116c-20230629", + version: "18.3.0-canary-7f362de15-20230630", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1238 = { - bundleType: devToolsConfig$jscomp$inline_1036.bundleType, - version: devToolsConfig$jscomp$inline_1036.version, - rendererPackageName: devToolsConfig$jscomp$inline_1036.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1036.rendererConfig, +var internals$jscomp$inline_1230 = { + bundleType: devToolsConfig$jscomp$inline_1031.bundleType, + version: devToolsConfig$jscomp$inline_1031.version, + rendererPackageName: devToolsConfig$jscomp$inline_1031.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1031.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8685,26 +8640,26 @@ var internals$jscomp$inline_1238 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1036.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1031.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-fc801116c-20230629" + reconcilerVersion: "18.3.0-canary-7f362de15-20230630" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1239.isDisabled && - hook$jscomp$inline_1239.supportsFiber + !hook$jscomp$inline_1231.isDisabled && + hook$jscomp$inline_1231.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1239.inject( - internals$jscomp$inline_1238 + (rendererID = hook$jscomp$inline_1231.inject( + internals$jscomp$inline_1230 )), - (injectedHook = hook$jscomp$inline_1239); + (injectedHook = hook$jscomp$inline_1231); } catch (err) {} } exports._Scheduler = Scheduler; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 407d4b43c2e7e..c3a6cd69b45a4 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<7df15d761b4fe2b8499cc4f6c9df49c8>> + * @generated SignedSource<<2af92e66a4414f0a6220bd4dac0e6fac>> */ "use strict"; @@ -484,6 +484,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; @@ -772,7 +777,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -1988,23 +2000,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -2058,8 +2057,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -6735,8 +6733,6 @@ var DefaultCacheDispatcher = { workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -6892,7 +6888,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { originallyAttemptedLanes, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), didTimeout @@ -6904,7 +6899,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { originallyAttemptedLanes, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -6954,11 +6948,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; ; ) { @@ -6994,15 +6987,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; @@ -7079,7 +7063,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -7588,12 +7571,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 { @@ -7603,7 +7581,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -7616,7 +7593,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -7638,7 +7614,6 @@ function commitRootImpl( var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -7703,8 +7678,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates @@ -7885,10 +7858,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 || @@ -7936,20 +7905,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -9082,19 +9037,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1078 = { +var devToolsConfig$jscomp$inline_1073 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-fc801116c-20230629", + version: "18.3.0-canary-7f362de15-20230630", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1279 = { - bundleType: devToolsConfig$jscomp$inline_1078.bundleType, - version: devToolsConfig$jscomp$inline_1078.version, - rendererPackageName: devToolsConfig$jscomp$inline_1078.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1078.rendererConfig, +var internals$jscomp$inline_1271 = { + bundleType: devToolsConfig$jscomp$inline_1073.bundleType, + version: devToolsConfig$jscomp$inline_1073.version, + rendererPackageName: devToolsConfig$jscomp$inline_1073.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1073.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9111,26 +9066,26 @@ var internals$jscomp$inline_1279 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1078.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1073.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-fc801116c-20230629" + reconcilerVersion: "18.3.0-canary-7f362de15-20230630" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1280 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1272 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1280.isDisabled && - hook$jscomp$inline_1280.supportsFiber + !hook$jscomp$inline_1272.isDisabled && + hook$jscomp$inline_1272.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1280.inject( - internals$jscomp$inline_1279 + (rendererID = hook$jscomp$inline_1272.inject( + internals$jscomp$inline_1271 )), - (injectedHook = hook$jscomp$inline_1280); + (injectedHook = hook$jscomp$inline_1272); } catch (err) {} } exports._Scheduler = Scheduler; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js index 61833054885c6..9741536c7f15d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-canary-fc801116c-20230629"; +var ReactVersion = "18.3.0-canary-7f362de15-20230630"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js index 897a5fc406173..f16540cc431bf 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js @@ -623,4 +623,4 @@ exports.useSyncExternalStore = function ( ); }; exports.useTransition = useTransition; -exports.version = "18.3.0-canary-fc801116c-20230629"; +exports.version = "18.3.0-canary-7f362de15-20230630"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js index b597776eb8a5e..1df2ae52812bd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js @@ -626,7 +626,7 @@ exports.useSyncExternalStore = function ( ); }; exports.useTransition = useTransition; -exports.version = "18.3.0-canary-fc801116c-20230629"; +exports.version = "18.3.0-canary-7f362de15-20230630"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 9840002b0bece..5a3a96c57330a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -fc801116c80b68f7ebdaf66ac77d5f2dcd9e50eb +7f362de1588d98438787d652941533e21f2f332d diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index eb90fc5d27794..0ea0acd917c0e 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ 'use strict'; @@ -4492,7 +4492,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. @@ -4525,7 +4525,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) { @@ -9758,21 +9758,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. @@ -9801,49 +9786,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) { @@ -22846,13 +22793,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? @@ -23340,8 +23281,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -23374,7 +23314,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -23388,7 +23327,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -23399,7 +23337,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -23423,20 +23360,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) { @@ -23499,49 +23430,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 @@ -23612,8 +23512,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -23754,7 +23653,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -24733,12 +24631,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(); @@ -24751,7 +24644,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -24766,7 +24658,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -24830,9 +24721,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. @@ -25015,18 +24904,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 @@ -25451,18 +25329,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 " + @@ -27076,7 +26942,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-canary-6f8e14d0"; +var ReactVersion = "18.3.0-canary-8fa97b4d"; function createPortal$1( children, diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 9727d072fb435..8a8ee498fe3e3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<97ae2031302c8c4fcbdf9844a2c09003>> + * @generated SignedSource<> */ "use strict"; @@ -1509,6 +1509,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; @@ -2122,7 +2127,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3340,23 +3352,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -3408,8 +3407,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -7410,8 +7408,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7577,7 +7573,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -7589,7 +7584,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -7639,11 +7633,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; ; ) { @@ -7679,15 +7672,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; @@ -7741,7 +7725,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -8220,12 +8203,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 { @@ -8235,7 +8213,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -8248,7 +8225,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -8270,7 +8246,6 @@ function commitRootImpl( var remainingLanes = transitions.lanes | transitions.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -8331,8 +8306,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -8448,10 +8421,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 || @@ -8499,20 +8468,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -9465,10 +9420,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1047 = { + devToolsConfig$jscomp$inline_1042 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-4f194c97", + version: "18.3.0-canary-e7a561cd", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9484,11 +9439,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1292 = { - bundleType: devToolsConfig$jscomp$inline_1047.bundleType, - version: devToolsConfig$jscomp$inline_1047.version, - rendererPackageName: devToolsConfig$jscomp$inline_1047.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1047.rendererConfig, +var internals$jscomp$inline_1284 = { + bundleType: devToolsConfig$jscomp$inline_1042.bundleType, + version: devToolsConfig$jscomp$inline_1042.version, + rendererPackageName: devToolsConfig$jscomp$inline_1042.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1042.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9504,26 +9459,26 @@ var internals$jscomp$inline_1292 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1047.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1042.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-4f194c97" + reconcilerVersion: "18.3.0-canary-e7a561cd" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1293 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1285 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1293.isDisabled && - hook$jscomp$inline_1293.supportsFiber + !hook$jscomp$inline_1285.isDisabled && + hook$jscomp$inline_1285.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1293.inject( - internals$jscomp$inline_1292 + (rendererID = hook$jscomp$inline_1285.inject( + internals$jscomp$inline_1284 )), - (injectedHook = hook$jscomp$inline_1293); + (injectedHook = hook$jscomp$inline_1285); } catch (err) {} } exports.createPortal = function (children, containerTag) { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 02e39080a8247..e182d161e0b44 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<8b7b7e906b3a95d73c3194256ec30353>> */ @@ -1607,6 +1607,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; @@ -2250,7 +2255,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3468,23 +3480,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -3538,8 +3537,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -7938,8 +7936,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8108,7 +8104,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -8120,7 +8115,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -8170,11 +8164,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; ; ) { @@ -8210,15 +8203,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; @@ -8272,7 +8256,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -8827,12 +8810,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 { @@ -8842,7 +8820,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -8855,7 +8832,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -8880,7 +8856,6 @@ function commitRootImpl( var remainingLanes = transitions.lanes | transitions.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -8949,8 +8924,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates @@ -9123,10 +9096,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 || @@ -9174,20 +9143,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -10173,10 +10128,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1125 = { + devToolsConfig$jscomp$inline_1120 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-96743b2c", + version: "18.3.0-canary-c583a14d", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10206,10 +10161,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1125.bundleType, - version: devToolsConfig$jscomp$inline_1125.version, - rendererPackageName: devToolsConfig$jscomp$inline_1125.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1125.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1120.bundleType, + version: devToolsConfig$jscomp$inline_1120.version, + rendererPackageName: devToolsConfig$jscomp$inline_1120.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1120.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10225,14 +10180,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1125.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1120.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-96743b2c" + reconcilerVersion: "18.3.0-canary-c583a14d" }); exports.createPortal = function (children, containerTag) { return createPortal$1( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 9cbbbbdbd9714..052aaaa620af6 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<686cc6fecdbf96861f068a6453b25cf8>> + * @generated SignedSource<<4e59c498f8eb265d99f2ae58b112b171>> */ 'use strict'; @@ -5353,7 +5353,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. @@ -5386,7 +5386,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) { @@ -10075,21 +10075,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. @@ -10118,49 +10103,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) { @@ -23360,13 +23307,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? @@ -23854,8 +23795,7 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); } else { if ( @@ -23888,7 +23828,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), msUntilTimeout @@ -23902,7 +23841,6 @@ function finishConcurrentRender(root, exitStatus, finishedWork, lanes) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -23913,7 +23851,6 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, lanes ) { // TODO: Combine retry throttling with Suspensey commits. Right now they run @@ -23937,20 +23874,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) { @@ -24013,49 +23944,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 @@ -24126,8 +24026,7 @@ function performSyncWorkOnRoot(root) { commitRoot( root, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -24268,7 +24167,6 @@ function prepareFreshStack(root, lanes) { workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = false; finishQueueingConcurrentUpdates(); { @@ -25247,12 +25145,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(); @@ -25265,7 +25158,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -25280,7 +25172,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do { @@ -25344,9 +25235,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. @@ -25529,18 +25418,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 @@ -25965,18 +25843,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 " + @@ -27590,7 +27456,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-canary-197447e9"; +var ReactVersion = "18.3.0-canary-93e339dc"; function createPortal$1( children, diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index 25ed5460e61bd..8c218849ca0b8 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<61fc501bd9deba1069fab61c2cbd0d6e>> */ "use strict"; @@ -1891,6 +1891,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; @@ -2200,7 +2205,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3430,23 +3442,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -3498,8 +3497,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -7672,8 +7670,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7826,7 +7822,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -7838,7 +7833,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -7888,11 +7882,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; ; ) { @@ -7928,15 +7921,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; @@ -7990,7 +7974,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -8469,12 +8452,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 { @@ -8484,7 +8462,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -8497,7 +8474,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -8519,7 +8495,6 @@ function commitRootImpl( var remainingLanes = transitions.lanes | transitions.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -8580,8 +8555,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -8697,10 +8670,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 || @@ -8748,20 +8717,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -9721,10 +9676,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1102 = { + devToolsConfig$jscomp$inline_1097 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-3ff9eb73", + version: "18.3.0-canary-03bab863", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9740,11 +9695,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1361 = { - bundleType: devToolsConfig$jscomp$inline_1102.bundleType, - version: devToolsConfig$jscomp$inline_1102.version, - rendererPackageName: devToolsConfig$jscomp$inline_1102.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1102.rendererConfig, +var internals$jscomp$inline_1353 = { + bundleType: devToolsConfig$jscomp$inline_1097.bundleType, + version: devToolsConfig$jscomp$inline_1097.version, + rendererPackageName: devToolsConfig$jscomp$inline_1097.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1097.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9760,26 +9715,26 @@ var internals$jscomp$inline_1361 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1102.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1097.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-3ff9eb73" + reconcilerVersion: "18.3.0-canary-03bab863" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1362 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1354 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1362.isDisabled && - hook$jscomp$inline_1362.supportsFiber + !hook$jscomp$inline_1354.isDisabled && + hook$jscomp$inline_1354.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1362.inject( - internals$jscomp$inline_1361 + (rendererID = hook$jscomp$inline_1354.inject( + internals$jscomp$inline_1353 )), - (injectedHook = hook$jscomp$inline_1362); + (injectedHook = hook$jscomp$inline_1354); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index ec4a72cc94bd2..c542a3603cc7a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<35758cdaeff2792977f1364e737d847f>> */ @@ -1989,6 +1989,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; @@ -2328,7 +2333,14 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 1073741824)); } function getRootForUpdatedFiber(sourceFiber) { - throwIfInfiniteUpdateLoopDetected(); + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + 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." + )) + ); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -3558,23 +3570,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( - "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." - ); - null === errors ? (errors = [onlyLegacy]) : errors.push(onlyLegacy); - break; - } for (var root = firstScheduledRoot; null !== root; ) { if ( (!onlyLegacy || 0 === root.tag) && @@ -3628,8 +3627,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { commitRoot( root$jscomp$0, workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate + workInProgressTransitions )); } ensureRootIsScheduled(root$jscomp$0); @@ -8200,8 +8198,6 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootPingedLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, - workInProgressRootDidIncludeRecursiveRenderUpdate = !1, - didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8357,7 +8353,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ), exitStatus @@ -8369,7 +8364,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes ); } @@ -8419,11 +8413,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; ; ) { @@ -8459,15 +8452,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; @@ -8521,7 +8505,6 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; - workInProgressRootDidIncludeRecursiveRenderUpdate = !1; finishQueueingConcurrentUpdates(); return root; } @@ -9076,12 +9059,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 { @@ -9091,7 +9069,6 @@ function commitRoot( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, previousUpdateLanePriority ); } finally { @@ -9104,7 +9081,6 @@ function commitRootImpl( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate, renderPriorityLevel ) { do flushPassiveEffects(); @@ -9129,7 +9105,6 @@ function commitRootImpl( var remainingLanes = transitions.lanes | transitions.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes); - didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); @@ -9198,8 +9173,6 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - didIncludeCommitPhaseUpdate || - didIncludeRenderPhaseUpdate || 0 !== (remainingLanes & 3) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates @@ -9372,10 +9345,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 || @@ -9423,20 +9392,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( - "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." - )) - ); -} var beginWork; beginWork = function (current, workInProgress, renderLanes) { if (null !== current) @@ -10429,10 +10384,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1180 = { + devToolsConfig$jscomp$inline_1175 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-1aa5104d", + version: "18.3.0-canary-45030907", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10462,10 +10417,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1180.bundleType, - version: devToolsConfig$jscomp$inline_1180.version, - rendererPackageName: devToolsConfig$jscomp$inline_1180.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1180.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1175.bundleType, + version: devToolsConfig$jscomp$inline_1175.version, + rendererPackageName: devToolsConfig$jscomp$inline_1175.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1175.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10481,14 +10436,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1180.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1175.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-1aa5104d" + reconcilerVersion: "18.3.0-canary-45030907" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {