From 0ee0a32085d890abf922c32e3f7398e9e6fe90db Mon Sep 17 00:00:00 2001 From: sebmarkbage Date: Thu, 27 Jun 2024 16:16:07 +0000 Subject: [PATCH] Warn for invalid type in renderer with the correct RSC stack (#30102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is all behind the `enableOwnerStacks` flag. This is a follow up to #29088. In that I moved type validation into the renderer since that's the one that knows what types are allowed. However, I only removed it from `React.createElement` and not the JSX which was an oversight. However, I also noticed that for invalid types we don't have the right stack trace for throws because we're not yet inside the JSX element that itself is invalid. We should use its stack for the stack trace. That's the reason it's enough to just use the throw now because we can get a good stack trace from the owner stack. This is fixed by creating a fake Throw Fiber that gets assigned the right stack. Additionally, I noticed that for certain invalid types like the most common one `undefined` we error in Flight so a missing import in RSC leads to a generic error. Instead of erroring on the Flight side we should just let anything that's not a Server Component through to the client and then let the Client renderer determine whether it's a valid type or not. Since we now have owner stacks through the server too, this will still be able to provide a good stack trace on the client that points to the server in that case. Screenshot 2024-06-25 at 6 46 35 PM To get the best stack you have to expand the little icon and the regular stack is noisy [due to this Chrome bug](https://issues.chromium.org/issues/345248263) which makes it a little harder to find but once that's fixed it might be easier. DiffTrain build for commit https://github.com/facebook/react/commit/e02baf6c92833a0d45a77fb2e741676f393c24f7. --- compiled-rn/VERSION_NATIVE_FB | 2 +- .../cjs/ReactTestRenderer-dev.js | 68 +++++++++--------- .../cjs/ReactTestRenderer-prod.js | 10 +-- .../cjs/ReactTestRenderer-profiling.js | 10 +-- .../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 | 68 +++++++++--------- .../implementations/ReactFabric-prod.fb.js | 10 +-- .../ReactFabric-profiling.fb.js | 10 +-- .../ReactNativeRenderer-dev.fb.js | 72 ++++++++++--------- .../ReactNativeRenderer-prod.fb.js | 14 ++-- .../ReactNativeRenderer-profiling.fb.js | 14 ++-- 14 files changed, 155 insertions(+), 137 deletions(-) diff --git a/compiled-rn/VERSION_NATIVE_FB b/compiled-rn/VERSION_NATIVE_FB index 250df17bc4540..68b1f3c062364 100644 --- a/compiled-rn/VERSION_NATIVE_FB +++ b/compiled-rn/VERSION_NATIVE_FB @@ -1 +1 @@ -19.0.0-native-fb-ffec9ec5b5-20240627 \ No newline at end of file +19.0.0-native-fb-e02baf6c92-20240627 \ 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 70b2a433ce6f4..db59fada89104 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<<44d1ab19516f0dc7115b3084b1b6983a>> + * @generated SignedSource<<42baca610fefec93b87cf45e12c0249d>> */ "use strict"; @@ -2442,6 +2442,7 @@ __DEV__ && if ("children" !== key && "key" !== key) { null === fiber && ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), (fiber.return = returnFiber)); runWithFiberInDEV( fiber, @@ -12527,34 +12528,32 @@ __DEV__ && break; case REACT_PROFILER_TYPE: return ( + (type = pendingProps), (owner = mode), - "string" !== typeof pendingProps.id && + "string" !== typeof type.id && error$jscomp$0( 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', - typeof pendingProps.id + typeof type.id ), - (owner = createFiber(12, pendingProps, key, owner | 2)), - (owner.elementType = REACT_PROFILER_TYPE), - (owner.lanes = lanes), - (owner.stateNode = { - effectDuration: 0, - passiveEffectDuration: 0 - }), - owner + (key = createFiber(12, type, key, owner | 2)), + (key.elementType = REACT_PROFILER_TYPE), + (key.lanes = lanes), + (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), + key ); case REACT_SUSPENSE_TYPE: return ( - (owner = createFiber(13, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(13, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_TYPE), + (key.lanes = lanes), + key ); case REACT_SUSPENSE_LIST_TYPE: return ( - (owner = createFiber(19, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_LIST_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(19, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_LIST_TYPE), + (key.lanes = lanes), + key ); case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); @@ -12580,40 +12579,43 @@ __DEV__ && resolvedType = null; break a; } - lanes = ""; + resolvedType = ""; if ( void 0 === type || ("object" === typeof type && null !== type && 0 === Object.keys(type).length) ) - lanes += + resolvedType += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; null === type - ? (type = "null") + ? (pendingProps = "null") : isArrayImpl(type) - ? (type = "array") + ? (pendingProps = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((type = + ? ((pendingProps = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (lanes = + (resolvedType = " Did you accidentally export a JSX literal instead of a component?")) - : (type = typeof type); - owner = owner + : (pendingProps = typeof type); + fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null : null; - owner && - (lanes += "\n\nCheck the render method of `" + owner + "`."); - throw Error( + fiberTag && + (resolvedType += + "\n\nCheck the render method of `" + fiberTag + "`."); + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - (type + "." + lanes) + (pendingProps + "." + resolvedType) ); + resolvedType = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -15070,14 +15072,14 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); })({ findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 1, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", 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 bda326a97d3b8..47464545ac968 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<<718ff5e34ce4342f80f8cd32c0855485>> + * @generated SignedSource<> */ "use strict"; @@ -8869,10 +8869,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -9397,7 +9399,7 @@ var devToolsConfig$jscomp$inline_1034 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1223 = { @@ -9428,7 +9430,7 @@ var internals$jscomp$inline_1223 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1224 = __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 6d1431201c4ae..5217a3c441d93 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<> + * @generated SignedSource<> */ "use strict"; @@ -9484,10 +9484,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -10017,7 +10019,7 @@ var devToolsConfig$jscomp$inline_1117 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-test-renderer" }; (function (internals) { @@ -10061,7 +10063,7 @@ var devToolsConfig$jscomp$inline_1117 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); 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 36b7effc78858..c1a8fc2192eec 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<> + * @generated SignedSource<<547bd318a581226337229e507fdff7e4>> */ "use strict"; @@ -1741,7 +1741,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-native-fb-ffec9ec5b5-20240627"; + exports.version = "19.0.0-native-fb-e02baf6c92-20240627"; "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 37934454c0081..8c19a14269787 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<<4f2a029ed6d83dece5be6850f80680a9>> + * @generated SignedSource<> */ "use strict"; @@ -604,4 +604,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-ffec9ec5b5-20240627"; +exports.version = "19.0.0-native-fb-e02baf6c92-20240627"; 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 1c5b9083f3023..de0b3f1cbe1df 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<> + * @generated SignedSource<<8fed01692ebeb6102c3169cea0452442>> */ "use strict"; @@ -608,7 +608,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-native-fb-ffec9ec5b5-20240627"; +exports.version = "19.0.0-native-fb-e02baf6c92-20240627"; "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 13f087b3ad38b..9d09158773357 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 @@ -ffec9ec5b5c846f61d7b40e92f138e2a7b34f273 +e02baf6c92833a0d45a77fb2e741676f393c24f7 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 63284484e9bbb..f582183d7705f 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<> + * @generated SignedSource<<362f23653ecadf010c8628af12b5d28b>> */ "use strict"; @@ -3380,6 +3380,7 @@ __DEV__ && if ("children" !== key && "key" !== key) { null === fiber && ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), (fiber.return = returnFiber)); runWithFiberInDEV( fiber, @@ -13507,34 +13508,32 @@ __DEV__ && break; case REACT_PROFILER_TYPE: return ( + (type = pendingProps), (owner = mode), - "string" !== typeof pendingProps.id && + "string" !== typeof type.id && error$jscomp$0( 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', - typeof pendingProps.id + typeof type.id ), - (owner = createFiber(12, pendingProps, key, owner | 2)), - (owner.elementType = REACT_PROFILER_TYPE), - (owner.lanes = lanes), - (owner.stateNode = { - effectDuration: 0, - passiveEffectDuration: 0 - }), - owner + (key = createFiber(12, type, key, owner | 2)), + (key.elementType = REACT_PROFILER_TYPE), + (key.lanes = lanes), + (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), + key ); case REACT_SUSPENSE_TYPE: return ( - (owner = createFiber(13, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(13, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_TYPE), + (key.lanes = lanes), + key ); case REACT_SUSPENSE_LIST_TYPE: return ( - (owner = createFiber(19, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_LIST_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(19, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_LIST_TYPE), + (key.lanes = lanes), + key ); case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); @@ -13560,40 +13559,43 @@ __DEV__ && resolvedType = null; break a; } - lanes = ""; + resolvedType = ""; if ( void 0 === type || ("object" === typeof type && null !== type && 0 === Object.keys(type).length) ) - lanes += + resolvedType += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; null === type - ? (type = "null") + ? (pendingProps = "null") : isArrayImpl(type) - ? (type = "array") + ? (pendingProps = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((type = + ? ((pendingProps = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (lanes = + (resolvedType = " Did you accidentally export a JSX literal instead of a component?")) - : (type = typeof type); - owner = owner + : (pendingProps = typeof type); + fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null : null; - owner && - (lanes += "\n\nCheck the render method of `" + owner + "`."); - throw Error( + fiberTag && + (resolvedType += + "\n\nCheck the render method of `" + fiberTag + "`."); + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - (type + "." + lanes) + (pendingProps + "." + resolvedType) ); + resolvedType = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -16677,12 +16679,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); })({ findFiberByHostInstance: getInstanceFromNode, bundleType: 1, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", 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 8cd6e59fd253a..ea8bab3a8afda 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<<80c3cccbcfc47f592774aff504fb92c0>> + * @generated SignedSource<> */ "use strict"; @@ -10216,10 +10216,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -10592,7 +10594,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1136 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10635,7 +10637,7 @@ var internals$jscomp$inline_1362 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }; 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 455fc582ae149..6b3eef007d095 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<<427638dcd086a328cea1303054a94dcd>> + * @generated SignedSource<<3b22c4c9bbdc85d394760e31e09a8df9>> */ "use strict"; @@ -10915,10 +10915,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -11298,7 +11300,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1217 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11354,7 +11356,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); 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 19114816dbcd0..39808aa52252d 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<<445c2206894a08f72ad954a38aa6f395>> + * @generated SignedSource<> */ "use strict"; @@ -3326,6 +3326,7 @@ __DEV__ && if ("children" !== key && "key" !== key) { null === fiber && ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), (fiber.return = returnFiber)); runWithFiberInDEV( fiber, @@ -13643,34 +13644,32 @@ __DEV__ && break; case REACT_PROFILER_TYPE: return ( + (type = pendingProps), (owner = mode), - "string" !== typeof pendingProps.id && + "string" !== typeof type.id && error$jscomp$0( 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', - typeof pendingProps.id + typeof type.id ), - (owner = createFiber(12, pendingProps, key, owner | 2)), - (owner.elementType = REACT_PROFILER_TYPE), - (owner.lanes = lanes), - (owner.stateNode = { - effectDuration: 0, - passiveEffectDuration: 0 - }), - owner + (key = createFiber(12, type, key, owner | 2)), + (key.elementType = REACT_PROFILER_TYPE), + (key.lanes = lanes), + (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), + key ); case REACT_SUSPENSE_TYPE: return ( - (owner = createFiber(13, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(13, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_TYPE), + (key.lanes = lanes), + key ); case REACT_SUSPENSE_LIST_TYPE: return ( - (owner = createFiber(19, pendingProps, key, mode)), - (owner.elementType = REACT_SUSPENSE_LIST_TYPE), - (owner.lanes = lanes), - owner + (key = createFiber(19, pendingProps, key, mode)), + (key.elementType = REACT_SUSPENSE_LIST_TYPE), + (key.lanes = lanes), + key ); case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); @@ -13696,40 +13695,43 @@ __DEV__ && resolvedType = null; break a; } - lanes = ""; + resolvedType = ""; if ( void 0 === type || ("object" === typeof type && null !== type && 0 === Object.keys(type).length) ) - lanes += + resolvedType += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; null === type - ? (type = "null") + ? (pendingProps = "null") : isArrayImpl(type) - ? (type = "array") + ? (pendingProps = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((type = + ? ((pendingProps = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (lanes = + (resolvedType = " Did you accidentally export a JSX literal instead of a component?")) - : (type = typeof type); - owner = owner + : (pendingProps = typeof type); + fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null : null; - owner && - (lanes += "\n\nCheck the render method of `" + owner + "`."); - throw Error( + fiberTag && + (resolvedType += + "\n\nCheck the render method of `" + fiberTag + "`."); + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + - (type + "." + lanes) + (pendingProps + "." + resolvedType) ); + resolvedType = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -16865,11 +16867,11 @@ __DEV__ && var emptyObject = {}; Object.freeze(emptyObject); var isomorphicReactPackageVersion = React.version; - if ("19.0.0-native-fb-ffec9ec5b5-20240627" !== isomorphicReactPackageVersion) + if ("19.0.0-native-fb-e02baf6c92-20240627" !== 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-ffec9ec5b5-20240627\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-e02baf6c92-20240627\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -16917,12 +16919,12 @@ __DEV__ && scheduleRoot: scheduleRoot, setRefreshHandler: setRefreshHandler, getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); })({ findFiberByHostInstance: getInstanceFromTag, bundleType: 1, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", 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 8b39976eac906..899b18775de37 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<<0f9f3949b329c894da01bb07246de2dd>> + * @generated SignedSource<<45f2decc15fefdff8d8b2d1c52772351>> */ "use strict"; @@ -10410,10 +10410,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -10746,11 +10748,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-ffec9ec5b5-20240627" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-e02baf6c92-20240627" !== 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-ffec9ec5b5-20240627\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-e02baf6c92-20240627\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -10800,7 +10802,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1210 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10843,7 +10845,7 @@ var internals$jscomp$inline_1457 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }; 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 ba756216fb125..717d347204771 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<> + * @generated SignedSource<> */ "use strict"; @@ -11110,10 +11110,12 @@ function createFiberFromTypeAndProps( owner = null; break a; } - throw Error( + fiberTag = 29; + pendingProps = Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ((null === type ? "null" : typeof type) + ".") ); + owner = null; } key = createFiber(fiberTag, pendingProps, key, mode); key.elementType = type; @@ -11453,11 +11455,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-native-fb-ffec9ec5b5-20240627" !== isomorphicReactPackageVersion) +if ("19.0.0-native-fb-e02baf6c92-20240627" !== 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-ffec9ec5b5-20240627\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-native-fb-e02baf6c92-20240627\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11507,7 +11509,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1291 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-native-fb-ffec9ec5b5-20240627", + version: "19.0.0-native-fb-e02baf6c92-20240627", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11563,7 +11565,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-native-fb-ffec9ec5b5-20240627" + reconcilerVersion: "19.0.0-native-fb-e02baf6c92-20240627" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {