From 8290a1fa3d08c96e2633ff7a122844a42426c26f Mon Sep 17 00:00:00 2001 From: dmytrorykun Date: Fri, 10 May 2024 10:04:44 +0000 Subject: [PATCH] Clean up the enableEarlyReturnForPropDiffing experiment (#29041) ## Summary The experiment has shown no significant performance changes. This PR removes it. ## How did you test this change? ``` yarn flow native yarn lint ``` DiffTrain build for commit https://github.com/facebook/react/commit/2c022b847ed2171c59d37db9f71b394e0082ae3f. --- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 11 +----- .../implementations/ReactFabric-prod.fb.js | 23 +++++------ .../ReactFabric-profiling.fb.js | 23 +++++------ .../ReactNativeRenderer-dev.fb.js | 11 +----- .../ReactNativeRenderer-prod.fb.js | 38 ++++++++----------- .../ReactNativeRenderer-profiling.fb.js | 38 ++++++++----------- 7 files changed, 53 insertions(+), 93 deletions(-) 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 75f547d5f7eb8..745de928b1082 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 @@ -151cce37401dc2ff609701119d61a17d92fce4ab +2c022b847ed2171c59d37db9f71b394e0082ae3f 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 826a963119aa3..32dd77ca6bacd 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<<577c7636235832d840ad016860b50817>> + * @generated SignedSource<<992be7ad266e7af316abc8834205d869>> */ 'use strict'; @@ -1995,7 +1995,6 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, disableStringRefs = dynamicFlags.disableStringRefs, enableAddPropertiesFastPath = dynamicFlags.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = dynamicFlags.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlags.enableRefAsProp, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane, @@ -2436,12 +2435,6 @@ function create(props, validAttributes) { props, validAttributes); } function diff(prevProps, nextProps, validAttributes) { - if (enableEarlyReturnForPropDiffing) { - if (prevProps === nextProps) { - return null; // no change - } - } - return diffProperties(null, // updatePayload prevProps, nextProps, validAttributes); } @@ -26095,7 +26088,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-beta-83bc2843'; +var ReactVersion = '19.0.0-beta-8cbbbfb0'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol 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 e35f6655bd812..55f00fce8f211 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<<844a7fde793a6bcbd87492fec25685e4>> + * @generated SignedSource<> */ "use strict"; @@ -974,8 +974,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = - dynamicFlagsUntyped.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, @@ -7297,15 +7295,12 @@ function completeWork(current, workInProgress, renderLanes) { : createChildNodeSet()), appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1)); b: { - oldProps = - enableEarlyReturnForPropDiffing && oldProps === newProps - ? null - : diffProperties( - null, - oldProps, - newProps, - renderLanes.canonical.viewConfig.validAttributes - ); + oldProps = diffProperties( + null, + oldProps, + newProps, + renderLanes.canonical.viewConfig.validAttributes + ); renderLanes.canonical.currentProps = newProps; newProps = renderLanes.node; if (current) @@ -10589,7 +10584,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1124 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-beta-bdce1f91", + version: "19.0.0-beta-0e5aa221", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10632,7 +10627,7 @@ var internals$jscomp$inline_1356 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-beta-bdce1f91" + reconcilerVersion: "19.0.0-beta-0e5aa221" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1357 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 a7220bd09e8f7..b0464ca88d876 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<79240e3cc80ad4ba1c6a4a8fd2e22e28>> */ "use strict"; @@ -978,8 +978,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = - dynamicFlagsUntyped.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, @@ -7563,15 +7561,12 @@ function completeWork(current, workInProgress, renderLanes) { : createChildNodeSet()), appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1)); b: { - oldProps = - enableEarlyReturnForPropDiffing && oldProps === newProps - ? null - : diffProperties( - null, - oldProps, - newProps, - renderLanes.canonical.viewConfig.validAttributes - ); + oldProps = diffProperties( + null, + oldProps, + newProps, + renderLanes.canonical.viewConfig.validAttributes + ); renderLanes.canonical.currentProps = newProps; newProps = renderLanes.node; if (current) @@ -11294,7 +11289,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1204 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-beta-13e56181", + version: "19.0.0-beta-6dfa24ac", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11350,7 +11345,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-beta-13e56181" + reconcilerVersion: "19.0.0-beta-6dfa24ac" }); 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 db88ea879647a..76e671016a615 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<> + * @generated SignedSource<> */ 'use strict'; @@ -2342,7 +2342,6 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries, disableDefaultPropsExceptForClasses = dynamicFlags.disableDefaultPropsExceptForClasses, disableStringRefs = dynamicFlags.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlags.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = dynamicFlags.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlags.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlags.enableRefAsProp, enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane; @@ -3391,12 +3390,6 @@ function create(props, validAttributes) { props, validAttributes); } function diff(prevProps, nextProps, validAttributes) { - if (enableEarlyReturnForPropDiffing) { - if (prevProps === nextProps) { - return null; // no change - } - } - return diffProperties(null, // updatePayload prevProps, nextProps, validAttributes); } @@ -26445,7 +26438,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-beta-303370bf'; +var ReactVersion = '19.0.0-beta-ddb899dd'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol 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 74ff1d1d55b93..648a9f0c7d174 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<<9218133e45a38bee509673d882f7b469>> + * @generated SignedSource<<40e897e52212d86ac96cac9227ed5e6e>> */ "use strict"; @@ -1118,8 +1118,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = - dynamicFlagsUntyped.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, @@ -8300,15 +8298,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { var viewConfig = flags.viewConfig; instanceProps.set(flags._nativeTag, newProps); - var updatePayload = - enableEarlyReturnForPropDiffing && current === newProps - ? null - : diffProperties( - null, - current, - newProps, - viewConfig.validAttributes - ); + var updatePayload = diffProperties( + null, + current, + newProps, + viewConfig.validAttributes + ); null != updatePayload && ReactNativePrivateInterface.UIManager.updateView( flags._nativeTag, @@ -8425,15 +8420,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { prevProps = assign({}, props, { style: [props.style, { display: "none" }] }); - var updatePayload$jscomp$1 = - enableEarlyReturnForPropDiffing && prevProps === props - ? null - : diffProperties( - null, - prevProps, - props, - viewConfig$jscomp$1.validAttributes - ); + var updatePayload$jscomp$1 = diffProperties( + null, + prevProps, + props, + viewConfig$jscomp$1.validAttributes + ); ReactNativePrivateInterface.UIManager.updateView( instance._nativeTag, viewConfig$jscomp$1.uiViewClassName, @@ -10781,7 +10773,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1192 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-beta-11cf708a", + version: "19.0.0-beta-f099a637", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10824,7 +10816,7 @@ var internals$jscomp$inline_1441 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-beta-11cf708a" + reconcilerVersion: "19.0.0-beta-f099a637" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1442 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 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 e182f396941f8..4f729a9079098 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<<7ec40d981bbcdacc39e55becc570911b>> + * @generated SignedSource<<82d14dcd5e1babbe3578eee9ac16e1a9>> */ "use strict"; @@ -1122,8 +1122,6 @@ var alwaysThrottleRetries = dynamicFlagsUntyped.alwaysThrottleRetries, disableStringRefs = dynamicFlagsUntyped.disableStringRefs, enableDeferRootSchedulingToMicrotask = dynamicFlagsUntyped.enableDeferRootSchedulingToMicrotask, - enableEarlyReturnForPropDiffing = - dynamicFlagsUntyped.enableEarlyReturnForPropDiffing, enableInfiniteRenderLoopDetection = dynamicFlagsUntyped.enableInfiniteRenderLoopDetection, enableRefAsProp = dynamicFlagsUntyped.enableRefAsProp, @@ -8783,15 +8781,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { try { var viewConfig = flags.viewConfig; instanceProps.set(flags._nativeTag, newProps); - var updatePayload = - enableEarlyReturnForPropDiffing && current === newProps - ? null - : diffProperties( - null, - current, - newProps, - viewConfig.validAttributes - ); + var updatePayload = diffProperties( + null, + current, + newProps, + viewConfig.validAttributes + ); null != updatePayload && ReactNativePrivateInterface.UIManager.updateView( flags._nativeTag, @@ -8908,15 +8903,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { prevProps = assign({}, props, { style: [props.style, { display: "none" }] }); - var updatePayload$jscomp$1 = - enableEarlyReturnForPropDiffing && prevProps === props - ? null - : diffProperties( - null, - prevProps, - props, - viewConfig$jscomp$1.validAttributes - ); + var updatePayload$jscomp$1 = diffProperties( + null, + prevProps, + props, + viewConfig$jscomp$1.validAttributes + ); ReactNativePrivateInterface.UIManager.updateView( instance._nativeTag, viewConfig$jscomp$1.uiViewClassName, @@ -11487,7 +11479,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1272 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-beta-fa7474ba", + version: "19.0.0-beta-203d3842", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11543,7 +11535,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-beta-fa7474ba" + reconcilerVersion: "19.0.0-beta-203d3842" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {