From 60fecf15ddcb4b1acc284f285ab7027da9e47515 Mon Sep 17 00:00:00 2001 From: gnoff Date: Thu, 28 Mar 2024 20:13:12 +0000 Subject: [PATCH] Remove module pattern function component support (#27742) The module pattern ``` function MyComponent() { return { render() { return this.state.foo } } } ``` has been deprecated for approximately 5 years now. This PR removes support for this pattern. It also simplifies a number of code paths in particular related to the concept of `IndeterminateComponent` types. DiffTrain build for [cc56bed38cbe5a5c76dfdc4e9c642fab4884a3fc](https://github.com/facebook/react/commit/cc56bed38cbe5a5c76dfdc4e9c642fab4884a3fc) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 280 +++------- compiled/facebook-www/ReactART-dev.modern.js | 289 ++++------- .../facebook-www/ReactART-prod.classic.js | 369 ++++++-------- compiled/facebook-www/ReactART-prod.modern.js | 280 +++++----- compiled/facebook-www/ReactDOM-dev.classic.js | 286 +++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 295 ++++------- .../facebook-www/ReactDOM-prod.classic.js | 481 ++++++++---------- compiled/facebook-www/ReactDOM-prod.modern.js | 372 +++++++------- .../ReactDOM-profiling.classic.js | 475 ++++++++--------- .../facebook-www/ReactDOM-profiling.modern.js | 366 +++++++------ .../ReactDOMServer-dev.classic.js | 86 +--- .../facebook-www/ReactDOMServer-dev.modern.js | 99 +--- .../ReactDOMServerStreaming-dev.modern.js | 97 +--- .../ReactDOMTesting-dev.classic.js | 286 +++-------- .../ReactDOMTesting-dev.modern.js | 295 ++++------- .../ReactDOMTesting-prod.classic.js | 481 ++++++++---------- .../ReactDOMTesting-prod.modern.js | 372 +++++++------- .../ReactTestRenderer-dev.classic.js | 272 +++------- .../ReactTestRenderer-dev.modern.js | 272 +++------- .../ReactTestUtils-dev.classic.js | 1 - .../facebook-www/ReactTestUtils-dev.modern.js | 1 - .../__test_utils__/ReactAllWarnings.js | 1 - 23 files changed, 2222 insertions(+), 3536 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 70b3b8d49d8a0..34b653fcecb35 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -63651c49e068a04cdc6ee1e2fa9c6125167987d2 +cc56bed38cbe5a5c76dfdc4e9c642fab4884a3fc diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 0ba93d0a5934c..5ccf98fe8c00b 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-classic-3513bb8c"; + var ReactVersion = "19.0.0-www-classic-726e2f78"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -199,8 +199,6 @@ 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. @@ -503,7 +501,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -3767,7 +3764,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -6126,7 +6122,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -13836,17 +13831,6 @@ 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; @@ -13922,7 +13906,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -15382,7 +15373,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -15393,7 +15383,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -16112,6 +16101,39 @@ 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; { @@ -16590,70 +16612,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -16715,119 +16735,6 @@ 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 (enableSchedulingProfiler) { - 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$1.current = workInProgress; - value = renderWithHooks( - null, - workInProgress, - Component, - props, - context, - renderLanes - ); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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) { @@ -16864,33 +16771,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -16899,16 +16805,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -18778,15 +18684,6 @@ 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( @@ -20527,7 +20424,6 @@ 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: @@ -27691,12 +27587,6 @@ 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`. @@ -29069,7 +28959,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -29868,22 +29757,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -29968,7 +29843,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -30094,7 +29968,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 3ddf97018148f..89de7b31b9623 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-modern-6b2eae4e"; + var ReactVersion = "19.0.0-www-modern-10db1517"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -199,8 +199,6 @@ 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. @@ -503,7 +501,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -3532,7 +3529,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -5891,7 +5887,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -13593,17 +13588,6 @@ 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 context = emptyContextObject; var contextType = ctor.contextType; @@ -13669,7 +13653,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -15106,7 +15097,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -15117,7 +15107,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -15836,6 +15825,47 @@ 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); + + if (Component.contextTypes) { + error( + "%s uses the legacy contextTypes API which was removed in React 19. " + + "Use React.createContext() with React.useContext() instead.", + getComponentNameFromType(Component) || "Unknown" + ); + } + } + } + var context; var nextChildren; @@ -16284,70 +16314,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -16408,120 +16436,6 @@ if (__DEV__) { ); } - function mountIndeterminateComponent( - _current, - workInProgress, - Component, - renderLanes - ) { - resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); - var props = workInProgress.pendingProps; - var context; - - prepareToReadContext(workInProgress, renderLanes); - var value; - - if (enableSchedulingProfiler) { - 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$1.current = workInProgress; - value = renderWithHooks( - null, - workInProgress, - Component, - props, - context, - renderLanes - ); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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; - - { - if (Component.contextTypes) { - error( - "%s uses the legacy contextTypes API which was removed in React 19. " + - "Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - ); - } - } - - reconcileChildren(null, workInProgress, value, renderLanes); - - { - validateFunctionComponentInDev(workInProgress, Component); - } - - return workInProgress.child; - } - } - function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -16558,33 +16472,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -16593,16 +16506,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -18466,15 +18379,6 @@ 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( @@ -20215,7 +20119,6 @@ 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: @@ -27350,12 +27253,6 @@ 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`. @@ -28719,7 +28616,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -29518,22 +29414,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -29618,7 +29500,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -29744,7 +29625,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index a7698ca8d7f83..f416d56876d4f 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -229,7 +229,6 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: - case 2: case 14: case 15: if ("function" === typeof type) @@ -1664,7 +1663,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -5613,108 +5611,91 @@ 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: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -5722,8 +5703,8 @@ function beginWork(current, workInProgress, renderLanes) { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; - context = workInProgress.memoizedState; - Component = context.element; + init = workInProgress.memoizedState; + elementType = init.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; @@ -5732,17 +5713,17 @@ function beginWork(current, workInProgress, renderLanes) { enableTransitionTracing && pushRootMarkerInstance(workInProgress); var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== context.cache && + nextCache !== init.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - context = nextProps.element; - context === Component + init = nextProps.element; + init === elementType ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, renderLanes )) - : (reconcileChildren(current, workInProgress, context, renderLanes), + : (reconcileChildren(current, workInProgress, init, renderLanes), (workInProgress = workInProgress.child)); return workInProgress; case 26: @@ -5750,17 +5731,17 @@ function beginWork(current, workInProgress, renderLanes) { case 5: return ( pushHostContext(workInProgress), - (context = workInProgress.type), + (init = workInProgress.type), (nextProps = workInProgress.pendingProps), (nextCache = null !== current ? current.memoizedProps : null), - (Component = nextProps.children), - shouldSetTextContent(context, nextProps) - ? (Component = null) + (elementType = nextProps.children), + shouldSetTextContent(init, nextProps) + ? (elementType = null) : null !== nextCache && - shouldSetTextContent(context, nextCache) && + shouldSetTextContent(init, nextCache) && (workInProgress.flags |= 32), null !== workInProgress.memoizedState && - ((context = renderWithHooks( + ((init = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -5768,18 +5749,18 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = context), + (HostTransitionContext._currentValue2 = init), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== context && + current.memoizedState.memoizedState !== init && propagateContextChange( workInProgress, HostTransitionContext, renderLanes ))), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 6: @@ -5792,30 +5773,35 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateForwardRef( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -5851,17 +5837,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; - nextCache = context.value; - pushProvider(workInProgress, Component, nextCache); + nextCache = init.value; + pushProvider(workInProgress, elementType, nextCache); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if ( - nextProps.children === context.children && + nextProps.children === init.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -5871,39 +5857,35 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren( - current, - workInProgress, - context.children, - renderLanes - ); + } else + propagateContextChange(workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (context = enableRenderableContext + (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (context = readContext(context)), - (Component = Component(context)), + (init = readContext(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (context = resolveDefaultProps(Component, workInProgress.pendingProps)), - (context = resolveDefaultProps(Component.type, context)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -5917,24 +5899,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(Component) + isContextProvider(elementType) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, context), - mountClassInstance(workInProgress, Component, context, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, current, renderLanes @@ -5944,9 +5926,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -5956,39 +5938,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current - ? ((context = peekCacheFromPool()), - null === context && - ((context = workInProgressRoot), + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), (nextProps = createCache()), - (context.pooledCache = nextProps), + (init.pooledCache = nextProps), nextProps.refCount++, - null !== nextProps && (context.pooledCacheLanes |= renderLanes), - (context = nextProps)), + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), (workInProgress.memoizedState = { - parent: Component, - cache: context + parent: elementType, + cache: init }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, context)) + pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (context = current.memoizedState), + (init = current.memoizedState), (nextProps = workInProgress.memoizedState), - context.parent !== Component - ? ((context = { parent: Component, cache: Component }), - (workInProgress.memoizedState = context), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - context), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = nextProps.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== context.cache && + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -6007,22 +5989,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -6544,7 +6526,6 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -9630,8 +9611,6 @@ 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, @@ -10103,16 +10082,6 @@ 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 @@ -10190,7 +10159,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -10612,19 +10581,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1119 = { + devToolsConfig$jscomp$inline_1105 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-classic-1ca45163", + version: "19.0.0-www-classic-5fe4dc7b", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1324 = { - bundleType: devToolsConfig$jscomp$inline_1119.bundleType, - version: devToolsConfig$jscomp$inline_1119.version, - rendererPackageName: devToolsConfig$jscomp$inline_1119.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1119.rendererConfig, +var internals$jscomp$inline_1307 = { + bundleType: devToolsConfig$jscomp$inline_1105.bundleType, + version: devToolsConfig$jscomp$inline_1105.version, + rendererPackageName: devToolsConfig$jscomp$inline_1105.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1105.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10641,26 +10610,26 @@ var internals$jscomp$inline_1324 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1119.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1105.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-1ca45163" + reconcilerVersion: "19.0.0-www-classic-5fe4dc7b" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1325 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1308 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1325.isDisabled && - hook$jscomp$inline_1325.supportsFiber + !hook$jscomp$inline_1308.isDisabled && + hook$jscomp$inline_1308.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1325.inject( - internals$jscomp$inline_1324 + (rendererID = hook$jscomp$inline_1308.inject( + internals$jscomp$inline_1307 )), - (injectedHook = hook$jscomp$inline_1325); + (injectedHook = hook$jscomp$inline_1308); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index d174c6ad104dd..85b1446901dd5 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -1460,7 +1460,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -5355,103 +5354,90 @@ 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; - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - void 0, - renderLanes - ); - workInProgress.flags |= 1; - workInProgress.tag = 0; - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = Component._init; - Component = init(Component._payload); - workInProgress.type = Component; - init = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (init) { - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -5461,7 +5447,7 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error(formatProdErrorMessage(387)); var nextProps = workInProgress.pendingProps; init = workInProgress.memoizedState; - Component = init.element; + elementType = init.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); nextProps = workInProgress.memoizedState; @@ -5474,7 +5460,7 @@ function beginWork(current, workInProgress, renderLanes) { propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); init = nextProps.element; - init === Component + init === elementType ? (workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -5491,9 +5477,9 @@ function beginWork(current, workInProgress, renderLanes) { (init = workInProgress.type), (nextProps = workInProgress.pendingProps), (nextCache = null !== current ? current.memoizedProps : null), - (Component = nextProps.children), + (elementType = nextProps.children), shouldSetTextContent(init, nextProps) - ? (Component = null) + ? (elementType = null) : null !== nextCache && shouldSetTextContent(init, nextCache) && (workInProgress.flags |= 32), @@ -5517,7 +5503,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ))), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 6: @@ -5530,26 +5516,37 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), - updateForwardRef(current, workInProgress, Component, init, renderLanes) + : resolveDefaultProps(elementType, init)), + updateForwardRef( + current, + workInProgress, + elementType, + init, + renderLanes + ) ); case 7: return ( @@ -5583,13 +5580,13 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; nextProps = workInProgress.memoizedProps; nextCache = init.value; - pushProvider(workInProgress, Component, nextCache); + pushProvider(workInProgress, elementType, nextCache); if (!enableLazyContextPropagation && null !== nextProps) if (objectIs(nextProps.value, nextCache)) { if (nextProps.children === init.children) { @@ -5600,7 +5597,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); + } else + propagateContextChange(workInProgress, elementType, renderLanes); reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } @@ -5610,23 +5608,23 @@ function beginWork(current, workInProgress, renderLanes) { (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), (init = readContext(init)), - (Component = Component(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (init = resolveDefaultProps(Component, workInProgress.pendingProps)), - (init = resolveDefaultProps(Component.type, init)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -5641,21 +5639,21 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, init), - mountClassInstance(workInProgress, Component, init, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, !1, renderLanes @@ -5665,9 +5663,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -5677,7 +5675,7 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), null === init && @@ -5687,7 +5685,10 @@ function beginWork(current, workInProgress, renderLanes) { nextProps.refCount++, null !== nextProps && (init.pooledCacheLanes |= renderLanes), (init = nextProps)), - (workInProgress.memoizedState = { parent: Component, cache: init }), + (workInProgress.memoizedState = { + parent: elementType, + cache: init + }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && @@ -5696,17 +5697,17 @@ function beginWork(current, workInProgress, renderLanes) { suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), (nextProps = workInProgress.memoizedState), - init.parent !== Component - ? ((init = { parent: Component, cache: Component }), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = init), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = nextProps.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== init.cache && + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = nextProps.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -5725,22 +5726,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -6262,7 +6263,6 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -9329,8 +9329,6 @@ 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, @@ -9798,16 +9796,6 @@ 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 @@ -9885,7 +9873,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) fiberTag = 5; @@ -10267,19 +10255,19 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component), - devToolsConfig$jscomp$inline_1099 = { + devToolsConfig$jscomp$inline_1086 = { findFiberByHostInstance: function () { return null; }, bundleType: 0, - version: "19.0.0-www-modern-ba56ad23", + version: "19.0.0-www-modern-00b5a4bc", rendererPackageName: "react-art" }; -var internals$jscomp$inline_1304 = { - bundleType: devToolsConfig$jscomp$inline_1099.bundleType, - version: devToolsConfig$jscomp$inline_1099.version, - rendererPackageName: devToolsConfig$jscomp$inline_1099.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1099.rendererConfig, +var internals$jscomp$inline_1288 = { + bundleType: devToolsConfig$jscomp$inline_1086.bundleType, + version: devToolsConfig$jscomp$inline_1086.version, + rendererPackageName: devToolsConfig$jscomp$inline_1086.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1086.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -10296,26 +10284,26 @@ var internals$jscomp$inline_1304 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1099.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1086.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-ba56ad23" + reconcilerVersion: "19.0.0-www-modern-00b5a4bc" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1305 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1289 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1305.isDisabled && - hook$jscomp$inline_1305.supportsFiber + !hook$jscomp$inline_1289.isDisabled && + hook$jscomp$inline_1289.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1305.inject( - internals$jscomp$inline_1304 + (rendererID = hook$jscomp$inline_1289.inject( + internals$jscomp$inline_1288 )), - (injectedHook = hook$jscomp$inline_1305); + (injectedHook = hook$jscomp$inline_1289); } catch (err) {} } var Path = Mode$1.Path; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index c66924d339565..80f4286a1143b 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -167,8 +167,6 @@ 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. @@ -471,7 +469,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -3719,7 +3716,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -8193,7 +8189,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -18559,17 +18554,6 @@ 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; @@ -18645,7 +18629,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -20192,7 +20183,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -20203,7 +20193,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -20928,6 +20917,39 @@ 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; { @@ -21572,70 +21594,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -21697,125 +21717,6 @@ 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; - var hasId; - - if (enableSchedulingProfiler) { - 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 - ); - hasId = checkDidRenderIdHook(); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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; - - if (getIsHydrating() && hasId) { - pushMaterializedTreeId(workInProgress); - } - - reconcileChildren(null, workInProgress, value, renderLanes); - - { - validateFunctionComponentInDev(workInProgress, Component); - } - - return workInProgress.child; - } - } - function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -21852,33 +21753,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -21887,16 +21787,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -23854,15 +23754,6 @@ 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( @@ -25650,7 +25541,6 @@ if (__DEV__) { popTreeContext(workInProgress); switch (workInProgress.tag) { - case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -33385,12 +33275,6 @@ 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`. @@ -34811,7 +34695,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -35610,22 +35493,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -35710,7 +35579,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -35836,7 +35704,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -36351,7 +36219,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-31c745b2"; + var ReactVersion = "19.0.0-www-classic-8b22fef9"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index ddfa28fb1b785..3a722ecf4bf56 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -2380,8 +2380,6 @@ 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. @@ -3321,7 +3319,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -3600,7 +3597,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -8156,7 +8152,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -18514,17 +18509,6 @@ 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 context = emptyContextObject; var contextType = ctor.contextType; @@ -18590,7 +18574,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -20114,7 +20105,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -20125,7 +20115,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -20850,6 +20839,47 @@ 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); + + if (Component.contextTypes) { + error( + "%s uses the legacy contextTypes API which was removed in React 19. " + + "Use React.createContext() with React.useContext() instead.", + getComponentNameFromType(Component) || "Unknown" + ); + } + } + } + var context; var nextChildren; @@ -21464,70 +21494,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -21588,126 +21616,6 @@ if (__DEV__) { ); } - function mountIndeterminateComponent( - _current, - workInProgress, - Component, - renderLanes - ) { - resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); - var props = workInProgress.pendingProps; - var context; - - prepareToReadContext(workInProgress, renderLanes); - var value; - var hasId; - - if (enableSchedulingProfiler) { - 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 - ); - hasId = checkDidRenderIdHook(); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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; - - { - if (Component.contextTypes) { - error( - "%s uses the legacy contextTypes API which was removed in React 19. " + - "Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - ); - } - } - - if (getIsHydrating() && hasId) { - pushMaterializedTreeId(workInProgress); - } - - reconcileChildren(null, workInProgress, value, renderLanes); - - { - validateFunctionComponentInDev(workInProgress, Component); - } - - return workInProgress.child; - } - } - function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -21744,33 +21652,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -21779,16 +21686,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -23740,15 +23647,6 @@ 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( @@ -25536,7 +25434,6 @@ if (__DEV__) { popTreeContext(workInProgress); switch (workInProgress.tag) { - case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -33242,12 +33139,6 @@ 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`. @@ -34659,7 +34550,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -35458,22 +35348,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -35558,7 +35434,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -35684,7 +35559,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -36199,7 +36074,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-c752b0b8"; + var ReactVersion = "19.0.0-www-modern-2963deed"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index a7f270b2dfca1..6d6882a7999c4 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -211,7 +211,6 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: - case 2: case 14: case 15: if ("function" === typeof type) @@ -991,7 +990,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6625,110 +6623,91 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var context = getMaskedContext( - workInProgress, - contextStackCursor.current - ); - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - context, - renderLanes - ); - Component = checkDidRenderIdHook(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -6736,25 +6715,25 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, context, null, renderLanes); + processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - context = nextState.cache; - pushProvider(workInProgress, CacheContext, context); - context !== prevState.cache && + init = nextState.cache; + pushProvider(workInProgress, CacheContext, init); + init !== prevState.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - context = nextState.element; + init = nextState.element; if (prevState.isDehydrated) if ( ((prevState = { - element: context, + element: init, isDehydrated: !1, cache: nextState.cache }), @@ -6762,29 +6741,29 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; - } else if (context !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; } else @@ -6799,7 +6778,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - context, + init, renderLanes ), workInProgress.child = renderLanes; @@ -6810,7 +6789,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (context === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6818,7 +6797,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, context, renderLanes); + reconcileChildren(current, workInProgress, init, renderLanes); } workInProgress = workInProgress.child; } @@ -6837,14 +6816,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -6852,7 +6831,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -6860,14 +6839,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -6875,36 +6854,36 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((context = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), - (context = !0)) - : (context = !1); - context || throwOnHydrationMismatch(); + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(); } pushHostContext(workInProgress); - context = workInProgress.type; + init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; - shouldSetTextContent(context, prevState) - ? (Component = null) + elementType = prevState.children; + shouldSetTextContent(init, prevState) + ? (elementType = null) : null !== nextState && - shouldSetTextContent(context, nextState) && + shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((context = renderWithHooks( + ((init = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6912,18 +6891,18 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = context), + (HostTransitionContext._currentValue = init), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== context && + current.memoizedState.memoizedState !== init && propagateContextChange( workInProgress, HostTransitionContext, renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -6950,30 +6929,35 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateForwardRef( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7009,17 +6993,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; - nextState = context.value; - pushProvider(workInProgress, Component, nextState); + nextState = init.value; + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if ( - prevState.children === context.children && + prevState.children === init.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7029,39 +7013,35 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren( - current, - workInProgress, - context.children, - renderLanes - ); + } else + propagateContextChange(workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (context = enableRenderableContext + (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (context = readContext(context)), - (Component = Component(context)), + (init = readContext(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (context = resolveDefaultProps(Component, workInProgress.pendingProps)), - (context = resolveDefaultProps(Component.type, context)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7075,24 +7055,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(Component) + isContextProvider(elementType) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, context), - mountClassInstance(workInProgress, Component, context, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, current, renderLanes @@ -7102,9 +7082,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -7114,39 +7094,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current - ? ((context = peekCacheFromPool()), - null === context && - ((context = workInProgressRoot), + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), (prevState = createCache()), - (context.pooledCache = prevState), + (init.pooledCache = prevState), prevState.refCount++, - null !== prevState && (context.pooledCacheLanes |= renderLanes), - (context = prevState)), + null !== prevState && (init.pooledCacheLanes |= renderLanes), + (init = prevState)), (workInProgress.memoizedState = { - parent: Component, - cache: context + parent: elementType, + cache: init }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, context)) + pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (context = current.memoizedState), + (init = current.memoizedState), (prevState = workInProgress.memoizedState), - context.parent !== Component - ? ((context = { parent: Component, cache: Component }), - (workInProgress.memoizedState = context), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - context), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== context.cache && + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -7165,22 +7145,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -7730,7 +7710,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -11486,8 +11465,6 @@ 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, @@ -11986,16 +11963,6 @@ 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 @@ -12073,7 +12040,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -13061,19 +13028,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$347; + var JSCompiler_inline_result$jscomp$346; if (canUseDOM) { - var isSupported$jscomp$inline_1497 = "oninput" in document; - if (!isSupported$jscomp$inline_1497) { - var element$jscomp$inline_1498 = document.createElement("div"); - element$jscomp$inline_1498.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1497 = - "function" === typeof element$jscomp$inline_1498.oninput; + var isSupported$jscomp$inline_1482 = "oninput" in document; + if (!isSupported$jscomp$inline_1482) { + var element$jscomp$inline_1483 = document.createElement("div"); + element$jscomp$inline_1483.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1482 = + "function" === typeof element$jscomp$inline_1483.oninput; } - JSCompiler_inline_result$jscomp$347 = isSupported$jscomp$inline_1497; - } else JSCompiler_inline_result$jscomp$347 = !1; + JSCompiler_inline_result$jscomp$346 = isSupported$jscomp$inline_1482; + } else JSCompiler_inline_result$jscomp$346 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$347 && + JSCompiler_inline_result$jscomp$346 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13445,20 +13412,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1538 = 0; - i$jscomp$inline_1538 < simpleEventPluginEvents.length; - i$jscomp$inline_1538++ + var i$jscomp$inline_1523 = 0; + i$jscomp$inline_1523 < simpleEventPluginEvents.length; + i$jscomp$inline_1523++ ) { - var eventName$jscomp$inline_1539 = - simpleEventPluginEvents[i$jscomp$inline_1538], - domEventName$jscomp$inline_1540 = - eventName$jscomp$inline_1539.toLowerCase(), - capitalizedEvent$jscomp$inline_1541 = - eventName$jscomp$inline_1539[0].toUpperCase() + - eventName$jscomp$inline_1539.slice(1); + var eventName$jscomp$inline_1524 = + simpleEventPluginEvents[i$jscomp$inline_1523], + domEventName$jscomp$inline_1525 = + eventName$jscomp$inline_1524.toLowerCase(), + capitalizedEvent$jscomp$inline_1526 = + eventName$jscomp$inline_1524[0].toUpperCase() + + eventName$jscomp$inline_1524.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1540, - "on" + capitalizedEvent$jscomp$inline_1541 + domEventName$jscomp$inline_1525, + "on" + capitalizedEvent$jscomp$inline_1526 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17108,17 +17075,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1732 = { +var devToolsConfig$jscomp$inline_1717 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-9df81848", + version: "19.0.0-www-classic-6bfbbc21", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2160 = { - bundleType: devToolsConfig$jscomp$inline_1732.bundleType, - version: devToolsConfig$jscomp$inline_1732.version, - rendererPackageName: devToolsConfig$jscomp$inline_1732.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1732.rendererConfig, +var internals$jscomp$inline_2142 = { + bundleType: devToolsConfig$jscomp$inline_1717.bundleType, + version: devToolsConfig$jscomp$inline_1717.version, + rendererPackageName: devToolsConfig$jscomp$inline_1717.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1717.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17134,26 +17101,26 @@ var internals$jscomp$inline_2160 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1732.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1717.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-9df81848" + reconcilerVersion: "19.0.0-www-classic-6bfbbc21" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2161 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2143 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2161.isDisabled && - hook$jscomp$inline_2161.supportsFiber + !hook$jscomp$inline_2143.isDisabled && + hook$jscomp$inline_2143.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2161.inject( - internals$jscomp$inline_2160 + (rendererID = hook$jscomp$inline_2143.inject( + internals$jscomp$inline_2142 )), - (injectedHook = hook$jscomp$inline_2161); + (injectedHook = hook$jscomp$inline_2143); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -17591,4 +17558,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-9df81848"; +exports.version = "19.0.0-www-classic-6bfbbc21"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 1d237f8fb93ed..3580759a6bf86 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -846,7 +846,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6470,105 +6469,90 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - void 0, - renderLanes - ); - Component = checkDidRenderIdHook(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = Component._init; - Component = init(Component._payload); - workInProgress.type = Component; - init = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (init) { - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -6582,7 +6566,7 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error(formatProdErrorMessage(387)); init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6606,7 +6590,7 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); @@ -6615,11 +6599,11 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; - } else if (init !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); @@ -6628,7 +6612,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; } else @@ -6654,7 +6638,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6681,14 +6665,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -6696,7 +6680,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -6704,14 +6688,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -6719,18 +6703,18 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), (init = !0)) @@ -6741,9 +6725,9 @@ function beginWork(current, workInProgress, renderLanes) { init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; + elementType = prevState.children; shouldSetTextContent(init, prevState) - ? (Component = null) + ? (elementType = null) : null !== nextState && shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); @@ -6767,7 +6751,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -6794,26 +6778,37 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), - updateForwardRef(current, workInProgress, Component, init, renderLanes) + : resolveDefaultProps(elementType, init)), + updateForwardRef( + current, + workInProgress, + elementType, + init, + renderLanes + ) ); case 7: return ( @@ -6847,13 +6842,13 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; nextState = init.value; - pushProvider(workInProgress, Component, nextState); + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if (prevState.children === init.children) { @@ -6864,7 +6859,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); + } else + propagateContextChange(workInProgress, elementType, renderLanes); reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } @@ -6874,23 +6870,23 @@ function beginWork(current, workInProgress, renderLanes) { (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), (init = readContext(init)), - (Component = Component(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (init = resolveDefaultProps(Component, workInProgress.pendingProps)), - (init = resolveDefaultProps(Component.type, init)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -6905,21 +6901,21 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, init), - mountClassInstance(workInProgress, Component, init, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, !1, renderLanes @@ -6929,9 +6925,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -6941,7 +6937,7 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), null === init && @@ -6951,7 +6947,10 @@ function beginWork(current, workInProgress, renderLanes) { prevState.refCount++, null !== prevState && (init.pooledCacheLanes |= renderLanes), (init = prevState)), - (workInProgress.memoizedState = { parent: Component, cache: init }), + (workInProgress.memoizedState = { + parent: elementType, + cache: init + }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && @@ -6960,17 +6959,17 @@ function beginWork(current, workInProgress, renderLanes) { suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), (prevState = workInProgress.memoizedState), - init.parent !== Component - ? ((init = { parent: Component, cache: Component }), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = init), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== init.cache && + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -6989,22 +6988,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -7554,7 +7553,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -11292,8 +11290,6 @@ 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, @@ -11788,16 +11784,6 @@ 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 @@ -11875,7 +11861,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -13431,19 +13417,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$342; + var JSCompiler_inline_result$jscomp$341; if (canUseDOM) { - var isSupported$jscomp$inline_1494 = "oninput" in document; - if (!isSupported$jscomp$inline_1494) { - var element$jscomp$inline_1495 = document.createElement("div"); - element$jscomp$inline_1495.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1494 = - "function" === typeof element$jscomp$inline_1495.oninput; + var isSupported$jscomp$inline_1480 = "oninput" in document; + if (!isSupported$jscomp$inline_1480) { + var element$jscomp$inline_1481 = document.createElement("div"); + element$jscomp$inline_1481.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1480 = + "function" === typeof element$jscomp$inline_1481.oninput; } - JSCompiler_inline_result$jscomp$342 = isSupported$jscomp$inline_1494; - } else JSCompiler_inline_result$jscomp$342 = !1; + JSCompiler_inline_result$jscomp$341 = isSupported$jscomp$inline_1480; + } else JSCompiler_inline_result$jscomp$341 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$342 && + JSCompiler_inline_result$jscomp$341 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13752,20 +13738,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1535 = 0; - i$jscomp$inline_1535 < simpleEventPluginEvents.length; - i$jscomp$inline_1535++ + var i$jscomp$inline_1521 = 0; + i$jscomp$inline_1521 < simpleEventPluginEvents.length; + i$jscomp$inline_1521++ ) { - var eventName$jscomp$inline_1536 = - simpleEventPluginEvents[i$jscomp$inline_1535], - domEventName$jscomp$inline_1537 = - eventName$jscomp$inline_1536.toLowerCase(), - capitalizedEvent$jscomp$inline_1538 = - eventName$jscomp$inline_1536[0].toUpperCase() + - eventName$jscomp$inline_1536.slice(1); + var eventName$jscomp$inline_1522 = + simpleEventPluginEvents[i$jscomp$inline_1521], + domEventName$jscomp$inline_1523 = + eventName$jscomp$inline_1522.toLowerCase(), + capitalizedEvent$jscomp$inline_1524 = + eventName$jscomp$inline_1522[0].toUpperCase() + + eventName$jscomp$inline_1522.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1537, - "on" + capitalizedEvent$jscomp$inline_1538 + domEventName$jscomp$inline_1523, + "on" + capitalizedEvent$jscomp$inline_1524 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16622,17 +16608,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1693 = { +var devToolsConfig$jscomp$inline_1679 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-8e569007", + version: "19.0.0-www-modern-d24a2178", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2122 = { - bundleType: devToolsConfig$jscomp$inline_1693.bundleType, - version: devToolsConfig$jscomp$inline_1693.version, - rendererPackageName: devToolsConfig$jscomp$inline_1693.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1693.rendererConfig, +var internals$jscomp$inline_2105 = { + bundleType: devToolsConfig$jscomp$inline_1679.bundleType, + version: devToolsConfig$jscomp$inline_1679.version, + rendererPackageName: devToolsConfig$jscomp$inline_1679.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1679.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16648,26 +16634,26 @@ var internals$jscomp$inline_2122 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1693.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1679.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-8e569007" + reconcilerVersion: "19.0.0-www-modern-d24a2178" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2123 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2106 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2123.isDisabled && - hook$jscomp$inline_2123.supportsFiber + !hook$jscomp$inline_2106.isDisabled && + hook$jscomp$inline_2106.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2123.inject( - internals$jscomp$inline_2122 + (rendererID = hook$jscomp$inline_2106.inject( + internals$jscomp$inline_2105 )), - (injectedHook = hook$jscomp$inline_2123); + (injectedHook = hook$jscomp$inline_2106); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -16958,4 +16944,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-8e569007"; +exports.version = "19.0.0-www-modern-d24a2178"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 3bc77fffae4b2..f1a6d828b3715 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -216,7 +216,6 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: - case 2: case 14: case 15: if ("function" === typeof type) @@ -1127,7 +1126,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6867,112 +6865,91 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var context = getMaskedContext( - workInProgress, - contextStackCursor.current - ); - prepareToReadContext(workInProgress, renderLanes); - enableSchedulingProfiler && markComponentRenderStarted(workInProgress); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - context, - renderLanes - ); - Component = checkDidRenderIdHook(); - enableSchedulingProfiler && markComponentRenderStopped(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -6980,25 +6957,25 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, context, null, renderLanes); + processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - context = nextState.cache; - pushProvider(workInProgress, CacheContext, context); - context !== prevState.cache && + init = nextState.cache; + pushProvider(workInProgress, CacheContext, init); + init !== prevState.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - context = nextState.element; + init = nextState.element; if (prevState.isDehydrated) if ( ((prevState = { - element: context, + element: init, isDehydrated: !1, cache: nextState.cache }), @@ -7006,29 +6983,29 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; - } else if (context !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; } else @@ -7043,7 +7020,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - context, + init, renderLanes ), workInProgress.child = renderLanes; @@ -7054,7 +7031,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (context === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -7062,7 +7039,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, context, renderLanes); + reconcileChildren(current, workInProgress, init, renderLanes); } workInProgress = workInProgress.child; } @@ -7081,14 +7058,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -7096,7 +7073,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -7104,14 +7081,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -7119,36 +7096,36 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((context = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), - (context = !0)) - : (context = !1); - context || throwOnHydrationMismatch(); + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(); } pushHostContext(workInProgress); - context = workInProgress.type; + init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; - shouldSetTextContent(context, prevState) - ? (Component = null) + elementType = prevState.children; + shouldSetTextContent(init, prevState) + ? (elementType = null) : null !== nextState && - shouldSetTextContent(context, nextState) && + shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((context = renderWithHooks( + ((init = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -7156,18 +7133,18 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = context), + (HostTransitionContext._currentValue = init), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== context && + current.memoizedState.memoizedState !== init && propagateContextChange( workInProgress, HostTransitionContext, renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -7194,30 +7171,35 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateForwardRef( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7244,9 +7226,9 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), - (Component = workInProgress.stateNode), - (Component.effectDuration = 0), - (Component.passiveEffectDuration = 0), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = 0), + (elementType.passiveEffectDuration = 0), reconcileChildren( current, workInProgress, @@ -7257,17 +7239,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; - nextState = context.value; - pushProvider(workInProgress, Component, nextState); + nextState = init.value; + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if ( - prevState.children === context.children && + prevState.children === init.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7277,41 +7259,37 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren( - current, - workInProgress, - context.children, - renderLanes - ); + } else + propagateContextChange(workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (context = enableRenderableContext + (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (context = readContext(context)), + (init = readContext(init)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), - (Component = Component(context)), + (elementType = elementType(init)), enableSchedulingProfiler && markComponentRenderStopped(), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (context = resolveDefaultProps(Component, workInProgress.pendingProps)), - (context = resolveDefaultProps(Component.type, context)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7325,24 +7303,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(Component) + isContextProvider(elementType) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, context), - mountClassInstance(workInProgress, Component, context, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, current, renderLanes @@ -7352,9 +7330,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -7364,39 +7342,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current - ? ((context = peekCacheFromPool()), - null === context && - ((context = workInProgressRoot), + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), (prevState = createCache()), - (context.pooledCache = prevState), + (init.pooledCache = prevState), prevState.refCount++, - null !== prevState && (context.pooledCacheLanes |= renderLanes), - (context = prevState)), + null !== prevState && (init.pooledCacheLanes |= renderLanes), + (init = prevState)), (workInProgress.memoizedState = { - parent: Component, - cache: context + parent: elementType, + cache: init }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, context)) + pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (context = current.memoizedState), + (init = current.memoizedState), (prevState = workInProgress.memoizedState), - context.parent !== Component - ? ((context = { parent: Component, cache: Component }), - (workInProgress.memoizedState = context), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - context), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== context.cache && + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -7415,22 +7393,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -8016,7 +7994,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -12151,8 +12128,6 @@ 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, @@ -12717,16 +12692,6 @@ 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 @@ -12812,7 +12777,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -13811,19 +13776,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$368; + var JSCompiler_inline_result$jscomp$367; if (canUseDOM) { - var isSupported$jscomp$inline_1583 = "oninput" in document; - if (!isSupported$jscomp$inline_1583) { - var element$jscomp$inline_1584 = document.createElement("div"); - element$jscomp$inline_1584.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1583 = - "function" === typeof element$jscomp$inline_1584.oninput; + var isSupported$jscomp$inline_1568 = "oninput" in document; + if (!isSupported$jscomp$inline_1568) { + var element$jscomp$inline_1569 = document.createElement("div"); + element$jscomp$inline_1569.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1568 = + "function" === typeof element$jscomp$inline_1569.oninput; } - JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1583; - } else JSCompiler_inline_result$jscomp$368 = !1; + JSCompiler_inline_result$jscomp$367 = isSupported$jscomp$inline_1568; + } else JSCompiler_inline_result$jscomp$367 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$368 && + JSCompiler_inline_result$jscomp$367 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14195,20 +14160,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1624 = 0; - i$jscomp$inline_1624 < simpleEventPluginEvents.length; - i$jscomp$inline_1624++ + var i$jscomp$inline_1609 = 0; + i$jscomp$inline_1609 < simpleEventPluginEvents.length; + i$jscomp$inline_1609++ ) { - var eventName$jscomp$inline_1625 = - simpleEventPluginEvents[i$jscomp$inline_1624], - domEventName$jscomp$inline_1626 = - eventName$jscomp$inline_1625.toLowerCase(), - capitalizedEvent$jscomp$inline_1627 = - eventName$jscomp$inline_1625[0].toUpperCase() + - eventName$jscomp$inline_1625.slice(1); + var eventName$jscomp$inline_1610 = + simpleEventPluginEvents[i$jscomp$inline_1609], + domEventName$jscomp$inline_1611 = + eventName$jscomp$inline_1610.toLowerCase(), + capitalizedEvent$jscomp$inline_1612 = + eventName$jscomp$inline_1610[0].toUpperCase() + + eventName$jscomp$inline_1610.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1626, - "on" + capitalizedEvent$jscomp$inline_1627 + domEventName$jscomp$inline_1611, + "on" + capitalizedEvent$jscomp$inline_1612 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17858,10 +17823,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1818 = { +var devToolsConfig$jscomp$inline_1803 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-e6369628", + version: "19.0.0-www-classic-e7c0316f", rendererPackageName: "react-dom" }; (function (internals) { @@ -17879,10 +17844,10 @@ var devToolsConfig$jscomp$inline_1818 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1818.bundleType, - version: devToolsConfig$jscomp$inline_1818.version, - rendererPackageName: devToolsConfig$jscomp$inline_1818.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1818.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1803.bundleType, + version: devToolsConfig$jscomp$inline_1803.version, + rendererPackageName: devToolsConfig$jscomp$inline_1803.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1803.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17898,14 +17863,14 @@ var devToolsConfig$jscomp$inline_1818 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1818.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1803.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-e6369628" + reconcilerVersion: "19.0.0-www-classic-e7c0316f" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -18342,7 +18307,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-e6369628"; +exports.version = "19.0.0-www-classic-e7c0316f"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 9d069198ca989..b594551853fae 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -982,7 +982,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6706,107 +6705,90 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - prepareToReadContext(workInProgress, renderLanes); - enableSchedulingProfiler && markComponentRenderStarted(workInProgress); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - void 0, - renderLanes - ); - Component = checkDidRenderIdHook(); - enableSchedulingProfiler && markComponentRenderStopped(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = Component._init; - Component = init(Component._payload); - workInProgress.type = Component; - init = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (init) { - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -6820,7 +6802,7 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error(formatProdErrorMessage(387)); init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6844,7 +6826,7 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); @@ -6853,11 +6835,11 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; - } else if (init !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); @@ -6866,7 +6848,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; } else @@ -6892,7 +6874,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6919,14 +6901,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -6934,7 +6916,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -6942,14 +6924,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -6957,18 +6939,18 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), (init = !0)) @@ -6979,9 +6961,9 @@ function beginWork(current, workInProgress, renderLanes) { init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; + elementType = prevState.children; shouldSetTextContent(init, prevState) - ? (Component = null) + ? (elementType = null) : null !== nextState && shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); @@ -7005,7 +6987,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -7032,26 +7014,37 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), - updateForwardRef(current, workInProgress, Component, init, renderLanes) + : resolveDefaultProps(elementType, init)), + updateForwardRef( + current, + workInProgress, + elementType, + init, + renderLanes + ) ); case 7: return ( @@ -7076,9 +7069,9 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), - (Component = workInProgress.stateNode), - (Component.effectDuration = 0), - (Component.passiveEffectDuration = 0), + (elementType = workInProgress.stateNode), + (elementType.effectDuration = 0), + (elementType.passiveEffectDuration = 0), reconcileChildren( current, workInProgress, @@ -7089,13 +7082,13 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; nextState = init.value; - pushProvider(workInProgress, Component, nextState); + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if (prevState.children === init.children) { @@ -7106,7 +7099,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); + } else + propagateContextChange(workInProgress, elementType, renderLanes); reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } @@ -7116,25 +7110,25 @@ function beginWork(current, workInProgress, renderLanes) { (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), (init = readContext(init)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), - (Component = Component(init)), + (elementType = elementType(init)), enableSchedulingProfiler && markComponentRenderStopped(), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (init = resolveDefaultProps(Component, workInProgress.pendingProps)), - (init = resolveDefaultProps(Component.type, init)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -7149,21 +7143,21 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, init), - mountClassInstance(workInProgress, Component, init, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, !1, renderLanes @@ -7173,9 +7167,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -7185,7 +7179,7 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), null === init && @@ -7195,7 +7189,10 @@ function beginWork(current, workInProgress, renderLanes) { prevState.refCount++, null !== prevState && (init.pooledCacheLanes |= renderLanes), (init = prevState)), - (workInProgress.memoizedState = { parent: Component, cache: init }), + (workInProgress.memoizedState = { + parent: elementType, + cache: init + }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && @@ -7204,17 +7201,17 @@ function beginWork(current, workInProgress, renderLanes) { suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), (prevState = workInProgress.memoizedState), - init.parent !== Component - ? ((init = { parent: Component, cache: Component }), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = init), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== init.cache && + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -7233,22 +7230,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -7834,7 +7831,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -11951,8 +11947,6 @@ 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, @@ -12513,16 +12507,6 @@ 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 @@ -12608,7 +12592,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -14175,19 +14159,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$363; + var JSCompiler_inline_result$jscomp$362; if (canUseDOM) { - var isSupported$jscomp$inline_1580 = "oninput" in document; - if (!isSupported$jscomp$inline_1580) { - var element$jscomp$inline_1581 = document.createElement("div"); - element$jscomp$inline_1581.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1580 = - "function" === typeof element$jscomp$inline_1581.oninput; + var isSupported$jscomp$inline_1566 = "oninput" in document; + if (!isSupported$jscomp$inline_1566) { + var element$jscomp$inline_1567 = document.createElement("div"); + element$jscomp$inline_1567.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1566 = + "function" === typeof element$jscomp$inline_1567.oninput; } - JSCompiler_inline_result$jscomp$363 = isSupported$jscomp$inline_1580; - } else JSCompiler_inline_result$jscomp$363 = !1; + JSCompiler_inline_result$jscomp$362 = isSupported$jscomp$inline_1566; + } else JSCompiler_inline_result$jscomp$362 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$363 && + JSCompiler_inline_result$jscomp$362 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14496,20 +14480,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1621 = 0; - i$jscomp$inline_1621 < simpleEventPluginEvents.length; - i$jscomp$inline_1621++ + var i$jscomp$inline_1607 = 0; + i$jscomp$inline_1607 < simpleEventPluginEvents.length; + i$jscomp$inline_1607++ ) { - var eventName$jscomp$inline_1622 = - simpleEventPluginEvents[i$jscomp$inline_1621], - domEventName$jscomp$inline_1623 = - eventName$jscomp$inline_1622.toLowerCase(), - capitalizedEvent$jscomp$inline_1624 = - eventName$jscomp$inline_1622[0].toUpperCase() + - eventName$jscomp$inline_1622.slice(1); + var eventName$jscomp$inline_1608 = + simpleEventPluginEvents[i$jscomp$inline_1607], + domEventName$jscomp$inline_1609 = + eventName$jscomp$inline_1608.toLowerCase(), + capitalizedEvent$jscomp$inline_1610 = + eventName$jscomp$inline_1608[0].toUpperCase() + + eventName$jscomp$inline_1608.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1623, - "on" + capitalizedEvent$jscomp$inline_1624 + domEventName$jscomp$inline_1609, + "on" + capitalizedEvent$jscomp$inline_1610 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17366,10 +17350,10 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1779 = { +var devToolsConfig$jscomp$inline_1765 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-6ec98dbb", + version: "19.0.0-www-modern-e8c45a4b", rendererPackageName: "react-dom" }; (function (internals) { @@ -17387,10 +17371,10 @@ var devToolsConfig$jscomp$inline_1779 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1779.bundleType, - version: devToolsConfig$jscomp$inline_1779.version, - rendererPackageName: devToolsConfig$jscomp$inline_1779.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1779.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1765.bundleType, + version: devToolsConfig$jscomp$inline_1765.version, + rendererPackageName: devToolsConfig$jscomp$inline_1765.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1765.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17406,14 +17390,14 @@ var devToolsConfig$jscomp$inline_1779 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1779.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1765.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-6ec98dbb" + reconcilerVersion: "19.0.0-www-modern-e8c45a4b" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -17703,7 +17687,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-6ec98dbb"; +exports.version = "19.0.0-www-modern-e8c45a4b"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index ddb8199f1b0ac..21af7204df301 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); - var ReactVersion = "19.0.0-www-classic-537a19a0"; + var ReactVersion = "19.0.0-www-classic-a80d8e81"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -11986,22 +11986,14 @@ if (__DEV__) { } var didWarnAboutBadClass = {}; - var didWarnAboutModulePatternComponent = {}; var didWarnAboutContextTypeOnFunctionComponent = {}; var didWarnAboutGetDerivedStateOnFunctionComponent = {}; var didWarnAboutReassigningProps = false; var didWarnAboutDefaultPropsOnFunctionComponent = {}; var didWarnAboutGenerators = false; - var didWarnAboutMaps = false; // This would typically be a function component but we still support module pattern - // components for some reason. + var didWarnAboutMaps = false; - function renderIndeterminateComponent( - request, - task, - keyPath, - Component, - props - ) { + function renderFunctionComponent(request, task, keyPath, Component, props) { var legacyContext; { @@ -12044,49 +12036,18 @@ if (__DEV__) { var actionStateMatchingIndex = getActionStateMatchingIndex(); { - // 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; - } - } - } - - { - { - validateFunctionComponentInDev(Component); - } - - finishFunctionComponent( - request, - task, - keyPath, - value, - hasId, - actionStateCount, - actionStateMatchingIndex - ); + validateFunctionComponentInDev(Component); } + finishFunctionComponent( + request, + task, + keyPath, + value, + hasId, + actionStateCount, + actionStateMatchingIndex + ); task.componentStack = previousComponentStack; } @@ -12184,18 +12145,15 @@ if (__DEV__) { } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] - ) { + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName3 + _componentName ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true; } } @@ -12204,16 +12162,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) { error( "%s: Function components do not support contextType.", - _componentName4 + _componentName2 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true; } } } @@ -12374,7 +12332,7 @@ if (__DEV__) { renderClassComponent(request, task, keyPath, type, props); return; } else { - renderIndeterminateComponent(request, task, keyPath, type, props); + renderFunctionComponent(request, task, keyPath, type, props); return; } } diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 4c5f64d8c9571..e7b67c800ad45 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); - var ReactVersion = "19.0.0-www-modern-94ca9b1f"; + var ReactVersion = "19.0.0-www-modern-0c510bed"; // This refers to a WWW module. var warningWWW = require("warning"); @@ -11889,22 +11889,14 @@ if (__DEV__) { } var didWarnAboutBadClass = {}; - var didWarnAboutModulePatternComponent = {}; var didWarnAboutContextTypeOnFunctionComponent = {}; var didWarnAboutGetDerivedStateOnFunctionComponent = {}; var didWarnAboutReassigningProps = false; var didWarnAboutDefaultPropsOnFunctionComponent = {}; var didWarnAboutGenerators = false; - var didWarnAboutMaps = false; // This would typically be a function component but we still support module pattern - // components for some reason. + var didWarnAboutMaps = false; - function renderIndeterminateComponent( - request, - task, - keyPath, - Component, - props - ) { + function renderFunctionComponent(request, task, keyPath, Component, props) { var legacyContext; var previousComponentStack = task.componentStack; @@ -11943,60 +11935,28 @@ if (__DEV__) { var actionStateMatchingIndex = getActionStateMatchingIndex(); { - // 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; - } + if (Component.contextTypes) { + error( + "%s uses the legacy contextTypes API which was removed in React 19. " + + "Use React.createContext() with React.useContext() instead.", + getComponentNameFromType(Component) || "Unknown" + ); } } { - // Proceed under the assumption that this is a function component - { - if (Component.contextTypes) { - error( - "%s uses the legacy contextTypes API which was removed in React 19. " + - "Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - ); - } - } - - { - validateFunctionComponentInDev(Component); - } - - finishFunctionComponent( - request, - task, - keyPath, - value, - hasId, - actionStateCount, - actionStateMatchingIndex - ); + validateFunctionComponentInDev(Component); } + finishFunctionComponent( + request, + task, + keyPath, + value, + hasId, + actionStateCount, + actionStateMatchingIndex + ); task.componentStack = previousComponentStack; } @@ -12094,18 +12054,15 @@ if (__DEV__) { } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] - ) { + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName3 + _componentName ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true; } } @@ -12114,16 +12071,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) { error( "%s: Function components do not support contextType.", - _componentName4 + _componentName2 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true; } } } @@ -12284,7 +12241,7 @@ if (__DEV__) { renderClassComponent(request, task, keyPath, type, props); return; } else { - renderIndeterminateComponent(request, task, keyPath, type, props); + renderFunctionComponent(request, task, keyPath, type, props); return; } } diff --git a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js index 894054d84f4be..54d0f21920e07 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js @@ -11770,22 +11770,14 @@ if (__DEV__) { } var didWarnAboutBadClass = {}; - var didWarnAboutModulePatternComponent = {}; var didWarnAboutContextTypeOnFunctionComponent = {}; var didWarnAboutGetDerivedStateOnFunctionComponent = {}; var didWarnAboutReassigningProps = false; var didWarnAboutDefaultPropsOnFunctionComponent = {}; var didWarnAboutGenerators = false; - var didWarnAboutMaps = false; // This would typically be a function component but we still support module pattern - // components for some reason. + var didWarnAboutMaps = false; - function renderIndeterminateComponent( - request, - task, - keyPath, - Component, - props - ) { + function renderFunctionComponent(request, task, keyPath, Component, props) { var legacyContext; var previousComponentStack = task.componentStack; @@ -11824,60 +11816,28 @@ if (__DEV__) { var actionStateMatchingIndex = getActionStateMatchingIndex(); { - // 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; - } + if (Component.contextTypes) { + error( + "%s uses the legacy contextTypes API which was removed in React 19. " + + "Use React.createContext() with React.useContext() instead.", + getComponentNameFromType(Component) || "Unknown" + ); } } { - // Proceed under the assumption that this is a function component - { - if (Component.contextTypes) { - error( - "%s uses the legacy contextTypes API which was removed in React 19. " + - "Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - ); - } - } - - { - validateFunctionComponentInDev(Component); - } - - finishFunctionComponent( - request, - task, - keyPath, - value, - hasId, - actionStateCount, - actionStateMatchingIndex - ); + validateFunctionComponentInDev(Component); } + finishFunctionComponent( + request, + task, + keyPath, + value, + hasId, + actionStateCount, + actionStateMatchingIndex + ); task.componentStack = previousComponentStack; } @@ -11975,18 +11935,15 @@ if (__DEV__) { } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] - ) { + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName3 + _componentName ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true; } } @@ -11995,16 +11952,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) { error( "%s: Function components do not support contextType.", - _componentName4 + _componentName2 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true; } } } @@ -12165,7 +12122,7 @@ if (__DEV__) { renderClassComponent(request, task, keyPath, type, props); return; } else { - renderIndeterminateComponent(request, task, keyPath, type, props); + renderFunctionComponent(request, task, keyPath, type, props); return; } } diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 3e6ad62225884..c5c96fadb60cf 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -159,8 +159,6 @@ 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. @@ -463,7 +461,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -3856,7 +3853,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -8330,7 +8326,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -18696,17 +18691,6 @@ 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; @@ -18782,7 +18766,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -20329,7 +20320,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -20340,7 +20330,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -21065,6 +21054,39 @@ 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; { @@ -21709,70 +21731,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -21834,125 +21854,6 @@ 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; - var hasId; - - if (enableSchedulingProfiler) { - 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 - ); - hasId = checkDidRenderIdHook(); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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; - - if (getIsHydrating() && hasId) { - pushMaterializedTreeId(workInProgress); - } - - reconcileChildren(null, workInProgress, value, renderLanes); - - { - validateFunctionComponentInDev(workInProgress, Component); - } - - return workInProgress.child; - } - } - function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -21989,33 +21890,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -22024,16 +21924,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -23991,15 +23891,6 @@ 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( @@ -25787,7 +25678,6 @@ if (__DEV__) { popTreeContext(workInProgress); switch (workInProgress.tag) { - case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -34009,12 +33899,6 @@ 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`. @@ -35435,7 +35319,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -36234,22 +36117,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -36334,7 +36203,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -36460,7 +36328,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -36975,7 +36843,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-f2c3cec0"; + var ReactVersion = "19.0.0-www-classic-800b32fb"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 319634c38856e..ee36d016ec5b0 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -2372,8 +2372,6 @@ 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. @@ -3458,7 +3456,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -3737,7 +3734,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -8293,7 +8289,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -18651,17 +18646,6 @@ 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 context = emptyContextObject; var contextType = ctor.contextType; @@ -18727,7 +18711,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -20251,7 +20242,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -20262,7 +20252,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -20987,6 +20976,47 @@ 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); + + if (Component.contextTypes) { + error( + "%s uses the legacy contextTypes API which was removed in React 19. " + + "Use React.createContext() with React.useContext() instead.", + getComponentNameFromType(Component) || "Unknown" + ); + } + } + } + var context; var nextChildren; @@ -21601,70 +21631,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -21725,126 +21753,6 @@ if (__DEV__) { ); } - function mountIndeterminateComponent( - _current, - workInProgress, - Component, - renderLanes - ) { - resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); - var props = workInProgress.pendingProps; - var context; - - prepareToReadContext(workInProgress, renderLanes); - var value; - var hasId; - - if (enableSchedulingProfiler) { - 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 - ); - hasId = checkDidRenderIdHook(); - setIsRendering(false); - } - - if (enableSchedulingProfiler) { - 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; - - { - if (Component.contextTypes) { - error( - "%s uses the legacy contextTypes API which was removed in React 19. " + - "Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - ); - } - } - - if (getIsHydrating() && hasId) { - pushMaterializedTreeId(workInProgress); - } - - reconcileChildren(null, workInProgress, value, renderLanes); - - { - validateFunctionComponentInDev(workInProgress, Component); - } - - return workInProgress.child; - } - } - function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { @@ -21881,33 +21789,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -21916,16 +21823,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -23877,15 +23784,6 @@ 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( @@ -25673,7 +25571,6 @@ if (__DEV__) { popTreeContext(workInProgress); switch (workInProgress.tag) { - case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: @@ -33866,12 +33763,6 @@ 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`. @@ -35283,7 +35174,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -36082,22 +35972,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -36182,7 +36058,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -36308,7 +36183,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -36823,7 +36698,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-eccc0e12"; + var ReactVersion = "19.0.0-www-modern-81c6e617"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index ab958d21a02cd..e704b48d64391 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -211,7 +211,6 @@ function getComponentNameFromFiber(fiber) { case 1: case 0: case 17: - case 2: case 14: case 15: if ("function" === typeof type) @@ -1077,7 +1076,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6711,110 +6709,91 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - var context = getMaskedContext( - workInProgress, - contextStackCursor.current - ); - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - context, - renderLanes - ); - Component = checkDidRenderIdHook(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -6822,25 +6801,25 @@ function beginWork(current, workInProgress, renderLanes) { a: { pushHostRootContext(workInProgress); if (null === current) throw Error(formatProdErrorMessage(387)); - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, context, null, renderLanes); + processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - context = nextState.cache; - pushProvider(workInProgress, CacheContext, context); - context !== prevState.cache && + init = nextState.cache; + pushProvider(workInProgress, CacheContext, init); + init !== prevState.cache && propagateContextChange(workInProgress, CacheContext, renderLanes); suspendIfUpdateReadFromEntangledAsyncAction(); - context = nextState.element; + init = nextState.element; if (prevState.isDehydrated) if ( ((prevState = { - element: context, + element: init, isDehydrated: !1, cache: nextState.cache }), @@ -6848,29 +6827,29 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; - } else if (context !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); workInProgress = mountHostRootWithoutHydrating( current, workInProgress, - context, + init, renderLanes, - Component + elementType ); break a; } else @@ -6885,7 +6864,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes = mountChildFibers( workInProgress, null, - context, + init, renderLanes ), workInProgress.child = renderLanes; @@ -6896,7 +6875,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (context === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6904,7 +6883,7 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - reconcileChildren(current, workInProgress, context, renderLanes); + reconcileChildren(current, workInProgress, init, renderLanes); } workInProgress = workInProgress.child; } @@ -6923,14 +6902,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -6938,7 +6917,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -6946,14 +6925,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -6961,36 +6940,36 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((context = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), - (context = !0)) - : (context = !1); - context || throwOnHydrationMismatch(); + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(); } pushHostContext(workInProgress); - context = workInProgress.type; + init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; - shouldSetTextContent(context, prevState) - ? (Component = null) + elementType = prevState.children; + shouldSetTextContent(init, prevState) + ? (elementType = null) : null !== nextState && - shouldSetTextContent(context, nextState) && + shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); null !== workInProgress.memoizedState && - ((context = renderWithHooks( + ((init = renderWithHooks( current, workInProgress, TransitionAwareHostComponent, @@ -6998,18 +6977,18 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue = context), + (HostTransitionContext._currentValue = init), enableLazyContextPropagation || (didReceiveUpdate && null !== current && - current.memoizedState.memoizedState !== context && + current.memoizedState.memoizedState !== init && propagateContextChange( workInProgress, HostTransitionContext, renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -7036,30 +7015,35 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), updateForwardRef( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7095,17 +7079,17 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; - context = workInProgress.pendingProps; + init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; - nextState = context.value; - pushProvider(workInProgress, Component, nextState); + nextState = init.value; + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if ( - prevState.children === context.children && + prevState.children === init.children && !didPerformWorkStackCursor.current ) { workInProgress = bailoutOnAlreadyFinishedWork( @@ -7115,39 +7099,35 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); - reconcileChildren( - current, - workInProgress, - context.children, - renderLanes - ); + } else + propagateContextChange(workInProgress, elementType, renderLanes); + reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } return workInProgress; case 9: return ( - (context = enableRenderableContext + (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), - (context = readContext(context)), - (Component = Component(context)), + (init = readContext(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (context = resolveDefaultProps(Component, workInProgress.pendingProps)), - (context = resolveDefaultProps(Component.type, context)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, - context, + elementType, + init, renderLanes ) ); @@ -7161,24 +7141,24 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), - (context = workInProgress.pendingProps), - (context = - workInProgress.elementType === Component - ? context - : resolveDefaultProps(Component, context)), + (elementType = workInProgress.type), + (init = workInProgress.pendingProps), + (init = + workInProgress.elementType === elementType + ? init + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), - isContextProvider(Component) + isContextProvider(elementType) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, context), - mountClassInstance(workInProgress, Component, context, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, current, renderLanes @@ -7188,9 +7168,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -7200,39 +7180,39 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current - ? ((context = peekCacheFromPool()), - null === context && - ((context = workInProgressRoot), + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), (prevState = createCache()), - (context.pooledCache = prevState), + (init.pooledCache = prevState), prevState.refCount++, - null !== prevState && (context.pooledCacheLanes |= renderLanes), - (context = prevState)), + null !== prevState && (init.pooledCacheLanes |= renderLanes), + (init = prevState)), (workInProgress.memoizedState = { - parent: Component, - cache: context + parent: elementType, + cache: init }), initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, context)) + pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && (cloneUpdateQueue(current, workInProgress), processUpdateQueue(workInProgress, null, null, renderLanes), suspendIfUpdateReadFromEntangledAsyncAction()), - (context = current.memoizedState), + (init = current.memoizedState), (prevState = workInProgress.memoizedState), - context.parent !== Component - ? ((context = { parent: Component, cache: Component }), - (workInProgress.memoizedState = context), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), + (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = - context), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== context.cache && + init), + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -7251,22 +7231,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -7816,7 +7796,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -11758,8 +11737,6 @@ 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, @@ -12258,16 +12235,6 @@ 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 @@ -12345,7 +12312,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -13333,19 +13300,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$349; + var JSCompiler_inline_result$jscomp$348; if (canUseDOM) { - var isSupported$jscomp$inline_1524 = "oninput" in document; - if (!isSupported$jscomp$inline_1524) { - var element$jscomp$inline_1525 = document.createElement("div"); - element$jscomp$inline_1525.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1524 = - "function" === typeof element$jscomp$inline_1525.oninput; + var isSupported$jscomp$inline_1509 = "oninput" in document; + if (!isSupported$jscomp$inline_1509) { + var element$jscomp$inline_1510 = document.createElement("div"); + element$jscomp$inline_1510.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1509 = + "function" === typeof element$jscomp$inline_1510.oninput; } - JSCompiler_inline_result$jscomp$349 = isSupported$jscomp$inline_1524; - } else JSCompiler_inline_result$jscomp$349 = !1; + JSCompiler_inline_result$jscomp$348 = isSupported$jscomp$inline_1509; + } else JSCompiler_inline_result$jscomp$348 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$349 && + JSCompiler_inline_result$jscomp$348 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13717,20 +13684,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1565 = 0; - i$jscomp$inline_1565 < simpleEventPluginEvents.length; - i$jscomp$inline_1565++ + var i$jscomp$inline_1550 = 0; + i$jscomp$inline_1550 < simpleEventPluginEvents.length; + i$jscomp$inline_1550++ ) { - var eventName$jscomp$inline_1566 = - simpleEventPluginEvents[i$jscomp$inline_1565], - domEventName$jscomp$inline_1567 = - eventName$jscomp$inline_1566.toLowerCase(), - capitalizedEvent$jscomp$inline_1568 = - eventName$jscomp$inline_1566[0].toUpperCase() + - eventName$jscomp$inline_1566.slice(1); + var eventName$jscomp$inline_1551 = + simpleEventPluginEvents[i$jscomp$inline_1550], + domEventName$jscomp$inline_1552 = + eventName$jscomp$inline_1551.toLowerCase(), + capitalizedEvent$jscomp$inline_1553 = + eventName$jscomp$inline_1551[0].toUpperCase() + + eventName$jscomp$inline_1551.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1567, - "on" + capitalizedEvent$jscomp$inline_1568 + domEventName$jscomp$inline_1552, + "on" + capitalizedEvent$jscomp$inline_1553 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17437,17 +17404,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1759 = { +var devToolsConfig$jscomp$inline_1744 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-d76ce55c", + version: "19.0.0-www-classic-34b7c846", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2168 = { - bundleType: devToolsConfig$jscomp$inline_1759.bundleType, - version: devToolsConfig$jscomp$inline_1759.version, - rendererPackageName: devToolsConfig$jscomp$inline_1759.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1759.rendererConfig, +var internals$jscomp$inline_2150 = { + bundleType: devToolsConfig$jscomp$inline_1744.bundleType, + version: devToolsConfig$jscomp$inline_1744.version, + rendererPackageName: devToolsConfig$jscomp$inline_1744.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1744.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17463,26 +17430,26 @@ var internals$jscomp$inline_2168 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1759.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1744.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-d76ce55c" + reconcilerVersion: "19.0.0-www-classic-34b7c846" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2151 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2169.isDisabled && - hook$jscomp$inline_2169.supportsFiber + !hook$jscomp$inline_2151.isDisabled && + hook$jscomp$inline_2151.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2169.inject( - internals$jscomp$inline_2168 + (rendererID = hook$jscomp$inline_2151.inject( + internals$jscomp$inline_2150 )), - (injectedHook = hook$jscomp$inline_2169); + (injectedHook = hook$jscomp$inline_2151); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -18063,4 +18030,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-d76ce55c"; +exports.version = "19.0.0-www-classic-34b7c846"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index d41308b96a56a..f02ed06f8565a 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -932,7 +932,6 @@ function describeFiber(fiber) { case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: - case 2: case 15: return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; case 11: @@ -6617,105 +6616,90 @@ function beginWork(current, workInProgress, renderLanes) { pushTreeId(workInProgress, treeForkCount, workInProgress.index); workInProgress.lanes = 0; switch (workInProgress.tag) { - case 2: - var Component = workInProgress.type; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - current = workInProgress.pendingProps; - prepareToReadContext(workInProgress, renderLanes); - current = renderWithHooks( - null, - workInProgress, - Component, - current, - void 0, - renderLanes - ); - Component = checkDidRenderIdHook(); - workInProgress.flags |= 1; - workInProgress.tag = 0; - isHydrating && Component && pushMaterializedTreeId(workInProgress); - reconcileChildren(null, workInProgress, current, renderLanes); - workInProgress = workInProgress.child; - return workInProgress; case 16: - Component = workInProgress.elementType; + var elementType = workInProgress.elementType; a: { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); current = workInProgress.pendingProps; - var init = Component._init; - Component = init(Component._payload); - workInProgress.type = Component; - init = workInProgress.tag = resolveLazyComponentTag(Component); - current = resolveDefaultProps(Component, current); - switch (init) { - 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; + 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(formatProdErrorMessage(306, elementType, "")); } - throw Error(formatProdErrorMessage(306, Component, "")); } return workInProgress; case 0: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateFunctionComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) ); case 1: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), updateClassComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -6729,7 +6713,7 @@ function beginWork(current, workInProgress, renderLanes) { if (null === current) throw Error(formatProdErrorMessage(387)); init = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; - Component = prevState.element; + elementType = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, init, null, renderLanes); var nextState = workInProgress.memoizedState; @@ -6753,7 +6737,7 @@ function beginWork(current, workInProgress, renderLanes) { (workInProgress.memoizedState = prevState), workInProgress.flags & 256) ) { - Component = createCapturedValueAtFiber( + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(423)), workInProgress ); @@ -6762,11 +6746,11 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; - } else if (init !== Component) { - Component = createCapturedValueAtFiber( + } else if (init !== elementType) { + elementType = createCapturedValueAtFiber( Error(formatProdErrorMessage(424)), workInProgress ); @@ -6775,7 +6759,7 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, init, renderLanes, - Component + elementType ); break a; } else @@ -6801,7 +6785,7 @@ function beginWork(current, workInProgress, renderLanes) { (renderLanes = renderLanes.sibling); else { resetHydrationState(); - if (init === Component) { + if (init === elementType) { workInProgress = bailoutOnAlreadyFinishedWork( current, workInProgress, @@ -6828,14 +6812,14 @@ function beginWork(current, workInProgress, renderLanes) { null !== renderLanes || ((renderLanes = workInProgress.type), (current = workInProgress.pendingProps), - (Component = getOwnerDocumentFromRootContainer( + (elementType = getOwnerDocumentFromRootContainer( rootInstanceStackCursor.current ).createElement(renderLanes)), - (Component[internalInstanceKey] = workInProgress), - (Component[internalPropsKey] = current), - setInitialProperties(Component, renderLanes, current), - markNodeAsHoistable(Component), - (workInProgress.stateNode = Component)), + (elementType[internalInstanceKey] = workInProgress), + (elementType[internalPropsKey] = current), + setInitialProperties(elementType, renderLanes, current), + markNodeAsHoistable(elementType), + (workInProgress.stateNode = elementType)), null ); case 27: @@ -6843,7 +6827,7 @@ function beginWork(current, workInProgress, renderLanes) { pushHostContext(workInProgress), null === current && isHydrating && - ((Component = workInProgress.stateNode = + ((elementType = workInProgress.stateNode = resolveSingletonInstance( workInProgress.type, workInProgress.pendingProps, @@ -6851,14 +6835,14 @@ function beginWork(current, workInProgress, renderLanes) { )), (hydrationParentFiber = workInProgress), (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable(Component.firstChild))), - (Component = workInProgress.pendingProps.children), + (nextHydratableInstance = getNextHydratable(elementType.firstChild))), + (elementType = workInProgress.pendingProps.children), null !== current || isHydrating - ? reconcileChildren(current, workInProgress, Component, renderLanes) + ? reconcileChildren(current, workInProgress, elementType, renderLanes) : (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )), markRef(current, workInProgress), @@ -6866,18 +6850,18 @@ function beginWork(current, workInProgress, renderLanes) { ); case 5: if (null === current && isHydrating) { - if ((init = Component = nextHydratableInstance)) - (Component = canHydrateInstance( - Component, + if ((init = elementType = nextHydratableInstance)) + (elementType = canHydrateInstance( + elementType, workInProgress.type, workInProgress.pendingProps, rootOrSingletonContext )), - null !== Component - ? ((workInProgress.stateNode = Component), + null !== elementType + ? ((workInProgress.stateNode = elementType), (hydrationParentFiber = workInProgress), (nextHydratableInstance = getNextHydratable( - Component.firstChild + elementType.firstChild )), (rootOrSingletonContext = !1), (init = !0)) @@ -6888,9 +6872,9 @@ function beginWork(current, workInProgress, renderLanes) { init = workInProgress.type; prevState = workInProgress.pendingProps; nextState = null !== current ? current.memoizedProps : null; - Component = prevState.children; + elementType = prevState.children; shouldSetTextContent(init, prevState) - ? (Component = null) + ? (elementType = null) : null !== nextState && shouldSetTextContent(init, nextState) && (workInProgress.flags |= 32); @@ -6914,7 +6898,7 @@ function beginWork(current, workInProgress, renderLanes) { renderLanes ))); markRef(current, workInProgress); - reconcileChildren(current, workInProgress, Component, renderLanes); + reconcileChildren(current, workInProgress, elementType, renderLanes); return workInProgress.child; case 6: if (null === current && isHydrating) { @@ -6941,26 +6925,37 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.stateNode.containerInfo ), - (Component = workInProgress.pendingProps), + (elementType = workInProgress.pendingProps), null === current ? (workInProgress.child = reconcileChildFibers( workInProgress, null, - Component, + elementType, renderLanes )) - : reconcileChildren(current, workInProgress, Component, renderLanes), + : reconcileChildren( + current, + workInProgress, + elementType, + renderLanes + ), workInProgress.child ); case 11: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), - updateForwardRef(current, workInProgress, Component, init, renderLanes) + : resolveDefaultProps(elementType, init)), + updateForwardRef( + current, + workInProgress, + elementType, + init, + renderLanes + ) ); case 7: return ( @@ -6994,13 +6989,13 @@ function beginWork(current, workInProgress, renderLanes) { ); case 10: a: { - Component = enableRenderableContext + elementType = enableRenderableContext ? workInProgress.type : workInProgress.type._context; init = workInProgress.pendingProps; prevState = workInProgress.memoizedProps; nextState = init.value; - pushProvider(workInProgress, Component, nextState); + pushProvider(workInProgress, elementType, nextState); if (!enableLazyContextPropagation && null !== prevState) if (objectIs(prevState.value, nextState)) { if (prevState.children === init.children) { @@ -7011,7 +7006,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - } else propagateContextChange(workInProgress, Component, renderLanes); + } else + propagateContextChange(workInProgress, elementType, renderLanes); reconcileChildren(current, workInProgress, init.children, renderLanes); workInProgress = workInProgress.child; } @@ -7021,23 +7017,23 @@ function beginWork(current, workInProgress, renderLanes) { (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), prepareToReadContext(workInProgress, renderLanes), (init = readContext(init)), - (Component = Component(init)), + (elementType = elementType(init)), (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 14: return ( - (Component = workInProgress.type), - (init = resolveDefaultProps(Component, workInProgress.pendingProps)), - (init = resolveDefaultProps(Component.type, init)), + (elementType = workInProgress.type), + (init = resolveDefaultProps(elementType, workInProgress.pendingProps)), + (init = resolveDefaultProps(elementType.type, init)), updateMemoComponent( current, workInProgress, - Component, + elementType, init, renderLanes ) @@ -7052,21 +7048,21 @@ function beginWork(current, workInProgress, renderLanes) { ); case 17: return ( - (Component = workInProgress.type), + (elementType = workInProgress.type), (init = workInProgress.pendingProps), (init = - workInProgress.elementType === Component + workInProgress.elementType === elementType ? init - : resolveDefaultProps(Component, init)), + : resolveDefaultProps(elementType, init)), resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), (workInProgress.tag = 1), prepareToReadContext(workInProgress, renderLanes), - constructClassInstance(workInProgress, Component, init), - mountClassInstance(workInProgress, Component, init, renderLanes), + constructClassInstance(workInProgress, elementType, init), + mountClassInstance(workInProgress, elementType, init, renderLanes), finishClassComponent( null, workInProgress, - Component, + elementType, !0, !1, renderLanes @@ -7076,9 +7072,9 @@ function beginWork(current, workInProgress, renderLanes) { return updateSuspenseListComponent(current, workInProgress, renderLanes); case 21: return ( - (Component = workInProgress.pendingProps.children), + (elementType = workInProgress.pendingProps.children), markRef(current, workInProgress), - reconcileChildren(current, workInProgress, Component, renderLanes), + reconcileChildren(current, workInProgress, elementType, renderLanes), workInProgress.child ); case 22: @@ -7088,7 +7084,7 @@ function beginWork(current, workInProgress, renderLanes) { case 24: return ( prepareToReadContext(workInProgress, renderLanes), - (Component = readContext(CacheContext)), + (elementType = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), null === init && @@ -7098,7 +7094,10 @@ function beginWork(current, workInProgress, renderLanes) { prevState.refCount++, null !== prevState && (init.pooledCacheLanes |= renderLanes), (init = prevState)), - (workInProgress.memoizedState = { parent: Component, cache: init }), + (workInProgress.memoizedState = { + parent: elementType, + cache: init + }), initializeUpdateQueue(workInProgress), pushProvider(workInProgress, CacheContext, init)) : (0 !== (current.lanes & renderLanes) && @@ -7107,17 +7106,17 @@ function beginWork(current, workInProgress, renderLanes) { suspendIfUpdateReadFromEntangledAsyncAction()), (init = current.memoizedState), (prevState = workInProgress.memoizedState), - init.parent !== Component - ? ((init = { parent: Component, cache: Component }), + init.parent !== elementType + ? ((init = { parent: elementType, cache: elementType }), (workInProgress.memoizedState = init), 0 === workInProgress.lanes && (workInProgress.memoizedState = workInProgress.updateQueue.baseState = init), - pushProvider(workInProgress, CacheContext, Component)) - : ((Component = prevState.cache), - pushProvider(workInProgress, CacheContext, Component), - Component !== init.cache && + pushProvider(workInProgress, CacheContext, elementType)) + : ((elementType = prevState.cache), + pushProvider(workInProgress, CacheContext, elementType), + elementType !== init.cache && propagateContextChange( workInProgress, CacheContext, @@ -7136,22 +7135,22 @@ function beginWork(current, workInProgress, renderLanes) { return ( enableTransitionTracing ? (null === current && - ((Component = enableTransitionTracing + ((elementType = enableTransitionTracing ? transitionStack.current : null), - null !== Component && - ((Component = { + null !== elementType && + ((elementType = { tag: 1, - transitions: new Set(Component), + transitions: new Set(elementType), pendingBoundaries: null, name: workInProgress.pendingProps.name, aborts: null }), - (workInProgress.stateNode = Component), + (workInProgress.stateNode = elementType), (workInProgress.flags |= 2048))), - (Component = workInProgress.stateNode), - null !== Component && - pushMarkerInstance(workInProgress, Component), + (elementType = workInProgress.stateNode), + null !== elementType && + pushMarkerInstance(workInProgress, elementType), reconcileChildren( current, workInProgress, @@ -7701,7 +7700,6 @@ function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); switch (workInProgress.tag) { - case 2: case 16: case 15: case 0: @@ -11625,8 +11623,6 @@ 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, @@ -12121,16 +12117,6 @@ 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 @@ -12208,7 +12194,7 @@ function createFiberFromTypeAndProps( mode, lanes ) { - var fiberTag = 2; + var fiberTag = 0; owner = type; if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); else if ("string" === typeof type) @@ -13764,19 +13750,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$344; + var JSCompiler_inline_result$jscomp$343; if (canUseDOM) { - var isSupported$jscomp$inline_1521 = "oninput" in document; - if (!isSupported$jscomp$inline_1521) { - var element$jscomp$inline_1522 = document.createElement("div"); - element$jscomp$inline_1522.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1521 = - "function" === typeof element$jscomp$inline_1522.oninput; + var isSupported$jscomp$inline_1507 = "oninput" in document; + if (!isSupported$jscomp$inline_1507) { + var element$jscomp$inline_1508 = document.createElement("div"); + element$jscomp$inline_1508.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1507 = + "function" === typeof element$jscomp$inline_1508.oninput; } - JSCompiler_inline_result$jscomp$344 = isSupported$jscomp$inline_1521; - } else JSCompiler_inline_result$jscomp$344 = !1; + JSCompiler_inline_result$jscomp$343 = isSupported$jscomp$inline_1507; + } else JSCompiler_inline_result$jscomp$343 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$344 && + JSCompiler_inline_result$jscomp$343 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14085,20 +14071,20 @@ function registerSimpleEvent(domEventName, reactName) { registerTwoPhaseEvent(reactName, [domEventName]); } for ( - var i$jscomp$inline_1562 = 0; - i$jscomp$inline_1562 < simpleEventPluginEvents.length; - i$jscomp$inline_1562++ + var i$jscomp$inline_1548 = 0; + i$jscomp$inline_1548 < simpleEventPluginEvents.length; + i$jscomp$inline_1548++ ) { - var eventName$jscomp$inline_1563 = - simpleEventPluginEvents[i$jscomp$inline_1562], - domEventName$jscomp$inline_1564 = - eventName$jscomp$inline_1563.toLowerCase(), - capitalizedEvent$jscomp$inline_1565 = - eventName$jscomp$inline_1563[0].toUpperCase() + - eventName$jscomp$inline_1563.slice(1); + var eventName$jscomp$inline_1549 = + simpleEventPluginEvents[i$jscomp$inline_1548], + domEventName$jscomp$inline_1550 = + eventName$jscomp$inline_1549.toLowerCase(), + capitalizedEvent$jscomp$inline_1551 = + eventName$jscomp$inline_1549[0].toUpperCase() + + eventName$jscomp$inline_1549.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1564, - "on" + capitalizedEvent$jscomp$inline_1565 + domEventName$jscomp$inline_1550, + "on" + capitalizedEvent$jscomp$inline_1551 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17012,17 +16998,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1720 = { +var devToolsConfig$jscomp$inline_1706 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-3f526f79", + version: "19.0.0-www-modern-915aecd9", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2126 = { - bundleType: devToolsConfig$jscomp$inline_1720.bundleType, - version: devToolsConfig$jscomp$inline_1720.version, - rendererPackageName: devToolsConfig$jscomp$inline_1720.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1720.rendererConfig, +var internals$jscomp$inline_2109 = { + bundleType: devToolsConfig$jscomp$inline_1706.bundleType, + version: devToolsConfig$jscomp$inline_1706.version, + rendererPackageName: devToolsConfig$jscomp$inline_1706.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1706.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17038,26 +17024,26 @@ var internals$jscomp$inline_2126 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1720.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1706.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-3f526f79" + reconcilerVersion: "19.0.0-www-modern-915aecd9" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2127 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2127.isDisabled && - hook$jscomp$inline_2127.supportsFiber + !hook$jscomp$inline_2110.isDisabled && + hook$jscomp$inline_2110.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2127.inject( - internals$jscomp$inline_2126 + (rendererID = hook$jscomp$inline_2110.inject( + internals$jscomp$inline_2109 )), - (injectedHook = hook$jscomp$inline_2127); + (injectedHook = hook$jscomp$inline_2110); } catch (err) {} } if ("function" !== typeof require("ReactFiberErrorDialog").showErrorDialog) @@ -17471,4 +17457,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-3f526f79"; +exports.version = "19.0.0-www-modern-915aecd9"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 860904b81218a..f1f9ec123af3c 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -148,8 +148,6 @@ 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. @@ -428,7 +426,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -2736,7 +2733,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -5067,7 +5063,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -12406,17 +12401,6 @@ 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; @@ -12480,7 +12464,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -13744,7 +13735,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -13755,7 +13745,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -14368,6 +14357,39 @@ 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; { @@ -14798,70 +14820,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -14923,111 +14943,6 @@ 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) { @@ -15064,33 +14979,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -15099,16 +15013,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -16800,15 +16714,6 @@ 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( @@ -18148,7 +18053,6 @@ 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: @@ -24267,12 +24171,6 @@ 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`. @@ -25412,7 +25310,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -26198,22 +26095,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -26298,7 +26181,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -26424,7 +26306,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -26839,7 +26721,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-22c1f956"; + var ReactVersion = "19.0.0-www-classic-7ce8154f"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 7d722dba924c9..ff0500b975d52 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -148,8 +148,6 @@ 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. @@ -428,7 +426,6 @@ if (__DEV__) { case ClassComponent: case FunctionComponent: case IncompleteClassComponent: - case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === "function") { @@ -2736,7 +2733,6 @@ if (__DEV__) { return "SuspenseList"; case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: var fn = fiber.type; return fn.displayName || fn.name || null; @@ -5067,7 +5063,6 @@ if (__DEV__) { return describeBuiltInComponentFrame("SuspenseList"); case FunctionComponent: - case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); @@ -12406,17 +12401,6 @@ 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; @@ -12480,7 +12464,14 @@ if (__DEV__) { instance.state !== null && instance.state !== undefined ? instance.state : null); - 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; + } { if ( @@ -13744,7 +13735,6 @@ if (__DEV__) { ); var didReceiveUpdate = false; var didWarnAboutBadClass; - var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; @@ -13755,7 +13745,6 @@ if (__DEV__) { { didWarnAboutBadClass = {}; - didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; @@ -14368,6 +14357,39 @@ 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; { @@ -14798,70 +14820,68 @@ 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; - switch (resolvedTag) { - case FunctionComponent: { + if (typeof Component === "function") { + if (isFunctionClassComponent(Component)) { + workInProgress.tag = ClassComponent; + { - validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveFunctionForHotReloading(Component); + resolveClassForHotReloading(Component); } - child = updateFunctionComponent( + return updateClassComponent( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } + } else { + workInProgress.tag = FunctionComponent; - case ClassComponent: { { + validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = - resolveClassForHotReloading(Component); + resolveFunctionForHotReloading(Component); } - child = updateClassComponent( + return updateFunctionComponent( 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); } - child = updateForwardRef( + return updateForwardRef( null, workInProgress, Component, resolvedProps, renderLanes ); - return child; - } - - case MemoComponent: { - child = updateMemoComponent( + } else if ($$typeof === REACT_MEMO_TYPE) { + workInProgress.tag = MemoComponent; + return updateMemoComponent( null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes ); - return child; } } @@ -14923,111 +14943,6 @@ 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) { @@ -15064,33 +14979,32 @@ if (__DEV__) { } if (Component.defaultProps !== undefined) { - var _componentName3 = - getComponentNameFromType(Component) || "Unknown"; + var _componentName = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) { + if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName]) { error( "%s: Support for defaultProps will be removed from function components " + "in a future major release. Use JavaScript default parameters instead.", - _componentName3 + _componentName ); - didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true; + didWarnAboutDefaultPropsOnFunctionComponent[_componentName] = true; } } if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName4 = + var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if ( - !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] + !didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] ) { error( "%s: Function components do not support getDerivedStateFromProps.", - _componentName4 + _componentName2 ); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] = + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; } } @@ -15099,16 +15013,16 @@ if (__DEV__) { typeof Component.contextType === "object" && Component.contextType !== null ) { - var _componentName5 = + var _componentName3 = getComponentNameFromType(Component) || "Unknown"; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) { + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { error( "%s: Function components do not support contextType.", - _componentName5 + _componentName3 ); - didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true; + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; } } } @@ -16800,15 +16714,6 @@ 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( @@ -18148,7 +18053,6 @@ 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: @@ -24267,12 +24171,6 @@ 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`. @@ -25412,7 +25310,6 @@ if (__DEV__) { var tag = fiber.tag; if ( - tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && @@ -26198,22 +26095,8 @@ if (__DEV__) { type.defaultProps === undefined ); } - 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; + function isFunctionClassComponent(type) { + return shouldConstruct(type); } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { @@ -26298,7 +26181,6 @@ if (__DEV__) { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { - case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); @@ -26424,7 +26306,7 @@ if (__DEV__) { mode, lanes ) { - var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + var fiberTag = FunctionComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; @@ -26839,7 +26721,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-22c1f956"; + var ReactVersion = "19.0.0-www-modern-7ce8154f"; // Might add PROFILE later. diff --git a/compiled/facebook-www/ReactTestUtils-dev.classic.js b/compiled/facebook-www/ReactTestUtils-dev.classic.js index fdd99a61000ae..5c58d54d96f16 100644 --- a/compiled/facebook-www/ReactTestUtils-dev.classic.js +++ b/compiled/facebook-www/ReactTestUtils-dev.classic.js @@ -98,7 +98,6 @@ if (__DEV__) { var FunctionComponent = 0; var ClassComponent = 1; - var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostComponent = 5; diff --git a/compiled/facebook-www/ReactTestUtils-dev.modern.js b/compiled/facebook-www/ReactTestUtils-dev.modern.js index fdd99a61000ae..5c58d54d96f16 100644 --- a/compiled/facebook-www/ReactTestUtils-dev.modern.js +++ b/compiled/facebook-www/ReactTestUtils-dev.modern.js @@ -98,7 +98,6 @@ if (__DEV__) { var FunctionComponent = 0; var ClassComponent = 1; - var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostComponent = 5; diff --git a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js index 998735c67dea2..38554388044da 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -274,7 +274,6 @@ export default [ "Symbols are not valid as a React child.\n root.render(%s)", "Text strings must be rendered within a component.", "Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components", - "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.", "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.", "The `%s` prop supplied to must be a scalar value if `multiple` is false.%s",