From 42dceaf21cfa2d6238c846d125dbc56c58399314 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Wed, 21 Apr 2021 09:57:15 -0700 Subject: [PATCH] React Native sync for revisions f7cdc89...bd7f4a0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This sync includes the following changes: - **[bd7f4a013](https://github.com/facebook/react/commit/bd7f4a013 )**: Fix sloppy factoring in `performSyncWorkOnRoot` ([#21246](https://github.com/facebook/react/pull/21246)) //// - **[78120032d](https://github.com/facebook/react/commit/78120032d )**: Remove `flushDiscreteUpdates` from end of event ([#21223](https://github.com/facebook/react/pull/21223)) //// - **[a3a7adb83](https://github.com/facebook/react/commit/a3a7adb83 )**: Turn off enableSyncDefaultUpdates in test renderer ([#21319](https://github.com/facebook/react/pull/21319)) //// - **[cdb6b4c55](https://github.com/facebook/react/commit/cdb6b4c55 )**: Only hide outermost host nodes when Offscreen is hidden ([#21250](https://github.com/facebook/react/pull/21250)) //// - **[b9c6a2b30](https://github.com/facebook/react/commit/b9c6a2b30 )**: Remove LayoutStatic check from commit phase ([#21249](https://github.com/facebook/react/pull/21249)) //// - **[af1a4cbf7](https://github.com/facebook/react/commit/af1a4cbf7 )**: Revert expiration for retry lanes ([#21300](https://github.com/facebook/react/pull/21300)) //// - **[cc4b431da](https://github.com/facebook/react/commit/cc4b431da )**: Mark boundary as client rendered even if aborting fallback ([#21294](https://github.com/facebook/react/pull/21294)) //// Changelog: [General][Changed] - React Native sync for revisions f7cdc89...bd7f4a0 jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D27909257 fbshipit-source-id: 36ec4cf1de9df109f1fe1542031df10a693baae0 --- Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 69 ++++--- .../implementations/ReactFabric-prod.fb.js | 94 +++++---- .../ReactFabric-profiling.fb.js | 94 +++++---- .../ReactNativeRenderer-dev.fb.js | 106 ++++++---- .../ReactNativeRenderer-prod.fb.js | 188 +++++++++--------- .../ReactNativeRenderer-profiling.fb.js | 188 +++++++++--------- 7 files changed, 409 insertions(+), 332 deletions(-) diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index 7de3a3ff9489a6..0d3b50ab63f09c 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -f7cdc893618e9701a8e3403b2b63bfc8233c6771 \ No newline at end of file +bd7f4a013be3ef272a01874532bee71ad861e617 \ No newline at end of file diff --git a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index 91b1392c03acac..1a89a0899f5517 100644 --- a/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<8e2b098b8adc0535d0c66734daceb246>> + * @generated SignedSource<<2ebb47c89a60a8b3e667fdf7431261b6>> */ 'use strict'; @@ -3711,7 +3711,6 @@ function batchedUpdates(fn, bookkeeping) { function setBatchingImplementation( _batchedUpdatesImpl, _discreteUpdatesImpl, - _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl ) { batchedUpdatesImpl = _batchedUpdatesImpl; @@ -4361,12 +4360,19 @@ function computeExpirationTime(lane, currentTime) { case TransitionLane14: case TransitionLane15: case TransitionLane16: + return currentTime + 5000; + case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: - return currentTime + 5000; + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: @@ -4573,11 +4579,6 @@ function markRootExpired(root, expiredLanes) { root.entangledLanes |= SyncLane; root.pendingLanes |= SyncLane; } -function areLanesExpired(root, lanes) { - var SyncLaneIndex = 0; - var entanglements = root.entanglements; - return (entanglements[SyncLaneIndex] & lanes) !== NoLanes; -} function markRootMutableRead(root, updateLane) { root.mutableReadLanes |= updateLane & root.pendingLanes; } @@ -18620,10 +18621,11 @@ function performConcurrentWorkOnRoot(root, didTimeout) { // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. - lanes = getLanesToRetrySynchronouslyOnError(root); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); - if (lanes !== NoLanes) { - exitStatus = renderRootSync(root, lanes); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = renderRootSync(root, errorRetryLanes); } } @@ -18788,22 +18790,25 @@ function performSyncWorkOnRoot(root) { } flushPassiveEffects(); - var lanes; - var exitStatus; + var lanes = getNextLanes(root, NoLanes); - if ( - root === workInProgressRoot && - areLanesExpired(root, workInProgressRootRenderLanes) - ) { - // There's a partial tree, and at least one of its lanes has expired. Finish - // rendering it before rendering the rest of the expired work. - lanes = workInProgressRootRenderLanes; - exitStatus = renderRootSync(root, lanes); + if (includesSomeLane(lanes, SyncLane)) { + if ( + root === workInProgressRoot && + includesSomeLane(lanes, workInProgressRootRenderLanes) + ) { + // There's a partial tree, and at least one of its lanes has expired. Finish + // rendering it before rendering the rest of the expired work. + lanes = workInProgressRootRenderLanes; + } } else { - lanes = getNextLanes(root, NoLanes); - exitStatus = renderRootSync(root, lanes); + // There's no remaining sync work left. + ensureRootIsScheduled(root, now()); + return null; } + var exitStatus = renderRootSync(root, lanes); + if (root.tag !== LegacyRoot && exitStatus === RootErrored) { executionContext |= RetryAfterError; // If an error occurred during hydration, // discard server response and fall back to client side render. @@ -18821,9 +18826,10 @@ function performSyncWorkOnRoot(root) { // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. - lanes = getLanesToRetrySynchronouslyOnError(root); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); - if (lanes !== NoLanes) { + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; exitStatus = renderRootSync(root, lanes); } } @@ -19364,6 +19370,15 @@ function commitRootImpl(root, renderPriorityLevel) { if (finishedWork === null) { return null; + } else { + { + if (lanes === NoLanes) { + error( + "root.finishedLanes should not be empty during a commit. This is a " + + "bug in React." + ); + } + } } root.finishedWork = null; @@ -19545,9 +19560,9 @@ function commitRootImpl(root, renderPriorityLevel) { if (hasUncaughtError) { hasUncaughtError = false; - var error = firstUncaughtError; + var error$1 = firstUncaughtError; firstUncaughtError = null; - throw error; + throw error$1; } if ((executionContext & LegacyUnbatchedContext) !== NoContext) { diff --git a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 5175a2c7064cdc..3d6cb45e414bc2 100644 --- a/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<90d01c86a28a69abef2fe93114ca8dd8>> + * @generated SignedSource<> */ "use strict"; @@ -930,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_215 = { +var injectedNamesToPlugins$jscomp$inline_214 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_215 = { } } }, - isOrderingDirty$jscomp$inline_216 = !1, - pluginName$jscomp$inline_217; -for (pluginName$jscomp$inline_217 in injectedNamesToPlugins$jscomp$inline_215) + isOrderingDirty$jscomp$inline_215 = !1, + pluginName$jscomp$inline_216; +for (pluginName$jscomp$inline_216 in injectedNamesToPlugins$jscomp$inline_214) if ( - injectedNamesToPlugins$jscomp$inline_215.hasOwnProperty( - pluginName$jscomp$inline_217 + injectedNamesToPlugins$jscomp$inline_214.hasOwnProperty( + pluginName$jscomp$inline_216 ) ) { - var pluginModule$jscomp$inline_218 = - injectedNamesToPlugins$jscomp$inline_215[pluginName$jscomp$inline_217]; + var pluginModule$jscomp$inline_217 = + injectedNamesToPlugins$jscomp$inline_214[pluginName$jscomp$inline_216]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_217) || - namesToPlugins[pluginName$jscomp$inline_217] !== - pluginModule$jscomp$inline_218 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_216) || + namesToPlugins[pluginName$jscomp$inline_216] !== + pluginModule$jscomp$inline_217 ) { - if (namesToPlugins[pluginName$jscomp$inline_217]) + if (namesToPlugins[pluginName$jscomp$inline_216]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_217 + + pluginName$jscomp$inline_216 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_217 - ] = pluginModule$jscomp$inline_218; - isOrderingDirty$jscomp$inline_216 = !0; + pluginName$jscomp$inline_216 + ] = pluginModule$jscomp$inline_217; + isOrderingDirty$jscomp$inline_215 = !0; } } -isOrderingDirty$jscomp$inline_216 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_215 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1730,12 +1730,13 @@ function computeExpirationTime(lane, currentTime) { case 524288: case 1048576: case 2097152: + return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: - return currentTime + 5e3; + return -1; case 134217728: case 268435456: case 536870912: @@ -6138,8 +6139,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (didTimeout = renderRootSync(root, lanes))); + (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root)), + 0 !== prevExecutionContext && + ((lanes = prevExecutionContext), + (didTimeout = renderRootSync(root, prevExecutionContext)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6241,17 +6244,20 @@ function performSyncWorkOnRoot(root) { if (0 !== (executionContext & 24)) throw Error("Should not already be working."); flushPassiveEffects(); - var lanes; - if ((lanes = root === workInProgressRoot)) - lanes = 0 !== (root.entanglements[0] & workInProgressRootRenderLanes); - lanes = lanes ? workInProgressRootRenderLanes : getNextLanes(root, 0); + var lanes = getNextLanes(root, 0); + if (0 !== (lanes & 1)) + root === workInProgressRoot && + 0 !== (lanes & workInProgressRootRenderLanes) && + (lanes = workInProgressRootRenderLanes); + else return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); - 0 !== root.tag && - 2 === exitStatus && - ((executionContext |= 32), - root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (exitStatus = renderRootSync(root, lanes))); + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), (exitStatus = renderRootSync(root, lanes))); + } if (1 === exitStatus) throw ((exitStatus = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -7738,7 +7744,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_941 = { + devToolsConfig$jscomp$inline_934 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -7756,11 +7762,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1175 = { - bundleType: devToolsConfig$jscomp$inline_941.bundleType, - version: devToolsConfig$jscomp$inline_941.version, - rendererPackageName: devToolsConfig$jscomp$inline_941.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_941.rendererConfig, +var internals$jscomp$inline_1168 = { + bundleType: devToolsConfig$jscomp$inline_934.bundleType, + version: devToolsConfig$jscomp$inline_934.version, + rendererPackageName: devToolsConfig$jscomp$inline_934.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_934.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -7775,7 +7781,7 @@ var internals$jscomp$inline_1175 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_941.findFiberByHostInstance || + devToolsConfig$jscomp$inline_934.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -7785,16 +7791,16 @@ var internals$jscomp$inline_1175 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1176 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1176.isDisabled && - hook$jscomp$inline_1176.supportsFiber + !hook$jscomp$inline_1169.isDisabled && + hook$jscomp$inline_1169.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1176.inject( - internals$jscomp$inline_1175 + (rendererID = hook$jscomp$inline_1169.inject( + internals$jscomp$inline_1168 )), - (injectedHook = hook$jscomp$inline_1176); + (injectedHook = hook$jscomp$inline_1169); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 5cea7d0c632ca5..09448caa825d82 100644 --- a/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -931,7 +931,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_221 = { +var injectedNamesToPlugins$jscomp$inline_220 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -966,34 +966,34 @@ var injectedNamesToPlugins$jscomp$inline_221 = { } } }, - isOrderingDirty$jscomp$inline_222 = !1, - pluginName$jscomp$inline_223; -for (pluginName$jscomp$inline_223 in injectedNamesToPlugins$jscomp$inline_221) + isOrderingDirty$jscomp$inline_221 = !1, + pluginName$jscomp$inline_222; +for (pluginName$jscomp$inline_222 in injectedNamesToPlugins$jscomp$inline_220) if ( - injectedNamesToPlugins$jscomp$inline_221.hasOwnProperty( - pluginName$jscomp$inline_223 + injectedNamesToPlugins$jscomp$inline_220.hasOwnProperty( + pluginName$jscomp$inline_222 ) ) { - var pluginModule$jscomp$inline_224 = - injectedNamesToPlugins$jscomp$inline_221[pluginName$jscomp$inline_223]; + var pluginModule$jscomp$inline_223 = + injectedNamesToPlugins$jscomp$inline_220[pluginName$jscomp$inline_222]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_223) || - namesToPlugins[pluginName$jscomp$inline_223] !== - pluginModule$jscomp$inline_224 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_222) || + namesToPlugins[pluginName$jscomp$inline_222] !== + pluginModule$jscomp$inline_223 ) { - if (namesToPlugins[pluginName$jscomp$inline_223]) + if (namesToPlugins[pluginName$jscomp$inline_222]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_223 + + pluginName$jscomp$inline_222 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_223 - ] = pluginModule$jscomp$inline_224; - isOrderingDirty$jscomp$inline_222 = !0; + pluginName$jscomp$inline_222 + ] = pluginModule$jscomp$inline_223; + isOrderingDirty$jscomp$inline_221 = !0; } } -isOrderingDirty$jscomp$inline_222 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_221 && recomputePluginOrdering(); function getInstanceFromInstance(instanceHandle) { return instanceHandle; } @@ -1756,12 +1756,13 @@ function computeExpirationTime(lane, currentTime) { case 524288: case 1048576: case 2097152: + return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: - return currentTime + 5e3; + return -1; case 134217728: case 268435456: case 536870912: @@ -6284,8 +6285,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (didTimeout = renderRootSync(root, lanes))); + (prevDispatcher = getLanesToRetrySynchronouslyOnError(root)), + 0 !== prevDispatcher && + ((lanes = prevDispatcher), + (didTimeout = renderRootSync(root, prevDispatcher)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6387,17 +6390,20 @@ function performSyncWorkOnRoot(root) { if (0 !== (executionContext & 24)) throw Error("Should not already be working."); flushPassiveEffects(); - var lanes; - if ((lanes = root === workInProgressRoot)) - lanes = 0 !== (root.entanglements[0] & workInProgressRootRenderLanes); - lanes = lanes ? workInProgressRootRenderLanes : getNextLanes(root, 0); + var lanes = getNextLanes(root, 0); + if (0 !== (lanes & 1)) + root === workInProgressRoot && + 0 !== (lanes & workInProgressRootRenderLanes) && + (lanes = workInProgressRootRenderLanes); + else return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); - 0 !== root.tag && - 2 === exitStatus && - ((executionContext |= 32), - root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (exitStatus = renderRootSync(root, lanes))); + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && ((root.hydrate = !1), shim(root.containerInfo)); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), (exitStatus = renderRootSync(root, lanes))); + } if (1 === exitStatus) throw ((exitStatus = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -8045,7 +8051,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_969 = { + devToolsConfig$jscomp$inline_962 = { findFiberByHostInstance: getInstanceFromInstance, bundleType: 0, version: "17.0.3", @@ -8063,11 +8069,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1216 = { - bundleType: devToolsConfig$jscomp$inline_969.bundleType, - version: devToolsConfig$jscomp$inline_969.version, - rendererPackageName: devToolsConfig$jscomp$inline_969.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_969.rendererConfig, +var internals$jscomp$inline_1209 = { + bundleType: devToolsConfig$jscomp$inline_962.bundleType, + version: devToolsConfig$jscomp$inline_962.version, + rendererPackageName: devToolsConfig$jscomp$inline_962.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_962.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8082,7 +8088,7 @@ var internals$jscomp$inline_1216 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_969.findFiberByHostInstance || + devToolsConfig$jscomp$inline_962.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8092,16 +8098,16 @@ var internals$jscomp$inline_1216 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1217 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1210 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1217.isDisabled && - hook$jscomp$inline_1217.supportsFiber + !hook$jscomp$inline_1210.isDisabled && + hook$jscomp$inline_1210.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1217.inject( - internals$jscomp$inline_1216 + (rendererID = hook$jscomp$inline_1210.inject( + internals$jscomp$inline_1209 )), - (injectedHook = hook$jscomp$inline_1217); + (injectedHook = hook$jscomp$inline_1210); } catch (err) {} } exports.createPortal = function(children, containerTag) { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index 0b7623b228ca6e..8d4c191e7f6ae0 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<5f437c4c1fcda37e2bb8dab0d04f1431>> */ 'use strict'; @@ -2554,7 +2554,6 @@ function batchedUpdates(fn, bookkeeping) { function setBatchingImplementation( _batchedUpdatesImpl, _discreteUpdatesImpl, - _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl ) { batchedUpdatesImpl = _batchedUpdatesImpl; @@ -4621,12 +4620,19 @@ function computeExpirationTime(lane, currentTime) { case TransitionLane14: case TransitionLane15: case TransitionLane16: + return currentTime + 5000; + case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: - return currentTime + 5000; + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: @@ -4833,11 +4839,6 @@ function markRootExpired(root, expiredLanes) { root.entangledLanes |= SyncLane; root.pendingLanes |= SyncLane; } -function areLanesExpired(root, lanes) { - var SyncLaneIndex = 0; - var entanglements = root.entanglements; - return (entanglements[SyncLaneIndex] & lanes) !== NoLanes; -} function markRootMutableRead(root, updateLane) { root.mutableReadLanes |= updateLane & root.pendingLanes; } @@ -17380,7 +17381,9 @@ function hideOrUnhideAllChildren(finishedWork, isHidden) { // Suspense layout effects semantics don't change for legacy roots. var isModernRoot = (finishedWork.mode & ConcurrentMode) !== NoMode; var current = finishedWork.alternate; - var wasHidden = current !== null && current.memoizedState !== null; + var wasHidden = current !== null && current.memoizedState !== null; // Only hide or unhide the top-most host nodes. + + var hostSubtreeRoot = null; { // We only have the top Fiber that was inserted but we need to recurse down its @@ -17389,20 +17392,25 @@ function hideOrUnhideAllChildren(finishedWork, isHidden) { while (true) { if (node.tag === HostComponent) { - var instance = node.stateNode; + if (hostSubtreeRoot === null) { + hostSubtreeRoot = node; + var instance = node.stateNode; - if (isHidden) { - hideInstance(instance); - } else { - unhideInstance(node.stateNode, node.memoizedProps); + if (isHidden) { + hideInstance(instance); + } else { + unhideInstance(node.stateNode, node.memoizedProps); + } } } else if (node.tag === HostText) { - var _instance3 = node.stateNode; + if (hostSubtreeRoot === null) { + var _instance3 = node.stateNode; - if (isHidden) { - hideTextInstance(); - } else { - unhideTextInstance(_instance3, node.memoizedProps); + if (isHidden) { + hideTextInstance(); + } else { + unhideTextInstance(_instance3, node.memoizedProps); + } } } else if ( (node.tag === OffscreenComponent || @@ -17425,9 +17433,17 @@ function hideOrUnhideAllChildren(finishedWork, isHidden) { return; } + if (hostSubtreeRoot === node) { + hostSubtreeRoot = null; + } + node = node.return; } + if (hostSubtreeRoot === node) { + hostSubtreeRoot = null; + } + node.sibling.return = node.return; node = node.sibling; } @@ -19112,10 +19128,11 @@ function performConcurrentWorkOnRoot(root, didTimeout) { // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. - lanes = getLanesToRetrySynchronouslyOnError(root); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); - if (lanes !== NoLanes) { - exitStatus = renderRootSync(root, lanes); + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; + exitStatus = renderRootSync(root, errorRetryLanes); } } @@ -19280,22 +19297,25 @@ function performSyncWorkOnRoot(root) { } flushPassiveEffects(); - var lanes; - var exitStatus; + var lanes = getNextLanes(root, NoLanes); - if ( - root === workInProgressRoot && - areLanesExpired(root, workInProgressRootRenderLanes) - ) { - // There's a partial tree, and at least one of its lanes has expired. Finish - // rendering it before rendering the rest of the expired work. - lanes = workInProgressRootRenderLanes; - exitStatus = renderRootSync(root, lanes); + if (includesSomeLane(lanes, SyncLane)) { + if ( + root === workInProgressRoot && + includesSomeLane(lanes, workInProgressRootRenderLanes) + ) { + // There's a partial tree, and at least one of its lanes has expired. Finish + // rendering it before rendering the rest of the expired work. + lanes = workInProgressRootRenderLanes; + } } else { - lanes = getNextLanes(root, NoLanes); - exitStatus = renderRootSync(root, lanes); + // There's no remaining sync work left. + ensureRootIsScheduled(root, now()); + return null; } + var exitStatus = renderRootSync(root, lanes); + if (root.tag !== LegacyRoot && exitStatus === RootErrored) { executionContext |= RetryAfterError; // If an error occurred during hydration, // discard server response and fall back to client side render. @@ -19313,9 +19333,10 @@ function performSyncWorkOnRoot(root) { // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. - lanes = getLanesToRetrySynchronouslyOnError(root); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); - if (lanes !== NoLanes) { + if (errorRetryLanes !== NoLanes) { + lanes = errorRetryLanes; exitStatus = renderRootSync(root, lanes); } } @@ -19856,6 +19877,15 @@ function commitRootImpl(root, renderPriorityLevel) { if (finishedWork === null) { return null; + } else { + { + if (lanes === NoLanes) { + error( + "root.finishedLanes should not be empty during a commit. This is a " + + "bug in React." + ); + } + } } root.finishedWork = null; @@ -20037,9 +20067,9 @@ function commitRootImpl(root, renderPriorityLevel) { if (hasUncaughtError) { hasUncaughtError = false; - var error = firstUncaughtError; + var error$1 = firstUncaughtError; firstUncaughtError = null; - throw error; + throw error$1; } if ((executionContext & LegacyUnbatchedContext) !== NoContext) { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index dadafbe97165b6..8dc378c6c35c75 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<67d6e303f1823e73e6e16508519f4668>> + * @generated SignedSource<> */ "use strict"; @@ -930,7 +930,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_218 = { +var injectedNamesToPlugins$jscomp$inline_217 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -965,34 +965,34 @@ var injectedNamesToPlugins$jscomp$inline_218 = { } } }, - isOrderingDirty$jscomp$inline_219 = !1, - pluginName$jscomp$inline_220; -for (pluginName$jscomp$inline_220 in injectedNamesToPlugins$jscomp$inline_218) + isOrderingDirty$jscomp$inline_218 = !1, + pluginName$jscomp$inline_219; +for (pluginName$jscomp$inline_219 in injectedNamesToPlugins$jscomp$inline_217) if ( - injectedNamesToPlugins$jscomp$inline_218.hasOwnProperty( - pluginName$jscomp$inline_220 + injectedNamesToPlugins$jscomp$inline_217.hasOwnProperty( + pluginName$jscomp$inline_219 ) ) { - var pluginModule$jscomp$inline_221 = - injectedNamesToPlugins$jscomp$inline_218[pluginName$jscomp$inline_220]; + var pluginModule$jscomp$inline_220 = + injectedNamesToPlugins$jscomp$inline_217[pluginName$jscomp$inline_219]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_220) || - namesToPlugins[pluginName$jscomp$inline_220] !== - pluginModule$jscomp$inline_221 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_219) || + namesToPlugins[pluginName$jscomp$inline_219] !== + pluginModule$jscomp$inline_220 ) { - if (namesToPlugins[pluginName$jscomp$inline_220]) + if (namesToPlugins[pluginName$jscomp$inline_219]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_220 + + pluginName$jscomp$inline_219 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_220 - ] = pluginModule$jscomp$inline_221; - isOrderingDirty$jscomp$inline_219 = !0; + pluginName$jscomp$inline_219 + ] = pluginModule$jscomp$inline_220; + isOrderingDirty$jscomp$inline_218 = !0; } } -isOrderingDirty$jscomp$inline_219 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_218 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1824,12 +1824,13 @@ function computeExpirationTime(lane, currentTime) { case 524288: case 1048576: case 2097152: + return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: - return currentTime + 5e3; + return -1; case 134217728: case 268435456: case 536870912: @@ -5498,59 +5499,63 @@ function commitHookEffectListMount(tag, finishedWork) { } } function hideOrUnhideAllChildren(finishedWork, isHidden) { - for (var node = finishedWork; ; ) { + for (var hostSubtreeRoot = null, node = finishedWork; ; ) { if (5 === node.tag) { - var instance = node.stateNode; - if (isHidden) { - var viewConfig = instance.viewConfig; - var updatePayload = diffProperties( - null, - emptyObject, - { style: { display: "none" } }, - viewConfig.validAttributes - ); - ReactNativePrivateInterface.UIManager.updateView( - instance._nativeTag, - viewConfig.uiViewClassName, - updatePayload - ); - } else { - instance = node.stateNode; - updatePayload = node.memoizedProps; - viewConfig = instance.viewConfig; - var prevProps = Object.assign({}, updatePayload, { - style: [updatePayload.style, { display: "none" }] - }); - updatePayload = diffProperties( - null, - prevProps, - updatePayload, - viewConfig.validAttributes - ); - ReactNativePrivateInterface.UIManager.updateView( - instance._nativeTag, - viewConfig.uiViewClassName, - updatePayload - ); - } - } else { - if (6 === node.tag) throw Error("Not yet implemented."); - if ( - ((22 !== node.tag && 23 !== node.tag) || - null === node.memoizedState || - node === finishedWork) && - null !== node.child - ) { - node.child.return = node; - node = node.child; - continue; + if (null === hostSubtreeRoot) { + hostSubtreeRoot = node; + var instance = node.stateNode; + if (isHidden) { + var viewConfig = instance.viewConfig; + var updatePayload = diffProperties( + null, + emptyObject, + { style: { display: "none" } }, + viewConfig.validAttributes + ); + ReactNativePrivateInterface.UIManager.updateView( + instance._nativeTag, + viewConfig.uiViewClassName, + updatePayload + ); + } else { + instance = node.stateNode; + updatePayload = node.memoizedProps; + viewConfig = instance.viewConfig; + var prevProps = Object.assign({}, updatePayload, { + style: [updatePayload.style, { display: "none" }] + }); + updatePayload = diffProperties( + null, + prevProps, + updatePayload, + viewConfig.validAttributes + ); + ReactNativePrivateInterface.UIManager.updateView( + instance._nativeTag, + viewConfig.uiViewClassName, + updatePayload + ); + } } + } else if (6 === node.tag) { + if (null === hostSubtreeRoot) throw Error("Not yet implemented."); + } else if ( + ((22 !== node.tag && 23 !== node.tag) || + null === node.memoizedState || + node === finishedWork) && + null !== node.child + ) { + node.child.return = node; + node = node.child; + continue; } if (node === finishedWork) break; for (; null === node.sibling; ) { if (null === node.return || node.return === finishedWork) return; + hostSubtreeRoot === node && (hostSubtreeRoot = null); node = node.return; } + hostSubtreeRoot === node && (hostSubtreeRoot = null); node.sibling.return = node.return; node = node.sibling; } @@ -6358,8 +6363,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && (root.hydrate = !1), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (didTimeout = renderRootSync(root, lanes))); + (prevExecutionContext = getLanesToRetrySynchronouslyOnError(root)), + 0 !== prevExecutionContext && + ((lanes = prevExecutionContext), + (didTimeout = renderRootSync(root, prevExecutionContext)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6461,17 +6468,20 @@ function performSyncWorkOnRoot(root) { if (0 !== (executionContext & 24)) throw Error("Should not already be working."); flushPassiveEffects(); - var lanes; - if ((lanes = root === workInProgressRoot)) - lanes = 0 !== (root.entanglements[0] & workInProgressRootRenderLanes); - lanes = lanes ? workInProgressRootRenderLanes : getNextLanes(root, 0); + var lanes = getNextLanes(root, 0); + if (0 !== (lanes & 1)) + root === workInProgressRoot && + 0 !== (lanes & workInProgressRootRenderLanes) && + (lanes = workInProgressRootRenderLanes); + else return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); - 0 !== root.tag && - 2 === exitStatus && - ((executionContext |= 32), - root.hydrate && (root.hydrate = !1), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (exitStatus = renderRootSync(root, lanes))); + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && (root.hydrate = !1); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), (exitStatus = renderRootSync(root, lanes))); + } if (1 === exitStatus) throw ((exitStatus = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -7965,7 +7975,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_985 = { + devToolsConfig$jscomp$inline_978 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -7983,11 +7993,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1238 = { - bundleType: devToolsConfig$jscomp$inline_985.bundleType, - version: devToolsConfig$jscomp$inline_985.version, - rendererPackageName: devToolsConfig$jscomp$inline_985.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_985.rendererConfig, +var internals$jscomp$inline_1231 = { + bundleType: devToolsConfig$jscomp$inline_978.bundleType, + version: devToolsConfig$jscomp$inline_978.version, + rendererPackageName: devToolsConfig$jscomp$inline_978.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_978.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8002,7 +8012,7 @@ var internals$jscomp$inline_1238 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_985.findFiberByHostInstance || + devToolsConfig$jscomp$inline_978.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8012,16 +8022,16 @@ var internals$jscomp$inline_1238 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1239.isDisabled && - hook$jscomp$inline_1239.supportsFiber + !hook$jscomp$inline_1232.isDisabled && + hook$jscomp$inline_1232.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1239.inject( - internals$jscomp$inline_1238 + (rendererID = hook$jscomp$inline_1232.inject( + internals$jscomp$inline_1231 )), - (injectedHook = hook$jscomp$inline_1239); + (injectedHook = hook$jscomp$inline_1232); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { diff --git a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index d809588b6b1fd1..ef2ee2b9927ebe 100644 --- a/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -931,7 +931,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_224 = { +var injectedNamesToPlugins$jscomp$inline_223 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -966,34 +966,34 @@ var injectedNamesToPlugins$jscomp$inline_224 = { } } }, - isOrderingDirty$jscomp$inline_225 = !1, - pluginName$jscomp$inline_226; -for (pluginName$jscomp$inline_226 in injectedNamesToPlugins$jscomp$inline_224) + isOrderingDirty$jscomp$inline_224 = !1, + pluginName$jscomp$inline_225; +for (pluginName$jscomp$inline_225 in injectedNamesToPlugins$jscomp$inline_223) if ( - injectedNamesToPlugins$jscomp$inline_224.hasOwnProperty( - pluginName$jscomp$inline_226 + injectedNamesToPlugins$jscomp$inline_223.hasOwnProperty( + pluginName$jscomp$inline_225 ) ) { - var pluginModule$jscomp$inline_227 = - injectedNamesToPlugins$jscomp$inline_224[pluginName$jscomp$inline_226]; + var pluginModule$jscomp$inline_226 = + injectedNamesToPlugins$jscomp$inline_223[pluginName$jscomp$inline_225]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_226) || - namesToPlugins[pluginName$jscomp$inline_226] !== - pluginModule$jscomp$inline_227 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_225) || + namesToPlugins[pluginName$jscomp$inline_225] !== + pluginModule$jscomp$inline_226 ) { - if (namesToPlugins[pluginName$jscomp$inline_226]) + if (namesToPlugins[pluginName$jscomp$inline_225]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - pluginName$jscomp$inline_226 + + pluginName$jscomp$inline_225 + "`." ); namesToPlugins[ - pluginName$jscomp$inline_226 - ] = pluginModule$jscomp$inline_227; - isOrderingDirty$jscomp$inline_225 = !0; + pluginName$jscomp$inline_225 + ] = pluginModule$jscomp$inline_226; + isOrderingDirty$jscomp$inline_224 = !0; } } -isOrderingDirty$jscomp$inline_225 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_224 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1850,12 +1850,13 @@ function computeExpirationTime(lane, currentTime) { case 524288: case 1048576: case 2097152: + return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: - return currentTime + 5e3; + return -1; case 134217728: case 268435456: case 536870912: @@ -5612,59 +5613,63 @@ function commitHookEffectListMount(tag, finishedWork) { } } function hideOrUnhideAllChildren(finishedWork, isHidden) { - for (var node = finishedWork; ; ) { + for (var hostSubtreeRoot = null, node = finishedWork; ; ) { if (5 === node.tag) { - var instance = node.stateNode; - if (isHidden) { - var viewConfig = instance.viewConfig; - var updatePayload = diffProperties( - null, - emptyObject, - { style: { display: "none" } }, - viewConfig.validAttributes - ); - ReactNativePrivateInterface.UIManager.updateView( - instance._nativeTag, - viewConfig.uiViewClassName, - updatePayload - ); - } else { - instance = node.stateNode; - updatePayload = node.memoizedProps; - viewConfig = instance.viewConfig; - var prevProps = Object.assign({}, updatePayload, { - style: [updatePayload.style, { display: "none" }] - }); - updatePayload = diffProperties( - null, - prevProps, - updatePayload, - viewConfig.validAttributes - ); - ReactNativePrivateInterface.UIManager.updateView( - instance._nativeTag, - viewConfig.uiViewClassName, - updatePayload - ); - } - } else { - if (6 === node.tag) throw Error("Not yet implemented."); - if ( - ((22 !== node.tag && 23 !== node.tag) || - null === node.memoizedState || - node === finishedWork) && - null !== node.child - ) { - node.child.return = node; - node = node.child; - continue; + if (null === hostSubtreeRoot) { + hostSubtreeRoot = node; + var instance = node.stateNode; + if (isHidden) { + var viewConfig = instance.viewConfig; + var updatePayload = diffProperties( + null, + emptyObject, + { style: { display: "none" } }, + viewConfig.validAttributes + ); + ReactNativePrivateInterface.UIManager.updateView( + instance._nativeTag, + viewConfig.uiViewClassName, + updatePayload + ); + } else { + instance = node.stateNode; + updatePayload = node.memoizedProps; + viewConfig = instance.viewConfig; + var prevProps = Object.assign({}, updatePayload, { + style: [updatePayload.style, { display: "none" }] + }); + updatePayload = diffProperties( + null, + prevProps, + updatePayload, + viewConfig.validAttributes + ); + ReactNativePrivateInterface.UIManager.updateView( + instance._nativeTag, + viewConfig.uiViewClassName, + updatePayload + ); + } } + } else if (6 === node.tag) { + if (null === hostSubtreeRoot) throw Error("Not yet implemented."); + } else if ( + ((22 !== node.tag && 23 !== node.tag) || + null === node.memoizedState || + node === finishedWork) && + null !== node.child + ) { + node.child.return = node; + node = node.child; + continue; } if (node === finishedWork) break; for (; null === node.sibling; ) { if (null === node.return || node.return === finishedWork) return; + hostSubtreeRoot === node && (hostSubtreeRoot = null); node = node.return; } + hostSubtreeRoot === node && (hostSubtreeRoot = null); node.sibling.return = node.return; node = node.sibling; } @@ -6503,8 +6508,10 @@ function performConcurrentWorkOnRoot(root, didTimeout) { 2 === didTimeout && ((executionContext |= 32), root.hydrate && (root.hydrate = !1), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (didTimeout = renderRootSync(root, lanes))); + (prevDispatcher = getLanesToRetrySynchronouslyOnError(root)), + 0 !== prevDispatcher && + ((lanes = prevDispatcher), + (didTimeout = renderRootSync(root, prevDispatcher)))); if (1 === didTimeout) throw ((originalCallbackNode = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -6606,17 +6613,20 @@ function performSyncWorkOnRoot(root) { if (0 !== (executionContext & 24)) throw Error("Should not already be working."); flushPassiveEffects(); - var lanes; - if ((lanes = root === workInProgressRoot)) - lanes = 0 !== (root.entanglements[0] & workInProgressRootRenderLanes); - lanes = lanes ? workInProgressRootRenderLanes : getNextLanes(root, 0); + var lanes = getNextLanes(root, 0); + if (0 !== (lanes & 1)) + root === workInProgressRoot && + 0 !== (lanes & workInProgressRootRenderLanes) && + (lanes = workInProgressRootRenderLanes); + else return ensureRootIsScheduled(root, now()), null; var exitStatus = renderRootSync(root, lanes); - 0 !== root.tag && - 2 === exitStatus && - ((executionContext |= 32), - root.hydrate && (root.hydrate = !1), - (lanes = getLanesToRetrySynchronouslyOnError(root)), - 0 !== lanes && (exitStatus = renderRootSync(root, lanes))); + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && (root.hydrate = !1); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && + ((lanes = errorRetryLanes), (exitStatus = renderRootSync(root, lanes))); + } if (1 === exitStatus) throw ((exitStatus = workInProgressRootFatalError), prepareFreshStack(root, 0), @@ -8271,7 +8281,7 @@ batchedUpdatesImpl = function(fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1013 = { + devToolsConfig$jscomp$inline_1006 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, version: "17.0.3", @@ -8289,11 +8299,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1279 = { - bundleType: devToolsConfig$jscomp$inline_1013.bundleType, - version: devToolsConfig$jscomp$inline_1013.version, - rendererPackageName: devToolsConfig$jscomp$inline_1013.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1013.rendererConfig, +var internals$jscomp$inline_1272 = { + bundleType: devToolsConfig$jscomp$inline_1006.bundleType, + version: devToolsConfig$jscomp$inline_1006.version, + rendererPackageName: devToolsConfig$jscomp$inline_1006.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1006.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -8308,7 +8318,7 @@ var internals$jscomp$inline_1279 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1013.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1006.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, @@ -8318,16 +8328,16 @@ var internals$jscomp$inline_1279 = { reconcilerVersion: "17.0.3" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1280 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1273 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1280.isDisabled && - hook$jscomp$inline_1280.supportsFiber + !hook$jscomp$inline_1273.isDisabled && + hook$jscomp$inline_1273.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1280.inject( - internals$jscomp$inline_1279 + (rendererID = hook$jscomp$inline_1273.inject( + internals$jscomp$inline_1272 )), - (injectedHook = hook$jscomp$inline_1280); + (injectedHook = hook$jscomp$inline_1273); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {