From 55213cc4a644b8727894ef6b52b3de8ee6106073 Mon Sep 17 00:00:00 2001 From: kassens Date: Fri, 9 Feb 2024 16:19:14 +0000 Subject: [PATCH] Add infinite update loop detection (#28279) This is a partial redo of https://github.com/facebook/react/pull/26625. Since that was unlanded due to some detected breakages. This now includes a feature flag to be careful in rolling this out. DiffTrain build for commit https://github.com/facebook/react/commit/d8c1fa6b0b8da0512cb5acab9cd4f242451392f3. --- .../cjs/ReactTestRenderer-dev.js | 67 +++++++++-- .../cjs/ReactTestRenderer-prod.js | 74 +++++++----- .../cjs/ReactTestRenderer-profiling.js | 74 +++++++----- .../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 | 67 +++++++++-- .../implementations/ReactFabric-prod.fb.js | 108 +++++++++++------- .../ReactFabric-profiling.fb.js | 90 +++++++++------ .../ReactNativeRenderer-dev.fb.js | 67 +++++++++-- .../ReactNativeRenderer-prod.fb.js | 108 +++++++++++------- .../ReactNativeRenderer-profiling.fb.js | 90 +++++++++------ 13 files changed, 509 insertions(+), 244 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 7d42fcfe5479b..bb9e9de6e523f 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<<491e433a3e81760180afd88ca49b58ec>> + * @generated SignedSource<<1aed0b993a4c164c11bd44255ec4ddac>> */ "use strict"; @@ -1728,7 +1728,7 @@ if (__DEV__) { return laneMap; } - function markRootUpdated(root, updateLane) { + function markRootUpdated$1(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. @@ -1765,7 +1765,7 @@ if (__DEV__) { markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } } - function markRootPinged(root, pingedLanes) { + function markRootPinged$1(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -21608,7 +21608,9 @@ if (__DEV__) { 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; // The most recent time we either committed a fallback, or when a fallback was + 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 // 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? @@ -22118,6 +22120,7 @@ if (__DEV__) { root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); } else { @@ -22148,6 +22151,7 @@ if (__DEV__) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -22162,6 +22166,7 @@ if (__DEV__) { finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -22173,6 +22178,7 @@ if (__DEV__) { finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { @@ -22197,14 +22203,26 @@ if (__DEV__) { // 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) + commitRoot.bind( + null, + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate + ) ); markRootSuspended(root, lanes, spawnedLane); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -22267,13 +22285,23 @@ if (__DEV__) { // 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); + } + + function markRootPinged(root, pingedLanes) { + markRootPinged$1(root, pingedLanes); } function markRootSuspended(root, suspendedLanes, spawnedLane) { // 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 @@ -22282,6 +22310,7 @@ if (__DEV__) { suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); + markRootSuspended$1(root, suspendedLanes, spawnedLane); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -22356,6 +22385,7 @@ if (__DEV__) { root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -22500,7 +22530,8 @@ if (__DEV__) { workInProgressRootPingedLanes = NoLanes; workInProgressDeferredLane = NoLane; workInProgressRootConcurrentErrors = null; - workInProgressRootRecoverableErrors = null; // Get the lanes that are entangled with whatever we're about to render. We + workInProgressRootRecoverableErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Get the lanes that are entangled with whatever we're about to render. We // track these separately so we can distinguish the priority of the render // task from the priority of the lanes it is entangled with. For example, a // transition may not be allowed to finish unless it includes the Sync lane, @@ -23450,7 +23481,13 @@ if (__DEV__) { workInProgress = null; } - function commitRoot(root, recoverableErrors, transitions, spawnedLane) { + function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -23463,6 +23500,7 @@ if (__DEV__) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -23478,6 +23516,7 @@ if (__DEV__) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -23537,7 +23576,7 @@ if (__DEV__) { var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished(root, remainingLanes, spawnedLane); // Reset this before firing side effects so we can detect recursive updates. if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -23725,6 +23764,9 @@ if (__DEV__) { // hydration is conceptually not an update. 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. // Was the finished render the result of an update (not hydration)? includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? includesSomeLane(remainingLanes, SyncUpdateLanes) @@ -24172,6 +24214,7 @@ if (__DEV__) { nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; + throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -25678,7 +25721,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-canary-03d6f7cf0-20240209"; + var ReactVersion = "18.3.0-canary-d8c1fa6b0-20240209"; // 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 ef9bfd786dadd..897787ac33433 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<> + * @generated SignedSource<<1fafe8c779f4832b19959f28b49afe3e>> */ "use strict"; @@ -452,7 +452,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -873,6 +873,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$7, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -7008,6 +7009,7 @@ var DefaultCacheDispatcher = { workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7054,7 +7056,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -7169,6 +7171,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { shouldTimeSlice, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -7181,6 +7184,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { shouldTimeSlice, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -7233,11 +7237,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -7356,6 +7367,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -7722,7 +7734,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -7732,6 +7750,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -7745,6 +7764,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -7752,8 +7772,8 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; + var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedLanes; if (null === finishedWork) return null; root.finishedWork = null; root.finishedLanes = 0; @@ -7801,7 +7821,7 @@ function commitRootImpl( rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) + (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); @@ -7830,7 +7850,7 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) @@ -7901,7 +7921,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -7936,7 +7956,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -7980,7 +8000,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9148,19 +9168,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1011 = { +var devToolsConfig$jscomp$inline_1023 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-03d6f7cf0-20240209", + version: "18.3.0-canary-d8c1fa6b0-20240209", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1189 = { - bundleType: devToolsConfig$jscomp$inline_1011.bundleType, - version: devToolsConfig$jscomp$inline_1011.version, - rendererPackageName: devToolsConfig$jscomp$inline_1011.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1011.rendererConfig, +var internals$jscomp$inline_1204 = { + bundleType: devToolsConfig$jscomp$inline_1023.bundleType, + version: devToolsConfig$jscomp$inline_1023.version, + rendererPackageName: devToolsConfig$jscomp$inline_1023.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1023.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9177,26 +9197,26 @@ var internals$jscomp$inline_1189 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1011.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1023.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-03d6f7cf0-20240209" + reconcilerVersion: "18.3.0-canary-d8c1fa6b0-20240209" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1190 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1205 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1190.isDisabled && - hook$jscomp$inline_1190.supportsFiber + !hook$jscomp$inline_1205.isDisabled && + hook$jscomp$inline_1205.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1190.inject( - internals$jscomp$inline_1189 + (rendererID = hook$jscomp$inline_1205.inject( + internals$jscomp$inline_1204 )), - (injectedHook = hook$jscomp$inline_1190); + (injectedHook = hook$jscomp$inline_1205); } 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 7f47428744017..5ba7990259c6a 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<<5b49f712bb1a860452ac3790a15aa134>> + * @generated SignedSource<> */ "use strict"; @@ -470,7 +470,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -893,6 +893,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$7, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -7348,6 +7349,7 @@ var DefaultCacheDispatcher = { workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7395,7 +7397,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -7511,6 +7513,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { shouldTimeSlice, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -7523,6 +7526,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { shouldTimeSlice, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -7575,11 +7579,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -7698,6 +7709,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -8085,7 +8097,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8095,6 +8113,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -8108,6 +8127,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -8115,8 +8135,8 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; + var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedLanes; if (null === finishedWork) return null; root.finishedWork = null; root.finishedLanes = 0; @@ -8165,7 +8185,7 @@ function commitRootImpl( rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) + (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) : releaseRootPooledCache(root, remainingLanes); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); @@ -8194,7 +8214,7 @@ function commitRootImpl( 0 !== root.tag && flushPassiveEffects(); remainingLanes = root.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -8311,7 +8331,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -8346,7 +8366,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -8390,7 +8410,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9576,19 +9596,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1053 = { +var devToolsConfig$jscomp$inline_1065 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-03d6f7cf0-20240209", + version: "18.3.0-canary-d8c1fa6b0-20240209", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1230 = { - bundleType: devToolsConfig$jscomp$inline_1053.bundleType, - version: devToolsConfig$jscomp$inline_1053.version, - rendererPackageName: devToolsConfig$jscomp$inline_1053.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1053.rendererConfig, +var internals$jscomp$inline_1245 = { + bundleType: devToolsConfig$jscomp$inline_1065.bundleType, + version: devToolsConfig$jscomp$inline_1065.version, + rendererPackageName: devToolsConfig$jscomp$inline_1065.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1065.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9605,26 +9625,26 @@ var internals$jscomp$inline_1230 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1053.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1065.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-03d6f7cf0-20240209" + reconcilerVersion: "18.3.0-canary-d8c1fa6b0-20240209" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1246 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1231.isDisabled && - hook$jscomp$inline_1231.supportsFiber + !hook$jscomp$inline_1246.isDisabled && + hook$jscomp$inline_1246.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1231.inject( - internals$jscomp$inline_1230 + (rendererID = hook$jscomp$inline_1246.inject( + internals$jscomp$inline_1245 )), - (injectedHook = hook$jscomp$inline_1231); + (injectedHook = hook$jscomp$inline_1246); } 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 c38a315c62fe9..571a9776a9295 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 @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-canary-03d6f7cf0-20240209"; + var ReactVersion = "18.3.0-canary-d8c1fa6b0-20240209"; // 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 0024f0a51c462..f9805d5b7d976 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 @@ -551,4 +551,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-03d6f7cf0-20240209"; +exports.version = "18.3.0-canary-d8c1fa6b0-20240209"; 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 fe3593ce33c0d..7ad4f8a231f1b 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 @@ -547,7 +547,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-03d6f7cf0-20240209"; +exports.version = "18.3.0-canary-d8c1fa6b0-20240209"; "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 b25f668aeb501..d9ff110cc83e7 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 @@ -03d6f7cf007cb3b2a3a65e6ec29be02aafd87870 +d8c1fa6b0b8da0512cb5acab9cd4f242451392f3 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 ebd27dc605bba..cb0ac67366ba9 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<<403df8be219f409355ab557986fd19af>> + * @generated SignedSource<<1e6850b081289af106b87495ff38a48d>> */ "use strict"; @@ -4594,7 +4594,7 @@ to return true:wantsResponderID| | return laneMap; } - function markRootUpdated(root, updateLane) { + function markRootUpdated$1(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. @@ -4631,7 +4631,7 @@ to return true:wantsResponderID| | markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } } - function markRootPinged(root, pingedLanes) { + function markRootPinged$1(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -23472,7 +23472,9 @@ to return true:wantsResponderID| | 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; // The most recent time we either committed a fallback, or when a fallback was + 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 // 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? @@ -23988,6 +23990,7 @@ to return true:wantsResponderID| | root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); } else { @@ -24021,6 +24024,7 @@ to return true:wantsResponderID| | finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -24035,6 +24039,7 @@ to return true:wantsResponderID| | finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -24046,6 +24051,7 @@ to return true:wantsResponderID| | finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { @@ -24070,14 +24076,26 @@ to return true:wantsResponderID| | // 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) + commitRoot.bind( + null, + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate + ) ); markRootSuspended(root, lanes, spawnedLane); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -24140,13 +24158,23 @@ to return true:wantsResponderID| | // 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); + } + + function markRootPinged(root, pingedLanes) { + markRootPinged$1(root, pingedLanes); } function markRootSuspended(root, suspendedLanes, spawnedLane) { // 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 @@ -24155,6 +24183,7 @@ to return true:wantsResponderID| | suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); + markRootSuspended$1(root, suspendedLanes, spawnedLane); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -24229,6 +24258,7 @@ to return true:wantsResponderID| | root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -24373,7 +24403,8 @@ to return true:wantsResponderID| | workInProgressRootPingedLanes = NoLanes; workInProgressDeferredLane = NoLane; workInProgressRootConcurrentErrors = null; - workInProgressRootRecoverableErrors = null; // Get the lanes that are entangled with whatever we're about to render. We + workInProgressRootRecoverableErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Get the lanes that are entangled with whatever we're about to render. We // track these separately so we can distinguish the priority of the render // task from the priority of the lanes it is entangled with. For example, a // transition may not be allowed to finish unless it includes the Sync lane, @@ -25387,7 +25418,13 @@ to return true:wantsResponderID| | workInProgress = null; } - function commitRoot(root, recoverableErrors, transitions, spawnedLane) { + function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -25400,6 +25437,7 @@ to return true:wantsResponderID| | root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -25415,6 +25453,7 @@ to return true:wantsResponderID| | root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -25482,7 +25521,7 @@ to return true:wantsResponderID| | var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished(root, remainingLanes, spawnedLane); // Reset this before firing side effects so we can detect recursive updates. if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -25672,6 +25711,9 @@ to return true:wantsResponderID| | // hydration is conceptually not an update. 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. // Was the finished render the result of an update (not hydration)? includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? includesSomeLane(remainingLanes, SyncUpdateLanes) @@ -26106,6 +26148,7 @@ to return true:wantsResponderID| | nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; + throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -27716,7 +27759,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-f52f3806"; + var ReactVersion = "18.3.0-canary-f30a24ae"; 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 1f23859a2e124..7603ab4456a22 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<<8911fd923383beea165b606e91b1d716>> */ "use strict"; @@ -1499,7 +1499,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -2224,6 +2224,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$9, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -7620,6 +7621,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7680,7 +7682,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -7793,6 +7795,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -7805,6 +7808,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -7857,11 +7861,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -7957,6 +7968,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -8314,7 +8326,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8324,6 +8342,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -8337,6 +8356,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -8344,34 +8364,35 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedWork; transitions = root.finishedLanes; - if (null === finishedWork) return null; + if (null === didIncludeRenderPhaseUpdate) return null; root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (didIncludeRenderPhaseUpdate === 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 = finishedWork.lanes | finishedWork.childLanes; + var remainingLanes = + didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && + 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); + if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -8379,30 +8400,35 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); + commitMutationEffectsOnFiber(didIncludeRenderPhaseUpdate, root); + root.current = didIncludeRenderPhaseUpdate; + commitLayoutEffectOnFiber( + root, + didIncludeRenderPhaseUpdate.alternate, + didIncludeRenderPhaseUpdate + ); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else root.current = finishedWork; + } else root.current = didIncludeRenderPhaseUpdate; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + didIncludeRenderPhaseUpdate = 0; + didIncludeRenderPhaseUpdate < recoverableErrors.length; + didIncludeRenderPhaseUpdate++ ) - (spawnedLane = recoverableErrors[finishedWork]), + (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -8471,7 +8497,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -8506,7 +8532,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -8550,7 +8576,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9504,10 +9530,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1058 = { + devToolsConfig$jscomp$inline_1070 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-bfa07db9", + version: "18.3.0-canary-2ee69b0b", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9523,11 +9549,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1280 = { - bundleType: devToolsConfig$jscomp$inline_1058.bundleType, - version: devToolsConfig$jscomp$inline_1058.version, - rendererPackageName: devToolsConfig$jscomp$inline_1058.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1058.rendererConfig, +var internals$jscomp$inline_1295 = { + bundleType: devToolsConfig$jscomp$inline_1070.bundleType, + version: devToolsConfig$jscomp$inline_1070.version, + rendererPackageName: devToolsConfig$jscomp$inline_1070.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1070.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9543,26 +9569,26 @@ var internals$jscomp$inline_1280 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1058.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1070.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-bfa07db9" + reconcilerVersion: "18.3.0-canary-2ee69b0b" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1281 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1296 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1281.isDisabled && - hook$jscomp$inline_1281.supportsFiber + !hook$jscomp$inline_1296.isDisabled && + hook$jscomp$inline_1296.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1281.inject( - internals$jscomp$inline_1280 + (rendererID = hook$jscomp$inline_1296.inject( + internals$jscomp$inline_1295 )), - (injectedHook = hook$jscomp$inline_1281); + (injectedHook = hook$jscomp$inline_1296); } 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 7a5a7427fcb2e..696fc7d001aec 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<<68ff2891d0ce1bdde3bc52620135bf6c>> + * @generated SignedSource<<7f0716b8572ee9c92294ac976ce341c4>> */ "use strict"; @@ -1591,7 +1591,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -2349,6 +2349,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$12, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -8144,6 +8145,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8205,7 +8207,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), root === workInProgressRoot && @@ -8320,6 +8322,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -8332,6 +8335,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -8384,11 +8388,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -8484,6 +8495,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -8916,7 +8928,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8926,6 +8944,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -8939,6 +8958,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -8946,37 +8966,38 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedWork; transitions = root.finishedLanes; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(transitions); - if (null === finishedWork) return markCommitStopped(), null; + if (null === didIncludeRenderPhaseUpdate) return markCommitStopped(), null; root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (didIncludeRenderPhaseUpdate === 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 = finishedWork.lanes | finishedWork.childLanes; + var remainingLanes = + didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && + 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); + if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -8984,14 +9005,14 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); + commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); commitTime = now(); - commitMutationEffects(root, finishedWork, transitions); - root.current = finishedWork; + commitMutationEffects(root, didIncludeRenderPhaseUpdate, transitions); + root.current = didIncludeRenderPhaseUpdate; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(transitions); - commitLayoutEffects(finishedWork, root, transitions); + commitLayoutEffects(didIncludeRenderPhaseUpdate, root, transitions); null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(); @@ -8999,23 +9020,24 @@ function commitRootImpl( executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else (root.current = finishedWork), (commitTime = now()); + } else (root.current = didIncludeRenderPhaseUpdate), (commitTime = now()); rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + didIncludeRenderPhaseUpdate = 0; + didIncludeRenderPhaseUpdate < recoverableErrors.length; + didIncludeRenderPhaseUpdate++ ) - (spawnedLane = recoverableErrors[finishedWork]), + (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -9140,7 +9162,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -9175,7 +9197,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -9220,7 +9242,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -10207,10 +10229,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1136 = { + devToolsConfig$jscomp$inline_1148 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "18.3.0-canary-9b213d01", + version: "18.3.0-canary-56cd92e7", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10240,10 +10262,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1136.bundleType, - version: devToolsConfig$jscomp$inline_1136.version, - rendererPackageName: devToolsConfig$jscomp$inline_1136.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1136.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1148.bundleType, + version: devToolsConfig$jscomp$inline_1148.version, + rendererPackageName: devToolsConfig$jscomp$inline_1148.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1148.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10259,14 +10281,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1136.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1148.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-9b213d01" + reconcilerVersion: "18.3.0-canary-56cd92e7" }); 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 03f1bb4be2a57..b22944d085f3c 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<<00f508d7f31eb3a54a0d5c56ac931ed9>> + * @generated SignedSource<<0d06e547a6cd0c1810b6eaac83860f87>> */ "use strict"; @@ -5473,7 +5473,7 @@ to return true:wantsResponderID| | return laneMap; } - function markRootUpdated(root, updateLane) { + function markRootUpdated$1(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. @@ -5510,7 +5510,7 @@ to return true:wantsResponderID| | markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } } - function markRootPinged(root, pingedLanes) { + function markRootPinged$1(root, pingedLanes) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -23913,7 +23913,9 @@ to return true:wantsResponderID| | 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; // The most recent time we either committed a fallback, or when a fallback was + 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 // 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? @@ -24429,6 +24431,7 @@ to return true:wantsResponderID| | root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); } else { @@ -24462,6 +24465,7 @@ to return true:wantsResponderID| | finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -24476,6 +24480,7 @@ to return true:wantsResponderID| | finishedWork, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -24487,6 +24492,7 @@ to return true:wantsResponderID| | finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { @@ -24511,14 +24517,26 @@ to return true:wantsResponderID| | // 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) + commitRoot.bind( + null, + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate + ) ); markRootSuspended(root, lanes, spawnedLane); return; } } // Otherwise, commit immediately. - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -24581,13 +24599,23 @@ to return true:wantsResponderID| | // 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); + } + + function markRootPinged(root, pingedLanes) { + markRootPinged$1(root, pingedLanes); } function markRootSuspended(root, suspendedLanes, spawnedLane) { // 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 @@ -24596,6 +24624,7 @@ to return true:wantsResponderID| | suspendedLanes, workInProgressRootInterleavedUpdatedLanes ); + markRootSuspended$1(root, suspendedLanes, spawnedLane); } // This is the entry point for synchronous tasks that don't go // through Scheduler @@ -24670,6 +24699,7 @@ to return true:wantsResponderID| | root, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane ); // Before exiting, make sure there's a callback scheduled for the next // pending level. @@ -24814,7 +24844,8 @@ to return true:wantsResponderID| | workInProgressRootPingedLanes = NoLanes; workInProgressDeferredLane = NoLane; workInProgressRootConcurrentErrors = null; - workInProgressRootRecoverableErrors = null; // Get the lanes that are entangled with whatever we're about to render. We + workInProgressRootRecoverableErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = false; // Get the lanes that are entangled with whatever we're about to render. We // track these separately so we can distinguish the priority of the render // task from the priority of the lanes it is entangled with. For example, a // transition may not be allowed to finish unless it includes the Sync lane, @@ -25828,7 +25859,13 @@ to return true:wantsResponderID| | workInProgress = null; } - function commitRoot(root, recoverableErrors, transitions, spawnedLane) { + function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); @@ -25841,6 +25878,7 @@ to return true:wantsResponderID| | root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -25856,6 +25894,7 @@ to return true:wantsResponderID| | root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -25923,7 +25962,7 @@ to return true:wantsResponderID| | var concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes(); remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes); - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished(root, remainingLanes, spawnedLane); // Reset this before firing side effects so we can detect recursive updates. if (root === workInProgressRoot) { // We can reset these now that they are finished. @@ -26113,6 +26152,9 @@ to return true:wantsResponderID| | // hydration is conceptually not an update. 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. // Was the finished render the result of an update (not hydration)? includesSomeLane(lanes, UpdateLanes) && // Did it schedule a sync update? includesSomeLane(remainingLanes, SyncUpdateLanes) @@ -26547,6 +26589,7 @@ to return true:wantsResponderID| | nestedPassiveUpdateCount = 0; rootWithNestedUpdates = null; rootWithPassiveNestedUpdates = null; + throw new Error( "Maximum update depth exceeded. This can happen when a component " + "repeatedly calls setState inside componentWillUpdate or " + @@ -28157,7 +28200,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "18.3.0-canary-76ba627b"; + var ReactVersion = "18.3.0-canary-2c1d8ed1"; 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 e899d525a5805..97f85827ca3f9 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<<3e63152645f6bf0b4fa7a1ea8bb90831>> + * @generated SignedSource<<39cc3a87ca227564cdd813f55956ea9b>> */ "use strict"; @@ -1870,7 +1870,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -2297,6 +2297,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$11, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -7847,6 +7848,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -7894,7 +7896,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8007,6 +8009,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -8019,6 +8022,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -8071,11 +8075,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -8171,6 +8182,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -8528,7 +8540,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -8538,6 +8556,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -8551,6 +8570,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -8558,34 +8578,35 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedWork; transitions = root.finishedLanes; - if (null === finishedWork) return null; + if (null === didIncludeRenderPhaseUpdate) return null; root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (didIncludeRenderPhaseUpdate === 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 = finishedWork.lanes | finishedWork.childLanes; + var remainingLanes = + didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && + 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); + if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -8593,30 +8614,35 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); + commitMutationEffectsOnFiber(didIncludeRenderPhaseUpdate, root); + root.current = didIncludeRenderPhaseUpdate; + commitLayoutEffectOnFiber( + root, + didIncludeRenderPhaseUpdate.alternate, + didIncludeRenderPhaseUpdate + ); requestPaint(); executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else root.current = finishedWork; + } else root.current = didIncludeRenderPhaseUpdate; rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + didIncludeRenderPhaseUpdate = 0; + didIncludeRenderPhaseUpdate < recoverableErrors.length; + didIncludeRenderPhaseUpdate++ ) - (spawnedLane = recoverableErrors[finishedWork]), + (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -8685,7 +8711,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -8720,7 +8746,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -8764,7 +8790,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -9725,10 +9751,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1127 = { + devToolsConfig$jscomp$inline_1139 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-5a2988f5", + version: "18.3.0-canary-b7eb11d7", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -9744,11 +9770,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1363 = { - bundleType: devToolsConfig$jscomp$inline_1127.bundleType, - version: devToolsConfig$jscomp$inline_1127.version, - rendererPackageName: devToolsConfig$jscomp$inline_1127.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1127.rendererConfig, +var internals$jscomp$inline_1378 = { + bundleType: devToolsConfig$jscomp$inline_1139.bundleType, + version: devToolsConfig$jscomp$inline_1139.version, + rendererPackageName: devToolsConfig$jscomp$inline_1139.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1139.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9764,26 +9790,26 @@ var internals$jscomp$inline_1363 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1127.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1139.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-5a2988f5" + reconcilerVersion: "18.3.0-canary-b7eb11d7" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1364 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1379 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1364.isDisabled && - hook$jscomp$inline_1364.supportsFiber + !hook$jscomp$inline_1379.isDisabled && + hook$jscomp$inline_1379.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1364.inject( - internals$jscomp$inline_1363 + (rendererID = hook$jscomp$inline_1379.inject( + internals$jscomp$inline_1378 )), - (injectedHook = hook$jscomp$inline_1364); + (injectedHook = hook$jscomp$inline_1379); } 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 2668b9b8e17bf..db4a8cc9fd2c1 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<<6091affeffc32510dd63cf6b69a72d7e>> + * @generated SignedSource<<84be8015422d9433af73cde9cdcf7115>> */ "use strict"; @@ -1962,7 +1962,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootUpdated(root, updateLane) { +function markRootUpdated$1(root, updateLane) { root.pendingLanes |= updateLane; 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); @@ -2421,6 +2421,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { workInProgressRootRenderLanes$14, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane )); } @@ -8370,6 +8371,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressDeferredLane = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, + workInProgressRootDidIncludeRecursiveRenderUpdate = !1, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, @@ -8418,7 +8420,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { workInProgressRootRenderLanes, workInProgressDeferredLane ); - markRootUpdated(root, lane); + markRootUpdated$1(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) isDevToolsPresent && addFiberToLanesMap(root, fiber, lane), root === workInProgressRoot && @@ -8533,6 +8535,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ), @@ -8545,6 +8548,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { didTimeout, workInProgressRootRecoverableErrors, workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane ); @@ -8597,11 +8601,18 @@ function commitRootWhenReady( finishedWork, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, lanes, spawnedLane ) { 0 === (lanes & 42) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot(root, recoverableErrors, transitions, spawnedLane); + commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -8697,6 +8708,7 @@ function prepareFreshStack(root, lanes) { 0; workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; + workInProgressRootDidIncludeRecursiveRenderUpdate = !1; 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) @@ -9129,7 +9141,13 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot(root, recoverableErrors, transitions, spawnedLane) { +function commitRoot( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane +) { var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig.transition; try { @@ -9139,6 +9157,7 @@ function commitRoot(root, recoverableErrors, transitions, spawnedLane) { root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, previousUpdateLanePriority, spawnedLane ); @@ -9152,6 +9171,7 @@ function commitRootImpl( root, recoverableErrors, transitions, + didIncludeRenderPhaseUpdate, renderPriorityLevel, spawnedLane ) { @@ -9159,37 +9179,38 @@ function commitRootImpl( while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error("Should not already be working."); - var finishedWork = root.finishedWork; + didIncludeRenderPhaseUpdate = root.finishedWork; transitions = root.finishedLanes; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(transitions); - if (null === finishedWork) return markCommitStopped(), null; + if (null === didIncludeRenderPhaseUpdate) return markCommitStopped(), null; root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (didIncludeRenderPhaseUpdate === 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 = finishedWork.lanes | finishedWork.childLanes; + var remainingLanes = + didIncludeRenderPhaseUpdate.lanes | didIncludeRenderPhaseUpdate.childLanes; remainingLanes |= concurrentlyUpdatedLanes; markRootFinished(root, remainingLanes, spawnedLane); root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === (didIncludeRenderPhaseUpdate.subtreeFlags & 10256) && + 0 === (didIncludeRenderPhaseUpdate.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), scheduleCallback(NormalPriority, function () { flushPassiveEffects(); return null; })); - spawnedLane = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || spawnedLane) { + spawnedLane = 0 !== (didIncludeRenderPhaseUpdate.flags & 15990); + if (0 !== (didIncludeRenderPhaseUpdate.subtreeFlags & 15990) || spawnedLane) { spawnedLane = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; remainingLanes = currentUpdatePriority; @@ -9197,14 +9218,14 @@ function commitRootImpl( var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; - commitBeforeMutationEffects(root, finishedWork); + commitBeforeMutationEffects(root, didIncludeRenderPhaseUpdate); commitTime = now(); - commitMutationEffects(root, finishedWork, transitions); - root.current = finishedWork; + commitMutationEffects(root, didIncludeRenderPhaseUpdate, transitions); + root.current = didIncludeRenderPhaseUpdate; null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(transitions); - commitLayoutEffects(finishedWork, root, transitions); + commitLayoutEffects(didIncludeRenderPhaseUpdate, root, transitions); null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && injectedProfilingHooks.markLayoutEffectsStopped(); @@ -9212,23 +9233,24 @@ function commitRootImpl( executionContext = prevExecutionContext; currentUpdatePriority = remainingLanes; ReactCurrentBatchConfig.transition = spawnedLane; - } else (root.current = finishedWork), (commitTime = now()); + } else (root.current = didIncludeRenderPhaseUpdate), (commitTime = now()); rootDoesHavePassiveEffects && ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), (pendingPassiveEffectsLanes = transitions)); remainingLanes = root.pendingLanes; 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot(didIncludeRenderPhaseUpdate.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + didIncludeRenderPhaseUpdate = 0; + didIncludeRenderPhaseUpdate < recoverableErrors.length; + didIncludeRenderPhaseUpdate++ ) - (spawnedLane = recoverableErrors[finishedWork]), + (spawnedLane = recoverableErrors[didIncludeRenderPhaseUpdate]), (remainingLanes = { digest: spawnedLane.digest, componentStack: spawnedLane.stack @@ -9353,7 +9375,7 @@ function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 2); rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); + (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { if (3 === sourceFiber.tag) @@ -9388,7 +9410,7 @@ function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 2 ); null !== nearestMountedAncestor && - (markRootUpdated(nearestMountedAncestor, 2), + (markRootUpdated$1(nearestMountedAncestor, 2), ensureRootIsScheduled(nearestMountedAncestor)); break; } @@ -9433,7 +9455,7 @@ function retryTimedOutBoundary(boundaryFiber, retryLane) { (retryLane = 0 === (boundaryFiber.mode & 1) ? 2 : claimNextRetryLane()); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && - (markRootUpdated(boundaryFiber, retryLane), + (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber)); } function retryDehydratedSuspenseBoundary(boundaryFiber) { @@ -10427,10 +10449,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1205 = { + devToolsConfig$jscomp$inline_1217 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "18.3.0-canary-3a0ee90f", + version: "18.3.0-canary-9321130d", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10460,10 +10482,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1205.bundleType, - version: devToolsConfig$jscomp$inline_1205.version, - rendererPackageName: devToolsConfig$jscomp$inline_1205.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1205.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1217.bundleType, + version: devToolsConfig$jscomp$inline_1217.version, + rendererPackageName: devToolsConfig$jscomp$inline_1217.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1217.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10479,14 +10501,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1205.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1217.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-3a0ee90f" + reconcilerVersion: "18.3.0-canary-9321130d" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {