From 1d800dfda16468f2cd2d80460e2d3d3f36a3e902 Mon Sep 17 00:00:00 2001 From: kassens Date: Wed, 10 Jul 2024 20:48:04 +0000 Subject: [PATCH] Experiment with using an object literal for Fiber creation (#28734) Object literals should be faster at least on React Native with Hermes as the JS engine. It might also be interesting to confirm the old comments in this file from years ago are even still valid. Creating an object from a literal should be a simpler operation. It's a bit unfortunate that this introduces a bunch of copied code, but since we rearely update the fields on fibers, this seems like an okay tradeoff for a hot code path. An alternative would be some sort of macro system, but that doesn't seem worth the extra complexity. DiffTrain build for commit https://github.com/facebook/react/commit/fe9828954adcc51aa2bd21fe53d969a44dd3c9d2. --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../cjs/ReactTestRenderer-dev.js | 12 ++-- .../cjs/ReactTestRenderer-prod.js | 30 +++++----- .../cjs/ReactTestRenderer-profiling.js | 30 +++++----- .../vendor/react/react/cjs/React-dev.js | 4 +- .../vendor/react/react/cjs/React-prod.js | 4 +- .../vendor/react/react/cjs/React-profiling.js | 4 +- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 51 +++++++++++++++-- .../implementations/ReactFabric-prod.fb.js | 39 +++++++++++-- .../ReactFabric-profiling.fb.js | 43 +++++++++++++-- .../ReactNativeRenderer-dev.fb.js | 55 +++++++++++++++++-- .../ReactNativeRenderer-prod.fb.js | 43 +++++++++++++-- .../ReactNativeRenderer-profiling.fb.js | 47 ++++++++++++++-- 14 files changed, 292 insertions(+), 74 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 06e5b6d53a124..c0f43a1ed75e1 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.0.0-native-fb-9647333b3d-20240710 \ No newline at end of file +19.0.0-native-fb-fe9828954a-20240710 \ No newline at end of file diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js index a026ee9b6cb09..d4b2ea0b7fdae 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<01dd4b5a3d9624de154a5d6e011f8782>> + * @generated SignedSource<<9cef70fc774ae45a7e3850789b3cb38f>> */ "use strict"; @@ -75,6 +75,9 @@ __DEV__ && function shouldErrorImpl() { return null; } + function createFiber(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); + } function findHostInstancesForRefresh(root, families) { var hostInstances = new Set(); families = new Set( @@ -12478,9 +12481,6 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { - return new FiberNode(tag, pendingProps, key, mode); - } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -15159,14 +15159,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); })({ findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 1, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-test-renderer" }); exports._Scheduler = Scheduler; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js index 2669248d0f5e1..68d1fb44a34a5 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<40cb55a2c17e388258d1238f01fa536e>> */ "use strict"; @@ -2227,7 +2227,7 @@ function createChildReconciler(shouldTrackSideEffects) { "function" === typeof x.then) ) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); fiber.lanes = lanes; fiber.return = returnFiber; return fiber; @@ -8713,7 +8713,7 @@ function FiberNode(tag, pendingProps, key, mode) { this.childLanes = this.lanes = 0; this.alternate = null; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } function shouldConstruct(Component) { @@ -8723,7 +8723,7 @@ function shouldConstruct(Component) { function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress - ? ((workInProgress = createFiber( + ? ((workInProgress = createFiberImplClass( current.tag, pendingProps, current.key, @@ -8812,21 +8812,21 @@ function createFiberFromTypeAndProps( break; case REACT_PROFILER_TYPE: return ( - (type = createFiber(12, pendingProps, key, mode | 2)), + (type = createFiberImplClass(12, pendingProps, key, mode | 2)), (type.elementType = REACT_PROFILER_TYPE), (type.lanes = lanes), type ); case REACT_SUSPENSE_TYPE: return ( - (type = createFiber(13, pendingProps, key, mode)), + (type = createFiberImplClass(13, pendingProps, key, mode)), (type.elementType = REACT_SUSPENSE_TYPE), (type.lanes = lanes), type ); case REACT_SUSPENSE_LIST_TYPE: return ( - (type = createFiber(19, pendingProps, key, mode)), + (type = createFiberImplClass(19, pendingProps, key, mode)), (type.elementType = REACT_SUSPENSE_LIST_TYPE), (type.lanes = lanes), type @@ -8861,19 +8861,19 @@ function createFiberFromTypeAndProps( ); owner = null; } - key = createFiber(fiberTag, pendingProps, key, mode); + key = createFiberImplClass(fiberTag, pendingProps, key, mode); key.elementType = type; key.type = owner; key.lanes = lanes; return key; } function createFiberFromFragment(elements, mode, lanes, key) { - elements = createFiber(7, elements, key, mode); + elements = createFiberImplClass(7, elements, key, mode); elements.lanes = lanes; return elements; } function createFiberFromOffscreen(pendingProps, mode, lanes, key) { - pendingProps = createFiber(22, pendingProps, key, mode); + pendingProps = createFiberImplClass(22, pendingProps, key, mode); pendingProps.elementType = REACT_OFFSCREEN_TYPE; pendingProps.lanes = lanes; var primaryChildInstance = { @@ -8914,12 +8914,12 @@ function createFiberFromOffscreen(pendingProps, mode, lanes, key) { return pendingProps; } function createFiberFromText(content, mode, lanes) { - content = createFiber(6, content, null, mode); + content = createFiberImplClass(6, content, null, mode); content.lanes = lanes; return content; } function createFiberFromPortal(portal, mode, lanes) { - mode = createFiber( + mode = createFiberImplClass( 4, null !== portal.children ? portal.children : [], portal.key, @@ -9005,7 +9005,7 @@ function createContainer( !0 === isStrictMode && (tag |= 24), concurrentUpdatesByDefaultOverride && (tag |= 32)) : (tag = 0); - isStrictMode = createFiber(3, null, null, tag); + isStrictMode = createFiberImplClass(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -9384,7 +9384,7 @@ var devToolsConfig$jscomp$inline_1053 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1240 = { @@ -9415,7 +9415,7 @@ var internals$jscomp$inline_1240 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1241 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 806f40432bb19..7e5b5a2209f1c 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<3764d14ed445c5c8724d00d7fbd96c6f>> + * @generated SignedSource<> */ "use strict"; @@ -2315,7 +2315,7 @@ function createChildReconciler(shouldTrackSideEffects) { "function" === typeof x.then) ) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); fiber.lanes = lanes; fiber.return = returnFiber; return fiber; @@ -9319,7 +9319,7 @@ function FiberNode(tag, pendingProps, key, mode) { this.actualStartTime = -1; this.treeBaseDuration = this.selfBaseDuration = 0; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } function shouldConstruct(Component) { @@ -9329,7 +9329,7 @@ function shouldConstruct(Component) { function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress - ? ((workInProgress = createFiber( + ? ((workInProgress = createFiberImplClass( current.tag, pendingProps, current.key, @@ -9426,7 +9426,7 @@ function createFiberFromTypeAndProps( break; case REACT_PROFILER_TYPE: return ( - (type = createFiber(12, pendingProps, key, mode | 2)), + (type = createFiberImplClass(12, pendingProps, key, mode | 2)), (type.elementType = REACT_PROFILER_TYPE), (type.lanes = lanes), (type.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), @@ -9434,14 +9434,14 @@ function createFiberFromTypeAndProps( ); case REACT_SUSPENSE_TYPE: return ( - (type = createFiber(13, pendingProps, key, mode)), + (type = createFiberImplClass(13, pendingProps, key, mode)), (type.elementType = REACT_SUSPENSE_TYPE), (type.lanes = lanes), type ); case REACT_SUSPENSE_LIST_TYPE: return ( - (type = createFiber(19, pendingProps, key, mode)), + (type = createFiberImplClass(19, pendingProps, key, mode)), (type.elementType = REACT_SUSPENSE_LIST_TYPE), (type.lanes = lanes), type @@ -9476,19 +9476,19 @@ function createFiberFromTypeAndProps( ); owner = null; } - key = createFiber(fiberTag, pendingProps, key, mode); + key = createFiberImplClass(fiberTag, pendingProps, key, mode); key.elementType = type; key.type = owner; key.lanes = lanes; return key; } function createFiberFromFragment(elements, mode, lanes, key) { - elements = createFiber(7, elements, key, mode); + elements = createFiberImplClass(7, elements, key, mode); elements.lanes = lanes; return elements; } function createFiberFromOffscreen(pendingProps, mode, lanes, key) { - pendingProps = createFiber(22, pendingProps, key, mode); + pendingProps = createFiberImplClass(22, pendingProps, key, mode); pendingProps.elementType = REACT_OFFSCREEN_TYPE; pendingProps.lanes = lanes; var primaryChildInstance = { @@ -9529,12 +9529,12 @@ function createFiberFromOffscreen(pendingProps, mode, lanes, key) { return pendingProps; } function createFiberFromText(content, mode, lanes) { - content = createFiber(6, content, null, mode); + content = createFiberImplClass(6, content, null, mode); content.lanes = lanes; return content; } function createFiberFromPortal(portal, mode, lanes) { - mode = createFiber( + mode = createFiberImplClass( 4, null !== portal.children ? portal.children : [], portal.key, @@ -9622,7 +9622,7 @@ function createContainer( concurrentUpdatesByDefaultOverride && (tag |= 32)) : (tag = 0); isDevToolsPresent && (tag |= 2); - isStrictMode = createFiber(3, null, null, tag); + isStrictMode = createFiberImplClass(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; concurrentUpdatesByDefaultOverride = createCache(); @@ -10004,7 +10004,7 @@ var devToolsConfig$jscomp$inline_1136 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-test-renderer" }; (function (internals) { @@ -10048,7 +10048,7 @@ var devToolsConfig$jscomp$inline_1136 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); exports._Scheduler = Scheduler; exports.act = act; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js index 09ffa8492ad37..5eff396f29096 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<562bf71e601a5e5aa5c534b3ed30d7aa>> + * @generated SignedSource<> */ "use strict"; @@ -1748,7 +1748,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-native-fb-9647333b3d-20240710"; + exports.version = "19.0.0-native-fb-fe9828954a-20240710"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js index c2b2752d493a1..1f745199d47f6 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<95205025217ebe36ed27eda6b2488601>> + * @generated SignedSource<<2f82adcf7d438c0b2588e872ad5b60a8>> */ "use strict"; @@ -604,4 +604,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-9647333b3d-20240710"; +exports.version = "19.0.0-native-fb-fe9828954a-20240710"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js index fb5b730a75dcd..da2c75e443e8d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<7e542d278da0a700309e6fc450e5a369>> + * @generated SignedSource<> */ "use strict"; @@ -608,7 +608,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-9647333b3d-20240710"; +exports.version = "19.0.0-native-fb-fe9828954a-20240710"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 3a1c0240d674e..39555d6a1a895 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 @@ -9647333b3d5a5d2a3ca7fe2a78d2d3da24bc4984 +fe9828954adcc51aa2bd21fe53d969a44dd3c9d2 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 3f3b89f2e0217..84348c1b59fa5 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<<93b736b3c74c0f2fab84b1a60c436181>> + * @generated SignedSource<<8bbbf707b5c0fdbafff9a599d611e079>> */ "use strict"; @@ -13470,9 +13470,48 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { + function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function createFiberImplObject(tag, pendingProps, key, mode) { + tag = { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: 0, + actualStartTime: -1, + selfBaseDuration: 0, + treeBaseDuration: 0, + _debugInfo: null, + _debugOwner: null, + _debugNeedsRemount: !1, + _debugHookTypes: null + }; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(tag); + return tag; + } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -14210,6 +14249,7 @@ __DEV__ && dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, enableShallowPropDiffing = dynamicFlagsUntyped.enableShallowPropDiffing, passChildrenWhenCloningPersistedNodes = dynamicFlagsUntyped.passChildrenWhenCloningPersistedNodes, @@ -16644,6 +16684,9 @@ __DEV__ && } catch (e) { hasBadMapPolyfill = !0; } + var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; var didWarnAboutNestedUpdates = !1; var didWarnAboutFindNodeInStrictMode = {}; var overrideHookState = null, @@ -16766,12 +16809,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); })({ findFiberByHostInstance: getInstanceFromNode, bundleType: 1, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, 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 3bd887813924d..2d61a568e80c1 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<<8c3e605bcd4deab6887546241ce915f2>> + * @generated SignedSource<> */ "use strict"; @@ -23,6 +23,7 @@ var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/R disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, enableShallowPropDiffing = dynamicFlagsUntyped.enableShallowPropDiffing, passChildrenWhenCloningPersistedNodes = dynamicFlagsUntyped.passChildrenWhenCloningPersistedNodes, @@ -10082,9 +10083,39 @@ function FiberNode(tag, pendingProps, key, mode) { this.childLanes = this.lanes = 0; this.alternate = null; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -10601,7 +10632,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1136 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10644,7 +10675,7 @@ var internals$jscomp$inline_1362 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1363 = __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 12579c31b797e..3e3d8fe402882 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<> */ "use strict"; @@ -27,6 +27,7 @@ var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/R disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, enableAddPropertiesFastPath = dynamicFlagsUntyped.enableAddPropertiesFastPath, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, enableShallowPropDiffing = dynamicFlagsUntyped.enableShallowPropDiffing, passChildrenWhenCloningPersistedNodes = dynamicFlagsUntyped.passChildrenWhenCloningPersistedNodes, @@ -10772,9 +10773,43 @@ function FiberNode(tag, pendingProps, key, mode) { this.actualStartTime = -1; this.treeBaseDuration = this.selfBaseDuration = 0; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: 0, + actualStartTime: -1, + selfBaseDuration: 0, + treeBaseDuration: 0 + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -11307,7 +11342,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1217 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11363,7 +11398,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); 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 3df70c10db429..7983af842e44f 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<<8584109002f045b3c3f3a2b760460d87>> */ "use strict"; @@ -13606,9 +13606,48 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { + function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function createFiberImplObject(tag, pendingProps, key, mode) { + tag = { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: 0, + actualStartTime: -1, + selfBaseDuration: 0, + treeBaseDuration: 0, + _debugInfo: null, + _debugOwner: null, + _debugNeedsRemount: !1, + _debugHookTypes: null + }; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(tag); + return tag; + } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -14344,6 +14383,7 @@ __DEV__ && dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = REACT_LEGACY_ELEMENT_TYPE, REACT_PORTAL_TYPE = Symbol.for("react.portal"), @@ -16878,6 +16918,9 @@ __DEV__ && } catch (e) { hasBadMapPolyfill = !0; } + var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; var didWarnAboutNestedUpdates = !1; var didWarnAboutFindNodeInStrictMode = {}; var overrideHookState = null, @@ -16954,11 +16997,11 @@ __DEV__ && var emptyObject = {}; Object.freeze(emptyObject); var isomorphicReactPackageVersion = React.version; - if ("19.0.0-native-fb-9647333b3d-20240710" !== isomorphicReactPackageVersion) + if ("19.0.0-native-fb-fe9828954a-20240710" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-9647333b3d-20240710\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-fe9828954a-20240710\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -17006,12 +17049,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); })({ findFiberByHostInstance: getInstanceFromTag, bundleType: 1, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, 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 25fb094be4413..0e75f286b083b 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<<508169d743b6b2b964b9d58c4c58e6fc>> + * @generated SignedSource<> */ "use strict"; @@ -22,6 +22,7 @@ var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/R dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -10276,9 +10277,39 @@ function FiberNode(tag, pendingProps, key, mode) { this.childLanes = this.lanes = 0; this.alternate = null; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -10755,11 +10786,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-9647333b3d-20240710" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-fe9828954a-20240710" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-9647333b3d-20240710\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-fe9828954a-20240710\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -10809,7 +10840,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1210 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10852,7 +10883,7 @@ var internals$jscomp$inline_1457 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1458 = __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 47126a1c2b807..e180f327b092e 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<<2f0f5b8dfbc79dcdb4cdae717c76ffea>> + * @generated SignedSource<> */ "use strict"; @@ -26,6 +26,7 @@ var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/R dynamicFlagsUntyped.consoleManagedByDevToolsDuringStrictMode, disableDefaultPropsExceptForClasses = dynamicFlagsUntyped.disableDefaultPropsExceptForClasses, + enableObjectFiber = dynamicFlagsUntyped.enableObjectFiber, ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -10967,9 +10968,43 @@ function FiberNode(tag, pendingProps, key, mode) { this.actualStartTime = -1; this.treeBaseDuration = this.selfBaseDuration = 0; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: 0, + actualStartTime: -1, + selfBaseDuration: 0, + treeBaseDuration: 0 + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -11462,11 +11497,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-9647333b3d-20240710" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-fe9828954a-20240710" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-native-fb-9647333b3d-20240710\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-fe9828954a-20240710\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11516,7 +11551,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1291 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-native-fb-9647333b3d-20240710", + version: "19.0.0-native-fb-fe9828954a-20240710", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11572,7 +11607,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-9647333b3d-20240710" + reconcilerVersion: "19.0.0-native-fb-fe9828954a-20240710" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {