From dff0ebb49bedbf28dd86e2a9f307ab631723c24c Mon Sep 17 00:00:00 2001 From: sophiebits Date: Sat, 23 Sep 2023 03:29:40 +0000 Subject: [PATCH] Ship diffInCommitPhase (#27409) Performance tests at Meta showed neutral results. DiffTrain build for [7f6201889e8e628eeb53e05d8850ddffa3c2e74a](https://github.com/facebook/react/commit/7f6201889e8e628eeb53e05d8850ddffa3c2e74a) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- compiled/facebook-www/React-prod.modern.js | 2 +- .../facebook-www/React-profiling.classic.js | 2 +- .../facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 59 +- compiled/facebook-www/ReactART-dev.modern.js | 59 +- .../facebook-www/ReactART-prod.classic.js | 79 +- compiled/facebook-www/ReactART-prod.modern.js | 79 +- compiled/facebook-www/ReactDOM-dev.classic.js | 648 +--------- compiled/facebook-www/ReactDOM-dev.modern.js | 648 +--------- .../facebook-www/ReactDOM-prod.classic.js | 1152 ++++++----------- compiled/facebook-www/ReactDOM-prod.modern.js | 1126 ++++++---------- .../ReactDOM-profiling.classic.js | 1100 ++++++---------- .../facebook-www/ReactDOM-profiling.modern.js | 1074 ++++++--------- .../ReactDOMTesting-dev.classic.js | 648 +--------- .../ReactDOMTesting-dev.modern.js | 648 +--------- .../ReactDOMTesting-prod.classic.js | 1152 ++++++----------- .../ReactDOMTesting-prod.modern.js | 1126 ++++++---------- .../ReactTestRenderer-dev.classic.js | 45 +- .../ReactTestRenderer-dev.modern.js | 45 +- 22 files changed, 2795 insertions(+), 6905 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 942b120956..07f1f0cc90 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -d9e00f795b77676fb14f2a3c6f421f48f73bec2a +7f6201889e8e628eeb53e05d8850ddffa3c2e74a diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index d2e25e19b1..b622535f4e 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-classic-2c91e2cd"; +var ReactVersion = "18.3.0-www-classic-2db55f27"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 5e80ca9a1d..286825a43f 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -623,4 +623,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-1613cb4a"; +exports.version = "18.3.0-www-classic-04278c02"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 649f423f6d..f33226efce 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -615,4 +615,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-a19b7375"; +exports.version = "18.3.0-www-modern-ee02aecb"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index fde497cb8f..69b24fcbde 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-c5b7407c"; +exports.version = "18.3.0-www-classic-f0c12329"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index 8f7fa0106b..07afb1da29 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -626,7 +626,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-4c57bafd"; +exports.version = "18.3.0-www-modern-957e7028"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 596e8befc2..2c43780ffc 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-1613cb4a"; +var ReactVersion = "18.3.0-www-classic-04278c02"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback = enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -2534,11 +2533,9 @@ var suspendResource = shim; var pooledTransform = new Transform(); var NO_CONTEXT = {}; -var UPDATE_SIGNAL = {}; { Object.freeze(NO_CONTEXT); - Object.freeze(UPDATE_SIGNAL); } /** Helper Methods */ @@ -2819,9 +2816,6 @@ function prepareForCommit() { // Noop return null; } -function prepareUpdate(domElement, type, oldProps, newProps) { - return UPDATE_SIGNAL; -} function resetTextContent(domElement) { // Noop } @@ -18213,22 +18207,7 @@ function updateHostComponent( return; } - if (diffInCommitPhase) { - markUpdate(workInProgress); - } else { - // component is hitting the resume path. Figure out why. Possibly - // related to `hidden`. - - getHostContext(); - var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component. - - workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. All the work is done in commitWork. - - if (updatePayload) { - markUpdate(workInProgress); - } - } + markUpdate(workInProgress); } } // This function must be called at the very end of the complete phase, because // it might throw to suspend, and if the resource immediately loads, the work @@ -18713,11 +18692,7 @@ function completeWork(current, workInProgress, renderLanes) { if (_wasHydrated2) { // TODO: Move this and createInstance step into the beginPhase // to consolidate. - if (prepareToHydrateHostInstance()) { - // If changes to the hydrated node need to be applied at the - // commit-phase we mark this as such. - markUpdate(workInProgress); - } + prepareToHydrateHostInstance(); } else { getRootHostContainer(); @@ -21856,23 +21831,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var _updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (_updatePayload !== null || diffInCommitPhase) { - try { - commitUpdate( - _instance2, - _updatePayload, - type, - oldProps, - newProps, - finishedWork - ); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } + try { + commitUpdate( + _instance2, + _updatePayload, + type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 701107904f..39ecdcecf1 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-modern-d6fa9db4"; +var ReactVersion = "18.3.0-www-modern-a4447545"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback = enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -2531,11 +2530,9 @@ var suspendResource = shim; var pooledTransform = new Transform(); var NO_CONTEXT = {}; -var UPDATE_SIGNAL = {}; { Object.freeze(NO_CONTEXT); - Object.freeze(UPDATE_SIGNAL); } /** Helper Methods */ @@ -2816,9 +2813,6 @@ function prepareForCommit() { // Noop return null; } -function prepareUpdate(domElement, type, oldProps, newProps) { - return UPDATE_SIGNAL; -} function resetTextContent(domElement) { // Noop } @@ -17907,22 +17901,7 @@ function updateHostComponent( return; } - if (diffInCommitPhase) { - markUpdate(workInProgress); - } else { - // component is hitting the resume path. Figure out why. Possibly - // related to `hidden`. - - getHostContext(); - var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component. - - workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. All the work is done in commitWork. - - if (updatePayload) { - markUpdate(workInProgress); - } - } + markUpdate(workInProgress); } } // This function must be called at the very end of the complete phase, because // it might throw to suspend, and if the resource immediately loads, the work @@ -18400,11 +18379,7 @@ function completeWork(current, workInProgress, renderLanes) { if (_wasHydrated2) { // TODO: Move this and createInstance step into the beginPhase // to consolidate. - if (prepareToHydrateHostInstance()) { - // If changes to the hydrated node need to be applied at the - // commit-phase we mark this as such. - markUpdate(workInProgress); - } + prepareToHydrateHostInstance(); } else { getRootHostContainer(); @@ -21521,23 +21496,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var _updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (_updatePayload !== null || diffInCommitPhase) { - try { - commitUpdate( - _instance2, - _updatePayload, - type, - oldProps, - newProps, - finishedWork - ); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } + try { + commitUpdate( + _instance2, + _updatePayload, + type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 11d6a38494..0be2324e11 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -71,7 +71,6 @@ var ReactSharedInternals = enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -644,8 +643,7 @@ function shim$1() { throw Error(formatProdErrorMessage(357)); } var pooledTransform = new Transform(), - NO_CONTEXT = {}, - UPDATE_SIGNAL = {}; + NO_CONTEXT = {}; function createEventHandler(instance) { return function (event) { var listener = instance._listeners[event.type]; @@ -5572,9 +5570,6 @@ function getChildContextValues(context) { collectNearestChildContextValues(currentFiber, context, childContextValues); return childContextValues; } -function markUpdate(workInProgress) { - workInProgress.flags |= 4; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue ? (workInProgress.flags |= 4) @@ -5692,11 +5687,7 @@ function completeWork(current, workInProgress, renderLanes) { popHostContext(workInProgress); renderLanes = workInProgress.type; if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && - (diffInCommitPhase - ? markUpdate(workInProgress) - : (workInProgress.updateQueue = UPDATE_SIGNAL) && - markUpdate(workInProgress)), + current.memoizedProps !== newProps && (workInProgress.flags |= 4), current.ref !== workInProgress.ref && (workInProgress.flags |= 2097664); else { @@ -5763,7 +5754,7 @@ function completeWork(current, workInProgress, renderLanes) { return null; case 6: if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && markUpdate(workInProgress); + current.memoizedProps !== newProps && (workInProgress.flags |= 4); else { if ("string" !== typeof newProps && null === workInProgress.stateNode) throw Error(formatProdErrorMessage(166)); @@ -5933,8 +5924,8 @@ function completeWork(current, workInProgress, renderLanes) { }), shim$1(), null !== workInProgress.ref && - ((workInProgress.flags |= 2097664), markUpdate(workInProgress))) - : (null !== workInProgress.ref && markUpdate(workInProgress), + ((workInProgress.flags |= 2097664), (workInProgress.flags |= 4))) + : (null !== workInProgress.ref && (workInProgress.flags |= 4), current.ref !== workInProgress.ref && (workInProgress.flags |= 2097664)), bubbleProperties(workInProgress), @@ -6997,18 +6988,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { var newProps = finishedWork.memoizedProps; current = null !== current ? current.memoizedProps : newProps; - var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (null !== updatePayload || diffInCommitPhase) - try { - flags._applyProps(flags, newProps, current); - } catch (error$108) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$108 - ); - } + try { + flags._applyProps(flags, newProps, current); + } catch (error$108) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$108); + } } break; case 6: @@ -7093,13 +7078,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) { current = root; try { - (newProps = root.stateNode), - suspenseCallback - ? newProps.hide() - : ((updatePayload = root.memoizedProps), - (null == updatePayload.visible || - updatePayload.visible) && - root.stateNode.show()); + if (((newProps = root.stateNode), suspenseCallback)) + newProps.hide(); + else { + var props = root.memoizedProps; + (null == props.visible || props.visible) && + root.stateNode.show(); + } } catch (error) { captureCommitPhaseError( finishedWork, @@ -10112,19 +10097,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1130 = { + devToolsConfig$jscomp$inline_1128 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-classic-c5b7407c", + version: "18.3.0-www-classic-f0c12329", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1303 = { - bundleType: devToolsConfig$jscomp$inline_1130.bundleType, - version: devToolsConfig$jscomp$inline_1130.version, - rendererPackageName: devToolsConfig$jscomp$inline_1130.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1130.rendererConfig, +var internals$jscomp$inline_1301 = { + bundleType: devToolsConfig$jscomp$inline_1128.bundleType, + version: devToolsConfig$jscomp$inline_1128.version, + rendererPackageName: devToolsConfig$jscomp$inline_1128.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1128.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10141,26 +10126,26 @@ var internals$jscomp$inline_1303 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1130.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1128.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-c5b7407c" + reconcilerVersion: "18.3.0-www-classic-f0c12329" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1304 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1302 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1304.isDisabled && - hook$jscomp$inline_1304.supportsFiber + !hook$jscomp$inline_1302.isDisabled && + hook$jscomp$inline_1302.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1304.inject( - internals$jscomp$inline_1303 + (rendererID = hook$jscomp$inline_1302.inject( + internals$jscomp$inline_1301 )), - (injectedHook = hook$jscomp$inline_1304); + (injectedHook = hook$jscomp$inline_1302); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 4ce90e3213..6ab88077f9 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -71,7 +71,6 @@ var ReactSharedInternals = enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -528,8 +527,7 @@ function shim$1() { throw Error(formatProdErrorMessage(357)); } var pooledTransform = new Transform(), - NO_CONTEXT = {}, - UPDATE_SIGNAL = {}; + NO_CONTEXT = {}; function createEventHandler(instance) { return function (event) { var listener = instance._listeners[event.type]; @@ -5327,9 +5325,6 @@ function getChildContextValues(context) { collectNearestChildContextValues(currentFiber, context, childContextValues); return childContextValues; } -function markUpdate(workInProgress) { - workInProgress.flags |= 4; -} function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue ? (workInProgress.flags |= 4) @@ -5441,11 +5436,7 @@ function completeWork(current, workInProgress, renderLanes) { popHostContext(workInProgress); renderLanes = workInProgress.type; if (null !== current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && - (diffInCommitPhase - ? markUpdate(workInProgress) - : (workInProgress.updateQueue = UPDATE_SIGNAL) && - markUpdate(workInProgress)), + current.memoizedProps !== newProps && (workInProgress.flags |= 4), current.ref !== workInProgress.ref && (workInProgress.flags |= 2097664); else { @@ -5512,7 +5503,7 @@ function completeWork(current, workInProgress, renderLanes) { return null; case 6: if (current && null != workInProgress.stateNode) - current.memoizedProps !== newProps && markUpdate(workInProgress); + current.memoizedProps !== newProps && (workInProgress.flags |= 4); else { if ("string" !== typeof newProps && null === workInProgress.stateNode) throw Error(formatProdErrorMessage(166)); @@ -5678,8 +5669,8 @@ function completeWork(current, workInProgress, renderLanes) { }), shim$1(), null !== workInProgress.ref && - ((workInProgress.flags |= 2097664), markUpdate(workInProgress))) - : (null !== workInProgress.ref && markUpdate(workInProgress), + ((workInProgress.flags |= 2097664), (workInProgress.flags |= 4))) + : (null !== workInProgress.ref && (workInProgress.flags |= 4), current.ref !== workInProgress.ref && (workInProgress.flags |= 2097664)), bubbleProperties(workInProgress), @@ -6733,18 +6724,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { var newProps = finishedWork.memoizedProps; current = null !== current ? current.memoizedProps : newProps; - var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (null !== updatePayload || diffInCommitPhase) - try { - flags._applyProps(flags, newProps, current); - } catch (error$107) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$107 - ); - } + try { + flags._applyProps(flags, newProps, current); + } catch (error$107) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$107); + } } break; case 6: @@ -6829,13 +6814,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (null === current) { current = root; try { - (newProps = root.stateNode), - suspenseCallback - ? newProps.hide() - : ((updatePayload = root.memoizedProps), - (null == updatePayload.visible || - updatePayload.visible) && - root.stateNode.show()); + if (((newProps = root.stateNode), suspenseCallback)) + newProps.hide(); + else { + var props = root.memoizedProps; + (null == props.visible || props.visible) && + root.stateNode.show(); + } } catch (error) { captureCommitPhaseError( finishedWork, @@ -9777,19 +9762,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1110 = { + devToolsConfig$jscomp$inline_1108 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "18.3.0-www-modern-06894e4c", + version: "18.3.0-www-modern-6b7c4026", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1283 = { - bundleType: devToolsConfig$jscomp$inline_1110.bundleType, - version: devToolsConfig$jscomp$inline_1110.version, - rendererPackageName: devToolsConfig$jscomp$inline_1110.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1110.rendererConfig, +var internals$jscomp$inline_1281 = { + bundleType: devToolsConfig$jscomp$inline_1108.bundleType, + version: devToolsConfig$jscomp$inline_1108.version, + rendererPackageName: devToolsConfig$jscomp$inline_1108.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1108.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9806,26 +9791,26 @@ var internals$jscomp$inline_1283 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1110.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1108.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-06894e4c" + reconcilerVersion: "18.3.0-www-modern-6b7c4026" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1284 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1282 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1284.isDisabled && - hook$jscomp$inline_1284.supportsFiber + !hook$jscomp$inline_1282.isDisabled && + hook$jscomp$inline_1282.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1284.inject( - internals$jscomp$inline_1283 + (rendererID = hook$jscomp$inline_1282.inject( + internals$jscomp$inline_1281 )), - (injectedHook = hook$jscomp$inline_1284); + (injectedHook = hook$jscomp$inline_1282); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 3ac19f0d05..fafc43dfb3 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -142,7 +142,6 @@ var disableInputAttributeSyncing = dynamicFeatureFlags.enableCustomElementPropertySupport, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase, enableAsyncActions = dynamicFeatureFlags.enableAsyncActions, alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -5624,7 +5623,7 @@ function setValueForStyles(node, styles, prevStyles) { var style = node.style; - if (diffInCommitPhase && prevStyles != null) { + if (prevStyles != null) { { validateShorthandPropertyCollisionInDev(prevStyles, styles); } @@ -8382,25 +8381,14 @@ function tryToClaimNextHydratableSuspenseInstance(fiber) { function prepareToHydrateHostInstance(fiber, hostContext) { var instance = fiber.stateNode; var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; - var updatePayload = hydrateInstance( + hydrateInstance( instance, fiber.type, fiber.memoizedProps, hostContext, fiber, shouldWarnIfMismatchDev - ); // TODO: Type this specific to this type of component. - - if (!diffInCommitPhase) { - fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. - - if (updatePayload !== null) { - return true; - } - } - - return false; + ); } function prepareToHydrateHostTextInstance(fiber) { @@ -23090,27 +23078,7 @@ function updateHostComponent( return; } - if (diffInCommitPhase) { - markUpdate(workInProgress); - } else { - // If we get updated because one of our children updated, we don't - // have newProps so we'll have to reuse them. - // TODO: Split the update API as separate for the props vs. children. - // Even better would be if children weren't special cased at all tho. - var instance = workInProgress.stateNode; // TODO: Experiencing an error where oldProps is null. Suggests a host - // component is hitting the resume path. Figure out why. Possibly - // related to `hidden`. - - getHostContext(); - var updatePayload = prepareUpdate(instance, type, oldProps, newProps); // TODO: Type this specific to this type of component. - - workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. All the work is done in commitWork. - - if (updatePayload) { - markUpdate(workInProgress); - } - } + markUpdate(workInProgress); } } // This function must be called at the very end of the complete phase, because // it might throw to suspend, and if the resource immediately loads, the work @@ -23616,10 +23584,6 @@ function completeWork(current, workInProgress, renderLanes) { case HostHoistable: { { - // The branching here is more complicated than you might expect because - // a HostHoistable sometimes corresponds to a Resource and sometimes - // corresponds to an Instance. It can also switch during an update. - var type = workInProgress.type; var nextResource = workInProgress.memoizedState; if (current === null) { @@ -23674,16 +23638,12 @@ function completeWork(current, workInProgress, renderLanes) { } else { // This is a Hoistable Instance // We may have props to update on the Hoistable instance. - if (diffInCommitPhase && supportsMutation) { + { var oldProps = current.memoizedProps; if (oldProps !== newProps) { markUpdate(workInProgress); } - } else { - // We use the updateHostComponent path becuase it produces - // the update queue we need for Hoistables. - updateHostComponent(current, workInProgress, type, newProps); } // This must come at the very end of the complete phase. bubbleProperties(workInProgress); @@ -23701,14 +23661,12 @@ function completeWork(current, workInProgress, renderLanes) { var _type = workInProgress.type; if (current !== null && workInProgress.stateNode != null) { - if (diffInCommitPhase && supportsMutation) { + { var _oldProps2 = current.memoizedProps; if (_oldProps2 !== newProps) { markUpdate(workInProgress); } - } else { - updateHostComponent(current, workInProgress, _type, newProps); } if (current.ref !== workInProgress.ref) { @@ -23785,7 +23743,7 @@ function completeWork(current, workInProgress, renderLanes) { return null; } - var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context + var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context // "stack" as the parent. Then append children as we go in beginWork // or completeWork depending on whether we want to add them top->down or // bottom->up. Top->down is faster in IE11. @@ -23795,13 +23753,7 @@ function completeWork(current, workInProgress, renderLanes) { if (_wasHydrated2) { // TODO: Move this and createInstance step into the beginPhase // to consolidate. - if ( - prepareToHydrateHostInstance(workInProgress, _currentHostContext2) - ) { - // If changes to the hydrated node need to be applied at the - // commit-phase we mark this as such. - markUpdate(workInProgress); - } + prepareToHydrateHostInstance(workInProgress, _currentHostContext); } else { var _rootContainerInstance = getRootHostContainer(); @@ -23809,7 +23761,7 @@ function completeWork(current, workInProgress, renderLanes) { _type2, newProps, _rootContainerInstance, - _currentHostContext2, + _currentHostContext, workInProgress ); @@ -23858,7 +23810,7 @@ function completeWork(current, workInProgress, renderLanes) { var _rootContainerInstance2 = getRootHostContainer(); - var _currentHostContext3 = getHostContext(); + var _currentHostContext2 = getHostContext(); var _wasHydrated3 = popHydrationState(workInProgress); @@ -23870,7 +23822,7 @@ function completeWork(current, workInProgress, renderLanes) { workInProgress.stateNode = createTextInstance( newText, _rootContainerInstance2, - _currentHostContext3, + _currentHostContext2, workInProgress ); } @@ -27194,23 +27146,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (updatePayload !== null || diffInCommitPhase) { - try { - commitUpdate( - finishedWork.stateNode, - updatePayload, - finishedWork.type, - current.memoizedProps, - finishedWork.memoizedProps, - finishedWork - ); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } + try { + commitUpdate( + finishedWork.stateNode, + updatePayload, + finishedWork.type, + current.memoizedProps, + finishedWork.memoizedProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } @@ -27282,23 +27228,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var _updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; - if (_updatePayload !== null || diffInCommitPhase) { - try { - commitUpdate( - _instance2, - _updatePayload, - type, - oldProps, - newProps, - finishedWork - ); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); - } + try { + commitUpdate( + _instance2, + _updatePayload, + type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } @@ -34021,7 +33961,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-bfae45bc"; +var ReactVersion = "18.3.0-www-classic-37c737b8"; function createPortal$1( children, @@ -39621,128 +39561,6 @@ function setInitialProperties(domElement, tag, props) { setProp(domElement, tag, _propKey6, _propValue6, props, null); } -} // Calculate the diff between the two objects. - -function diffProperties(domElement, tag, lastProps, nextProps) { - { - validatePropertiesInDevelopment(tag, nextProps); - } - - var updatePayload = null; - var propKey; - var styleName; - var styleUpdates = null; - - for (propKey in lastProps) { - if ( - nextProps.hasOwnProperty(propKey) || - !lastProps.hasOwnProperty(propKey) || - lastProps[propKey] == null - ) { - continue; - } - - switch (propKey) { - case "style": { - var lastStyle = lastProps[propKey]; - - for (styleName in lastStyle) { - if (lastStyle.hasOwnProperty(styleName)) { - if (!styleUpdates) { - styleUpdates = {}; - } - - styleUpdates[styleName] = ""; - } - } - - break; - } - - default: { - // For all other deleted properties we add it to the queue. We use - // the allowed property list in the commit phase instead. - (updatePayload = updatePayload || []).push(propKey, null); - } - } - } - - for (propKey in nextProps) { - var nextProp = nextProps[propKey]; - var lastProp = lastProps != null ? lastProps[propKey] : undefined; - - if ( - nextProps.hasOwnProperty(propKey) && - nextProp !== lastProp && - (nextProp != null || lastProp != null) - ) { - switch (propKey) { - case "style": { - if (lastProp) { - // Unset styles on `lastProp` but not on `nextProp`. - for (styleName in lastProp) { - if ( - lastProp.hasOwnProperty(styleName) && - (!nextProp || !nextProp.hasOwnProperty(styleName)) - ) { - if (!styleUpdates) { - styleUpdates = {}; - } - - styleUpdates[styleName] = ""; - } - } // Update styles that changed since `lastProp`. - - for (styleName in nextProp) { - if ( - nextProp.hasOwnProperty(styleName) && - lastProp[styleName] !== nextProp[styleName] - ) { - if (!styleUpdates) { - styleUpdates = {}; - } - - styleUpdates[styleName] = nextProp[styleName]; - } - } - } else { - // Relies on `updateStylesByID` not mutating `styleUpdates`. - if (!styleUpdates) { - if (!updatePayload) { - updatePayload = []; - } - - updatePayload.push(propKey, styleUpdates); - } - - styleUpdates = nextProp; - } - - break; - } - - case "is": { - error('Cannot update the "is" prop after it has been initialized.'); - } - - // Fall through - - default: { - (updatePayload = updatePayload || []).push(propKey, nextProp); - } - } - } - } - - if (styleUpdates) { - { - validateShorthandPropertyCollisionInDev(lastProps.style, nextProps.style); - } - - (updatePayload = updatePayload || []).push("style", styleUpdates); - } - - return updatePayload; } function updateProperties(domElement, tag, lastProps, nextProps) { { @@ -40291,348 +40109,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, _propKey19, _nextProp6, nextProps, _lastProp13); } } -} // Apply the diff. - -function updatePropertiesWithDiff( - domElement, - updatePayload, - tag, - lastProps, - nextProps -) { - switch (tag) { - case "div": - case "span": - case "svg": - case "path": - case "a": - case "g": - case "p": - case "li": { - // Fast track the most common tag types - break; - } - - case "input": { - var name = nextProps.name; - var type = nextProps.type; - var value = nextProps.value; - var defaultValue = nextProps.defaultValue; - var lastDefaultValue = lastProps.defaultValue; - var checked = nextProps.checked; - var defaultChecked = nextProps.defaultChecked; - - for (var i = 0; i < updatePayload.length; i += 2) { - var propKey = updatePayload[i]; - var propValue = updatePayload[i + 1]; - - switch (propKey) { - case "type": { - break; - } - - case "name": { - break; - } - - case "checked": { - break; - } - - case "defaultChecked": { - break; - } - - case "value": { - break; - } - - case "defaultValue": { - break; - } - - case "children": - case "dangerouslySetInnerHTML": { - if (propValue != null) { - throw new Error( - tag + - " is a void element tag and must neither have `children` nor " + - "use `dangerouslySetInnerHTML`." - ); - } - - break; - } - - default: { - setProp( - domElement, - tag, - propKey, - propValue, - nextProps, - lastProps[propKey] - ); - } - } - } - - { - var wasControlled = - lastProps.type === "checkbox" || lastProps.type === "radio" - ? lastProps.checked != null - : lastProps.value != null; - var isControlled = - nextProps.type === "checkbox" || nextProps.type === "radio" - ? nextProps.checked != null - : nextProps.value != null; - - if ( - !wasControlled && - isControlled && - !didWarnUncontrolledToControlled - ) { - error( - "A component is changing an uncontrolled input to be controlled. " + - "This is likely caused by the value changing from undefined to " + - "a defined value, which should not happen. " + - "Decide between using a controlled or uncontrolled input " + - "element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components" - ); - - didWarnUncontrolledToControlled = true; - } - - if ( - wasControlled && - !isControlled && - !didWarnControlledToUncontrolled - ) { - error( - "A component is changing a controlled input to be uncontrolled. " + - "This is likely caused by the value changing from a defined to " + - "undefined, which should not happen. " + - "Decide between using a controlled or uncontrolled input " + - "element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components" - ); - - didWarnControlledToUncontrolled = true; - } - } // Update the wrapper around inputs *after* updating props. This has to - // happen after updating the rest of props. Otherwise HTML5 input validations - // raise warnings and prevent the new value from being assigned. - - updateInput( - domElement, - value, - defaultValue, - lastDefaultValue, - checked, - defaultChecked, - type, - name - ); - return; - } - - case "select": { - var _value5 = nextProps.value; - var _defaultValue5 = nextProps.defaultValue; - var multiple = nextProps.multiple; - var wasMultiple = lastProps.multiple; - - for (var _i = 0; _i < updatePayload.length; _i += 2) { - var _propKey20 = updatePayload[_i]; - var _propValue7 = updatePayload[_i + 1]; - - switch (_propKey20) { - case "value": { - // This is handled by updateWrapper below. - break; - } - // defaultValue are ignored by setProp - - default: { - setProp( - domElement, - tag, - _propKey20, - _propValue7, - nextProps, - lastProps[_propKey20] - ); - } - } - } //