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 2530a14c6bedc..8467cd138f361 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 @@ -25735,7 +25735,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-canary-fb10a2c66-20240228"; + var ReactVersion = "18.3.0-canary-b8da12e8f-20240229"; // 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 b34e0fc565f18..5e407b1d942b9 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 @@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1014 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-fb10a2c66-20240228", + version: "18.3.0-canary-b8da12e8f-20240229", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1195 = { @@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1195 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-fb10a2c66-20240228" + reconcilerVersion: "18.3.0-canary-b8da12e8f-20240229" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 db11639d62cb8..12fac4fc4ba71 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 @@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1056 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-fb10a2c66-20240228", + version: "18.3.0-canary-b8da12e8f-20240229", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1236 = { @@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1236 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-fb10a2c66-20240228" + reconcilerVersion: "18.3.0-canary-b8da12e8f-20240229" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 534069a8204c8..dde60aebe237e 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 @@ -26,7 +26,7 @@ if (__DEV__) { } var dynamicFlags = require("ReactNativeInternalFeatureFlags"); - var ReactVersion = "18.3.0-canary-fb10a2c66-20240228"; + var ReactVersion = "18.3.0-canary-b8da12e8f-20240229"; // 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 c315259d37002..6901e5bfa509a 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 @@ -598,4 +598,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-fb10a2c66-20240228"; +exports.version = "18.3.0-canary-b8da12e8f-20240229"; 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 ccefa89f91205..c5dd1ae19cd71 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 @@ -594,7 +594,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-fb10a2c66-20240228"; +exports.version = "18.3.0-canary-b8da12e8f-20240229"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && 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 4d6be0b5f52d1..a7a380ea1e4ca 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 @@ -fb10a2c66a923d218471b535fdaf0dbc530417ee +b8da12e8f8e6a6b087f6531c1c791ab41e5273d4 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 e1523c3ddab96..0b3a7c9ce57d5 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"; @@ -3238,7 +3238,9 @@ to return true:wantsResponderID| | dynamicFlags.passChildrenWhenCloningPersistedNodes, useMicrotasksForSchedulingInFabric = dynamicFlags.useMicrotasksForSchedulingInFabric, - enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane; // The rest of the flags are static for better dead code elimination. + enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection; // The rest of the flags are static for better dead code elimination. var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; @@ -23748,6 +23750,10 @@ to return true:wantsResponderID| | 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 // 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? @@ -24439,10 +24445,36 @@ to return true:wantsResponderID| | function markRootUpdated(root, updatedLanes) { markRootUpdated$1(root, updatedLanes); + + if (enableInfiniteRenderLoopDetection) { + // Check for recursive updates + if (executionContext & RenderContext) { + workInProgressRootDidIncludeRecursiveRenderUpdate = true; + } else if (executionContext & CommitContext) { + didIncludeCommitPhaseUpdate = true; + } + + throwIfInfiniteUpdateLoopDetected(); + } } function markRootPinged(root, pingedLanes) { markRootPinged$1(root, pingedLanes); + + if (enableInfiniteRenderLoopDetection) { + // 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, spawnedLane) { @@ -25796,6 +25828,8 @@ to return true:wantsResponderID| | remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); markRootFinished(root, remainingLanes, spawnedLane); // Reset this before firing side effects so we can detect recursive updates. + didIncludeCommitPhaseUpdate = false; + if (root === workInProgressRoot) { // We can reset these now that they are finished. workInProgressRoot = null; @@ -25987,9 +26021,10 @@ to return true:wantsResponderID| | // 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. - // Was the finished render the result of an update (not hydration)? - includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? - includesSomeLane(remainingLanes, SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || // Was the finished render the result of an update (not hydration)? + (includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? + includesSomeLane(remainingLanes, SyncUpdateLanes)) ) { { markNestedUpdateScheduled(); @@ -26422,6 +26457,19 @@ to return true:wantsResponderID| | rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; + if (enableInfiniteRenderLoopDetection) { + 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 " + @@ -28042,7 +28090,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-26c89f2f"; + var ReactVersion = "18.3.0-canary-b1191c0d"; 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 5c1231dd0e284..b1319a41d3e59 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<> + * @generated SignedSource<> */ "use strict"; @@ -1319,6 +1319,8 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, useMicrotasksForSchedulingInFabric = dynamicFlags.useMicrotasksForSchedulingInFabric, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, @@ -1499,11 +1501,6 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated$1(root, updateLane) { - root.pendingLanes |= updateLane; - 268435456 !== updateLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); -} function markRootFinished(root, remainingLanes, spawnedLane) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -2117,14 +2114,7 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { - 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." - )) - ); + throwIfInfiniteUpdateLoopDetected(); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -7775,6 +7765,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7835,7 +7826,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated$1(root, lane); + markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8061,6 +8052,16 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -8517,35 +8518,35 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - didIncludeRenderPhaseUpdate = root.finishedWork; + var finishedWork = root.finishedWork; transitions = root.finishedLanes; - if (null === didIncludeRenderPhaseUpdate) return null; + if (null === finishedWork) return null; root.finishedWork = null; root.finishedLanes = 0; - if (didIncludeRenderPhaseUpdate === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = - didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && - 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); - if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -8553,35 +8554,30 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); - commitMutationEffectsOnFiber(didIncludeRenderPhaseUpdate, root); - root.current = didIncludeRenderPhaseUpdate; - commitLayoutEffectOnFiber( - root, - didIncludeRenderPhaseUpdate.alternate, - didIncludeRenderPhaseUpdate - ); + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else root.current = didIncludeRenderPhaseUpdate; + } else root.current = finishedWork; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - didIncludeRenderPhaseUpdate = 0; - didIncludeRenderPhaseUpdate < recoverableErrors.length; - didIncludeRenderPhaseUpdate++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), + (spawnedLane = recoverableErrors[finishedWork]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -8598,7 +8594,9 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -8650,7 +8648,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -8685,7 +8683,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated$1(nearestMountedAncestor, 2), + (markRootUpdated(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -8713,6 +8711,11 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -8729,7 +8732,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), + (markRootUpdated(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -8760,6 +8763,21 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + 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) @@ -9684,10 +9702,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1069 = { + devToolsConfig$jscomp$inline_1059 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-def5fb42", + version: "18.3.0-canary-2f67afac", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9703,11 +9721,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1294 = { - bundleType: devToolsConfig$jscomp$inline_1069.bundleType, - version: devToolsConfig$jscomp$inline_1069.version, - rendererPackageName: devToolsConfig$jscomp$inline_1069.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1069.rendererConfig, +var internals$jscomp$inline_1284 = { + bundleType: devToolsConfig$jscomp$inline_1059.bundleType, + version: devToolsConfig$jscomp$inline_1059.version, + rendererPackageName: devToolsConfig$jscomp$inline_1059.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1059.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9723,26 +9741,26 @@ var internals$jscomp$inline_1294 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1069.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1059.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-def5fb42" + reconcilerVersion: "18.3.0-canary-2f67afac" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1295 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1285 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1295.isDisabled && - hook$jscomp$inline_1295.supportsFiber + !hook$jscomp$inline_1285.isDisabled && + hook$jscomp$inline_1285.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1295.inject( - internals$jscomp$inline_1294 + (rendererID = hook$jscomp$inline_1285.inject( + internals$jscomp$inline_1284 )), - (injectedHook = hook$jscomp$inline_1295); + (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 00fc05c28215e..a8729441c2665 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<<0350e17049e5f4e18145e2eb8636ec13>> + * @generated SignedSource<<225029855a5d7573ff10fa1f1445bcaf>> */ "use strict"; @@ -1323,6 +1323,8 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, useMicrotasksForSchedulingInFabric = dynamicFlags.useMicrotasksForSchedulingInFabric, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, @@ -1591,11 +1593,6 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated$1(root, updateLane) { - root.pendingLanes |= updateLane; - 268435456 !== updateLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); -} function markRootFinished(root, remainingLanes, spawnedLane) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -2239,14 +2236,7 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { - 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." - )) - ); + throwIfInfiniteUpdateLoopDetected(); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -8298,6 +8288,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8359,7 +8350,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated$1(root, lane); + markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), root === workInProgressRoot && @@ -8587,6 +8578,16 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -9118,38 +9119,38 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - didIncludeRenderPhaseUpdate = root.finishedWork; + var finishedWork = root.finishedWork; transitions = root.finishedLanes; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(transitions); - if (null === didIncludeRenderPhaseUpdate) return markCommitStopped(), null; + if (null === finishedWork) return markCommitStopped(), null; root.finishedWork = null; root.finishedLanes = 0; - if (didIncludeRenderPhaseUpdate === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = - didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && - 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); - if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -9157,14 +9158,14 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); + commitBeforeMutationEffects(root, finishedWork); commitTime = now(); - commitMutationEffects(root, didIncludeRenderPhaseUpdate, transitions); - root.current = didIncludeRenderPhaseUpdate; + commitMutationEffects(root, finishedWork, transitions); + root.current = finishedWork; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(transitions); - commitLayoutEffects(didIncludeRenderPhaseUpdate, root, transitions); + commitLayoutEffects(finishedWork, root, transitions); null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(); @@ -9172,24 +9173,23 @@ function commitRootImpl( executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else (root.current = didIncludeRenderPhaseUpdate), (commitTime = now()); + } else (root.current = finishedWork), (commitTime = now()); rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - didIncludeRenderPhaseUpdate = 0; - didIncludeRenderPhaseUpdate < recoverableErrors.length; - didIncludeRenderPhaseUpdate++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), + (spawnedLane = recoverableErrors[finishedWork]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -9206,7 +9206,9 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -9314,7 +9316,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -9349,7 +9351,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated$1(nearestMountedAncestor, 2), + (markRootUpdated(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -9378,6 +9380,11 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -9394,7 +9401,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), + (markRootUpdated(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9425,6 +9432,21 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + 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) @@ -10382,10 +10404,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1147 = { + devToolsConfig$jscomp$inline_1137 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-ffa714ed", + version: "18.3.0-canary-22c30fbb", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10415,10 +10437,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1147.bundleType, - version: devToolsConfig$jscomp$inline_1147.version, - rendererPackageName: devToolsConfig$jscomp$inline_1147.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1147.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1137.bundleType, + version: devToolsConfig$jscomp$inline_1137.version, + rendererPackageName: devToolsConfig$jscomp$inline_1137.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1137.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10434,14 +10456,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1147.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1137.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-ffa714ed" + reconcilerVersion: "18.3.0-canary-22c30fbb" }); 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 5a394af284000..b6e48491e22e5 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<<5909dc5990a62864ce33afd4b7d168b4>> + * @generated SignedSource<> */ "use strict"; @@ -2945,7 +2945,9 @@ to return true:wantsResponderID| | enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask, enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning, - enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane; // The rest of the flags are static for better dead code elimination. + enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection; // The rest of the flags are static for better dead code elimination. var enableSchedulingProfiler = true; var enableProfilerTimer = true; var enableProfilerCommitHooks = true; @@ -24188,6 +24190,10 @@ to return true:wantsResponderID| | 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 // 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? @@ -24879,10 +24885,36 @@ to return true:wantsResponderID| | function markRootUpdated(root, updatedLanes) { markRootUpdated$1(root, updatedLanes); + + if (enableInfiniteRenderLoopDetection) { + // Check for recursive updates + if (executionContext & RenderContext) { + workInProgressRootDidIncludeRecursiveRenderUpdate = true; + } else if (executionContext & CommitContext) { + didIncludeCommitPhaseUpdate = true; + } + + throwIfInfiniteUpdateLoopDetected(); + } } function markRootPinged(root, pingedLanes) { markRootPinged$1(root, pingedLanes); + + if (enableInfiniteRenderLoopDetection) { + // 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, spawnedLane) { @@ -26236,6 +26268,8 @@ to return true:wantsResponderID| | remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); markRootFinished(root, remainingLanes, spawnedLane); // Reset this before firing side effects so we can detect recursive updates. + didIncludeCommitPhaseUpdate = false; + if (root === workInProgressRoot) { // We can reset these now that they are finished. workInProgressRoot = null; @@ -26427,9 +26461,10 @@ to return true:wantsResponderID| | // 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. - // Was the finished render the result of an update (not hydration)? - includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? - includesSomeLane(remainingLanes, SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || // Was the finished render the result of an update (not hydration)? + (includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? + includesSomeLane(remainingLanes, SyncUpdateLanes)) ) { { markNestedUpdateScheduled(); @@ -26862,6 +26897,19 @@ to return true:wantsResponderID| | rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; + if (enableInfiniteRenderLoopDetection) { + 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 " + @@ -28482,7 +28530,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-d516a389"; + var ReactVersion = "18.3.0-canary-58d268df"; 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 bd45d214c83ad..b7262563777c8 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<<812a9e09e3ae33fdba69074b3c4a6016>> + * @generated SignedSource<> */ "use strict"; @@ -1160,6 +1160,8 @@ var ReactSharedInternals = dynamicFlags.enableDeferRootSchedulingToMicrotask, enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection, REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -1871,11 +1873,6 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated$1(root, updateLane) { - root.pendingLanes |= updateLane; - 268435456 !== updateLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); -} function markRootFinished(root, remainingLanes, spawnedLane) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -2189,14 +2186,7 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { - 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." - )) - ); + throwIfInfiniteUpdateLoopDetected(); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -7999,6 +7989,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8046,7 +8037,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated$1(root, lane); + markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8272,6 +8263,16 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -8728,35 +8729,35 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - didIncludeRenderPhaseUpdate = root.finishedWork; + var finishedWork = root.finishedWork; transitions = root.finishedLanes; - if (null === didIncludeRenderPhaseUpdate) return null; + if (null === finishedWork) return null; root.finishedWork = null; root.finishedLanes = 0; - if (didIncludeRenderPhaseUpdate === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = - didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && - 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); - if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -8764,35 +8765,30 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); - commitMutationEffectsOnFiber(didIncludeRenderPhaseUpdate, root); - root.current = didIncludeRenderPhaseUpdate; - commitLayoutEffectOnFiber( - root, - didIncludeRenderPhaseUpdate.alternate, - didIncludeRenderPhaseUpdate - ); + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else root.current = didIncludeRenderPhaseUpdate; + } else root.current = finishedWork; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - didIncludeRenderPhaseUpdate = 0; - didIncludeRenderPhaseUpdate < recoverableErrors.length; - didIncludeRenderPhaseUpdate++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), + (spawnedLane = recoverableErrors[finishedWork]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -8809,7 +8805,9 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -8861,7 +8859,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -8896,7 +8894,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated$1(nearestMountedAncestor, 2), + (markRootUpdated(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -8924,6 +8922,11 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -8940,7 +8943,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), + (markRootUpdated(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -8971,6 +8974,21 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + 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) @@ -9902,10 +9920,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1138 = { + devToolsConfig$jscomp$inline_1128 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-62437c9b", + version: "18.3.0-canary-bdd9cd5c", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9921,11 +9939,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1377 = { - bundleType: devToolsConfig$jscomp$inline_1138.bundleType, - version: devToolsConfig$jscomp$inline_1138.version, - rendererPackageName: devToolsConfig$jscomp$inline_1138.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1138.rendererConfig, +var internals$jscomp$inline_1367 = { + bundleType: devToolsConfig$jscomp$inline_1128.bundleType, + version: devToolsConfig$jscomp$inline_1128.version, + rendererPackageName: devToolsConfig$jscomp$inline_1128.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1128.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9941,26 +9959,26 @@ var internals$jscomp$inline_1377 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1138.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1128.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-62437c9b" + reconcilerVersion: "18.3.0-canary-bdd9cd5c" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1378 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1368 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1378.isDisabled && - hook$jscomp$inline_1378.supportsFiber + !hook$jscomp$inline_1368.isDisabled && + hook$jscomp$inline_1368.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1378.inject( - internals$jscomp$inline_1377 + (rendererID = hook$jscomp$inline_1368.inject( + internals$jscomp$inline_1367 )), - (injectedHook = hook$jscomp$inline_1378); + (injectedHook = hook$jscomp$inline_1368); } 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 fba7762465d2b..256a22c40fd22 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<<507d660f60907c9b0d0c5b895716660f>> + * @generated SignedSource<> */ "use strict"; @@ -1164,6 +1164,8 @@ var ReactSharedInternals = dynamicFlags.enableDeferRootSchedulingToMicrotask, enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, + enableInfiniteRenderLoopDetection = + dynamicFlags.enableInfiniteRenderLoopDetection, REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), @@ -1963,11 +1965,6 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated$1(root, updateLane) { - root.pendingLanes |= updateLane; - 268435456 !== updateLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); -} function markRootFinished(root, remainingLanes, spawnedLane) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; @@ -2311,14 +2308,7 @@ function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { - 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." - )) - ); + throwIfInfiniteUpdateLoopDetected(); for (var parent = sourceFiber.return; null !== parent; ) (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; @@ -8522,6 +8512,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, + didIncludeCommitPhaseUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8570,7 +8561,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated$1(root, lane); + markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), root === workInProgressRoot && @@ -8798,6 +8789,16 @@ function isRenderConsistentWithExternalStores(finishedWork) { } return !0; } +function markRootUpdated(root, updatedLanes) { + root.pendingLanes |= updatedLanes; + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); +} function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; @@ -9329,38 +9330,38 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - didIncludeRenderPhaseUpdate = root.finishedWork; + var finishedWork = root.finishedWork; transitions = root.finishedLanes; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(transitions); - if (null === didIncludeRenderPhaseUpdate) return markCommitStopped(), null; + if (null === finishedWork) return markCommitStopped(), null; root.finishedWork = null; root.finishedLanes = 0; - if (didIncludeRenderPhaseUpdate === root.current) + if (finishedWork === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = - didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); + didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && - 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || + (0 === (finishedWork.subtreeFlags & 10256) && + 0 === (finishedWork.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); - if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -9368,14 +9369,14 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); + commitBeforeMutationEffects(root, finishedWork); commitTime = now(); - commitMutationEffects(root, didIncludeRenderPhaseUpdate, transitions); - root.current = didIncludeRenderPhaseUpdate; + commitMutationEffects(root, finishedWork, transitions); + root.current = finishedWork; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(transitions); - commitLayoutEffects(didIncludeRenderPhaseUpdate, root, transitions); + commitLayoutEffects(finishedWork, root, transitions); null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(); @@ -9383,24 +9384,23 @@ function commitRootImpl( executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else (root.current = didIncludeRenderPhaseUpdate), (commitTime = now()); + } else (root.current = finishedWork), (commitTime = now()); rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, - didIncludeRenderPhaseUpdate = 0; - didIncludeRenderPhaseUpdate < recoverableErrors.length; - didIncludeRenderPhaseUpdate++ + renderPriorityLevel = root.onRecoverableError, finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ ) - (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), + (spawnedLane = recoverableErrors[finishedWork]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -9417,7 +9417,9 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes) + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -9525,7 +9527,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -9560,7 +9562,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated$1(nearestMountedAncestor, 2), + (markRootUpdated(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -9589,6 +9591,11 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + enableInfiniteRenderLoopDetection && + (executionContext & 2 + ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) + : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0), + throwIfInfiniteUpdateLoopDetected()); workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || @@ -9605,7 +9612,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated$1(boundaryFiber, retryLane), + (markRootUpdated(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9636,6 +9643,21 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } +function throwIfInfiniteUpdateLoopDetected() { + if (50 < nestedUpdateCount) + throw ( + ((nestedUpdateCount = 0), + (rootWithNestedUpdates = null), + enableInfiniteRenderLoopDetection && + 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) @@ -10600,10 +10622,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1216 = { + devToolsConfig$jscomp$inline_1206 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-372089a1", + version: "18.3.0-canary-f7ec4633", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10633,10 +10655,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1216.bundleType, - version: devToolsConfig$jscomp$inline_1216.version, - rendererPackageName: devToolsConfig$jscomp$inline_1216.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1216.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1206.bundleType, + version: devToolsConfig$jscomp$inline_1206.version, + rendererPackageName: devToolsConfig$jscomp$inline_1206.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1206.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10652,14 +10674,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1216.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1206.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-372089a1" + reconcilerVersion: "18.3.0-canary-f7ec4633" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {