From 7e5c5c5adc78b2bb119cc5061d828ffb2cb7338b Mon Sep 17 00:00:00 2001 From: rickhanlonii Date: Fri, 29 Mar 2024 14:15:08 +0000 Subject: [PATCH] Revert "Remove module pattern function component support" (#28670) This breaks internal tests, so must be something in the refactor. Since it's the top commit let's revert and split into two PRs, one that removes the flag and one that does the refactor, so we can find the bug. DiffTrain build for commit https://github.com/facebook/react/commit/f2690747239533fa266612d2d4dd9ae88ea92fbc. --- .../cjs/ReactTestRenderer-dev.js | 274 +++++++++---- .../cjs/ReactTestRenderer-prod.js | 351 ++++++++-------- .../cjs/ReactTestRenderer-profiling.js | 357 ++++++++-------- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 282 +++++++++---- .../implementations/ReactFabric-prod.fb.js | 385 ++++++++++-------- .../ReactFabric-profiling.fb.js | 379 +++++++++-------- .../ReactNativeRenderer-dev.fb.js | 282 +++++++++---- .../ReactNativeRenderer-prod.fb.js | 385 ++++++++++-------- .../ReactNativeRenderer-profiling.fb.js | 379 +++++++++-------- 10 files changed, 1818 insertions(+), 1258 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index d51df55f2ece6..8b3fe5a1b2329 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -153,6 +153,8 @@ if (__DEV__) { var FunctionComponent = 0; var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. @@ -431,6 +433,7 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: + case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -2714,6 +2717,7 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -4821,6 +4825,7 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList", owner); case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type, owner); @@ -12118,6 +12123,17 @@ if (__DEV__) { } } + function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + + { + instance._reactInternalInstance = fakeInternalInstance; + } + } + function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = false; var unmaskedContext = emptyContextObject; @@ -12181,14 +12197,7 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates - - set(instance, workInProgress); - - { - instance._reactInternalInstance = fakeInternalInstance; - } + adoptClassInstance(workInProgress, instance); { if ( @@ -13452,6 +13461,7 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; + var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -13462,6 +13472,7 @@ if (__DEV__) { { didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -14074,39 +14085,6 @@ if (__DEV__) { nextProps, renderLanes ) { - { - if ( - Component.prototype && - typeof Component.prototype.render === "function" - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - - if (!didWarnAboutBadClass[componentName]) { - error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + - "This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ); - - didWarnAboutBadClass[componentName] = true; - } - } - - if (workInProgress.mode & StrictLegacyMode) { - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - } - - if (current === null) { - // Some validations were previously done in mountIndeterminateComponent however and are now run - // in updateFuntionComponent but only on mount - validateFunctionComponentInDev(workInProgress, workInProgress.type); - } - } - var context; { @@ -14537,68 +14515,70 @@ if (__DEV__) { var Component = init(payload); // Store the unwrapped component in the type. workInProgress.type = Component; + var resolvedTag = (workInProgress.tag = + resolveLazyComponentTag(Component)); var resolvedProps = resolveDefaultProps(Component, props); + var child; - if (typeof Component === "function") { - if (isFunctionClassComponent(Component)) { - workInProgress.tag = ClassComponent; - + switch (resolvedTag) { + case FunctionComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - return updateClassComponent( + child = updateFunctionComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - } else { - workInProgress.tag = FunctionComponent; + return child; + } + case ClassComponent: { { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - return updateFunctionComponent( + child = updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); + return child; } - } else if (Component !== undefined && Component !== null) { - var $$typeof = Component.$$typeof; - - if ($$typeof === REACT_FORWARD_REF_TYPE) { - workInProgress.tag = ForwardRef; + case ForwardRef: { { workInProgress.type = Component = resolveForwardRefForHotReloading(Component); } - return updateForwardRef( + child = updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - } else if ($$typeof === REACT_MEMO_TYPE) { - workInProgress.tag = MemoComponent; - return updateMemoComponent( + return child; + } + + case MemoComponent: { + child = updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); + return child; } } @@ -14660,6 +14640,111 @@ if (__DEV__) { ); } + function mountIndeterminateComponent( + _current, + workInProgress, + Component, + renderLanes + ) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var context; + + { + var unmaskedContext = getUnmaskedContext( + workInProgress, + Component, + false + ); + context = getMaskedContext(workInProgress, unmaskedContext); + } + + prepareToReadContext(workInProgress, renderLanes); + var value; + + { + if ( + Component.prototype && + typeof Component.prototype.render === "function" + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutBadClass[componentName]) { + error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + + "This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ); + + didWarnAboutBadClass[componentName] = true; + } + } + + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + } + + setIsRendering(true); + ReactCurrentOwner$1.current = workInProgress; + value = renderWithHooks( + null, + workInProgress, + Component, + props, + context, + renderLanes + ); + setIsRendering(false); + } + + workInProgress.flags |= PerformedWork; + + { + // Support for module components is deprecated and is removed behind a flag. + // Whether or not it would crash later, we want to show a good message in DEV first. + if ( + typeof value === "object" && + value !== null && + typeof value.render === "function" && + value.$$typeof === undefined + ) { + var _componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutModulePatternComponent[_componentName]) { + error( + "The <%s /> component appears to be a function component that returns a class instance. " + + "Change %s to a class that extends React.Component instead. " + + "If you can't use a class try assigning the prototype on the function as a workaround. " + + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + + "cannot be called with `new` by React.", + _componentName, + _componentName, + _componentName + ); + + didWarnAboutModulePatternComponent[_componentName] = true; + } + } + } + + { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + + reconcileChildren(null, workInProgress, value, renderLanes); + + { + validateFunctionComponentInDev(workInProgress, Component); + } + + return workInProgress.child; + } + } + function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -14696,32 +14781,33 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName = getComponentNameFromType(Component) || "Unknown"; + var _componentName3 = + getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName + _componentName3 ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName2 = + var _componentName4 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName2 + _componentName4 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = true; } } @@ -14730,16 +14816,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName3 = + var _componentName5 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { error( "%s: Function components do not support contextType.", - _componentName3 + _componentName5 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; } } } @@ -16423,6 +16509,15 @@ if (__DEV__) { workInProgress.lanes = NoLanes; switch (workInProgress.tag) { + case IndeterminateComponent: { + return mountIndeterminateComponent( + current, + workInProgress, + workInProgress.type, + renderLanes + ); + } + case LazyComponent: { var elementType = workInProgress.elementType; return mountLazyComponent( @@ -17571,6 +17666,7 @@ if (__DEV__) { var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing switch (workInProgress.tag) { + case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -23602,6 +23698,12 @@ if (__DEV__) { } switch (unitOfWork.tag) { + case IndeterminateComponent: { + // Because it suspended with `use`, we can assume it's a + // function component. + unitOfWork.tag = FunctionComponent; // Fallthrough to the next branch. + } + case SimpleMemoComponent: case FunctionComponent: { // Resolve `defaultProps`. This logic is copied from `beginWork`. @@ -24741,6 +24843,7 @@ if (__DEV__) { var tag = fiber.tag; if ( + tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -25526,8 +25629,22 @@ if (__DEV__) { type.defaultProps === undefined ); } - function isFunctionClassComponent(type) { - return shouldConstruct(type); + function resolveLazyComponentTag(Component) { + if (typeof Component === "function") { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + + return IndeterminateComponent; } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -25612,6 +25729,7 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { + case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -25737,7 +25855,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -26134,7 +26252,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-canary-9424bca2"; + var ReactVersion = "19.0.0-canary-6c021864"; // Might add PROFILE later. diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index 01ff9e00765d1..bb48ab22a127d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<4246320e0183f27d5d91164123c6a1a5>> + * @generated SignedSource<> */ "use strict"; @@ -161,6 +161,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -1267,6 +1268,7 @@ function describeFiber(fiber) { case 19: return describeComponentFrame("SuspenseList", null); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -4903,95 +4905,112 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5000,24 +5019,24 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: @@ -5025,9 +5044,9 @@ function beginWork(current, workInProgress, renderLanes) { case 5: return ( pushHostContext(workInProgress), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -5035,17 +5054,17 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = init), + (HostTransitionContext._currentValue2 = context), didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, renderLanes )), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 6: @@ -5058,35 +5077,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5122,15 +5136,15 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = workInProgress.type._context; - init = workInProgress.pendingProps; + Component = workInProgress.type._context; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -5140,33 +5154,37 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (context = workInProgress.type), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (elementType = elementType(init)), + (context = readContext(context)), + (Component = Component(context)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5180,24 +5198,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -5210,39 +5228,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -5528,6 +5546,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -8036,6 +8055,8 @@ function performUnitOfWork(unitOfWork) { function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -8484,6 +8505,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -8561,7 +8592,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -9150,19 +9181,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_995 = { +var devToolsConfig$jscomp$inline_1009 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-canary-519dded5", + version: "19.0.0-canary-34d57ea6", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1180 = { - bundleType: devToolsConfig$jscomp$inline_995.bundleType, - version: devToolsConfig$jscomp$inline_995.version, - rendererPackageName: devToolsConfig$jscomp$inline_995.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_995.rendererConfig, +var internals$jscomp$inline_1197 = { + bundleType: devToolsConfig$jscomp$inline_1009.bundleType, + version: devToolsConfig$jscomp$inline_1009.version, + rendererPackageName: devToolsConfig$jscomp$inline_1009.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1009.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9179,26 +9210,26 @@ var internals$jscomp$inline_1180 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_995.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1009.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-519dded5" + reconcilerVersion: "19.0.0-canary-34d57ea6" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1181 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1198 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1181.isDisabled && - hook$jscomp$inline_1181.supportsFiber + !hook$jscomp$inline_1198.isDisabled && + hook$jscomp$inline_1198.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1181.inject( - internals$jscomp$inline_1180 + (rendererID = hook$jscomp$inline_1198.inject( + internals$jscomp$inline_1197 )), - (injectedHook = hook$jscomp$inline_1181); + (injectedHook = hook$jscomp$inline_1198); } catch (err) {} } exports._Scheduler = Scheduler; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index 1e3125dd8fdf2..c8c6e0dbd157c 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5ba107fe7188cdee7f75daa50f35f021>> + * @generated SignedSource<> */ "use strict"; @@ -161,6 +161,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -1285,6 +1286,7 @@ function describeFiber(fiber) { case 19: return describeComponentFrame("SuspenseList", null); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -5005,95 +5007,112 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5102,24 +5121,24 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: @@ -5127,9 +5146,9 @@ function beginWork(current, workInProgress, renderLanes) { case 5: return ( pushHostContext(workInProgress), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), null !== workInProgress.memoizedState && - ((init = renderWithHooks( + ((context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -5137,17 +5156,17 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = init), + (HostTransitionContext._currentValue2 = context), didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, renderLanes )), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 6: @@ -5160,35 +5179,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5215,9 +5229,9 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = 0), - (elementType.passiveEffectDuration = 0), + (Component = workInProgress.stateNode), + (Component.effectDuration = 0), + (Component.passiveEffectDuration = 0), reconcileChildren( current, workInProgress, @@ -5228,15 +5242,15 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = workInProgress.type._context; - init = workInProgress.pendingProps; + Component = workInProgress.type._context; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -5246,33 +5260,37 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (context = workInProgress.type), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (elementType = elementType(init)), + (context = readContext(context)), + (Component = Component(context)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -5286,24 +5304,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -5316,39 +5334,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -5670,6 +5688,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -8391,6 +8410,8 @@ function replaySuspendedUnitOfWork(unitOfWork) { isProfilingMode = 0 !== (unitOfWork.mode & 2); isProfilingMode && startProfilerTimer(unitOfWork); switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -8899,6 +8920,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -8984,7 +9015,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -9576,19 +9607,19 @@ function wrapFiber(fiber) { fiberToWrapper.set(fiber, wrapper)); return wrapper; } -var devToolsConfig$jscomp$inline_1038 = { +var devToolsConfig$jscomp$inline_1052 = { findFiberByHostInstance: function () { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-canary-d49e00ea", + version: "19.0.0-canary-a4b56d0a", rendererPackageName: "react-test-renderer" }; -var internals$jscomp$inline_1221 = { - bundleType: devToolsConfig$jscomp$inline_1038.bundleType, - version: devToolsConfig$jscomp$inline_1038.version, - rendererPackageName: devToolsConfig$jscomp$inline_1038.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1038.rendererConfig, +var internals$jscomp$inline_1238 = { + bundleType: devToolsConfig$jscomp$inline_1052.bundleType, + version: devToolsConfig$jscomp$inline_1052.version, + rendererPackageName: devToolsConfig$jscomp$inline_1052.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1052.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -9605,26 +9636,26 @@ var internals$jscomp$inline_1221 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1038.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1052.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-d49e00ea" + reconcilerVersion: "19.0.0-canary-a4b56d0a" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1222 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1222.isDisabled && - hook$jscomp$inline_1222.supportsFiber + !hook$jscomp$inline_1239.isDisabled && + hook$jscomp$inline_1239.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1222.inject( - internals$jscomp$inline_1221 + (rendererID = hook$jscomp$inline_1239.inject( + internals$jscomp$inline_1238 )), - (injectedHook = hook$jscomp$inline_1222); + (injectedHook = hook$jscomp$inline_1239); } catch (err) {} } exports._Scheduler = Scheduler; 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 34b653fcecb35..b0f7ca9619362 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 @@ -cc56bed38cbe5a5c76dfdc4e9c642fab4884a3fc +f2690747239533fa266612d2d4dd9ae88ea92fbc 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 5747da973e60d..b1fdfd135c4e3 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<<2940dab0e5bb073c10640613b89c3d00>> + * @generated SignedSource<> */ "use strict"; @@ -993,6 +993,8 @@ if (__DEV__) { var FunctionComponent = 0; var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. @@ -5378,6 +5380,7 @@ to return true:wantsResponderID| | case ClassComponent: case FunctionComponent: case IncompleteClassComponent: + case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -6194,6 +6197,7 @@ to return true:wantsResponderID| | return "SuspenseList"; case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -8612,6 +8616,7 @@ to return true:wantsResponderID| | return describeBuiltInComponentFrame("SuspenseList", owner); case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type, owner); @@ -16110,6 +16115,17 @@ to return true:wantsResponderID| | } } + function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + + { + instance._reactInternalInstance = fakeInternalInstance; + } + } + function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = false; var unmaskedContext = emptyContextObject; @@ -16185,14 +16201,7 @@ to return true:wantsResponderID| | instance.state !== null && instance.state !== undefined ? instance.state : null); - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates - - set(instance, workInProgress); - - { - instance._reactInternalInstance = fakeInternalInstance; - } + adoptClassInstance(workInProgress, instance); { if ( @@ -17463,6 +17472,7 @@ to return true:wantsResponderID| | ); var didReceiveUpdate = false; var didWarnAboutBadClass; + var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -17473,6 +17483,7 @@ to return true:wantsResponderID| | { didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -18093,39 +18104,6 @@ to return true:wantsResponderID| | nextProps, renderLanes ) { - { - if ( - Component.prototype && - typeof Component.prototype.render === "function" - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - - if (!didWarnAboutBadClass[componentName]) { - error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + - "This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ); - - didWarnAboutBadClass[componentName] = true; - } - } - - if (workInProgress.mode & StrictLegacyMode) { - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - } - - if (current === null) { - // Some validations were previously done in mountIndeterminateComponent however and are now run - // in updateFuntionComponent but only on mount - validateFunctionComponentInDev(workInProgress, workInProgress.type); - } - } - var context; { @@ -18590,68 +18568,70 @@ to return true:wantsResponderID| | var Component = init(payload); // Store the unwrapped component in the type. workInProgress.type = Component; + var resolvedTag = (workInProgress.tag = + resolveLazyComponentTag(Component)); var resolvedProps = resolveDefaultProps(Component, props); + var child; - if (typeof Component === "function") { - if (isFunctionClassComponent(Component)) { - workInProgress.tag = ClassComponent; - + switch (resolvedTag) { + case FunctionComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - return updateClassComponent( + child = updateFunctionComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - } else { - workInProgress.tag = FunctionComponent; + return child; + } + case ClassComponent: { { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - return updateFunctionComponent( + child = updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); + return child; } - } else if (Component !== undefined && Component !== null) { - var $$typeof = Component.$$typeof; - - if ($$typeof === REACT_FORWARD_REF_TYPE) { - workInProgress.tag = ForwardRef; + case ForwardRef: { { workInProgress.type = Component = resolveForwardRefForHotReloading(Component); } - return updateForwardRef( + child = updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - } else if ($$typeof === REACT_MEMO_TYPE) { - workInProgress.tag = MemoComponent; - return updateMemoComponent( + return child; + } + + case MemoComponent: { + child = updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); + return child; } } @@ -18713,6 +18693,119 @@ to return true:wantsResponderID| | ); } + function mountIndeterminateComponent( + _current, + workInProgress, + Component, + renderLanes + ) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var context; + + { + var unmaskedContext = getUnmaskedContext( + workInProgress, + Component, + false + ); + context = getMaskedContext(workInProgress, unmaskedContext); + } + + prepareToReadContext(workInProgress, renderLanes); + var value; + + { + markComponentRenderStarted(workInProgress); + } + + { + if ( + Component.prototype && + typeof Component.prototype.render === "function" + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutBadClass[componentName]) { + error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + + "This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ); + + didWarnAboutBadClass[componentName] = true; + } + } + + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + } + + setIsRendering(true); + ReactCurrentOwner$2.current = workInProgress; + value = renderWithHooks( + null, + workInProgress, + Component, + props, + context, + renderLanes + ); + setIsRendering(false); + } + + { + markComponentRenderStopped(); + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + + { + // Support for module components is deprecated and is removed behind a flag. + // Whether or not it would crash later, we want to show a good message in DEV first. + if ( + typeof value === "object" && + value !== null && + typeof value.render === "function" && + value.$$typeof === undefined + ) { + var _componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutModulePatternComponent[_componentName]) { + error( + "The <%s /> component appears to be a function component that returns a class instance. " + + "Change %s to a class that extends React.Component instead. " + + "If you can't use a class try assigning the prototype on the function as a workaround. " + + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + + "cannot be called with `new` by React.", + _componentName, + _componentName, + _componentName + ); + + didWarnAboutModulePatternComponent[_componentName] = true; + } + } + } + + { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + + reconcileChildren(null, workInProgress, value, renderLanes); + + { + validateFunctionComponentInDev(workInProgress, Component); + } + + return workInProgress.child; + } + } + function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -18749,32 +18842,33 @@ to return true:wantsResponderID| | } if (Component.defaultProps !== undefined) { - var _componentName = getComponentNameFromType(Component) || "Unknown"; + var _componentName3 = + getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName + _componentName3 ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName2 = + var _componentName4 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName2 + _componentName4 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = true; } } @@ -18783,16 +18877,16 @@ to return true:wantsResponderID| | typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName3 = + var _componentName5 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { error( "%s: Function components do not support contextType.", - _componentName3 + _componentName5 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; } } } @@ -20524,6 +20618,15 @@ to return true:wantsResponderID| | workInProgress.lanes = NoLanes; switch (workInProgress.tag) { + case IndeterminateComponent: { + return mountIndeterminateComponent( + current, + workInProgress, + workInProgress.type, + renderLanes + ); + } + case LazyComponent: { var elementType = workInProgress.elementType; return mountLazyComponent( @@ -21904,6 +22007,7 @@ to return true:wantsResponderID| | var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing switch (workInProgress.tag) { + case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -27736,6 +27840,12 @@ to return true:wantsResponderID| | } switch (unitOfWork.tag) { + case IndeterminateComponent: { + // Because it suspended with `use`, we can assume it's a + // function component. + unitOfWork.tag = FunctionComponent; // Fallthrough to the next branch. + } + case SimpleMemoComponent: case FunctionComponent: { // Resolve `defaultProps`. This logic is copied from `beginWork`. @@ -29044,6 +29154,7 @@ to return true:wantsResponderID| | var tag = fiber.tag; if ( + tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -29842,8 +29953,22 @@ to return true:wantsResponderID| | type.defaultProps === undefined ); } - function isFunctionClassComponent(type) { - return shouldConstruct(type); + function resolveLazyComponentTag(Component) { + if (typeof Component === "function") { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + + return IndeterminateComponent; } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -29928,6 +30053,7 @@ to return true:wantsResponderID| | workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { + case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -30046,7 +30172,7 @@ to return true:wantsResponderID| | mode, lanes ) { - var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -30457,7 +30583,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "19.0.0-canary-d286a6be"; + var ReactVersion = "19.0.0-canary-fb494e93"; function createPortal$1( children, 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 347f9b3af65b6..abe2d65c5dc3a 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<<2949dbdb6975d15ebcc9eddf576ec1e9>> + * @generated SignedSource<<290dfece63aea68ecb6f52375631b2ff>> */ "use strict"; @@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_245 = { +var injectedNamesToPlugins$jscomp$inline_246 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_245 = { } } }, - isOrderingDirty$jscomp$inline_246 = !1, - pluginName$jscomp$inline_247; -for (pluginName$jscomp$inline_247 in injectedNamesToPlugins$jscomp$inline_245) + isOrderingDirty$jscomp$inline_247 = !1, + pluginName$jscomp$inline_248; +for (pluginName$jscomp$inline_248 in injectedNamesToPlugins$jscomp$inline_246) if ( - injectedNamesToPlugins$jscomp$inline_245.hasOwnProperty( - pluginName$jscomp$inline_247 + injectedNamesToPlugins$jscomp$inline_246.hasOwnProperty( + pluginName$jscomp$inline_248 ) ) { - var pluginModule$jscomp$inline_248 = - injectedNamesToPlugins$jscomp$inline_245[pluginName$jscomp$inline_247]; + var pluginModule$jscomp$inline_249 = + injectedNamesToPlugins$jscomp$inline_246[pluginName$jscomp$inline_248]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_247) || - namesToPlugins[pluginName$jscomp$inline_247] !== - pluginModule$jscomp$inline_248 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_248) || + namesToPlugins[pluginName$jscomp$inline_248] !== + pluginModule$jscomp$inline_249 ) { - if (namesToPlugins[pluginName$jscomp$inline_247]) + if (namesToPlugins[pluginName$jscomp$inline_248]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_247 + "`.") + (pluginName$jscomp$inline_248 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_247] = - pluginModule$jscomp$inline_248; - isOrderingDirty$jscomp$inline_246 = !0; + namesToPlugins[pluginName$jscomp$inline_248] = + pluginModule$jscomp$inline_249; + isOrderingDirty$jscomp$inline_247 = !0; } } -isOrderingDirty$jscomp$inline_246 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_247 && recomputePluginOrdering(); var emptyObject$1 = {}, removedKeys = null, removedKeyCount = 0, @@ -1779,6 +1779,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -2773,6 +2774,7 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -6485,95 +6487,112 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6582,34 +6601,34 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: case 27: case 5: pushHostContext(workInProgress); - elementType = workInProgress.pendingProps.children; + Component = workInProgress.pendingProps.children; if (enableAsyncActions && null !== workInProgress.memoizedState) { if (!enableAsyncActions) throw Error("Not implemented."); - init = renderWithHooks( + context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6617,10 +6636,10 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes ); - HostTransitionContext._currentValue2 = init; + HostTransitionContext._currentValue2 = context; didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, @@ -6628,7 +6647,7 @@ function beginWork(current, workInProgress, renderLanes) { ); } markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, Component, renderLanes); return workInProgress.child; case 6: return null; @@ -6640,35 +6659,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6704,17 +6718,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = enableRenderableContext + Component = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -6724,35 +6738,39 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (context = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (elementType = elementType(init)), + (context = readContext(context)), + (Component = Component(context)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6766,24 +6784,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -6796,39 +6814,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -7225,6 +7243,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -9618,6 +9637,8 @@ function performUnitOfWork(unitOfWork) { function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -10089,6 +10110,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -10166,7 +10197,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -10605,10 +10636,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1090 = { + devToolsConfig$jscomp$inline_1104 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-canary-d52afae6", + version: "19.0.0-canary-c845e507", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10624,11 +10655,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1324 = { - bundleType: devToolsConfig$jscomp$inline_1090.bundleType, - version: devToolsConfig$jscomp$inline_1090.version, - rendererPackageName: devToolsConfig$jscomp$inline_1090.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1090.rendererConfig, +var internals$jscomp$inline_1341 = { + bundleType: devToolsConfig$jscomp$inline_1104.bundleType, + version: devToolsConfig$jscomp$inline_1104.version, + rendererPackageName: devToolsConfig$jscomp$inline_1104.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1104.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10644,26 +10675,26 @@ var internals$jscomp$inline_1324 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1090.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1104.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-d52afae6" + reconcilerVersion: "19.0.0-canary-c845e507" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1342 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1325.isDisabled && - hook$jscomp$inline_1325.supportsFiber + !hook$jscomp$inline_1342.isDisabled && + hook$jscomp$inline_1342.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1325.inject( - internals$jscomp$inline_1324 + (rendererID = hook$jscomp$inline_1342.inject( + internals$jscomp$inline_1341 )), - (injectedHook = hook$jscomp$inline_1325); + (injectedHook = hook$jscomp$inline_1342); } catch (err) {} } exports.createPortal = function (children, containerTag) { 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 487177daa9147..75375f750c39c 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<<5e0c58c3be0c39fa62556d95d99f1f0d>> + * @generated SignedSource<<48687683c293fb45d02204564978a6b7>> */ "use strict"; @@ -897,7 +897,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_261 = { +var injectedNamesToPlugins$jscomp$inline_262 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -943,32 +943,32 @@ var injectedNamesToPlugins$jscomp$inline_261 = { } } }, - isOrderingDirty$jscomp$inline_262 = !1, - pluginName$jscomp$inline_263; -for (pluginName$jscomp$inline_263 in injectedNamesToPlugins$jscomp$inline_261) + isOrderingDirty$jscomp$inline_263 = !1, + pluginName$jscomp$inline_264; +for (pluginName$jscomp$inline_264 in injectedNamesToPlugins$jscomp$inline_262) if ( - injectedNamesToPlugins$jscomp$inline_261.hasOwnProperty( - pluginName$jscomp$inline_263 + injectedNamesToPlugins$jscomp$inline_262.hasOwnProperty( + pluginName$jscomp$inline_264 ) ) { - var pluginModule$jscomp$inline_264 = - injectedNamesToPlugins$jscomp$inline_261[pluginName$jscomp$inline_263]; + var pluginModule$jscomp$inline_265 = + injectedNamesToPlugins$jscomp$inline_262[pluginName$jscomp$inline_264]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_263) || - namesToPlugins[pluginName$jscomp$inline_263] !== - pluginModule$jscomp$inline_264 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_264) || + namesToPlugins[pluginName$jscomp$inline_264] !== + pluginModule$jscomp$inline_265 ) { - if (namesToPlugins[pluginName$jscomp$inline_263]) + if (namesToPlugins[pluginName$jscomp$inline_264]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_263 + "`.") + (pluginName$jscomp$inline_264 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_263] = - pluginModule$jscomp$inline_264; - isOrderingDirty$jscomp$inline_262 = !0; + namesToPlugins[pluginName$jscomp$inline_264] = + pluginModule$jscomp$inline_265; + isOrderingDirty$jscomp$inline_263 = !0; } } -isOrderingDirty$jscomp$inline_262 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_263 && recomputePluginOrdering(); var emptyObject$1 = {}, removedKeys = null, removedKeyCount = 0, @@ -1901,6 +1901,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -2895,6 +2896,7 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -6709,95 +6711,114 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + markComponentRenderStarted(workInProgress); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + markComponentRenderStopped(); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6806,34 +6827,34 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: case 27: case 5: pushHostContext(workInProgress); - elementType = workInProgress.pendingProps.children; + Component = workInProgress.pendingProps.children; if (enableAsyncActions && null !== workInProgress.memoizedState) { if (!enableAsyncActions) throw Error("Not implemented."); - init = renderWithHooks( + context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6841,10 +6862,10 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes ); - HostTransitionContext._currentValue2 = init; + HostTransitionContext._currentValue2 = context; didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, @@ -6852,7 +6873,7 @@ function beginWork(current, workInProgress, renderLanes) { ); } markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, Component, renderLanes); return workInProgress.child; case 6: return null; @@ -6864,35 +6885,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6919,9 +6935,9 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = 0), - (elementType.passiveEffectDuration = 0), + (Component = workInProgress.stateNode), + (Component.effectDuration = 0), + (Component.passiveEffectDuration = 0), reconcileChildren( current, workInProgress, @@ -6932,17 +6948,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = enableRenderableContext + Component = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -6952,37 +6968,41 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (context = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), + (context = readContext(context)), markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), + (Component = Component(context)), markComponentRenderStopped(), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6996,24 +7016,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -7026,39 +7046,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -7491,6 +7511,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -10216,6 +10237,8 @@ function replaySuspendedUnitOfWork(unitOfWork) { isProfilingMode = 0 !== (unitOfWork.mode & 2); isProfilingMode && startProfilerTimer(unitOfWork); switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -10778,6 +10801,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -10863,7 +10896,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -11310,10 +11343,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1172 = { + devToolsConfig$jscomp$inline_1186 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-canary-c51895a2", + version: "19.0.0-canary-b92bb150", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11343,10 +11376,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1172.bundleType, - version: devToolsConfig$jscomp$inline_1172.version, - rendererPackageName: devToolsConfig$jscomp$inline_1172.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1172.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1186.bundleType, + version: devToolsConfig$jscomp$inline_1186.version, + rendererPackageName: devToolsConfig$jscomp$inline_1186.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1186.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11362,14 +11395,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1172.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1186.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-c51895a2" + reconcilerVersion: "19.0.0-canary-b92bb150" }); 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 e5b2888a93a26..99c9a40c61d48 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<<610f862d94a502bcce7f0e734ffe7472>> + * @generated SignedSource<<217faa179ec43aec470e31136cd73a9b>> */ "use strict"; @@ -993,6 +993,8 @@ if (__DEV__) { var FunctionComponent = 0; var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. @@ -2974,6 +2976,7 @@ to return true:wantsResponderID| | case ClassComponent: case FunctionComponent: case IncompleteClassComponent: + case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -6489,6 +6492,7 @@ to return true:wantsResponderID| | return "SuspenseList"; case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -8883,6 +8887,7 @@ to return true:wantsResponderID| | return describeBuiltInComponentFrame("SuspenseList", owner); case FunctionComponent: + case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type, owner); @@ -16381,6 +16386,17 @@ to return true:wantsResponderID| | } } + function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + + { + instance._reactInternalInstance = fakeInternalInstance; + } + } + function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = false; var unmaskedContext = emptyContextObject; @@ -16456,14 +16472,7 @@ to return true:wantsResponderID| | instance.state !== null && instance.state !== undefined ? instance.state : null); - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates - - set(instance, workInProgress); - - { - instance._reactInternalInstance = fakeInternalInstance; - } + adoptClassInstance(workInProgress, instance); { if ( @@ -17734,6 +17743,7 @@ to return true:wantsResponderID| | ); var didReceiveUpdate = false; var didWarnAboutBadClass; + var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -17744,6 +17754,7 @@ to return true:wantsResponderID| | { didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -18364,39 +18375,6 @@ to return true:wantsResponderID| | nextProps, renderLanes ) { - { - if ( - Component.prototype && - typeof Component.prototype.render === "function" - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - - if (!didWarnAboutBadClass[componentName]) { - error( - "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + - "This is likely to cause errors. Change %s to extend React.Component instead.", - componentName, - componentName - ); - - didWarnAboutBadClass[componentName] = true; - } - } - - if (workInProgress.mode & StrictLegacyMode) { - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - } - - if (current === null) { - // Some validations were previously done in mountIndeterminateComponent however and are now run - // in updateFuntionComponent but only on mount - validateFunctionComponentInDev(workInProgress, workInProgress.type); - } - } - var context; { @@ -18861,68 +18839,70 @@ to return true:wantsResponderID| | var Component = init(payload); // Store the unwrapped component in the type. workInProgress.type = Component; + var resolvedTag = (workInProgress.tag = + resolveLazyComponentTag(Component)); var resolvedProps = resolveDefaultProps(Component, props); + var child; - if (typeof Component === "function") { - if (isFunctionClassComponent(Component)) { - workInProgress.tag = ClassComponent; - + switch (resolvedTag) { + case FunctionComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - return updateClassComponent( + child = updateFunctionComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - } else { - workInProgress.tag = FunctionComponent; + return child; + } + case ClassComponent: { { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - return updateFunctionComponent( + child = updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); + return child; } - } else if (Component !== undefined && Component !== null) { - var $$typeof = Component.$$typeof; - - if ($$typeof === REACT_FORWARD_REF_TYPE) { - workInProgress.tag = ForwardRef; + case ForwardRef: { { workInProgress.type = Component = resolveForwardRefForHotReloading(Component); } - return updateForwardRef( + child = updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - } else if ($$typeof === REACT_MEMO_TYPE) { - workInProgress.tag = MemoComponent; - return updateMemoComponent( + return child; + } + + case MemoComponent: { + child = updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); + return child; } } @@ -18984,6 +18964,119 @@ to return true:wantsResponderID| | ); } + function mountIndeterminateComponent( + _current, + workInProgress, + Component, + renderLanes + ) { + resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); + var props = workInProgress.pendingProps; + var context; + + { + var unmaskedContext = getUnmaskedContext( + workInProgress, + Component, + false + ); + context = getMaskedContext(workInProgress, unmaskedContext); + } + + prepareToReadContext(workInProgress, renderLanes); + var value; + + { + markComponentRenderStarted(workInProgress); + } + + { + if ( + Component.prototype && + typeof Component.prototype.render === "function" + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutBadClass[componentName]) { + error( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + + "This is likely to cause errors. Change %s to extend React.Component instead.", + componentName, + componentName + ); + + didWarnAboutBadClass[componentName] = true; + } + } + + if (workInProgress.mode & StrictLegacyMode) { + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + } + + setIsRendering(true); + ReactCurrentOwner$2.current = workInProgress; + value = renderWithHooks( + null, + workInProgress, + Component, + props, + context, + renderLanes + ); + setIsRendering(false); + } + + { + markComponentRenderStopped(); + } // React DevTools reads this flag. + + workInProgress.flags |= PerformedWork; + + { + // Support for module components is deprecated and is removed behind a flag. + // Whether or not it would crash later, we want to show a good message in DEV first. + if ( + typeof value === "object" && + value !== null && + typeof value.render === "function" && + value.$$typeof === undefined + ) { + var _componentName = getComponentNameFromType(Component) || "Unknown"; + + if (!didWarnAboutModulePatternComponent[_componentName]) { + error( + "The <%s /> component appears to be a function component that returns a class instance. " + + "Change %s to a class that extends React.Component instead. " + + "If you can't use a class try assigning the prototype on the function as a workaround. " + + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + + "cannot be called with `new` by React.", + _componentName, + _componentName, + _componentName + ); + + didWarnAboutModulePatternComponent[_componentName] = true; + } + } + } + + { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + + reconcileChildren(null, workInProgress, value, renderLanes); + + { + validateFunctionComponentInDev(workInProgress, Component); + } + + return workInProgress.child; + } + } + function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -19020,32 +19113,33 @@ to return true:wantsResponderID| | } if (Component.defaultProps !== undefined) { - var _componentName = getComponentNameFromType(Component) || "Unknown"; + var _componentName3 = + getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName + _componentName3 ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName2 = + var _componentName4 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName2 + _componentName4 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = true; } } @@ -19054,16 +19148,16 @@ to return true:wantsResponderID| | typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName3 = + var _componentName5 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { error( "%s: Function components do not support contextType.", - _componentName3 + _componentName5 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; } } } @@ -20795,6 +20889,15 @@ to return true:wantsResponderID| | workInProgress.lanes = NoLanes; switch (workInProgress.tag) { + case IndeterminateComponent: { + return mountIndeterminateComponent( + current, + workInProgress, + workInProgress.type, + renderLanes + ); + } + case LazyComponent: { var elementType = workInProgress.elementType; return mountLazyComponent( @@ -21942,6 +22045,7 @@ to return true:wantsResponderID| | var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing switch (workInProgress.tag) { + case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -28176,6 +28280,12 @@ to return true:wantsResponderID| | } switch (unitOfWork.tag) { + case IndeterminateComponent: { + // Because it suspended with `use`, we can assume it's a + // function component. + unitOfWork.tag = FunctionComponent; // Fallthrough to the next branch. + } + case SimpleMemoComponent: case FunctionComponent: { // Resolve `defaultProps`. This logic is copied from `beginWork`. @@ -29484,6 +29594,7 @@ to return true:wantsResponderID| | var tag = fiber.tag; if ( + tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -30282,8 +30393,22 @@ to return true:wantsResponderID| | type.defaultProps === undefined ); } - function isFunctionClassComponent(type) { - return shouldConstruct(type); + function resolveLazyComponentTag(Component) { + if (typeof Component === "function") { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + + return IndeterminateComponent; } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -30368,6 +30493,7 @@ to return true:wantsResponderID| | workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { + case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -30486,7 +30612,7 @@ to return true:wantsResponderID| | mode, lanes ) { - var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -30897,7 +31023,7 @@ to return true:wantsResponderID| | return root; } - var ReactVersion = "19.0.0-canary-10db70a4"; + var ReactVersion = "19.0.0-canary-59bec1ad"; function createPortal$1( children, 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 164f946ad5d73..dfe730b05eab7 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<<42abf16682357ce3e26053a1231d69e5>> + * @generated SignedSource<<41450bae9ba9bf1c2816655a8856184d>> */ "use strict"; @@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_252 = { +var injectedNamesToPlugins$jscomp$inline_253 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_252 = { } } }, - isOrderingDirty$jscomp$inline_253 = !1, - pluginName$jscomp$inline_254; -for (pluginName$jscomp$inline_254 in injectedNamesToPlugins$jscomp$inline_252) + isOrderingDirty$jscomp$inline_254 = !1, + pluginName$jscomp$inline_255; +for (pluginName$jscomp$inline_255 in injectedNamesToPlugins$jscomp$inline_253) if ( - injectedNamesToPlugins$jscomp$inline_252.hasOwnProperty( - pluginName$jscomp$inline_254 + injectedNamesToPlugins$jscomp$inline_253.hasOwnProperty( + pluginName$jscomp$inline_255 ) ) { - var pluginModule$jscomp$inline_255 = - injectedNamesToPlugins$jscomp$inline_252[pluginName$jscomp$inline_254]; + var pluginModule$jscomp$inline_256 = + injectedNamesToPlugins$jscomp$inline_253[pluginName$jscomp$inline_255]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_254) || - namesToPlugins[pluginName$jscomp$inline_254] !== - pluginModule$jscomp$inline_255 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_255) || + namesToPlugins[pluginName$jscomp$inline_255] !== + pluginModule$jscomp$inline_256 ) { - if (namesToPlugins[pluginName$jscomp$inline_254]) + if (namesToPlugins[pluginName$jscomp$inline_255]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_254 + "`.") + (pluginName$jscomp$inline_255 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_254] = - pluginModule$jscomp$inline_255; - isOrderingDirty$jscomp$inline_253 = !0; + namesToPlugins[pluginName$jscomp$inline_255] = + pluginModule$jscomp$inline_256; + isOrderingDirty$jscomp$inline_254 = !0; } } -isOrderingDirty$jscomp$inline_253 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_254 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1267,6 +1267,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -2838,6 +2839,7 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -6550,95 +6552,112 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6647,34 +6666,34 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: case 27: case 5: pushHostContext(workInProgress); - elementType = workInProgress.pendingProps.children; + Component = workInProgress.pendingProps.children; if (enableAsyncActions && null !== workInProgress.memoizedState) { if (!enableAsyncActions) throw Error("Not implemented."); - init = renderWithHooks( + context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6682,10 +6701,10 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes ); - HostTransitionContext._currentValue = init; + HostTransitionContext._currentValue = context; didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, @@ -6693,7 +6712,7 @@ function beginWork(current, workInProgress, renderLanes) { ); } markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, Component, renderLanes); return workInProgress.child; case 6: return null; @@ -6705,35 +6724,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6769,17 +6783,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = enableRenderableContext + Component = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -6789,35 +6803,39 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (context = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), - (elementType = elementType(init)), + (context = readContext(context)), + (Component = Component(context)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6831,24 +6849,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -6861,39 +6879,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -7179,6 +7197,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -9827,6 +9846,8 @@ function performUnitOfWork(unitOfWork) { function replaySuspendedUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -10298,6 +10319,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -10375,7 +10406,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -10821,10 +10852,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1157 = { + devToolsConfig$jscomp$inline_1171 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-canary-9504c155", + version: "19.0.0-canary-08707297", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10840,11 +10871,11 @@ var roots = new Map(), }.bind(null, findNodeHandle) } }; -var internals$jscomp$inline_1405 = { - bundleType: devToolsConfig$jscomp$inline_1157.bundleType, - version: devToolsConfig$jscomp$inline_1157.version, - rendererPackageName: devToolsConfig$jscomp$inline_1157.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1157.rendererConfig, +var internals$jscomp$inline_1422 = { + bundleType: devToolsConfig$jscomp$inline_1171.bundleType, + version: devToolsConfig$jscomp$inline_1171.version, + rendererPackageName: devToolsConfig$jscomp$inline_1171.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1171.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10860,26 +10891,26 @@ var internals$jscomp$inline_1405 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1157.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1171.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-9504c155" + reconcilerVersion: "19.0.0-canary-08707297" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1406 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1423 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1406.isDisabled && - hook$jscomp$inline_1406.supportsFiber + !hook$jscomp$inline_1423.isDisabled && + hook$jscomp$inline_1423.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1406.inject( - internals$jscomp$inline_1405 + (rendererID = hook$jscomp$inline_1423.inject( + internals$jscomp$inline_1422 )), - (injectedHook = hook$jscomp$inline_1406); + (injectedHook = hook$jscomp$inline_1423); } catch (err) {} } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { 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 5638b3c5a87ba..f4667a13c5ec8 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<<99b117fbe29590e38574e17bf42322b6>> + * @generated SignedSource<> */ "use strict"; @@ -897,7 +897,7 @@ eventPluginOrder = Array.prototype.slice.call([ "ReactNativeBridgeEventPlugin" ]); recomputePluginOrdering(); -var injectedNamesToPlugins$jscomp$inline_268 = { +var injectedNamesToPlugins$jscomp$inline_269 = { ResponderEventPlugin: ResponderEventPlugin, ReactNativeBridgeEventPlugin: { eventTypes: {}, @@ -943,32 +943,32 @@ var injectedNamesToPlugins$jscomp$inline_268 = { } } }, - isOrderingDirty$jscomp$inline_269 = !1, - pluginName$jscomp$inline_270; -for (pluginName$jscomp$inline_270 in injectedNamesToPlugins$jscomp$inline_268) + isOrderingDirty$jscomp$inline_270 = !1, + pluginName$jscomp$inline_271; +for (pluginName$jscomp$inline_271 in injectedNamesToPlugins$jscomp$inline_269) if ( - injectedNamesToPlugins$jscomp$inline_268.hasOwnProperty( - pluginName$jscomp$inline_270 + injectedNamesToPlugins$jscomp$inline_269.hasOwnProperty( + pluginName$jscomp$inline_271 ) ) { - var pluginModule$jscomp$inline_271 = - injectedNamesToPlugins$jscomp$inline_268[pluginName$jscomp$inline_270]; + var pluginModule$jscomp$inline_272 = + injectedNamesToPlugins$jscomp$inline_269[pluginName$jscomp$inline_271]; if ( - !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_270) || - namesToPlugins[pluginName$jscomp$inline_270] !== - pluginModule$jscomp$inline_271 + !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_271) || + namesToPlugins[pluginName$jscomp$inline_271] !== + pluginModule$jscomp$inline_272 ) { - if (namesToPlugins[pluginName$jscomp$inline_270]) + if (namesToPlugins[pluginName$jscomp$inline_271]) throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + - (pluginName$jscomp$inline_270 + "`.") + (pluginName$jscomp$inline_271 + "`.") ); - namesToPlugins[pluginName$jscomp$inline_270] = - pluginModule$jscomp$inline_271; - isOrderingDirty$jscomp$inline_269 = !0; + namesToPlugins[pluginName$jscomp$inline_271] = + pluginModule$jscomp$inline_272; + isOrderingDirty$jscomp$inline_270 = !0; } } -isOrderingDirty$jscomp$inline_269 && recomputePluginOrdering(); +isOrderingDirty$jscomp$inline_270 && recomputePluginOrdering(); var instanceCache = new Map(), instanceProps = new Map(); function getInstanceFromTag(tag) { @@ -1271,6 +1271,7 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: + case 2: case 14: case 15: if ("function" === typeof type) @@ -2960,6 +2961,7 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: + case 2: case 15: return describeFunctionComponentFrame(fiber.type); case 11: @@ -6774,95 +6776,114 @@ function beginWork(current, workInProgress, renderLanes) { else didReceiveUpdate = !1; workInProgress.lanes = 0; switch (workInProgress.tag) { + case 2: + var Component = workInProgress.type; + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); + current = workInProgress.pendingProps; + var context = getMaskedContext( + workInProgress, + contextStackCursor$1.current + ); + prepareToReadContext(workInProgress, renderLanes); + markComponentRenderStarted(workInProgress); + current = renderWithHooks( + null, + workInProgress, + Component, + current, + context, + renderLanes + ); + markComponentRenderStopped(); + workInProgress.flags |= 1; + workInProgress.tag = 0; + reconcileChildren(null, workInProgress, current, renderLanes); + workInProgress = workInProgress.child; + return workInProgress; case 16: - var elementType = workInProgress.elementType; + Component = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = elementType._init; - elementType = init(elementType._payload); - workInProgress.type = elementType; - current = resolveDefaultProps(elementType, current); - if ("function" === typeof elementType) - shouldConstruct(elementType) - ? ((workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - elementType, - current, - renderLanes - ))); - else { - if (void 0 !== elementType && null !== elementType) - if ( - ((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - elementType, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - elementType, - resolveDefaultProps(elementType.type, current), - renderLanes - ); - break a; - } - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - elementType + - ". Lazy element type must resolve to a class or function." - ); + context = Component._init; + Component = context(Component._payload); + workInProgress.type = Component; + context = workInProgress.tag = resolveLazyComponentTag(Component); + current = resolveDefaultProps(Component, current); + switch (context) { + case 0: + workInProgress = updateFunctionComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 1: + workInProgress = updateClassComponent( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 11: + workInProgress = updateForwardRef( + null, + workInProgress, + Component, + current, + renderLanes + ); + break a; + case 14: + workInProgress = updateMemoComponent( + null, + workInProgress, + Component, + resolveDefaultProps(Component.type, current), + renderLanes + ); + break a; } + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + Component + + ". Lazy element type must resolve to a class or function." + ); } return workInProgress; case 0: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateFunctionComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); case 1: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateClassComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6871,34 +6892,34 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error("Should have a current fiber. This is a bug in React."); var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - elementType = init.element; + context = workInProgress.memoizedState; + Component = context.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== init.cache && + nextCache !== context.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - init = nextProps.element; - init === elementType + context = nextProps.element; + context === Component ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, init, renderLanes), + : (reconcileChildren(current, workInProgress, context, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: case 27: case 5: pushHostContext(workInProgress); - elementType = workInProgress.pendingProps.children; + Component = workInProgress.pendingProps.children; if (enableAsyncActions && null !== workInProgress.memoizedState) { if (!enableAsyncActions) throw Error("Not implemented."); - init = renderWithHooks( + context = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6906,10 +6927,10 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes ); - HostTransitionContext._currentValue = init; + HostTransitionContext._currentValue = context; didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== init && + current.memoizedState.memoizedState !== context && propagateContextChange( workInProgress, HostTransitionContext, @@ -6917,7 +6938,7 @@ function beginWork(current, workInProgress, renderLanes) { ); } markRef(current, workInProgress); - reconcileChildren(current, workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, Component, renderLanes); return workInProgress.child; case 6: return null; @@ -6929,35 +6950,30 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (elementType = workInProgress.pendingProps), + (Component = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - elementType, + Component, renderLanes )) - : reconcileChildren( - current, - workInProgress, - elementType, - renderLanes - ), + : reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 11: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), updateForwardRef( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -6984,9 +7000,9 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), - (elementType = workInProgress.stateNode), - (elementType.effectDuration = 0), - (elementType.passiveEffectDuration = 0), + (Component = workInProgress.stateNode), + (Component.effectDuration = 0), + (Component.passiveEffectDuration = 0), reconcileChildren( current, workInProgress, @@ -6997,17 +7013,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - elementType = enableRenderableContext + Component = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - init = workInProgress.pendingProps; + context = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, elementType, nextCache); + nextCache = context.value; + pushProvider(workInProgress, Component, nextCache); if (null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === init.children && + nextProps.children === context.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7017,37 +7033,41 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else - propagateContextChange(workInProgress, elementType, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); + } else propagateContextChange(workInProgress, Component, renderLanes); + reconcileChildren( + current, + workInProgress, + context.children, + renderLanes + ); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (init = enableRenderableContext + (context = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (elementType = workInProgress.pendingProps.children), + (Component = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (init = readContext(init)), + (context = readContext(context)), markComponentRenderStarted(workInProgress), - (elementType = elementType(init)), + (Component = Component(context)), markComponentRenderStopped(), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, elementType, renderLanes), + reconcileChildren(current, workInProgress, Component, renderLanes), workInProgress.child ); case 14: return ( - (elementType = workInProgress.type), - (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), - (init = resolveDefaultProps(elementType.type, init)), + (Component = workInProgress.type), + (context = resolveDefaultProps(Component, workInProgress.pendingProps)), + (context = resolveDefaultProps(Component.type, context)), updateMemoComponent( current, workInProgress, - elementType, - init, + Component, + context, renderLanes ) ); @@ -7061,24 +7081,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (elementType = workInProgress.type), - (init = workInProgress.pendingProps), - (init = - workInProgress.elementType === elementType - ? init - : resolveDefaultProps(elementType, init)), + (Component = workInProgress.type), + (context = workInProgress.pendingProps), + (context = + workInProgress.elementType === Component + ? context + : resolveDefaultProps(Component, context)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(elementType) + isContextProvider(Component) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, elementType, init), - mountClassInstance(workInProgress, elementType, init, renderLanes), + constructClassInstance(workInProgress, Component, context), + mountClassInstance(workInProgress, Component, context, renderLanes), finishClassComponent( null, workInProgress, - elementType, + Component, !0, current, renderLanes @@ -7091,39 +7111,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (elementType = readContext(CacheContext)), + (Component = readContext(CacheContext)), null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), + ? ((context = peekCacheFromPool()), + null === context && + ((context = workInProgressRoot), (nextProps = createCache()), - (init.pooledCache = nextProps), + (context.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), + null !== nextProps && (context.pooledCacheLanes |= renderLanes), + (context = nextProps)), (workInProgress.memoizedState = { - parent: elementType, - cache: init + parent: Component, + cache: context }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) + pushProvider(workInProgress, CacheContext, context)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), + (context = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== elementType - ? ((init = { parent: elementType, cache: elementType }), - (workInProgress.memoizedState = init), + context.parent !== Component + ? ((context = { parent: Component, cache: Component }), + (workInProgress.memoizedState = context), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, elementType)) - : ((elementType = nextProps.cache), - pushProvider(workInProgress, CacheContext, elementType), - elementType !== init.cache && + context), + pushProvider(workInProgress, CacheContext, Component)) + : ((Component = nextProps.cache), + pushProvider(workInProgress, CacheContext, Component), + Component !== context.cache && propagateContextChange( workInProgress, CacheContext, @@ -7445,6 +7465,7 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { + case 2: case 16: case 15: case 0: @@ -10426,6 +10447,8 @@ function replaySuspendedUnitOfWork(unitOfWork) { isProfilingMode = 0 !== (unitOfWork.mode & 2); isProfilingMode && startProfilerTimer(unitOfWork); switch (unitOfWork.tag) { + case 2: + unitOfWork.tag = 0; case 15: case 0: var Component = unitOfWork.type, @@ -10988,6 +11011,16 @@ function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); } +function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) + return shouldConstruct(Component) ? 1 : 0; + if (void 0 !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + return 2; +} function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; null === workInProgress @@ -11073,7 +11106,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 0; + var fiberTag = 2; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -11527,10 +11560,10 @@ batchedUpdatesImpl = function (fn, a) { } }; var roots = new Map(), - devToolsConfig$jscomp$inline_1239 = { + devToolsConfig$jscomp$inline_1253 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-canary-3546d2bf", + version: "19.0.0-canary-c3d7585f", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11560,10 +11593,10 @@ var roots = new Map(), } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1239.bundleType, - version: devToolsConfig$jscomp$inline_1239.version, - rendererPackageName: devToolsConfig$jscomp$inline_1239.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1239.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1253.bundleType, + version: devToolsConfig$jscomp$inline_1253.version, + rendererPackageName: devToolsConfig$jscomp$inline_1253.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1253.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -11579,14 +11612,14 @@ var roots = new Map(), return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1239.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1253.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-canary-3546d2bf" + reconcilerVersion: "19.0.0-canary-c3d7585f" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {