From b3204925be3ed6a0a8eb9b791fcd5eba4bee0490 Mon Sep 17 00:00:00 2001 From: 22388o <22388o@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:12:03 -0800 Subject: [PATCH] [flags] Clean up scheduler flags (#31814) These flags are hardcoded now, we can make them static. DiffTrain build for [d42872588282b9eef56b8fa02441b33d596fd197](https://github.com/facebook/react/commit/d42872588282b9eef56b8fa02441b33d596fd197) --- .../facebook-www/JSXDEVRuntime-dev.classic.js | 93 +- .../facebook-www/JSXDEVRuntime-dev.modern.js | 93 +- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 219 ++- compiled/facebook-www/React-dev.modern.js | 219 ++- compiled/facebook-www/React-prod.classic.js | 8 +- compiled/facebook-www/React-prod.modern.js | 8 +- .../facebook-www/React-profiling.classic.js | 8 +- .../facebook-www/React-profiling.modern.js | 8 +- compiled/facebook-www/ReactART-dev.classic.js | 908 ++++------ compiled/facebook-www/ReactART-dev.modern.js | 908 ++++------ .../facebook-www/ReactART-prod.classic.js | 241 +-- compiled/facebook-www/ReactART-prod.modern.js | 241 +-- compiled/facebook-www/ReactDOM-dev.classic.js | 1551 +++++++--------- compiled/facebook-www/ReactDOM-dev.modern.js | 1551 +++++++--------- .../facebook-www/ReactDOM-prod.classic.js | 428 ++--- compiled/facebook-www/ReactDOM-prod.modern.js | 428 ++--- .../ReactDOM-profiling.classic.js | 432 ++--- .../facebook-www/ReactDOM-profiling.modern.js | 432 ++--- .../ReactDOMServer-dev.classic.js | 1023 ++++++----- .../facebook-www/ReactDOMServer-dev.modern.js | 1029 ++++++----- .../ReactDOMServer-prod.classic.js | 74 +- .../ReactDOMServer-prod.modern.js | 74 +- .../ReactDOMServerStreaming-dev.modern.js | 937 ++++++---- .../ReactDOMServerStreaming-prod.modern.js | 32 +- .../ReactDOMTesting-dev.classic.js | 1551 +++++++--------- .../ReactDOMTesting-dev.modern.js | 1551 +++++++--------- .../ReactDOMTesting-prod.classic.js | 428 ++--- .../ReactDOMTesting-prod.modern.js | 428 ++--- compiled/facebook-www/ReactIs-dev.classic.js | 3 - compiled/facebook-www/ReactIs-dev.modern.js | 3 - compiled/facebook-www/ReactIs-prod.classic.js | 3 - compiled/facebook-www/ReactIs-prod.modern.js | 3 - .../ReactReconciler-dev.classic.js | 1063 +++++------ .../ReactReconciler-dev.modern.js | 1063 +++++------ .../ReactReconciler-prod.classic.js | 391 ++-- .../ReactReconciler-prod.modern.js | 391 ++-- .../ReactTestRenderer-dev.classic.js | 1573 ++++++++--------- .../ReactTestRenderer-dev.modern.js | 1573 ++++++++--------- .../facebook-www/Scheduler-dev.classic.js | 46 +- compiled/facebook-www/Scheduler-dev.modern.js | 46 +- .../facebook-www/Scheduler-prod.classic.js | 33 +- .../facebook-www/Scheduler-prod.modern.js | 33 +- .../Scheduler-profiling.classic.js | 33 +- .../Scheduler-profiling.modern.js | 33 +- .../facebook-www/SchedulerMock-dev.classic.js | 15 +- .../facebook-www/SchedulerMock-dev.modern.js | 15 +- .../SchedulerMock-prod.classic.js | 15 +- .../facebook-www/SchedulerMock-prod.modern.js | 15 +- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 3 +- .../facebook-www/eslint-plugin-react-hooks.js | 16 +- 54 files changed, 9795 insertions(+), 11485 deletions(-) diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js index 6592ba25d19a9..ebb14bf63095c 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -361,7 +361,7 @@ __DEV__ && if ("object" === typeof type) switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: - return (type = describeNativeComponentFrame(type.render, !1)), type; + return describeNativeComponentFrame(type.render, !1); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type); case REACT_LAZY_TYPE: @@ -373,6 +373,21 @@ __DEV__ && } return ""; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); @@ -409,7 +424,16 @@ __DEV__ && componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -437,6 +461,19 @@ __DEV__ && writable: !0, value: null }); + enableOwnerStacks && + (Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }), + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + })); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -446,14 +483,16 @@ __DEV__ && maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { if ( + enableOwnerStacks || "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || - (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || @@ -562,10 +601,21 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask + ); } function validateChildKeys(node, parentType) { - if ( + if (enableOwnerStacks) + isValidElement(node) && node._store && (node._store.validated = 1); + else if ( "object" === typeof node && node && node.$$typeof !== REACT_CLIENT_REFERENCE @@ -601,6 +651,7 @@ __DEV__ && } function validateExplicitKey(element, parentType) { if ( + !enableOwnerStacks && element._store && !element._store.validated && null == element.key && @@ -649,14 +700,14 @@ __DEV__ && dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing; - dynamicFeatureFlags = dynamicFeatureFlags.renameElementSymbol; - var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_ELEMENT_TYPE = dynamicFeatureFlags + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks; + dynamicFeatureFlags = Symbol.for("react.element"); + var REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") - : REACT_LEGACY_ELEMENT_TYPE, + : dynamicFeatureFlags, REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), @@ -670,7 +721,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -699,6 +749,12 @@ __DEV__ && "function" === typeof WeakMap ? WeakMap : Map )(); var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + createTask = + enableOwnerStacks && console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; var didWarnAboutKeySpread = {}, @@ -712,6 +768,15 @@ __DEV__ && source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; })(); diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js index 6592ba25d19a9..ebb14bf63095c 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js @@ -361,7 +361,7 @@ __DEV__ && if ("object" === typeof type) switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: - return (type = describeNativeComponentFrame(type.render, !1)), type; + return describeNativeComponentFrame(type.render, !1); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type); case REACT_LAZY_TYPE: @@ -373,6 +373,21 @@ __DEV__ && } return ""; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); @@ -409,7 +424,16 @@ __DEV__ && componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -437,6 +461,19 @@ __DEV__ && writable: !0, value: null }); + enableOwnerStacks && + (Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }), + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + })); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -446,14 +483,16 @@ __DEV__ && maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { if ( + enableOwnerStacks || "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || - (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || @@ -562,10 +601,21 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask + ); } function validateChildKeys(node, parentType) { - if ( + if (enableOwnerStacks) + isValidElement(node) && node._store && (node._store.validated = 1); + else if ( "object" === typeof node && node && node.$$typeof !== REACT_CLIENT_REFERENCE @@ -601,6 +651,7 @@ __DEV__ && } function validateExplicitKey(element, parentType) { if ( + !enableOwnerStacks && element._store && !element._store.validated && null == element.key && @@ -649,14 +700,14 @@ __DEV__ && dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing; - dynamicFeatureFlags = dynamicFeatureFlags.renameElementSymbol; - var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_ELEMENT_TYPE = dynamicFeatureFlags + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks; + dynamicFeatureFlags = Symbol.for("react.element"); + var REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") - : REACT_LEGACY_ELEMENT_TYPE, + : dynamicFeatureFlags, REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), @@ -670,7 +721,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -699,6 +749,12 @@ __DEV__ && "function" === typeof WeakMap ? WeakMap : Map )(); var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + createTask = + enableOwnerStacks && console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown; var didWarnAboutElementRef = {}; var didWarnAboutKeySpread = {}, @@ -712,6 +768,15 @@ __DEV__ && source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; })(); diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index fb57af55bdf97..38ba8aec4e512 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -7283a213dbbc31029e65005276f12202558558fc +d42872588282b9eef56b8fa02441b33d596fd197 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index fb57af55bdf97..38ba8aec4e512 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -7283a213dbbc31029e65005276f12202558558fc +d42872588282b9eef56b8fa02441b33d596fd197 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index e0a15eca817a1..fbc99ddb3b35c 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -187,7 +187,6 @@ __DEV__ && "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || - (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || @@ -448,7 +447,7 @@ __DEV__ && if ("object" === typeof type) switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: - return (type = describeNativeComponentFrame(type.render, !1)), type; + return describeNativeComponentFrame(type.render, !1); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type); case REACT_LAZY_TYPE: @@ -460,6 +459,21 @@ __DEV__ && } return ""; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); @@ -496,7 +510,16 @@ __DEV__ && componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -524,6 +547,19 @@ __DEV__ && writable: !0, value: null }); + enableOwnerStacks && + (Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }), + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + })); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -533,9 +569,11 @@ __DEV__ && maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if (isValidElementType(type)) { + if (enableOwnerStacks || isValidElementType(type)) { var children = config.children; if (void 0 !== children) if (isStaticChildren) @@ -624,7 +662,16 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask + ); } function cloneAndReplaceKey(oldElement, newKey) { newKey = ReactElement( @@ -633,13 +680,17 @@ __DEV__ && void 0, void 0, oldElement._owner, - oldElement.props + oldElement.props, + enableOwnerStacks ? oldElement._debugStack : void 0, + enableOwnerStacks ? oldElement._debugTask : void 0 ); newKey._store.validated = oldElement._store.validated; return newKey; } function validateChildKeys(node, parentType) { - if ( + if (enableOwnerStacks) + isValidElement(node) && node._store && (node._store.validated = 1); + else if ( "object" === typeof node && node && node.$$typeof !== REACT_CLIENT_REFERENCE @@ -670,6 +721,7 @@ __DEV__ && } function validateExplicitKey(element, parentType) { if ( + !enableOwnerStacks && element._store && !element._store.validated && null == element.key && @@ -1046,6 +1098,11 @@ __DEV__ && } } } + function captureOwnerStack() { + if (!enableOwnerStacks) return null; + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -1053,12 +1110,12 @@ __DEV__ && var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableUseResourceEffectHook = dynamicFeatureFlags.enableUseResourceEffectHook, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -1076,7 +1133,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -1167,6 +1223,12 @@ __DEV__ && "function" === typeof WeakMap ? WeakMap : Map )(); var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + createTask = + enableOwnerStacks && console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; var didWarnAboutElementRef = {}; @@ -1217,42 +1279,45 @@ __DEV__ && } : enqueueTask, ReactCompilerRuntime = { c: useMemoCache }, + Children = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) + throw Error( + "React.Children.only expected to receive a single React element child." + ); + return children; + } + }, experimental_useResourceEffect = enableUseResourceEffectHook ? useResourceEffect : void 0; - exports.Children = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) - throw Error( - "React.Children.only expected to receive a single React element child." - ); - return children; - } - }; + exports.captureOwnerStack = void 0; + enableOwnerStacks && (exports.captureOwnerStack = captureOwnerStack); + exports.Children = Children; exports.Component = Component; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; @@ -1440,7 +1505,16 @@ __DEV__ && arguments[JSCompiler_inline_result + 2]; props.children = defaultProps; } - props = ReactElement(element.type, key, void 0, void 0, owner, props); + props = ReactElement( + element.type, + key, + void 0, + void 0, + owner, + props, + enableOwnerStacks ? element._debugStack : void 0, + enableOwnerStacks ? element._debugTask : void 0 + ); for (key = 2; key < arguments.length; key++) validateChildKeys(arguments[key], props.type); return props; @@ -1516,7 +1590,7 @@ __DEV__ && return context; }; exports.createElement = function (type, config, children) { - if (isValidElementType(type)) + if (enableOwnerStacks || isValidElementType(type)) for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], type); else { @@ -1588,7 +1662,16 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, typeString, void 0, void 0, getOwner(), i); + return ReactElement( + type, + typeString, + void 0, + void 0, + getOwner(), + i, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.createRef = function () { var refObject = { current: null }; @@ -1642,7 +1725,16 @@ __DEV__ && }; exports.isValidElement = isValidElement; exports.jsx = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !1, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.jsxDEV = function ( type, @@ -1652,10 +1744,28 @@ __DEV__ && source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.jsxs = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !0, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.lazy = function (ctor) { var lazyType = { @@ -1747,7 +1857,6 @@ __DEV__ && } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; - exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -1761,14 +1870,6 @@ __DEV__ && exports.unstable_useCacheRefresh = function () { return resolveDispatcher().useCacheRefresh(); }; - exports.unstable_useContextWithBailout = function (context, select) { - var dispatcher = resolveDispatcher(); - context.$$typeof === REACT_CONSUMER_TYPE && - error$jscomp$0( - "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" - ); - return dispatcher.unstable_useContextWithBailout(context, select); - }; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return resolveDispatcher().use(usable); @@ -1841,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-7283a213-20241206"; + exports.version = "19.1.0-www-classic-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 0b64c409fd1e6..7c0085ea7dc60 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -187,7 +187,6 @@ __DEV__ && "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || - (enableDebugTracing && type === REACT_DEBUG_TRACING_MODE_TYPE) || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || @@ -448,7 +447,7 @@ __DEV__ && if ("object" === typeof type) switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: - return (type = describeNativeComponentFrame(type.render, !1)), type; + return describeNativeComponentFrame(type.render, !1); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type); case REACT_LAZY_TYPE: @@ -460,6 +459,21 @@ __DEV__ && } return ""; } + function getTaskName(type) { + if (type === REACT_FRAGMENT_TYPE) return "<>"; + if ( + "object" === typeof type && + null !== type && + type.$$typeof === REACT_LAZY_TYPE + ) + return "<...>"; + try { + var name = getComponentNameFromType(type); + return name ? "<" + name + ">" : "<...>"; + } catch (x) { + return "<...>"; + } + } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); @@ -496,7 +510,16 @@ __DEV__ && componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } - function ReactElement(type, key, self, source, owner, props) { + function ReactElement( + type, + key, + self, + source, + owner, + props, + debugStack, + debugTask + ) { self = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, @@ -524,6 +547,19 @@ __DEV__ && writable: !0, value: null }); + enableOwnerStacks && + (Object.defineProperty(type, "_debugStack", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugStack + }), + Object.defineProperty(type, "_debugTask", { + configurable: !1, + enumerable: !1, + writable: !0, + value: debugTask + })); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } @@ -533,9 +569,11 @@ __DEV__ && maybeKey, isStaticChildren, source, - self + self, + debugStack, + debugTask ) { - if (isValidElementType(type)) { + if (enableOwnerStacks || isValidElementType(type)) { var children = config.children; if (void 0 !== children) if (isStaticChildren) @@ -624,7 +662,16 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, children, self, source, getOwner(), maybeKey); + return ReactElement( + type, + children, + self, + source, + getOwner(), + maybeKey, + debugStack, + debugTask + ); } function cloneAndReplaceKey(oldElement, newKey) { newKey = ReactElement( @@ -633,13 +680,17 @@ __DEV__ && void 0, void 0, oldElement._owner, - oldElement.props + oldElement.props, + enableOwnerStacks ? oldElement._debugStack : void 0, + enableOwnerStacks ? oldElement._debugTask : void 0 ); newKey._store.validated = oldElement._store.validated; return newKey; } function validateChildKeys(node, parentType) { - if ( + if (enableOwnerStacks) + isValidElement(node) && node._store && (node._store.validated = 1); + else if ( "object" === typeof node && node && node.$$typeof !== REACT_CLIENT_REFERENCE @@ -670,6 +721,7 @@ __DEV__ && } function validateExplicitKey(element, parentType) { if ( + !enableOwnerStacks && element._store && !element._store.validated && null == element.key && @@ -1046,6 +1098,11 @@ __DEV__ && } } } + function captureOwnerStack() { + if (!enableOwnerStacks) return null; + var getCurrentStack = ReactSharedInternals.getCurrentStack; + return null === getCurrentStack ? null : getCurrentStack(); + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -1053,12 +1110,12 @@ __DEV__ && var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableUseResourceEffectHook = dynamicFeatureFlags.enableUseResourceEffectHook, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -1076,7 +1133,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -1167,6 +1223,12 @@ __DEV__ && "function" === typeof WeakMap ? WeakMap : Map )(); var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), + createTask = + enableOwnerStacks && console.createTask + ? console.createTask + : function () { + return null; + }, specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; var didWarnAboutElementRef = {}; @@ -1217,42 +1279,45 @@ __DEV__ && } : enqueueTask, ReactCompilerRuntime = { c: useMemoCache }, + Children = { + map: mapChildren, + forEach: function (children, forEachFunc, forEachContext) { + mapChildren( + children, + function () { + forEachFunc.apply(this, arguments); + }, + forEachContext + ); + }, + count: function (children) { + var n = 0; + mapChildren(children, function () { + n++; + }); + return n; + }, + toArray: function (children) { + return ( + mapChildren(children, function (child) { + return child; + }) || [] + ); + }, + only: function (children) { + if (!isValidElement(children)) + throw Error( + "React.Children.only expected to receive a single React element child." + ); + return children; + } + }, experimental_useResourceEffect = enableUseResourceEffectHook ? useResourceEffect : void 0; - exports.Children = { - map: mapChildren, - forEach: function (children, forEachFunc, forEachContext) { - mapChildren( - children, - function () { - forEachFunc.apply(this, arguments); - }, - forEachContext - ); - }, - count: function (children) { - var n = 0; - mapChildren(children, function () { - n++; - }); - return n; - }, - toArray: function (children) { - return ( - mapChildren(children, function (child) { - return child; - }) || [] - ); - }, - only: function (children) { - if (!isValidElement(children)) - throw Error( - "React.Children.only expected to receive a single React element child." - ); - return children; - } - }; + exports.captureOwnerStack = void 0; + enableOwnerStacks && (exports.captureOwnerStack = captureOwnerStack); + exports.Children = Children; exports.Component = Component; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; @@ -1440,7 +1505,16 @@ __DEV__ && arguments[JSCompiler_inline_result + 2]; props.children = defaultProps; } - props = ReactElement(element.type, key, void 0, void 0, owner, props); + props = ReactElement( + element.type, + key, + void 0, + void 0, + owner, + props, + enableOwnerStacks ? element._debugStack : void 0, + enableOwnerStacks ? element._debugTask : void 0 + ); for (key = 2; key < arguments.length; key++) validateChildKeys(arguments[key], props.type); return props; @@ -1516,7 +1590,7 @@ __DEV__ && return context; }; exports.createElement = function (type, config, children) { - if (isValidElementType(type)) + if (enableOwnerStacks || isValidElementType(type)) for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i], type); else { @@ -1588,7 +1662,16 @@ __DEV__ && ? type.displayName || type.name || "Unknown" : type ); - return ReactElement(type, typeString, void 0, void 0, getOwner(), i); + return ReactElement( + type, + typeString, + void 0, + void 0, + getOwner(), + i, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.createRef = function () { var refObject = { current: null }; @@ -1642,7 +1725,16 @@ __DEV__ && }; exports.isValidElement = isValidElement; exports.jsx = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !1, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !1, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.jsxDEV = function ( type, @@ -1652,10 +1744,28 @@ __DEV__ && source, self ) { - return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + isStaticChildren, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.jsxs = function (type, config, maybeKey, source, self) { - return jsxDEVImpl(type, config, maybeKey, !0, source, self); + return jsxDEVImpl( + type, + config, + maybeKey, + !0, + source, + self, + enableOwnerStacks ? Error("react-stack-top-frame") : void 0, + enableOwnerStacks ? createTask(getTaskName(type)) : void 0 + ); }; exports.lazy = function (ctor) { var lazyType = { @@ -1747,7 +1857,6 @@ __DEV__ && } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; - exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -1761,14 +1870,6 @@ __DEV__ && exports.unstable_useCacheRefresh = function () { return resolveDispatcher().useCacheRefresh(); }; - exports.unstable_useContextWithBailout = function (context, select) { - var dispatcher = resolveDispatcher(); - context.$$typeof === REACT_CONSUMER_TYPE && - error$jscomp$0( - "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" - ); - return dispatcher.unstable_useContextWithBailout(context, select); - }; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return resolveDispatcher().use(usable); @@ -1841,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-7283a213-20241206"; + exports.version = "19.1.0-www-modern-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 795341823091f..f393f48328a92 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -35,7 +35,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -420,6 +419,7 @@ exports.cache = function (fn) { return fn.apply(null, arguments); }; }; +exports.captureOwnerStack = void 0; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -558,7 +558,6 @@ exports.startTransition = function (scope, options) { } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; -exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -570,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; -exports.unstable_useContextWithBailout = function (context, select) { - return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); -}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -634,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-7283a213-20241206"; +exports.version = "19.1.0-www-classic-d4287258-20241217"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index abb031b784519..88dc24c88a8b4 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -35,7 +35,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -420,6 +419,7 @@ exports.cache = function (fn) { return fn.apply(null, arguments); }; }; +exports.captureOwnerStack = void 0; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -558,7 +558,6 @@ exports.startTransition = function (scope, options) { } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; -exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -570,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; -exports.unstable_useContextWithBailout = function (context, select) { - return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); -}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -634,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-7283a213-20241206"; +exports.version = "19.1.0-www-modern-d4287258-20241217"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 9c19d0b4221df..523867ddd2807 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -39,7 +39,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -424,6 +423,7 @@ exports.cache = function (fn) { return fn.apply(null, arguments); }; }; +exports.captureOwnerStack = void 0; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -562,7 +562,6 @@ exports.startTransition = function (scope, options) { } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; -exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -574,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; -exports.unstable_useContextWithBailout = function (context, select) { - return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); -}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -638,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-7283a213-20241206"; +exports.version = "19.1.0-www-classic-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index dd1dfa2cbb7bf..6115cc4048f3a 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -39,7 +39,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -424,6 +423,7 @@ exports.cache = function (fn) { return fn.apply(null, arguments); }; }; +exports.captureOwnerStack = void 0; exports.cloneElement = function (element, config, children) { if (null === element || void 0 === element) throw Error( @@ -562,7 +562,6 @@ exports.startTransition = function (scope, options) { } }; exports.unstable_Activity = REACT_OFFSCREEN_TYPE; -exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; @@ -574,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; -exports.unstable_useContextWithBailout = function (context, select) { - return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); -}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -638,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-7283a213-20241206"; +exports.version = "19.1.0-www-modern-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 0035439f1c032..364b48a469f23 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -536,6 +536,27 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -550,13 +571,11 @@ __DEV__ && return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -586,8 +605,71 @@ __DEV__ && return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } + function getOwnerStackByFiberInDev(workInProgress) { + if (!enableOwnerStacks) return ""; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + return null === current + ? "" + : enableOwnerStacks + ? getOwnerStackByFiberInDev(current) + : getStackByFiberInDevAndProd(current); } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; @@ -596,7 +678,11 @@ __DEV__ && isRendering = !1; current = fiber; try { - return callback(arg0, arg1, arg2, arg3, arg4); + return enableOwnerStacks && null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { current = previousFiber; } @@ -701,7 +787,7 @@ __DEV__ && } } function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$2 && + "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), (suppressWarning = newIsStrictMode)); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -759,7 +845,7 @@ __DEV__ && } function clz32Fallback(x) { x >>>= 0; - return 0 === x ? 32 : (31 - ((log$1(x) / LN2) | 0)) | 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } function getLabelForLane(lane) { if (enableSchedulingProfiler) { @@ -1281,9 +1367,6 @@ __DEV__ && (null == props.visible || props.visible) && instance.show(); } function unhideTextInstance() {} - function getInstanceFromNode() { - return null; - } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1400,100 +1483,6 @@ __DEV__ && function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } - function formatLanes(laneOrLanes) { - return "0b" + laneOrLanes.toString(2).padStart(31, "0"); - } - function group() { - for ( - var _len = arguments.length, groupArgs = Array(_len), _key = 0; - _key < _len; - _key++ - ) - groupArgs[_key] = arguments[_key]; - pendingGroupArgs.push(groupArgs); - null === nativeConsoleLog && - ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); - } - function groupEnd() { - for ( - pendingGroupArgs.pop(); - printedGroupIndex >= pendingGroupArgs.length; - - ) - nativeConsole.groupEnd(), printedGroupIndex--; - 0 === pendingGroupArgs.length && - ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); - } - function log() { - if (printedGroupIndex < pendingGroupArgs.length - 1) { - for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) - nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); - printedGroupIndex = pendingGroupArgs.length - 1; - } - "function" === typeof nativeConsoleLog - ? nativeConsoleLog.apply(void 0, arguments) - : nativeConsole.log.apply(nativeConsole, arguments); - } - function getWakeableID(wakeable) { - wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); - return wakeableIDs.get(wakeable); - } - function logComponentSuspended(componentName, wakeable) { - if (enableDebugTracing) { - var id = getWakeableID(wakeable), - display = wakeable.displayName || wakeable; - log( - "%c\u269b%c " + componentName + " suspended", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - wakeable.then( - function () { - log( - "%c\u269b%c " + componentName + " resolved", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - }, - function () { - log( - "%c\u269b%c " + componentName + " rejected", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - } - ); - } - } - function logRenderStarted(lanes) { - enableDebugTracing && - group( - "%c\u269b%c render%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - } - function logStateUpdateScheduled(componentName, lane, payloadOrAction) { - enableDebugTracing && - log( - "%c\u269b%c " + - componentName + - " updated state %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #01a252; font-weight: bold;", - "", - payloadOrAction - ); - } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var existing = CapturedStacks.get(value); @@ -3157,34 +3146,8 @@ __DEV__ && } return workInProgressHook; } - function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue2; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - JSCompiler_temp.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } function useThenable(thenable) { var index = thenableIndexCounter$1; @@ -4378,7 +4341,7 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - var update = { + action = { lane: JSCompiler_OptimizeArgumentsArray_p0, revertLane: 0, action: action, @@ -4387,25 +4350,26 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, update) - : ((update = enqueueConcurrentHookUpdate( + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, JSCompiler_OptimizeArgumentsArray_p0 )), - null !== update && + null !== action && (scheduleUpdateOnFiber( - update, + action, fiber, JSCompiler_OptimizeArgumentsArray_p0 ), entangleTransitionUpdate( - update, + action, queue, JSCompiler_OptimizeArgumentsArray_p0 ))); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p0, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); } function dispatchSetState( fiber, @@ -4424,7 +4388,8 @@ __DEV__ && action, JSCompiler_OptimizeArgumentsArray_p1 ); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -4483,7 +4448,7 @@ __DEV__ && error$jscomp$0( "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - var update = { + action = { lane: 2, revertLane: requestTransitionLane(), action: action, @@ -4499,12 +4464,12 @@ __DEV__ && (throwIfDuringRender = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, 2 )), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markUpdateInDevTools(fiber, 2, action); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 2); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -4531,13 +4496,6 @@ __DEV__ && markRootEntangled(root, lane); } } - function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & 4) { - var name = getComponentNameFromFiber(fiber) || "Unknown"; - logStateUpdateScheduled(name, lane, action); - } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); - } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -4694,6 +4652,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -4768,6 +4727,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -4790,6 +4750,7 @@ __DEV__ && )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -4837,6 +4798,7 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -5366,6 +5328,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -5532,6 +5496,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -5561,10 +5527,13 @@ __DEV__ && fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); break; } return fiber; @@ -5906,10 +5875,6 @@ __DEV__ && rootRenderLanes, !0 ); - enableDebugTracing && - sourceFiber.mode & 4 && - ((returnFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(returnFiber, value)); returnFiber = suspenseHandlerStackCursor.current; if (null !== returnFiber) { switch (returnFiber.tag) { @@ -8003,6 +7968,9 @@ __DEV__ && workInProgress.mode, workInProgress.lanes ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -8614,19 +8582,8 @@ __DEV__ && a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue2) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -8724,37 +8681,19 @@ __DEV__ && ); workInProgress.flags |= 262144; } - function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue - ) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error("Compared context values must be arrays"); - return !1; - } function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue2, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -12991,7 +12930,6 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); prepareFreshStack(root, lanes); } - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; memoizedUpdaters = workInProgressRootExitStatus; @@ -13045,7 +12983,6 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); null === workInProgress && ((workInProgressRoot = null), @@ -13080,7 +13017,6 @@ __DEV__ && root, lanes ); - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -13210,7 +13146,6 @@ __DEV__ && ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; - enableDebugTracing && enableDebugTracing && groupEnd(); if (null !== workInProgress) return ( enableSchedulingProfiler && @@ -13472,25 +13407,13 @@ __DEV__ && throw Error("Should not already be working."); var finishedWork = root.finishedWork, lanes = root.finishedLanes; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return ( - enableDebugTracing && enableDebugTracing && groupEnd(), - enableSchedulingProfiler && markCommitStopped(), - null - ); + return enableSchedulingProfiler && markCommitStopped(), null; 0 === lanes && error$jscomp$0( "root.finishedLanes should not be empty during a commit. This is a bug in React." @@ -13540,14 +13463,6 @@ __DEV__ && commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, lanes), (root.current = finishedWork), - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13555,7 +13470,6 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), commitLayoutEffects(finishedWork, root, lanes), - enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13605,7 +13519,6 @@ __DEV__ && : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; } @@ -13664,14 +13577,6 @@ __DEV__ && throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13682,7 +13587,6 @@ __DEV__ && executionContext |= CommitContext; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -14156,6 +14060,7 @@ __DEV__ && this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; + enableOwnerStacks && (this._debugTask = this._debugStack = null); this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -14195,10 +14100,11 @@ __DEV__ && selfBaseDuration: -0, treeBaseDuration: -0, _debugInfo: null, - _debugOwner: null, - _debugNeedsRemount: !1, - _debugHookTypes: null + _debugOwner: null }; + enableOwnerStacks && ((tag._debugStack = null), (tag._debugTask = null)); + tag._debugNeedsRemount = !1; + tag._debugHookTypes = null; hasBadMapPolyfill || "function" !== typeof Object.preventExtensions || Object.preventExtensions(tag); @@ -14221,6 +14127,9 @@ __DEV__ && (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + enableOwnerStacks && + ((workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask)), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -14391,12 +14300,6 @@ __DEV__ && }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -14480,6 +14383,9 @@ __DEV__ && lanes ); mode._debugOwner = element._owner; + enableOwnerStacks && + ((mode._debugStack = element._debugStack), + (mode._debugTask = element._debugTask)); return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -14741,7 +14647,6 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -14763,6 +14668,7 @@ __DEV__ && syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -14781,7 +14687,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -14831,7 +14736,7 @@ __DEV__ && UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, - log$2 = Scheduler.log, + log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, @@ -14839,7 +14744,7 @@ __DEV__ && hasLoggedError = !1, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log$1 = Math.log, + log = Math.log, LN2 = Math.LN2, nextTransitionLane = 128, nextRetryLane = 4194304, @@ -14881,12 +14786,6 @@ __DEV__ && didPerformWorkStackCursor = createCursor(!1), previousContext = emptyContextObject, objectIs = "function" === typeof Object.is ? Object.is : is, - nativeConsole = console, - nativeConsoleLog = null, - pendingGroupArgs = [], - printedGroupIndex = -1, - wakeableIDs = new ("function" === typeof WeakMap ? WeakMap : Map)(), - wakeableID = 0, CapturedStacks = new WeakMap(), contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), @@ -15164,40 +15063,35 @@ __DEV__ && currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; - ContextOnlyDispatcher.unstable_useContextWithBailout = - throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15308,18 +15202,35 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountInDEV.useResourceEffect = function ( create, @@ -15346,35 +15257,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15472,20 +15354,35 @@ __DEV__ && updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( create, @@ -15504,38 +15401,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15633,18 +15498,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( create, @@ -15665,35 +15547,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -15791,18 +15644,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( create, @@ -15823,35 +15693,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15968,15 +15809,34 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -16003,41 +15863,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16154,15 +15979,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -16191,38 +16035,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16339,15 +16151,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -16371,40 +16202,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -16650,14 +16447,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueReplaceState: function (inst, payload, callback) { @@ -16669,14 +16462,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueForceUpdate: function (inst, callback) { @@ -16691,20 +16480,6 @@ __DEV__ && null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - enableDebugTracing && - log( - "%c\u269b%c " + - callback + - " forced update %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #db2e1f; font-weight: bold;", - "" - )); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -17129,11 +16904,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-7283a213-20241206", + version: "19.1.0-www-classic-d4287258-20241217", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-7283a213-20241206" + reconcilerVersion: "19.1.0-www-classic-d4287258-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -17167,7 +16941,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-classic-7283a213-20241206"; + exports.version = "19.1.0-www-classic-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index fb1417ecd77e4..baf3017bf20ec 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -536,6 +536,27 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -550,13 +571,11 @@ __DEV__ && return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -586,8 +605,71 @@ __DEV__ && return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } + function getOwnerStackByFiberInDev(workInProgress) { + if (!enableOwnerStacks) return ""; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + return null === current + ? "" + : enableOwnerStacks + ? getOwnerStackByFiberInDev(current) + : getStackByFiberInDevAndProd(current); } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; @@ -596,7 +678,11 @@ __DEV__ && isRendering = !1; current = fiber; try { - return callback(arg0, arg1, arg2, arg3, arg4); + return enableOwnerStacks && null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { current = previousFiber; } @@ -687,7 +773,7 @@ __DEV__ && } } function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$2 && + "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), (suppressWarning = newIsStrictMode)); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -745,7 +831,7 @@ __DEV__ && } function clz32Fallback(x) { x >>>= 0; - return 0 === x ? 32 : (31 - ((log$1(x) / LN2) | 0)) | 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } function getLabelForLane(lane) { if (enableSchedulingProfiler) { @@ -1267,9 +1353,6 @@ __DEV__ && (null == props.visible || props.visible) && instance.show(); } function unhideTextInstance() {} - function getInstanceFromNode() { - return null; - } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1292,100 +1375,6 @@ __DEV__ && function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } - function formatLanes(laneOrLanes) { - return "0b" + laneOrLanes.toString(2).padStart(31, "0"); - } - function group() { - for ( - var _len = arguments.length, groupArgs = Array(_len), _key = 0; - _key < _len; - _key++ - ) - groupArgs[_key] = arguments[_key]; - pendingGroupArgs.push(groupArgs); - null === nativeConsoleLog && - ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); - } - function groupEnd() { - for ( - pendingGroupArgs.pop(); - printedGroupIndex >= pendingGroupArgs.length; - - ) - nativeConsole.groupEnd(), printedGroupIndex--; - 0 === pendingGroupArgs.length && - ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); - } - function log() { - if (printedGroupIndex < pendingGroupArgs.length - 1) { - for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) - nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); - printedGroupIndex = pendingGroupArgs.length - 1; - } - "function" === typeof nativeConsoleLog - ? nativeConsoleLog.apply(void 0, arguments) - : nativeConsole.log.apply(nativeConsole, arguments); - } - function getWakeableID(wakeable) { - wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); - return wakeableIDs.get(wakeable); - } - function logComponentSuspended(componentName, wakeable) { - if (enableDebugTracing) { - var id = getWakeableID(wakeable), - display = wakeable.displayName || wakeable; - log( - "%c\u269b%c " + componentName + " suspended", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - wakeable.then( - function () { - log( - "%c\u269b%c " + componentName + " resolved", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - }, - function () { - log( - "%c\u269b%c " + componentName + " rejected", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - } - ); - } - } - function logRenderStarted(lanes) { - enableDebugTracing && - group( - "%c\u269b%c render%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - } - function logStateUpdateScheduled(componentName, lane, payloadOrAction) { - enableDebugTracing && - log( - "%c\u269b%c " + - componentName + - " updated state %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #01a252; font-weight: bold;", - "", - payloadOrAction - ); - } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var existing = CapturedStacks.get(value); @@ -3049,34 +3038,8 @@ __DEV__ && } return workInProgressHook; } - function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue2; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - JSCompiler_temp.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } function useThenable(thenable) { var index = thenableIndexCounter$1; @@ -4270,7 +4233,7 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - var update = { + action = { lane: JSCompiler_OptimizeArgumentsArray_p0, revertLane: 0, action: action, @@ -4279,25 +4242,26 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, update) - : ((update = enqueueConcurrentHookUpdate( + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, JSCompiler_OptimizeArgumentsArray_p0 )), - null !== update && + null !== action && (scheduleUpdateOnFiber( - update, + action, fiber, JSCompiler_OptimizeArgumentsArray_p0 ), entangleTransitionUpdate( - update, + action, queue, JSCompiler_OptimizeArgumentsArray_p0 ))); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p0, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); } function dispatchSetState( fiber, @@ -4316,7 +4280,8 @@ __DEV__ && action, JSCompiler_OptimizeArgumentsArray_p1 ); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -4375,7 +4340,7 @@ __DEV__ && error$jscomp$0( "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - var update = { + action = { lane: 2, revertLane: requestTransitionLane(), action: action, @@ -4391,12 +4356,12 @@ __DEV__ && (throwIfDuringRender = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, 2 )), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markUpdateInDevTools(fiber, 2, action); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 2); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -4423,13 +4388,6 @@ __DEV__ && markRootEntangled(root, lane); } } - function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & 4) { - var name = getComponentNameFromFiber(fiber) || "Unknown"; - logStateUpdateScheduled(name, lane, action); - } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); - } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -4586,6 +4544,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -4660,6 +4619,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -4682,6 +4642,7 @@ __DEV__ && )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -4729,6 +4690,7 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -5258,6 +5220,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -5424,6 +5388,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -5453,10 +5419,13 @@ __DEV__ && fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); break; } return fiber; @@ -5798,10 +5767,6 @@ __DEV__ && rootRenderLanes, !0 ); - enableDebugTracing && - sourceFiber.mode & 4 && - ((returnFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(returnFiber, value)); returnFiber = suspenseHandlerStackCursor.current; if (null !== returnFiber) { switch (returnFiber.tag) { @@ -7819,6 +7784,9 @@ __DEV__ && workInProgress.mode, workInProgress.lanes ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -8432,19 +8400,8 @@ __DEV__ && a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue2) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -8542,37 +8499,19 @@ __DEV__ && ); workInProgress.flags |= 262144; } - function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue - ) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error("Compared context values must be arrays"); - return !1; - } function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue2, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -12795,7 +12734,6 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); prepareFreshStack(root, lanes); } - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; memoizedUpdaters = workInProgressRootExitStatus; @@ -12849,7 +12787,6 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); null === workInProgress && ((workInProgressRoot = null), @@ -12884,7 +12821,6 @@ __DEV__ && root, lanes ); - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -13014,7 +12950,6 @@ __DEV__ && ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; - enableDebugTracing && enableDebugTracing && groupEnd(); if (null !== workInProgress) return ( enableSchedulingProfiler && @@ -13272,25 +13207,13 @@ __DEV__ && throw Error("Should not already be working."); var finishedWork = root.finishedWork, lanes = root.finishedLanes; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return ( - enableDebugTracing && enableDebugTracing && groupEnd(), - enableSchedulingProfiler && markCommitStopped(), - null - ); + return enableSchedulingProfiler && markCommitStopped(), null; 0 === lanes && error$jscomp$0( "root.finishedLanes should not be empty during a commit. This is a bug in React." @@ -13340,14 +13263,6 @@ __DEV__ && commitBeforeMutationEffects(root, finishedWork), commitMutationEffects(root, finishedWork, lanes), (root.current = finishedWork), - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13355,7 +13270,6 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), commitLayoutEffects(finishedWork, root, lanes), - enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13405,7 +13319,6 @@ __DEV__ && : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; } @@ -13464,14 +13377,6 @@ __DEV__ && throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13482,7 +13387,6 @@ __DEV__ && executionContext |= CommitContext; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -13956,6 +13860,7 @@ __DEV__ && this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; + enableOwnerStacks && (this._debugTask = this._debugStack = null); this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -13995,10 +13900,11 @@ __DEV__ && selfBaseDuration: -0, treeBaseDuration: -0, _debugInfo: null, - _debugOwner: null, - _debugNeedsRemount: !1, - _debugHookTypes: null + _debugOwner: null }; + enableOwnerStacks && ((tag._debugStack = null), (tag._debugTask = null)); + tag._debugNeedsRemount = !1; + tag._debugHookTypes = null; hasBadMapPolyfill || "function" !== typeof Object.preventExtensions || Object.preventExtensions(tag); @@ -14021,6 +13927,9 @@ __DEV__ && (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + enableOwnerStacks && + ((workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask)), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -14191,12 +14100,6 @@ __DEV__ && }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -14280,6 +14183,9 @@ __DEV__ && lanes ); mode._debugOwner = element._owner; + enableOwnerStacks && + ((mode._debugStack = element._debugStack), + (mode._debugTask = element._debugTask)); return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -14498,7 +14404,6 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -14520,6 +14425,7 @@ __DEV__ && syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -14538,7 +14444,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -14588,7 +14493,7 @@ __DEV__ && UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, IdlePriority = Scheduler.unstable_IdlePriority, - log$2 = Scheduler.log, + log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, @@ -14596,7 +14501,7 @@ __DEV__ && hasLoggedError = !1, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log$1 = Math.log, + log = Math.log, LN2 = Math.LN2, nextTransitionLane = 128, nextRetryLane = 4194304, @@ -14634,12 +14539,6 @@ __DEV__ && emptyContextObject = {}; Object.freeze(emptyContextObject); var objectIs = "function" === typeof Object.is ? Object.is : is, - nativeConsole = console, - nativeConsoleLog = null, - pendingGroupArgs = [], - printedGroupIndex = -1, - wakeableIDs = new ("function" === typeof WeakMap ? WeakMap : Map)(), - wakeableID = 0, CapturedStacks = new WeakMap(), contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), @@ -14917,40 +14816,35 @@ __DEV__ && currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; - ContextOnlyDispatcher.unstable_useContextWithBailout = - throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15061,18 +14955,35 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountInDEV.useResourceEffect = function ( create, @@ -15099,35 +15010,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15225,20 +15107,35 @@ __DEV__ && updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( create, @@ -15257,38 +15154,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15386,18 +15251,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( create, @@ -15418,35 +15300,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -15544,18 +15397,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( create, @@ -15576,35 +15446,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15721,15 +15562,34 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -15756,41 +15616,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15907,15 +15732,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -15944,38 +15788,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16092,15 +15904,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -16124,40 +15955,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -16413,14 +16210,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueReplaceState: function (inst, payload, callback) { @@ -16432,14 +16225,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueForceUpdate: function (inst, callback) { @@ -16454,20 +16243,6 @@ __DEV__ && null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & 4 && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - enableDebugTracing && - log( - "%c\u269b%c " + - callback + - " forced update %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #db2e1f; font-weight: bold;", - "" - )); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16892,11 +16667,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-7283a213-20241206", + version: "19.1.0-www-modern-d4287258-20241217", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-7283a213-20241206" + reconcilerVersion: "19.1.0-www-modern-d4287258-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16930,7 +16704,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-modern-7283a213-20241206"; + exports.version = "19.1.0-www-modern-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 3e4dd704d5c74..b168691167c58 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -67,7 +67,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -104,7 +103,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -408,13 +406,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -1967,32 +1963,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue2; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -2948,18 +2921,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3090,50 +3062,49 @@ var HooksDispatcherOnMount = { ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3170,22 +3141,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3224,25 +3193,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -6161,19 +6128,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue2) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -6260,37 +6216,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue2, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -10472,12 +10410,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -10825,27 +10757,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1509 = { +var internals$jscomp$inline_1493 = { bundleType: 0, - version: "19.0.0-www-classic-7283a213-20241206", + version: "19.1.0-www-classic-d4287258-20241217", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: function () { - return null; - }, - reconcilerVersion: "19.0.0-www-classic-7283a213-20241206" + reconcilerVersion: "19.1.0-www-classic-d4287258-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1510 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1494 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1510.isDisabled && - hook$jscomp$inline_1510.supportsFiber + !hook$jscomp$inline_1494.isDisabled && + hook$jscomp$inline_1494.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1510.inject( - internals$jscomp$inline_1509 + (rendererID = hook$jscomp$inline_1494.inject( + internals$jscomp$inline_1493 )), - (injectedHook = hook$jscomp$inline_1510); + (injectedHook = hook$jscomp$inline_1494); } catch (err) {} } var Path = Mode$1.Path; @@ -10859,4 +10788,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-classic-7283a213-20241206"; +exports.version = "19.1.0-www-classic-d4287258-20241217"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index c8caef58102d1..47746cb983f55 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -65,7 +65,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -102,7 +101,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -343,13 +341,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -1814,32 +1810,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue2; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -2795,18 +2768,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -2937,50 +2909,49 @@ var HooksDispatcherOnMount = { ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3017,22 +2988,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3071,25 +3040,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -5940,19 +5907,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue2) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -6039,37 +5995,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue2, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue2, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -10228,12 +10166,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -10541,27 +10473,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1488 = { +var internals$jscomp$inline_1472 = { bundleType: 0, - version: "19.0.0-www-modern-7283a213-20241206", + version: "19.1.0-www-modern-d4287258-20241217", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: function () { - return null; - }, - reconcilerVersion: "19.0.0-www-modern-7283a213-20241206" + reconcilerVersion: "19.1.0-www-modern-d4287258-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1489 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1473 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1489.isDisabled && - hook$jscomp$inline_1489.supportsFiber + !hook$jscomp$inline_1473.isDisabled && + hook$jscomp$inline_1473.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1489.inject( - internals$jscomp$inline_1488 + (rendererID = hook$jscomp$inline_1473.inject( + internals$jscomp$inline_1472 )), - (injectedHook = hook$jscomp$inline_1489); + (injectedHook = hook$jscomp$inline_1473); } catch (err) {} } var Path = Mode$1.Path; @@ -10575,4 +10504,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-modern-7283a213-20241206"; +exports.version = "19.1.0-www-modern-d4287258-20241217"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index f92febd923a3b..0aca5e4c3b1c8 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -520,6 +520,27 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -534,13 +555,11 @@ __DEV__ && return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -570,13 +589,76 @@ __DEV__ && return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } + function getOwnerStackByFiberInDev(workInProgress) { + if (!enableOwnerStacks) return ""; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } function getCurrentFiberOwnerNameInDevOrNull() { if (null === current) return null; var owner = current._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + return null === current + ? "" + : enableOwnerStacks + ? getOwnerStackByFiberInDev(current) + : getStackByFiberInDevAndProd(current); } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; @@ -585,7 +667,11 @@ __DEV__ && isRendering = !1; current = fiber; try { - return callback(arg0, arg1, arg2, arg3, arg4); + return enableOwnerStacks && null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { current = previousFiber; } @@ -785,7 +871,7 @@ __DEV__ && } } function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$2 && + "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), (suppressWarning = newIsStrictMode)); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -843,7 +929,7 @@ __DEV__ && } function clz32Fallback(x) { x >>>= 0; - return 0 === x ? 32 : (31 - ((log$1(x) / LN2) | 0)) | 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } function getLabelForLane(lane) { if (enableSchedulingProfiler) { @@ -1105,6 +1191,46 @@ __DEV__ && rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -2548,37 +2674,51 @@ __DEV__ && : findInvalidAncestorForTag(childTag, ancestorInfo); ancestorInfo = parentInfo || ancestorInfo; if (!ancestorInfo) return !0; - ancestorInfo = ancestorInfo.tag; - var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - var ancestor = (warnKey = current) - ? findAncestor(warnKey.return, ancestorInfo) - : null; - warnKey = - null !== warnKey && null !== ancestor - ? describeAncestors(ancestor, warnKey, null) - : ""; - ancestor = "<" + childTag + ">"; + var ancestorTag = ancestorInfo.tag; + ancestorInfo = String(!!parentInfo) + "|" + childTag + "|" + ancestorTag; + if (didWarn[ancestorInfo]) return !1; + didWarn[ancestorInfo] = !0; + var ancestor = (ancestorInfo = current) + ? findAncestor(ancestorInfo.return, ancestorTag) + : null, + ancestorDescription = + null !== ancestorInfo && null !== ancestor + ? describeAncestors(ancestor, ancestorInfo, null) + : "", + tagDisplayName = "<" + childTag + ">"; parentInfo ? ((parentInfo = ""), - "table" === ancestorInfo && + "table" === ancestorTag && "tr" === childTag && (parentInfo += " Add a , or to your code to match the DOM tree generated by the browser."), error$jscomp$0( "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, + tagDisplayName, + ancestorTag, parentInfo, - warnKey + ancestorDescription )) : error$jscomp$0( "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, - warnKey + tagDisplayName, + ancestorTag, + ancestorDescription ); + enableOwnerStacks && + ancestorInfo && + ((childTag = ancestorInfo.return), + null === ancestor || + null === childTag || + (ancestor === childTag && + childTag._debugOwner === ancestorInfo._debugOwner) || + runWithFiberInDEV(ancestor, function () { + error$jscomp$0( + "<%s> cannot contain a nested %s.\nSee this log for the ancestor stack trace.", + ancestorTag, + tagDisplayName + ); + })); return !1; } function validateTextNesting(childText, parentTag) { @@ -3315,100 +3455,6 @@ __DEV__ && function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } - function formatLanes(laneOrLanes) { - return "0b" + laneOrLanes.toString(2).padStart(31, "0"); - } - function group() { - for ( - var _len = arguments.length, groupArgs = Array(_len), _key = 0; - _key < _len; - _key++ - ) - groupArgs[_key] = arguments[_key]; - pendingGroupArgs.push(groupArgs); - null === nativeConsoleLog && - ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); - } - function groupEnd() { - for ( - pendingGroupArgs.pop(); - printedGroupIndex >= pendingGroupArgs.length; - - ) - nativeConsole.groupEnd(), printedGroupIndex--; - 0 === pendingGroupArgs.length && - ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); - } - function log() { - if (printedGroupIndex < pendingGroupArgs.length - 1) { - for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) - nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); - printedGroupIndex = pendingGroupArgs.length - 1; - } - "function" === typeof nativeConsoleLog - ? nativeConsoleLog.apply(void 0, arguments) - : nativeConsole.log.apply(nativeConsole, arguments); - } - function getWakeableID(wakeable) { - wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); - return wakeableIDs.get(wakeable); - } - function logComponentSuspended(componentName, wakeable) { - if (enableDebugTracing) { - var id = getWakeableID(wakeable), - display = wakeable.displayName || wakeable; - log( - "%c\u269b%c " + componentName + " suspended", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - wakeable.then( - function () { - log( - "%c\u269b%c " + componentName + " resolved", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - }, - function () { - log( - "%c\u269b%c " + componentName + " rejected", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - } - ); - } - } - function logRenderStarted(lanes) { - enableDebugTracing && - group( - "%c\u269b%c render%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - } - function logStateUpdateScheduled(componentName, lane, payloadOrAction) { - enableDebugTracing && - log( - "%c\u269b%c " + - componentName + - " updated state %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #01a252; font-weight: bold;", - "", - payloadOrAction - ); - } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var existing = CapturedStacks.get(value); @@ -4903,34 +4949,8 @@ __DEV__ && } return workInProgressHook; } - function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - JSCompiler_temp.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } function useThenable(thenable) { var index = thenableIndexCounter$1; @@ -6279,7 +6299,7 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - var update = { + action = { lane: JSCompiler_OptimizeArgumentsArray_p0, revertLane: 0, action: action, @@ -6288,25 +6308,26 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, update) - : ((update = enqueueConcurrentHookUpdate( + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, JSCompiler_OptimizeArgumentsArray_p0 )), - null !== update && + null !== action && (scheduleUpdateOnFiber( - update, + action, fiber, JSCompiler_OptimizeArgumentsArray_p0 ), entangleTransitionUpdate( - update, + action, queue, JSCompiler_OptimizeArgumentsArray_p0 ))); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p0, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); } function dispatchSetState( fiber, @@ -6325,7 +6346,8 @@ __DEV__ && action, JSCompiler_OptimizeArgumentsArray_p1 ); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -6384,7 +6406,7 @@ __DEV__ && error$jscomp$0( "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - var update = { + action = { lane: 2, revertLane: requestTransitionLane(), action: action, @@ -6400,12 +6422,12 @@ __DEV__ && (throwIfDuringRender = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, 2 )), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markUpdateInDevTools(fiber, 2, action); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 2); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -6432,13 +6454,6 @@ __DEV__ && markRootEntangled(root, lane); } } - function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & DebugTracingMode) { - var name = getComponentNameFromFiber(fiber) || "Unknown"; - logStateUpdateScheduled(name, lane, action); - } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); - } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -6595,6 +6610,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6669,6 +6685,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6691,6 +6708,7 @@ __DEV__ && )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6738,6 +6756,7 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7275,6 +7294,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7441,6 +7462,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7470,10 +7493,13 @@ __DEV__ && fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); break; } return fiber; @@ -7711,12 +7737,14 @@ __DEV__ && error = componentName ? "An error occurred in the <" + componentName + "> component." : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = + var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } try { warn( "%s\n\n%s\n", @@ -7724,7 +7752,8 @@ __DEV__ && "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." ); } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } function defaultOnCaughtError(error$1, errorInfo) { @@ -7734,12 +7763,14 @@ __DEV__ && recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = + prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } try { "object" === typeof error$1 && null !== error$1 && @@ -7761,7 +7792,8 @@ __DEV__ && recreateMessage ); } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } function defaultOnRecoverableError(error) { @@ -7883,10 +7915,6 @@ __DEV__ && !0 ); isHydrating && (didSuspendOrErrorDEV = !0); - enableDebugTracing && - sourceFiber.mode & DebugTracingMode && - ((sourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(sourceFiber, value)); sourceFiber = suspenseHandlerStackCursor.current; if (null !== sourceFiber) { switch (sourceFiber.tag) { @@ -9247,32 +9275,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2513; - var JSCompiler_object_inline_stack_2514 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2484; + var JSCompiler_object_inline_stack_2485 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2515 = !1; + var JSCompiler_object_inline_componentStack_2486 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2513 = didSuspend) || - (JSCompiler_object_inline_digest_2513 = + (JSCompiler_object_inline_digest_2484 = didSuspend) || + (JSCompiler_object_inline_digest_2484 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2513 && - ((JSCompiler_object_inline_componentStack_2515 = !0), + JSCompiler_object_inline_digest_2484 && + ((JSCompiler_object_inline_componentStack_2486 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2513 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2484 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2515 + JSCompiler_object_inline_componentStack_2486 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2512 = nextHydratableInstance; + var JSCompiler_object_inline_message_2483 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2512)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2483)) { c: { - var instance = JSCompiler_object_inline_message_2512; + var instance = JSCompiler_object_inline_message_2483; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9313,46 +9341,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2512 + JSCompiler_object_inline_message_2483 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2512 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2483 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2512 && - ((JSCompiler_object_inline_message_2512 = - JSCompiler_object_inline_message_2512.dehydrated), - null !== JSCompiler_object_inline_message_2512) + null !== JSCompiler_object_inline_message_2483 && + ((JSCompiler_object_inline_message_2483 = + JSCompiler_object_inline_message_2483.dehydrated), + null !== JSCompiler_object_inline_message_2483) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2512) - ? (workInProgress.lanes = 16) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2483) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2512 = - JSCompiler_object_inline_stack_2514.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2514.fallback; - if (JSCompiler_object_inline_componentStack_2515) + JSCompiler_object_inline_message_2483 = + JSCompiler_object_inline_stack_2485.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2485.fallback; + if (JSCompiler_object_inline_componentStack_2486) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2514 = + (JSCompiler_object_inline_stack_2485 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2512, + JSCompiler_object_inline_message_2483, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2515 = + (JSCompiler_object_inline_componentStack_2486 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2515.memoizedState = + (JSCompiler_object_inline_componentStack_2486.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2515.childLanes = + (JSCompiler_object_inline_componentStack_2486.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2513, + JSCompiler_object_inline_digest_2484, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9365,9 +9393,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2515.updateQueue), + JSCompiler_object_inline_componentStack_2486.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2515.updateQueue = + ? (JSCompiler_object_inline_componentStack_2486.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9375,46 +9403,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2514 + JSCompiler_object_inline_stack_2485 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2514.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2485.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2514 = + (JSCompiler_object_inline_stack_2485 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2512, + JSCompiler_object_inline_message_2483, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2515 = + (JSCompiler_object_inline_componentStack_2486 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2515.memoizedState = + (JSCompiler_object_inline_componentStack_2486.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2515.childLanes = + (JSCompiler_object_inline_componentStack_2486.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2513, + JSCompiler_object_inline_digest_2484, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2514 + JSCompiler_object_inline_stack_2485 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2512 + JSCompiler_object_inline_message_2483 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2512 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2512) + ((JSCompiler_object_inline_message_2483 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2483) ) { if (didSuspend) workInProgress.flags & 256 @@ -9431,94 +9459,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2515 = - JSCompiler_object_inline_stack_2514.fallback), - (JSCompiler_object_inline_message_2512 = workInProgress.mode), - (JSCompiler_object_inline_stack_2514 = + (JSCompiler_object_inline_componentStack_2486 = + JSCompiler_object_inline_stack_2485.fallback), + (JSCompiler_object_inline_message_2483 = workInProgress.mode), + (JSCompiler_object_inline_stack_2485 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2514.children + children: JSCompiler_object_inline_stack_2485.children }, - JSCompiler_object_inline_message_2512 + JSCompiler_object_inline_message_2483 )), - (JSCompiler_object_inline_componentStack_2515 = + (JSCompiler_object_inline_componentStack_2486 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2515, - JSCompiler_object_inline_message_2512, + JSCompiler_object_inline_componentStack_2486, + JSCompiler_object_inline_message_2483, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2515.flags |= 2), - (JSCompiler_object_inline_stack_2514.return = workInProgress), - (JSCompiler_object_inline_componentStack_2515.return = + (JSCompiler_object_inline_componentStack_2486.flags |= 2), + (JSCompiler_object_inline_stack_2485.return = workInProgress), + (JSCompiler_object_inline_componentStack_2486.return = workInProgress), - (JSCompiler_object_inline_stack_2514.sibling = - JSCompiler_object_inline_componentStack_2515), - (workInProgress.child = JSCompiler_object_inline_stack_2514), + (JSCompiler_object_inline_stack_2485.sibling = + JSCompiler_object_inline_componentStack_2486), + (workInProgress.child = JSCompiler_object_inline_stack_2485), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2514 = workInProgress.child), - (JSCompiler_object_inline_stack_2514.memoizedState = + (JSCompiler_object_inline_stack_2485 = workInProgress.child), + (JSCompiler_object_inline_stack_2485.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2514.childLanes = + (JSCompiler_object_inline_stack_2485.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2513, + JSCompiler_object_inline_digest_2484, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2515)); + JSCompiler_object_inline_componentStack_2486)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2512)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2483)) ) { - JSCompiler_object_inline_digest_2513 = - JSCompiler_object_inline_message_2512.nextSibling && - JSCompiler_object_inline_message_2512.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2513) { - JSCompiler_temp = JSCompiler_object_inline_digest_2513.dgst; - var message = JSCompiler_object_inline_digest_2513.msg; - instance = JSCompiler_object_inline_digest_2513.stck; - var componentStack = JSCompiler_object_inline_digest_2513.cstck; + JSCompiler_object_inline_digest_2484 = + JSCompiler_object_inline_message_2483.nextSibling && + JSCompiler_object_inline_message_2483.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2484) { + JSCompiler_temp = JSCompiler_object_inline_digest_2484.dgst; + var message = JSCompiler_object_inline_digest_2484.msg; + instance = JSCompiler_object_inline_digest_2484.stck; + var componentStack = JSCompiler_object_inline_digest_2484.cstck; } - JSCompiler_object_inline_message_2512 = message; - JSCompiler_object_inline_digest_2513 = JSCompiler_temp; - JSCompiler_object_inline_stack_2514 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2515 = + JSCompiler_object_inline_message_2483 = message; + JSCompiler_object_inline_digest_2484 = JSCompiler_temp; + JSCompiler_object_inline_stack_2485 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2486 = componentStack; - JSCompiler_object_inline_componentStack_2515 = - JSCompiler_object_inline_message_2512 - ? Error(JSCompiler_object_inline_message_2512) + JSCompiler_object_inline_componentStack_2486 = + JSCompiler_object_inline_message_2483 + ? Error(JSCompiler_object_inline_message_2483) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2515.stack = - JSCompiler_object_inline_stack_2514 || ""; - JSCompiler_object_inline_componentStack_2515.digest = - JSCompiler_object_inline_digest_2513; - JSCompiler_object_inline_digest_2513 = + JSCompiler_object_inline_componentStack_2486.stack = + JSCompiler_object_inline_stack_2485 || ""; + JSCompiler_object_inline_componentStack_2486.digest = + JSCompiler_object_inline_digest_2484; + JSCompiler_object_inline_digest_2484 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2514 = { - value: JSCompiler_object_inline_componentStack_2515, + JSCompiler_object_inline_stack_2485 = { + value: JSCompiler_object_inline_componentStack_2486, source: null, - stack: JSCompiler_object_inline_digest_2513 + stack: JSCompiler_object_inline_digest_2484 }; - "string" === typeof JSCompiler_object_inline_digest_2513 && + "string" === typeof JSCompiler_object_inline_digest_2484 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2515, - JSCompiler_object_inline_stack_2514 + JSCompiler_object_inline_componentStack_2486, + JSCompiler_object_inline_stack_2485 ); - queueHydrationError(JSCompiler_object_inline_stack_2514); + queueHydrationError(JSCompiler_object_inline_stack_2485); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9532,79 +9560,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2513 = + (JSCompiler_object_inline_digest_2484 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2513) + didReceiveUpdate || JSCompiler_object_inline_digest_2484) ) { - JSCompiler_object_inline_digest_2513 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2513) { - JSCompiler_object_inline_stack_2514 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2514 & 42)) - JSCompiler_object_inline_stack_2514 = 1; - else - switch (JSCompiler_object_inline_stack_2514) { - case 2: - JSCompiler_object_inline_stack_2514 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2514 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2514 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2514 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2514 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2514 = 0; - } - JSCompiler_object_inline_stack_2514 = + JSCompiler_object_inline_digest_2484 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_digest_2484 && + ((JSCompiler_object_inline_stack_2485 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2485 = + 0 !== (JSCompiler_object_inline_stack_2485 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2485 + )), + (JSCompiler_object_inline_stack_2485 = 0 !== - (JSCompiler_object_inline_stack_2514 & - (JSCompiler_object_inline_digest_2513.suspendedLanes | + (JSCompiler_object_inline_stack_2485 & + (JSCompiler_object_inline_digest_2484.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2514; - if ( - 0 !== JSCompiler_object_inline_stack_2514 && - JSCompiler_object_inline_stack_2514 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2514), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2514 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2513, - current, - JSCompiler_object_inline_stack_2514 - ), - SelectiveHydrationException) - ); - } - JSCompiler_object_inline_message_2512.data === + : JSCompiler_object_inline_stack_2485), + 0 !== JSCompiler_object_inline_stack_2485 && + JSCompiler_object_inline_stack_2485 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2485), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2485 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_digest_2484, + current, + JSCompiler_object_inline_stack_2485 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_message_2483.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9612,14 +9605,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2512.data === + JSCompiler_object_inline_message_2483.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2512.nextSibling + JSCompiler_object_inline_message_2483.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9637,57 +9630,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2514.children + JSCompiler_object_inline_stack_2485.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2515) + if (JSCompiler_object_inline_componentStack_2486) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2515 = - JSCompiler_object_inline_stack_2514.fallback), - (JSCompiler_object_inline_message_2512 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2486 = + JSCompiler_object_inline_stack_2485.fallback), + (JSCompiler_object_inline_message_2483 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2514 = createWorkInProgress( + (JSCompiler_object_inline_stack_2485 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2514.children + children: JSCompiler_object_inline_stack_2485.children } )), - (JSCompiler_object_inline_stack_2514.subtreeFlags = + (JSCompiler_object_inline_stack_2485.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2515 = + ? (JSCompiler_object_inline_componentStack_2486 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2515 + JSCompiler_object_inline_componentStack_2486 )) - : ((JSCompiler_object_inline_componentStack_2515 = + : ((JSCompiler_object_inline_componentStack_2486 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2515, - JSCompiler_object_inline_message_2512, + JSCompiler_object_inline_componentStack_2486, + JSCompiler_object_inline_message_2483, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2515.flags |= 2)), - (JSCompiler_object_inline_componentStack_2515.return = + (JSCompiler_object_inline_componentStack_2486.flags |= 2)), + (JSCompiler_object_inline_componentStack_2486.return = workInProgress), - (JSCompiler_object_inline_stack_2514.return = workInProgress), - (JSCompiler_object_inline_stack_2514.sibling = - JSCompiler_object_inline_componentStack_2515), - (workInProgress.child = JSCompiler_object_inline_stack_2514), - (JSCompiler_object_inline_stack_2514 = - JSCompiler_object_inline_componentStack_2515), - (JSCompiler_object_inline_componentStack_2515 = workInProgress.child), - (JSCompiler_object_inline_message_2512 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2512 - ? (JSCompiler_object_inline_message_2512 = + (JSCompiler_object_inline_stack_2485.return = workInProgress), + (JSCompiler_object_inline_stack_2485.sibling = + JSCompiler_object_inline_componentStack_2486), + (workInProgress.child = JSCompiler_object_inline_stack_2485), + (JSCompiler_object_inline_stack_2485 = + JSCompiler_object_inline_componentStack_2486), + (JSCompiler_object_inline_componentStack_2486 = workInProgress.child), + (JSCompiler_object_inline_message_2483 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2483 + ? (JSCompiler_object_inline_message_2483 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2512.cachePool), + JSCompiler_object_inline_message_2483.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9695,34 +9688,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2512 = { + (JSCompiler_object_inline_message_2483 = { baseLanes: - JSCompiler_object_inline_message_2512.baseLanes | renderLanes, + JSCompiler_object_inline_message_2483.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2515.memoizedState = - JSCompiler_object_inline_message_2512), + (JSCompiler_object_inline_componentStack_2486.memoizedState = + JSCompiler_object_inline_message_2483), enableTransitionTracing && - ((JSCompiler_object_inline_message_2512 = enableTransitionTracing + ((JSCompiler_object_inline_message_2483 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2512 && + null !== JSCompiler_object_inline_message_2483 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2515.updateQueue), + JSCompiler_object_inline_componentStack_2486.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2515.updateQueue = { - transitions: JSCompiler_object_inline_message_2512, + ? (JSCompiler_object_inline_componentStack_2486.updateQueue = { + transitions: JSCompiler_object_inline_message_2483, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2515.updateQueue = + ? (JSCompiler_object_inline_componentStack_2486.updateQueue = { - transitions: JSCompiler_object_inline_message_2512, + transitions: JSCompiler_object_inline_message_2483, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9730,32 +9723,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2512), + JSCompiler_object_inline_message_2483), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2515.childLanes = + (JSCompiler_object_inline_componentStack_2486.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2513, + JSCompiler_object_inline_digest_2484, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2514 + JSCompiler_object_inline_stack_2485 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2514.children + children: JSCompiler_object_inline_stack_2485.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2513 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2513 + ((JSCompiler_object_inline_digest_2484 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2484 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2513.push(current)); + : JSCompiler_object_inline_digest_2484.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10203,6 +10196,9 @@ __DEV__ && workInProgress.mode, workInProgress.lanes ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -11034,19 +11030,8 @@ __DEV__ && a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -11144,37 +11129,19 @@ __DEV__ && ); workInProgress.flags |= 262144; } - function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue - ) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error("Compared context values must be arrays"); - return !1; - } function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -16090,7 +16057,6 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); prepareFreshStack(root, lanes); } - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; memoizedUpdaters = workInProgressRootExitStatus; @@ -16144,7 +16110,6 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); null === workInProgress && ((workInProgressRoot = null), @@ -16179,7 +16144,6 @@ __DEV__ && root, lanes ); - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -16309,7 +16273,6 @@ __DEV__ && ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; - enableDebugTracing && enableDebugTracing && groupEnd(); if (null !== workInProgress) return ( enableSchedulingProfiler && @@ -16608,25 +16571,13 @@ __DEV__ && throw Error("Should not already be working."); var finishedWork = root.finishedWork, lanes = root.finishedLanes; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return ( - enableDebugTracing && enableDebugTracing && groupEnd(), - enableSchedulingProfiler && markCommitStopped(), - null - ); + return enableSchedulingProfiler && markCommitStopped(), null; 0 === lanes && error$jscomp$0( "root.finishedLanes should not be empty during a commit. This is a bug in React." @@ -16686,14 +16637,6 @@ __DEV__ && (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), (root.current = finishedWork), - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16701,7 +16644,6 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), commitLayoutEffects(finishedWork, root, lanes), - enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16752,7 +16694,6 @@ __DEV__ && : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; @@ -16829,14 +16770,6 @@ __DEV__ && throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16847,7 +16780,6 @@ __DEV__ && executionContext |= CommitContext; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -17322,6 +17254,7 @@ __DEV__ && this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; + enableOwnerStacks && (this._debugTask = this._debugStack = null); this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -17361,10 +17294,11 @@ __DEV__ && selfBaseDuration: -0, treeBaseDuration: -0, _debugInfo: null, - _debugOwner: null, - _debugNeedsRemount: !1, - _debugHookTypes: null + _debugOwner: null }; + enableOwnerStacks && ((tag._debugStack = null), (tag._debugTask = null)); + tag._debugNeedsRemount = !1; + tag._debugHookTypes = null; hasBadMapPolyfill || "function" !== typeof Object.preventExtensions || Object.preventExtensions(tag); @@ -17387,6 +17321,9 @@ __DEV__ && (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + enableOwnerStacks && + ((workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask)), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -17564,12 +17501,6 @@ __DEV__ && }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= DebugTracingMode; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -17646,6 +17577,9 @@ __DEV__ && lanes ); mode._debugOwner = element._owner; + enableOwnerStacks && + ((mode._debugStack = element._debugStack), + (mode._debugTask = element._debugTask)); return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -18687,6 +18621,15 @@ __DEV__ && }); } } + function executeDispatch(event, listener, currentTarget) { + event.currentTarget = currentTarget; + try { + listener(event); + } catch (error$43) { + reportGlobalError(error$43); + } + event.currentTarget = null; + } function processDispatchQueue(dispatchQueue, eventSystemFlags) { eventSystemFlags = 0 !== (eventSystemFlags & 4); for (var i = 0; i < dispatchQueue.length; i++) { @@ -18707,14 +18650,15 @@ __DEV__ && _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error$43) { - reportGlobalError(error$43); - } - previousInstance.currentTarget = null; + enableOwnerStacks && null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } else @@ -18729,14 +18673,15 @@ __DEV__ && _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error$43) { - reportGlobalError(error$43); - } - previousInstance.currentTarget = null; + enableOwnerStacks && null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } } @@ -20832,7 +20777,7 @@ __DEV__ && error$jscomp$0( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -21251,42 +21196,36 @@ __DEV__ && } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -23086,8 +23025,12 @@ __DEV__ && queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -23646,7 +23589,6 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -23672,6 +23614,7 @@ __DEV__ && syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -23690,7 +23633,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -23728,7 +23670,7 @@ __DEV__ && NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, - log$2 = Scheduler.log, + log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, @@ -23736,7 +23678,7 @@ __DEV__ && hasLoggedError = !1, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log$1 = Math.log, + log = Math.log, LN2 = Math.LN2, nextTransitionLane = 128, nextRetryLane = 4194304, @@ -23780,11 +23722,6 @@ __DEV__ && allNativeEvents.add("afterblur"); var registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -23832,8 +23769,6 @@ __DEV__ && containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_FRAGMENT_NODE = 11, @@ -23987,6 +23922,8 @@ __DEV__ && " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -24640,12 +24577,6 @@ __DEV__ && didPerformWorkStackCursor = createCursor(!1), previousContext = emptyContextObject, objectIs = "function" === typeof Object.is ? Object.is : is, - nativeConsole = console, - nativeConsoleLog = null, - pendingGroupArgs = [], - printedGroupIndex = -1, - wakeableIDs = new ("function" === typeof WeakMap ? WeakMap : Map)(), - wakeableID = 0, CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, @@ -24669,7 +24600,6 @@ __DEV__ && NoMode = 0, ConcurrentMode = 1, ProfileMode = 2, - DebugTracingMode = 4, StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, @@ -24944,40 +24874,35 @@ __DEV__ && currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; - ContextOnlyDispatcher.unstable_useContextWithBailout = - throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -25096,18 +25021,35 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountInDEV.useResourceEffect = function ( create, @@ -25134,35 +25076,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -25268,20 +25181,35 @@ __DEV__ && updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( create, @@ -25300,38 +25228,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -25437,18 +25333,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( create, @@ -25469,35 +25382,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -25603,18 +25487,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( create, @@ -25635,35 +25536,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -25788,15 +25660,34 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -25823,41 +25714,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -25982,15 +25838,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -26019,38 +25894,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26175,15 +26018,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -26207,40 +26069,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -26486,14 +26314,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueReplaceState: function (inst, payload, callback) { @@ -26505,14 +26329,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueForceUpdate: function (inst, callback) { @@ -26527,20 +26347,6 @@ __DEV__ && null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - enableDebugTracing && - log( - "%c\u269b%c " + - callback + - " forced update %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #db2e1f; font-weight: bold;", - "" - )); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -26842,6 +26648,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -27238,7 +27049,6 @@ __DEV__ && didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -27569,11 +27379,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-7283a213-20241206" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-d4287258-20241217" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-classic-7283a213-20241206\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27616,11 +27426,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-7283a213-20241206", + version: "19.1.0-www-classic-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-7283a213-20241206" + reconcilerVersion: "19.1.0-www-classic-d4287258-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27894,11 +27703,13 @@ __DEV__ && initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -28225,7 +28036,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-7283a213-20241206"; + exports.version = "19.1.0-www-classic-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index da49a43580ad7..ca64082a6e6c0 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -520,6 +520,27 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -534,13 +555,11 @@ __DEV__ && return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -570,13 +589,76 @@ __DEV__ && return "\nError generating stack: " + x.message + "\n" + x.stack; } } + function describeFunctionComponentFrameWithoutLineNumber(fn) { + return (fn = fn ? fn.displayName || fn.name : "") + ? describeBuiltInComponentFrame(fn) + : ""; + } + function getOwnerStackByFiberInDev(workInProgress) { + if (!enableOwnerStacks) return ""; + try { + var info = ""; + 6 === workInProgress.tag && (workInProgress = workInProgress.return); + switch (workInProgress.tag) { + case 26: + case 27: + case 5: + info += describeBuiltInComponentFrame(workInProgress.type); + break; + case 13: + info += describeBuiltInComponentFrame("Suspense"); + break; + case 19: + info += describeBuiltInComponentFrame("SuspenseList"); + break; + case 0: + case 15: + case 1: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type + )); + break; + case 11: + workInProgress._debugOwner || + "" !== info || + (info += describeFunctionComponentFrameWithoutLineNumber( + workInProgress.type.render + )); + } + for (; workInProgress; ) + if ("number" === typeof workInProgress.tag) { + var fiber = workInProgress; + workInProgress = fiber._debugOwner; + var debugStack = fiber._debugStack; + workInProgress && + debugStack && + ("string" !== typeof debugStack && + (fiber._debugStack = debugStack = formatOwnerStack(debugStack)), + "" !== debugStack && (info += "\n" + debugStack)); + } else if (null != workInProgress.debugStack) { + var ownerStack = workInProgress.debugStack; + (workInProgress = workInProgress.owner) && + ownerStack && + (info += "\n" + formatOwnerStack(ownerStack)); + } else break; + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } function getCurrentFiberOwnerNameInDevOrNull() { if (null === current) return null; var owner = current._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } function getCurrentFiberStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); + return null === current + ? "" + : enableOwnerStacks + ? getOwnerStackByFiberInDev(current) + : getStackByFiberInDevAndProd(current); } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current; @@ -585,7 +667,11 @@ __DEV__ && isRendering = !1; current = fiber; try { - return callback(arg0, arg1, arg2, arg3, arg4); + return enableOwnerStacks && null !== fiber && fiber._debugTask + ? fiber._debugTask.run( + callback.bind(null, arg0, arg1, arg2, arg3, arg4) + ) + : callback(arg0, arg1, arg2, arg3, arg4); } finally { current = previousFiber; } @@ -785,7 +871,7 @@ __DEV__ && } } function setIsStrictModeForDevtools(newIsStrictMode) { - "function" === typeof log$2 && + "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), (suppressWarning = newIsStrictMode)); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -843,7 +929,7 @@ __DEV__ && } function clz32Fallback(x) { x >>>= 0; - return 0 === x ? 32 : (31 - ((log$1(x) / LN2) | 0)) | 0; + return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; } function getLabelForLane(lane) { if (enableSchedulingProfiler) { @@ -1105,6 +1191,46 @@ __DEV__ && rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -2534,37 +2660,51 @@ __DEV__ && : findInvalidAncestorForTag(childTag, ancestorInfo); ancestorInfo = parentInfo || ancestorInfo; if (!ancestorInfo) return !0; - ancestorInfo = ancestorInfo.tag; - var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - var ancestor = (warnKey = current) - ? findAncestor(warnKey.return, ancestorInfo) - : null; - warnKey = - null !== warnKey && null !== ancestor - ? describeAncestors(ancestor, warnKey, null) - : ""; - ancestor = "<" + childTag + ">"; + var ancestorTag = ancestorInfo.tag; + ancestorInfo = String(!!parentInfo) + "|" + childTag + "|" + ancestorTag; + if (didWarn[ancestorInfo]) return !1; + didWarn[ancestorInfo] = !0; + var ancestor = (ancestorInfo = current) + ? findAncestor(ancestorInfo.return, ancestorTag) + : null, + ancestorDescription = + null !== ancestorInfo && null !== ancestor + ? describeAncestors(ancestor, ancestorInfo, null) + : "", + tagDisplayName = "<" + childTag + ">"; parentInfo ? ((parentInfo = ""), - "table" === ancestorInfo && + "table" === ancestorTag && "tr" === childTag && (parentInfo += " Add a , or to your code to match the DOM tree generated by the browser."), error$jscomp$0( "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, + tagDisplayName, + ancestorTag, parentInfo, - warnKey + ancestorDescription )) : error$jscomp$0( "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", - ancestor, - ancestorInfo, - warnKey + tagDisplayName, + ancestorTag, + ancestorDescription ); + enableOwnerStacks && + ancestorInfo && + ((childTag = ancestorInfo.return), + null === ancestor || + null === childTag || + (ancestor === childTag && + childTag._debugOwner === ancestorInfo._debugOwner) || + runWithFiberInDEV(ancestor, function () { + error$jscomp$0( + "<%s> cannot contain a nested %s.\nSee this log for the ancestor stack trace.", + ancestorTag, + tagDisplayName + ); + })); return !1; } function validateTextNesting(childText, parentTag) { @@ -3207,100 +3347,6 @@ __DEV__ && function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } - function formatLanes(laneOrLanes) { - return "0b" + laneOrLanes.toString(2).padStart(31, "0"); - } - function group() { - for ( - var _len = arguments.length, groupArgs = Array(_len), _key = 0; - _key < _len; - _key++ - ) - groupArgs[_key] = arguments[_key]; - pendingGroupArgs.push(groupArgs); - null === nativeConsoleLog && - ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); - } - function groupEnd() { - for ( - pendingGroupArgs.pop(); - printedGroupIndex >= pendingGroupArgs.length; - - ) - nativeConsole.groupEnd(), printedGroupIndex--; - 0 === pendingGroupArgs.length && - ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); - } - function log() { - if (printedGroupIndex < pendingGroupArgs.length - 1) { - for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) - nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); - printedGroupIndex = pendingGroupArgs.length - 1; - } - "function" === typeof nativeConsoleLog - ? nativeConsoleLog.apply(void 0, arguments) - : nativeConsole.log.apply(nativeConsole, arguments); - } - function getWakeableID(wakeable) { - wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); - return wakeableIDs.get(wakeable); - } - function logComponentSuspended(componentName, wakeable) { - if (enableDebugTracing) { - var id = getWakeableID(wakeable), - display = wakeable.displayName || wakeable; - log( - "%c\u269b%c " + componentName + " suspended", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - wakeable.then( - function () { - log( - "%c\u269b%c " + componentName + " resolved", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - }, - function () { - log( - "%c\u269b%c " + componentName + " rejected", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - } - ); - } - } - function logRenderStarted(lanes) { - enableDebugTracing && - group( - "%c\u269b%c render%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - } - function logStateUpdateScheduled(componentName, lane, payloadOrAction) { - enableDebugTracing && - log( - "%c\u269b%c " + - componentName + - " updated state %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #01a252; font-weight: bold;", - "", - payloadOrAction - ); - } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var existing = CapturedStacks.get(value); @@ -4790,34 +4836,8 @@ __DEV__ && } return workInProgressHook; } - function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) - throw Error( - "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." - ); - lastContextDependency = context; - JSCompiler_temp.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } function useThenable(thenable) { var index = thenableIndexCounter$1; @@ -6166,7 +6186,7 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - var update = { + action = { lane: JSCompiler_OptimizeArgumentsArray_p0, revertLane: 0, action: action, @@ -6175,25 +6195,26 @@ __DEV__ && next: null }; isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, update) - : ((update = enqueueConcurrentHookUpdate( + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, JSCompiler_OptimizeArgumentsArray_p0 )), - null !== update && + null !== action && (scheduleUpdateOnFiber( - update, + action, fiber, JSCompiler_OptimizeArgumentsArray_p0 ), entangleTransitionUpdate( - update, + action, queue, JSCompiler_OptimizeArgumentsArray_p0 ))); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p0, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0); } function dispatchSetState( fiber, @@ -6212,7 +6233,8 @@ __DEV__ && action, JSCompiler_OptimizeArgumentsArray_p1 ); - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + enableSchedulingProfiler && + markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1); } function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { @@ -6271,7 +6293,7 @@ __DEV__ && error$jscomp$0( "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); - var update = { + action = { lane: 2, revertLane: requestTransitionLane(), action: action, @@ -6287,12 +6309,12 @@ __DEV__ && (throwIfDuringRender = enqueueConcurrentHookUpdate( fiber, queue, - update, + action, 2 )), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); - markUpdateInDevTools(fiber, 2, action); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 2); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -6319,13 +6341,6 @@ __DEV__ && markRootEntangled(root, lane); } } - function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & DebugTracingMode) { - var name = getComponentNameFromFiber(fiber) || "Unknown"; - logStateUpdateScheduled(name, lane, action); - } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); - } function pushDebugInfo(debugInfo) { var previousDebugInfo = currentDebugInfo; null != debugInfo && @@ -6482,6 +6497,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6556,6 +6572,7 @@ __DEV__ && )), (current.return = returnFiber), (current._debugOwner = returnFiber), + enableOwnerStacks && (current._debugTask = returnFiber._debugTask), (current._debugInfo = currentDebugInfo), current ); @@ -6578,6 +6595,7 @@ __DEV__ && )), (newChild.return = returnFiber), (newChild._debugOwner = returnFiber), + enableOwnerStacks && (newChild._debugTask = returnFiber._debugTask), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -6625,6 +6643,7 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && (lanes._debugTask = returnFiber._debugTask), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -7162,6 +7181,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), validateFragmentProps(newChild, lanes, returnFiber), (returnFiber = lanes)) @@ -7328,6 +7349,8 @@ __DEV__ && )), (lanes.return = returnFiber), (lanes._debugOwner = returnFiber), + enableOwnerStacks && + (lanes._debugTask = returnFiber._debugTask), (lanes._debugInfo = currentDebugInfo), (returnFiber = lanes)), placeSingleChild(returnFiber) @@ -7357,10 +7380,13 @@ __DEV__ && fiber.return = returnFiber; var debugInfo = (fiber._debugInfo = currentDebugInfo); fiber._debugOwner = returnFiber._debugOwner; + enableOwnerStacks && (fiber._debugTask = returnFiber._debugTask); if (null != debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) if ("string" === typeof debugInfo[i].stack) { fiber._debugOwner = debugInfo[i]; + enableOwnerStacks && + (fiber._debugTask = debugInfo[i].debugTask); break; } return fiber; @@ -7598,12 +7624,14 @@ __DEV__ && error = componentName ? "An error occurred in the <" + componentName + "> component." : "An error occurred in one of your React components."; - var prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = + var prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } try { warn( "%s\n\n%s\n", @@ -7611,7 +7639,8 @@ __DEV__ && "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." ); } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } function defaultOnCaughtError(error$1, errorInfo) { @@ -7621,12 +7650,14 @@ __DEV__ && recreateMessage = "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((errorBoundaryName || "Anonymous") + "."), - prevGetCurrentStack = ReactSharedInternals.getCurrentStack, - componentStack = + prevGetCurrentStack = ReactSharedInternals.getCurrentStack; + if (!enableOwnerStacks) { + var componentStack = null != errorInfo.componentStack ? errorInfo.componentStack : ""; - ReactSharedInternals.getCurrentStack = function () { - return componentStack; - }; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + } try { "object" === typeof error$1 && null !== error$1 && @@ -7648,7 +7679,8 @@ __DEV__ && recreateMessage ); } finally { - ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + enableOwnerStacks || + (ReactSharedInternals.getCurrentStack = prevGetCurrentStack); } } function defaultOnRecoverableError(error) { @@ -7770,10 +7802,6 @@ __DEV__ && !0 ); isHydrating && (didSuspendOrErrorDEV = !0); - enableDebugTracing && - sourceFiber.mode & DebugTracingMode && - ((sourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), - logComponentSuspended(sourceFiber, value)); sourceFiber = suspenseHandlerStackCursor.current; if (null !== sourceFiber) { switch (sourceFiber.tag) { @@ -9059,32 +9087,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2505; - var JSCompiler_object_inline_stack_2506 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2476; + var JSCompiler_object_inline_stack_2477 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2507 = !1; + var JSCompiler_object_inline_componentStack_2478 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2505 = didSuspend) || - (JSCompiler_object_inline_digest_2505 = + (JSCompiler_object_inline_digest_2476 = didSuspend) || + (JSCompiler_object_inline_digest_2476 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2505 && - ((JSCompiler_object_inline_componentStack_2507 = !0), + JSCompiler_object_inline_digest_2476 && + ((JSCompiler_object_inline_componentStack_2478 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2505 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2476 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2507 + JSCompiler_object_inline_componentStack_2478 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2504 = nextHydratableInstance; + var JSCompiler_object_inline_message_2475 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2504)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2475)) { c: { - var instance = JSCompiler_object_inline_message_2504; + var instance = JSCompiler_object_inline_message_2475; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9125,46 +9153,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2504 + JSCompiler_object_inline_message_2475 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2504 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2475 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2504 && - ((JSCompiler_object_inline_message_2504 = - JSCompiler_object_inline_message_2504.dehydrated), - null !== JSCompiler_object_inline_message_2504) + null !== JSCompiler_object_inline_message_2475 && + ((JSCompiler_object_inline_message_2475 = + JSCompiler_object_inline_message_2475.dehydrated), + null !== JSCompiler_object_inline_message_2475) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2504) - ? (workInProgress.lanes = 16) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2475) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2504 = - JSCompiler_object_inline_stack_2506.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2506.fallback; - if (JSCompiler_object_inline_componentStack_2507) + JSCompiler_object_inline_message_2475 = + JSCompiler_object_inline_stack_2477.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2477.fallback; + if (JSCompiler_object_inline_componentStack_2478) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2506 = + (JSCompiler_object_inline_stack_2477 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2504, + JSCompiler_object_inline_message_2475, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2507 = + (JSCompiler_object_inline_componentStack_2478 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2507.memoizedState = + (JSCompiler_object_inline_componentStack_2478.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2507.childLanes = + (JSCompiler_object_inline_componentStack_2478.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2505, + JSCompiler_object_inline_digest_2476, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9177,9 +9205,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2507.updateQueue), + JSCompiler_object_inline_componentStack_2478.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2507.updateQueue = + ? (JSCompiler_object_inline_componentStack_2478.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9187,46 +9215,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2506 + JSCompiler_object_inline_stack_2477 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2506.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2477.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2506 = + (JSCompiler_object_inline_stack_2477 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2504, + JSCompiler_object_inline_message_2475, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2507 = + (JSCompiler_object_inline_componentStack_2478 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2507.memoizedState = + (JSCompiler_object_inline_componentStack_2478.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2507.childLanes = + (JSCompiler_object_inline_componentStack_2478.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2505, + JSCompiler_object_inline_digest_2476, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2506 + JSCompiler_object_inline_stack_2477 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2504 + JSCompiler_object_inline_message_2475 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2504 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2504) + ((JSCompiler_object_inline_message_2475 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2475) ) { if (didSuspend) workInProgress.flags & 256 @@ -9243,94 +9271,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2507 = - JSCompiler_object_inline_stack_2506.fallback), - (JSCompiler_object_inline_message_2504 = workInProgress.mode), - (JSCompiler_object_inline_stack_2506 = + (JSCompiler_object_inline_componentStack_2478 = + JSCompiler_object_inline_stack_2477.fallback), + (JSCompiler_object_inline_message_2475 = workInProgress.mode), + (JSCompiler_object_inline_stack_2477 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2506.children + children: JSCompiler_object_inline_stack_2477.children }, - JSCompiler_object_inline_message_2504 + JSCompiler_object_inline_message_2475 )), - (JSCompiler_object_inline_componentStack_2507 = + (JSCompiler_object_inline_componentStack_2478 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2507, - JSCompiler_object_inline_message_2504, + JSCompiler_object_inline_componentStack_2478, + JSCompiler_object_inline_message_2475, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2507.flags |= 2), - (JSCompiler_object_inline_stack_2506.return = workInProgress), - (JSCompiler_object_inline_componentStack_2507.return = + (JSCompiler_object_inline_componentStack_2478.flags |= 2), + (JSCompiler_object_inline_stack_2477.return = workInProgress), + (JSCompiler_object_inline_componentStack_2478.return = workInProgress), - (JSCompiler_object_inline_stack_2506.sibling = - JSCompiler_object_inline_componentStack_2507), - (workInProgress.child = JSCompiler_object_inline_stack_2506), + (JSCompiler_object_inline_stack_2477.sibling = + JSCompiler_object_inline_componentStack_2478), + (workInProgress.child = JSCompiler_object_inline_stack_2477), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2506 = workInProgress.child), - (JSCompiler_object_inline_stack_2506.memoizedState = + (JSCompiler_object_inline_stack_2477 = workInProgress.child), + (JSCompiler_object_inline_stack_2477.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2506.childLanes = + (JSCompiler_object_inline_stack_2477.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2505, + JSCompiler_object_inline_digest_2476, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2507)); + JSCompiler_object_inline_componentStack_2478)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2504)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2475)) ) { - JSCompiler_object_inline_digest_2505 = - JSCompiler_object_inline_message_2504.nextSibling && - JSCompiler_object_inline_message_2504.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2505) { - JSCompiler_temp = JSCompiler_object_inline_digest_2505.dgst; - var message = JSCompiler_object_inline_digest_2505.msg; - instance = JSCompiler_object_inline_digest_2505.stck; - var componentStack = JSCompiler_object_inline_digest_2505.cstck; + JSCompiler_object_inline_digest_2476 = + JSCompiler_object_inline_message_2475.nextSibling && + JSCompiler_object_inline_message_2475.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2476) { + JSCompiler_temp = JSCompiler_object_inline_digest_2476.dgst; + var message = JSCompiler_object_inline_digest_2476.msg; + instance = JSCompiler_object_inline_digest_2476.stck; + var componentStack = JSCompiler_object_inline_digest_2476.cstck; } - JSCompiler_object_inline_message_2504 = message; - JSCompiler_object_inline_digest_2505 = JSCompiler_temp; - JSCompiler_object_inline_stack_2506 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2507 = + JSCompiler_object_inline_message_2475 = message; + JSCompiler_object_inline_digest_2476 = JSCompiler_temp; + JSCompiler_object_inline_stack_2477 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2478 = componentStack; - JSCompiler_object_inline_componentStack_2507 = - JSCompiler_object_inline_message_2504 - ? Error(JSCompiler_object_inline_message_2504) + JSCompiler_object_inline_componentStack_2478 = + JSCompiler_object_inline_message_2475 + ? Error(JSCompiler_object_inline_message_2475) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2507.stack = - JSCompiler_object_inline_stack_2506 || ""; - JSCompiler_object_inline_componentStack_2507.digest = - JSCompiler_object_inline_digest_2505; - JSCompiler_object_inline_digest_2505 = + JSCompiler_object_inline_componentStack_2478.stack = + JSCompiler_object_inline_stack_2477 || ""; + JSCompiler_object_inline_componentStack_2478.digest = + JSCompiler_object_inline_digest_2476; + JSCompiler_object_inline_digest_2476 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2506 = { - value: JSCompiler_object_inline_componentStack_2507, + JSCompiler_object_inline_stack_2477 = { + value: JSCompiler_object_inline_componentStack_2478, source: null, - stack: JSCompiler_object_inline_digest_2505 + stack: JSCompiler_object_inline_digest_2476 }; - "string" === typeof JSCompiler_object_inline_digest_2505 && + "string" === typeof JSCompiler_object_inline_digest_2476 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2507, - JSCompiler_object_inline_stack_2506 + JSCompiler_object_inline_componentStack_2478, + JSCompiler_object_inline_stack_2477 ); - queueHydrationError(JSCompiler_object_inline_stack_2506); + queueHydrationError(JSCompiler_object_inline_stack_2477); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9344,79 +9372,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2505 = + (JSCompiler_object_inline_digest_2476 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2505) + didReceiveUpdate || JSCompiler_object_inline_digest_2476) ) { - JSCompiler_object_inline_digest_2505 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2505) { - JSCompiler_object_inline_stack_2506 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2506 & 42)) - JSCompiler_object_inline_stack_2506 = 1; - else - switch (JSCompiler_object_inline_stack_2506) { - case 2: - JSCompiler_object_inline_stack_2506 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2506 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2506 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2506 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2506 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2506 = 0; - } - JSCompiler_object_inline_stack_2506 = + JSCompiler_object_inline_digest_2476 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_digest_2476 && + ((JSCompiler_object_inline_stack_2477 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2477 = + 0 !== (JSCompiler_object_inline_stack_2477 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2477 + )), + (JSCompiler_object_inline_stack_2477 = 0 !== - (JSCompiler_object_inline_stack_2506 & - (JSCompiler_object_inline_digest_2505.suspendedLanes | + (JSCompiler_object_inline_stack_2477 & + (JSCompiler_object_inline_digest_2476.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2506; - if ( - 0 !== JSCompiler_object_inline_stack_2506 && - JSCompiler_object_inline_stack_2506 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2506), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2506 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2505, - current, - JSCompiler_object_inline_stack_2506 - ), - SelectiveHydrationException) - ); - } - JSCompiler_object_inline_message_2504.data === + : JSCompiler_object_inline_stack_2477), + 0 !== JSCompiler_object_inline_stack_2477 && + JSCompiler_object_inline_stack_2477 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2477), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2477 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_digest_2476, + current, + JSCompiler_object_inline_stack_2477 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_message_2475.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9424,14 +9417,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2504.data === + JSCompiler_object_inline_message_2475.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2504.nextSibling + JSCompiler_object_inline_message_2475.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9449,57 +9442,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2506.children + JSCompiler_object_inline_stack_2477.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2507) + if (JSCompiler_object_inline_componentStack_2478) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2507 = - JSCompiler_object_inline_stack_2506.fallback), - (JSCompiler_object_inline_message_2504 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2478 = + JSCompiler_object_inline_stack_2477.fallback), + (JSCompiler_object_inline_message_2475 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2506 = createWorkInProgress( + (JSCompiler_object_inline_stack_2477 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2506.children + children: JSCompiler_object_inline_stack_2477.children } )), - (JSCompiler_object_inline_stack_2506.subtreeFlags = + (JSCompiler_object_inline_stack_2477.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2507 = + ? (JSCompiler_object_inline_componentStack_2478 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2507 + JSCompiler_object_inline_componentStack_2478 )) - : ((JSCompiler_object_inline_componentStack_2507 = + : ((JSCompiler_object_inline_componentStack_2478 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2507, - JSCompiler_object_inline_message_2504, + JSCompiler_object_inline_componentStack_2478, + JSCompiler_object_inline_message_2475, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2507.flags |= 2)), - (JSCompiler_object_inline_componentStack_2507.return = + (JSCompiler_object_inline_componentStack_2478.flags |= 2)), + (JSCompiler_object_inline_componentStack_2478.return = workInProgress), - (JSCompiler_object_inline_stack_2506.return = workInProgress), - (JSCompiler_object_inline_stack_2506.sibling = - JSCompiler_object_inline_componentStack_2507), - (workInProgress.child = JSCompiler_object_inline_stack_2506), - (JSCompiler_object_inline_stack_2506 = - JSCompiler_object_inline_componentStack_2507), - (JSCompiler_object_inline_componentStack_2507 = workInProgress.child), - (JSCompiler_object_inline_message_2504 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2504 - ? (JSCompiler_object_inline_message_2504 = + (JSCompiler_object_inline_stack_2477.return = workInProgress), + (JSCompiler_object_inline_stack_2477.sibling = + JSCompiler_object_inline_componentStack_2478), + (workInProgress.child = JSCompiler_object_inline_stack_2477), + (JSCompiler_object_inline_stack_2477 = + JSCompiler_object_inline_componentStack_2478), + (JSCompiler_object_inline_componentStack_2478 = workInProgress.child), + (JSCompiler_object_inline_message_2475 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2475 + ? (JSCompiler_object_inline_message_2475 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2504.cachePool), + JSCompiler_object_inline_message_2475.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9507,34 +9500,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2504 = { + (JSCompiler_object_inline_message_2475 = { baseLanes: - JSCompiler_object_inline_message_2504.baseLanes | renderLanes, + JSCompiler_object_inline_message_2475.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2507.memoizedState = - JSCompiler_object_inline_message_2504), + (JSCompiler_object_inline_componentStack_2478.memoizedState = + JSCompiler_object_inline_message_2475), enableTransitionTracing && - ((JSCompiler_object_inline_message_2504 = enableTransitionTracing + ((JSCompiler_object_inline_message_2475 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2504 && + null !== JSCompiler_object_inline_message_2475 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2507.updateQueue), + JSCompiler_object_inline_componentStack_2478.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2507.updateQueue = { - transitions: JSCompiler_object_inline_message_2504, + ? (JSCompiler_object_inline_componentStack_2478.updateQueue = { + transitions: JSCompiler_object_inline_message_2475, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2507.updateQueue = + ? (JSCompiler_object_inline_componentStack_2478.updateQueue = { - transitions: JSCompiler_object_inline_message_2504, + transitions: JSCompiler_object_inline_message_2475, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9542,32 +9535,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2504), + JSCompiler_object_inline_message_2475), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2507.childLanes = + (JSCompiler_object_inline_componentStack_2478.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2505, + JSCompiler_object_inline_digest_2476, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2506 + JSCompiler_object_inline_stack_2477 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2506.children + children: JSCompiler_object_inline_stack_2477.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2505 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2505 + ((JSCompiler_object_inline_digest_2476 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2476 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2505.push(current)); + : JSCompiler_object_inline_digest_2476.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10014,6 +10007,9 @@ __DEV__ && workInProgress.mode, workInProgress.lanes ); + enableOwnerStacks && + ((renderLanes._debugStack = workInProgress._debugStack), + (renderLanes._debugTask = workInProgress._debugTask)); var returnFiber = workInProgress.return; if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; @@ -10847,19 +10843,8 @@ __DEV__ && a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -10957,37 +10942,19 @@ __DEV__ && ); workInProgress.flags |= 262144; } - function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue - ) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error("Compared context values must be arrays"); - return !1; - } function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -15889,7 +15856,6 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); prepareFreshStack(root, lanes); } - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; memoizedUpdaters = workInProgressRootExitStatus; @@ -15943,7 +15909,6 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); null === workInProgress && ((workInProgressRoot = null), @@ -15978,7 +15943,6 @@ __DEV__ && root, lanes ); - enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -16108,7 +16072,6 @@ __DEV__ && ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; - enableDebugTracing && enableDebugTracing && groupEnd(); if (null !== workInProgress) return ( enableSchedulingProfiler && @@ -16403,25 +16366,13 @@ __DEV__ && throw Error("Should not already be working."); var finishedWork = root.finishedWork, lanes = root.finishedLanes; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return ( - enableDebugTracing && enableDebugTracing && groupEnd(), - enableSchedulingProfiler && markCommitStopped(), - null - ); + return enableSchedulingProfiler && markCommitStopped(), null; 0 === lanes && error$jscomp$0( "root.finishedLanes should not be empty during a commit. This is a bug in React." @@ -16481,14 +16432,6 @@ __DEV__ && (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), (root.current = finishedWork), - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16496,7 +16439,6 @@ __DEV__ && typeof injectedProfilingHooks.markLayoutEffectsStarted && injectedProfilingHooks.markLayoutEffectsStarted(lanes), commitLayoutEffects(finishedWork, root, lanes), - enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16547,7 +16489,6 @@ __DEV__ && : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); flushSyncWorkAcrossRoots_impl(0, !1); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; @@ -16624,14 +16565,6 @@ __DEV__ && throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - enableDebugTracing && - enableDebugTracing && - group( - "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -16642,7 +16575,6 @@ __DEV__ && executionContext |= CommitContext; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -17117,6 +17049,7 @@ __DEV__ && this.actualStartTime = -1.1; this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; + enableOwnerStacks && (this._debugTask = this._debugStack = null); this._debugNeedsRemount = !1; this._debugHookTypes = null; hasBadMapPolyfill || @@ -17156,10 +17089,11 @@ __DEV__ && selfBaseDuration: -0, treeBaseDuration: -0, _debugInfo: null, - _debugOwner: null, - _debugNeedsRemount: !1, - _debugHookTypes: null + _debugOwner: null }; + enableOwnerStacks && ((tag._debugStack = null), (tag._debugTask = null)); + tag._debugNeedsRemount = !1; + tag._debugHookTypes = null; hasBadMapPolyfill || "function" !== typeof Object.preventExtensions || Object.preventExtensions(tag); @@ -17182,6 +17116,9 @@ __DEV__ && (workInProgress.type = current.type), (workInProgress.stateNode = current.stateNode), (workInProgress._debugOwner = current._debugOwner), + enableOwnerStacks && + ((workInProgress._debugStack = current._debugStack), + (workInProgress._debugTask = current._debugTask)), (workInProgress._debugHookTypes = current._debugHookTypes), (workInProgress.alternate = current), (current.alternate = workInProgress)) @@ -17359,12 +17296,6 @@ __DEV__ && }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= DebugTracingMode; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -17441,6 +17372,9 @@ __DEV__ && lanes ); mode._debugOwner = element._owner; + enableOwnerStacks && + ((mode._debugStack = element._debugStack), + (mode._debugTask = element._debugTask)); return mode; } function createFiberFromFragment(elements, mode, lanes, key) { @@ -18478,6 +18412,15 @@ __DEV__ && }); } } + function executeDispatch(event, listener, currentTarget) { + event.currentTarget = currentTarget; + try { + listener(event); + } catch (error$43) { + reportGlobalError(error$43); + } + event.currentTarget = null; + } function processDispatchQueue(dispatchQueue, eventSystemFlags) { eventSystemFlags = 0 !== (eventSystemFlags & 4); for (var i = 0; i < dispatchQueue.length; i++) { @@ -18498,14 +18441,15 @@ __DEV__ && _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error$43) { - reportGlobalError(error$43); - } - previousInstance.currentTarget = null; + enableOwnerStacks && null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } else @@ -18520,14 +18464,15 @@ __DEV__ && _dispatchListeners$i = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) break a; - previousInstance = event; - previousInstance.currentTarget = currentTarget; - try { - _dispatchListeners$i(previousInstance); - } catch (error$43) { - reportGlobalError(error$43); - } - previousInstance.currentTarget = null; + enableOwnerStacks && null !== instance + ? runWithFiberInDEV( + instance, + executeDispatch, + event, + _dispatchListeners$i, + currentTarget + ) + : executeDispatch(event, _dispatchListeners$i, currentTarget); previousInstance = instance; } } @@ -20619,7 +20564,7 @@ __DEV__ && error$jscomp$0( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -21038,42 +20983,36 @@ __DEV__ && } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -22873,8 +22812,12 @@ __DEV__ && queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -23431,7 +23374,6 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -23457,6 +23399,7 @@ __DEV__ && syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -23475,7 +23418,6 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -23513,7 +23455,7 @@ __DEV__ && NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, - log$2 = Scheduler.log, + log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null, @@ -23521,7 +23463,7 @@ __DEV__ && hasLoggedError = !1, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__, clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, - log$1 = Math.log, + log = Math.log, LN2 = Math.LN2, nextTransitionLane = 128, nextRetryLane = 4194304, @@ -23565,11 +23507,6 @@ __DEV__ && allNativeEvents.add("afterblur"); var registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -23617,8 +23554,6 @@ __DEV__ && containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_FRAGMENT_NODE = 11, @@ -23772,6 +23707,8 @@ __DEV__ && " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -24421,12 +24358,6 @@ __DEV__ && emptyContextObject = {}; Object.freeze(emptyContextObject); var objectIs = "function" === typeof Object.is ? Object.is : is, - nativeConsole = console, - nativeConsoleLog = null, - pendingGroupArgs = [], - printedGroupIndex = -1, - wakeableIDs = new ("function" === typeof WeakMap ? WeakMap : Map)(), - wakeableID = 0, CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, @@ -24450,7 +24381,6 @@ __DEV__ && NoMode = 0, ConcurrentMode = 1, ProfileMode = 2, - DebugTracingMode = 4, StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, @@ -24725,40 +24655,35 @@ __DEV__ && currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; - ContextOnlyDispatcher.unstable_useContextWithBailout = - throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -24877,18 +24802,35 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountInDEV.useResourceEffect = function ( create, @@ -24915,35 +24857,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -25049,20 +24962,35 @@ __DEV__ && updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( create, @@ -25081,38 +25009,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; - HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -25218,18 +25114,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( create, @@ -25250,35 +25163,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -25384,18 +25268,35 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; enableUseResourceEffectHook && (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( create, @@ -25416,35 +25317,6 @@ __DEV__ && destroy ); }); - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( - context, - select - ) { - currentHookNameInDev = "useContext"; - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -25569,15 +25441,34 @@ __DEV__ && mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -25604,41 +25495,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; - InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -25763,15 +25619,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -25800,38 +25675,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -25956,15 +25799,34 @@ __DEV__ && updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -25988,40 +25850,6 @@ __DEV__ && destroy ); }); - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = - function (context, select) { - currentHookNameInDev = "useContext"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return unstable_useContextWithBailout(context, select); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -26266,14 +26094,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueReplaceState: function (inst, payload, callback) { @@ -26285,14 +26109,10 @@ __DEV__ && void 0 !== callback && null !== callback && (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - logStateUpdateScheduled(callback, lane, payload)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); enableSchedulingProfiler && markStateUpdateScheduled(inst, lane); }, enqueueForceUpdate: function (inst, callback) { @@ -26307,20 +26127,6 @@ __DEV__ && null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane)); - enableDebugTracing && - inst.mode & DebugTracingMode && - ((callback = getComponentNameFromFiber(inst) || "Unknown"), - enableDebugTracing && - log( - "%c\u269b%c " + - callback + - " forced update %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #db2e1f; font-weight: bold;", - "" - )); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -26622,6 +26428,11 @@ __DEV__ && shouldSuspendImpl = newShouldSuspendImpl; }; var isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -27017,7 +26828,6 @@ __DEV__ && didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -27348,11 +27158,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-7283a213-20241206" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-d4287258-20241217" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-modern-7283a213-20241206\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-d4287258-20241217\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27395,11 +27205,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-7283a213-20241206", + version: "19.1.0-www-modern-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-7283a213-20241206" + reconcilerVersion: "19.1.0-www-modern-d4287258-20241217" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27673,11 +27482,13 @@ __DEV__ && initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -28004,7 +27815,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-7283a213-20241206"; + exports.version = "19.1.0-www-modern-d4287258-20241217"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 68d0b95058be0..dbcd478783adc 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -40,7 +40,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -81,7 +80,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -385,13 +383,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -809,6 +805,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { @@ -973,12 +1009,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -2734,32 +2765,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -3829,18 +3837,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4001,50 +4008,49 @@ var HooksDispatcherOnMount = { ":"); return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -4081,22 +4087,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4135,25 +4139,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -6178,7 +6180,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ) return ( isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); @@ -6323,59 +6325,25 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { didReceiveUpdate || JSCompiler_temp) ) { JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - } + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -7368,19 +7336,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -7467,37 +7424,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -12408,12 +12347,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -12773,7 +12706,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -13257,19 +13195,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$354; + var JSCompiler_inline_result$jscomp$351; if (canUseDOM) { - var isSupported$jscomp$inline_1560 = "oninput" in document; - if (!isSupported$jscomp$inline_1560) { - var element$jscomp$inline_1561 = document.createElement("div"); - element$jscomp$inline_1561.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1560 = - "function" === typeof element$jscomp$inline_1561.oninput; + var isSupported$jscomp$inline_1551 = "oninput" in document; + if (!isSupported$jscomp$inline_1551) { + var element$jscomp$inline_1552 = document.createElement("div"); + element$jscomp$inline_1552.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1551 = + "function" === typeof element$jscomp$inline_1552.oninput; } - JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1560; - } else JSCompiler_inline_result$jscomp$354 = !1; + JSCompiler_inline_result$jscomp$351 = isSupported$jscomp$inline_1551; + } else JSCompiler_inline_result$jscomp$351 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$354 && + JSCompiler_inline_result$jscomp$351 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13680,20 +13618,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1601 = 0; - i$jscomp$inline_1601 < simpleEventPluginEvents.length; - i$jscomp$inline_1601++ + var i$jscomp$inline_1592 = 0; + i$jscomp$inline_1592 < simpleEventPluginEvents.length; + i$jscomp$inline_1592++ ) { - var eventName$jscomp$inline_1602 = - simpleEventPluginEvents[i$jscomp$inline_1601], - domEventName$jscomp$inline_1603 = - eventName$jscomp$inline_1602.toLowerCase(), - capitalizedEvent$jscomp$inline_1604 = - eventName$jscomp$inline_1602[0].toUpperCase() + - eventName$jscomp$inline_1602.slice(1); + var eventName$jscomp$inline_1593 = + simpleEventPluginEvents[i$jscomp$inline_1592], + domEventName$jscomp$inline_1594 = + eventName$jscomp$inline_1593.toLowerCase(), + capitalizedEvent$jscomp$inline_1595 = + eventName$jscomp$inline_1593[0].toUpperCase() + + eventName$jscomp$inline_1593.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1603, - "on" + capitalizedEvent$jscomp$inline_1604 + domEventName$jscomp$inline_1594, + "on" + capitalizedEvent$jscomp$inline_1595 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16816,8 +16754,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -17275,16 +17214,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1774 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1765 = React.version; if ( - "19.0.0-www-classic-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1774 + "19.1.0-www-classic-d4287258-20241217" !== + isomorphicReactPackageVersion$jscomp$inline_1765 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1774, - "19.0.0-www-classic-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1765, + "19.1.0-www-classic-d4287258-20241217" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17300,25 +17239,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2315 = { +var internals$jscomp$inline_2299 = { bundleType: 0, - version: "19.0.0-www-classic-7283a213-20241206", + version: "19.1.0-www-classic-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-7283a213-20241206" + reconcilerVersion: "19.1.0-www-classic-d4287258-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2316 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2300 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2316.isDisabled && - hook$jscomp$inline_2316.supportsFiber + !hook$jscomp$inline_2300.isDisabled && + hook$jscomp$inline_2300.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2316.inject( - internals$jscomp$inline_2315 + (rendererID = hook$jscomp$inline_2300.inject( + internals$jscomp$inline_2299 )), - (injectedHook = hook$jscomp$inline_2316); + (injectedHook = hook$jscomp$inline_2300); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17503,11 +17441,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -17669,4 +17609,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-7283a213-20241206"; +exports.version = "19.1.0-www-classic-d4287258-20241217"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 827d297da85c9..9ca8f9b630f29 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -38,7 +38,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -79,7 +78,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -320,13 +318,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -744,6 +740,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { @@ -908,12 +944,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -2585,32 +2616,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -3680,18 +3688,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3852,50 +3859,49 @@ var HooksDispatcherOnMount = { ":"); return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3932,22 +3938,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3986,25 +3990,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -5952,7 +5954,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ) return ( isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); @@ -6097,59 +6099,25 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { didReceiveUpdate || JSCompiler_temp) ) { JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - } + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -7138,19 +7106,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -7237,37 +7194,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -12155,12 +12094,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -12481,7 +12414,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -12993,19 +12931,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$357; + var JSCompiler_inline_result$jscomp$354; if (canUseDOM) { - var isSupported$jscomp$inline_1550 = "oninput" in document; - if (!isSupported$jscomp$inline_1550) { - var element$jscomp$inline_1551 = document.createElement("div"); - element$jscomp$inline_1551.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1550 = - "function" === typeof element$jscomp$inline_1551.oninput; + var isSupported$jscomp$inline_1541 = "oninput" in document; + if (!isSupported$jscomp$inline_1541) { + var element$jscomp$inline_1542 = document.createElement("div"); + element$jscomp$inline_1542.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1541 = + "function" === typeof element$jscomp$inline_1542.oninput; } - JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1550; - } else JSCompiler_inline_result$jscomp$357 = !1; + JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1541; + } else JSCompiler_inline_result$jscomp$354 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$357 && + JSCompiler_inline_result$jscomp$354 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13416,20 +13354,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1591 = 0; - i$jscomp$inline_1591 < simpleEventPluginEvents.length; - i$jscomp$inline_1591++ + var i$jscomp$inline_1582 = 0; + i$jscomp$inline_1582 < simpleEventPluginEvents.length; + i$jscomp$inline_1582++ ) { - var eventName$jscomp$inline_1592 = - simpleEventPluginEvents[i$jscomp$inline_1591], - domEventName$jscomp$inline_1593 = - eventName$jscomp$inline_1592.toLowerCase(), - capitalizedEvent$jscomp$inline_1594 = - eventName$jscomp$inline_1592[0].toUpperCase() + - eventName$jscomp$inline_1592.slice(1); + var eventName$jscomp$inline_1583 = + simpleEventPluginEvents[i$jscomp$inline_1582], + domEventName$jscomp$inline_1584 = + eventName$jscomp$inline_1583.toLowerCase(), + capitalizedEvent$jscomp$inline_1585 = + eventName$jscomp$inline_1583[0].toUpperCase() + + eventName$jscomp$inline_1583.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1593, - "on" + capitalizedEvent$jscomp$inline_1594 + domEventName$jscomp$inline_1584, + "on" + capitalizedEvent$jscomp$inline_1585 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16547,8 +16485,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -17006,16 +16945,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1764 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1755 = React.version; if ( - "19.0.0-www-modern-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1764 + "19.1.0-www-modern-d4287258-20241217" !== + isomorphicReactPackageVersion$jscomp$inline_1755 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1764, - "19.0.0-www-modern-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1755, + "19.1.0-www-modern-d4287258-20241217" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17031,25 +16970,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2297 = { +var internals$jscomp$inline_2281 = { bundleType: 0, - version: "19.0.0-www-modern-7283a213-20241206", + version: "19.1.0-www-modern-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-7283a213-20241206" + reconcilerVersion: "19.1.0-www-modern-d4287258-20241217" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2298 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2282 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2298.isDisabled && - hook$jscomp$inline_2298.supportsFiber + !hook$jscomp$inline_2282.isDisabled && + hook$jscomp$inline_2282.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2298.inject( - internals$jscomp$inline_2297 + (rendererID = hook$jscomp$inline_2282.inject( + internals$jscomp$inline_2281 )), - (injectedHook = hook$jscomp$inline_2298); + (injectedHook = hook$jscomp$inline_2282); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17234,11 +17172,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = emptyContextObject; options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -17400,4 +17340,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-7283a213-20241206"; +exports.version = "19.1.0-www-modern-d4287258-20241217"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 1fc490a0bc350..c0e8d9e275a74 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -44,7 +44,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -86,7 +85,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -390,13 +388,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -890,6 +886,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -1084,12 +1120,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -2902,32 +2933,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -4000,18 +4008,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4172,50 +4179,49 @@ var HooksDispatcherOnMount = { ":"); return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -4252,22 +4258,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4306,25 +4310,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -6366,7 +6368,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ) return ( isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); @@ -6511,59 +6513,25 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { didReceiveUpdate || JSCompiler_temp) ) { JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - } + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -7572,19 +7540,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -7671,37 +7628,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -13072,12 +13011,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -13462,7 +13395,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -13946,19 +13884,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$371; + var JSCompiler_inline_result$jscomp$368; if (canUseDOM) { - var isSupported$jscomp$inline_1653 = "oninput" in document; - if (!isSupported$jscomp$inline_1653) { - var element$jscomp$inline_1654 = document.createElement("div"); - element$jscomp$inline_1654.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1653 = - "function" === typeof element$jscomp$inline_1654.oninput; + var isSupported$jscomp$inline_1644 = "oninput" in document; + if (!isSupported$jscomp$inline_1644) { + var element$jscomp$inline_1645 = document.createElement("div"); + element$jscomp$inline_1645.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1644 = + "function" === typeof element$jscomp$inline_1645.oninput; } - JSCompiler_inline_result$jscomp$371 = isSupported$jscomp$inline_1653; - } else JSCompiler_inline_result$jscomp$371 = !1; + JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1644; + } else JSCompiler_inline_result$jscomp$368 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$371 && + JSCompiler_inline_result$jscomp$368 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14369,20 +14307,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1694 = 0; - i$jscomp$inline_1694 < simpleEventPluginEvents.length; - i$jscomp$inline_1694++ + var i$jscomp$inline_1685 = 0; + i$jscomp$inline_1685 < simpleEventPluginEvents.length; + i$jscomp$inline_1685++ ) { - var eventName$jscomp$inline_1695 = - simpleEventPluginEvents[i$jscomp$inline_1694], - domEventName$jscomp$inline_1696 = - eventName$jscomp$inline_1695.toLowerCase(), - capitalizedEvent$jscomp$inline_1697 = - eventName$jscomp$inline_1695[0].toUpperCase() + - eventName$jscomp$inline_1695.slice(1); + var eventName$jscomp$inline_1686 = + simpleEventPluginEvents[i$jscomp$inline_1685], + domEventName$jscomp$inline_1687 = + eventName$jscomp$inline_1686.toLowerCase(), + capitalizedEvent$jscomp$inline_1688 = + eventName$jscomp$inline_1686[0].toUpperCase() + + eventName$jscomp$inline_1686.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1696, - "on" + capitalizedEvent$jscomp$inline_1697 + domEventName$jscomp$inline_1687, + "on" + capitalizedEvent$jscomp$inline_1688 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17505,8 +17443,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -17964,16 +17903,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1867 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1858 = React.version; if ( - "19.0.0-www-classic-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1867 + "19.1.0-www-classic-d4287258-20241217" !== + isomorphicReactPackageVersion$jscomp$inline_1858 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1867, - "19.0.0-www-classic-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1858, + "19.1.0-www-classic-d4287258-20241217" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17989,28 +17928,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1869 = { +var internals$jscomp$inline_1860 = { bundleType: 0, - version: "19.0.0-www-classic-7283a213-20241206", + version: "19.1.0-www-classic-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-7283a213-20241206" + reconcilerVersion: "19.1.0-www-classic-d4287258-20241217" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1869.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1869.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1860.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1860.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2367 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2351 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2367.isDisabled && - hook$jscomp$inline_2367.supportsFiber + !hook$jscomp$inline_2351.isDisabled && + hook$jscomp$inline_2351.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2367.inject( - internals$jscomp$inline_1869 + (rendererID = hook$jscomp$inline_2351.inject( + internals$jscomp$inline_1860 )), - (injectedHook = hook$jscomp$inline_2367); + (injectedHook = hook$jscomp$inline_2351); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18195,11 +18133,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -18361,7 +18301,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-7283a213-20241206"; +exports.version = "19.1.0-www-classic-d4287258-20241217"; "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 e179eaeed061a..0373846558cee 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -42,7 +42,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = @@ -84,7 +83,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), @@ -325,13 +323,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -825,6 +821,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -1019,12 +1055,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -2753,32 +2784,9 @@ function updateWorkInProgressHook() { } return workInProgressHook; } -function unstable_useContextWithBailout(context, select) { - if (null === select) var JSCompiler_temp = readContext(context); - else { - JSCompiler_temp = currentlyRenderingFiber; - var value = context._currentValue; - context = { - context: context, - memoizedValue: value, - next: null, - select: select, - lastSelectedValue: select(value) - }; - if (null === lastContextDependency) { - if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; - JSCompiler_temp.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - JSCompiler_temp = value; - } - return JSCompiler_temp; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { +function createFunctionComponentUpdateQueue() { return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; +} function useThenable(thenable) { var index = thenableIndexCounter$1; thenableIndexCounter$1 += 1; @@ -3851,18 +3859,17 @@ var ContextOnlyDispatcher = { useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError }; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; enableUseResourceEffectHook && (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -4023,50 +4030,49 @@ var HooksDispatcherOnMount = { ":"); return (hook.memoizedState = identifierPrefix); }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber$1, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, useCacheRefresh: function () { return (mountWorkInProgressHook().memoizedState = refreshCache.bind( null, currentlyRenderingFiber$1 )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } }; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; enableUseResourceEffectHook && (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -HooksDispatcherOnMount.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -4103,22 +4109,20 @@ var HooksDispatcherOnUpdate = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -HooksDispatcherOnUpdate.unstable_useContextWithBailout = - unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4157,25 +4161,23 @@ var HooksDispatcherOnRerender = { ]; }, useSyncExternalStore: updateSyncExternalStore, - useId: updateId + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; HooksDispatcherOnRerender.useEffectEvent = updateEvent; enableUseResourceEffectHook && (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -HooksDispatcherOnRerender.unstable_useContextWithBailout = - unstable_useContextWithBailout; var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -6139,7 +6141,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ) return ( isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); @@ -6284,59 +6286,25 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { didReceiveUpdate || JSCompiler_temp) ) { JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - } + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -7341,19 +7309,8 @@ function propagateContextChanges( a: for (; null !== list; ) { var dependency = list; list = fiber; - var i = 0; - b: for (; i < contexts.length; i++) + for (var i = 0; i < contexts.length; i++) if (dependency.context === contexts[i]) { - var select = dependency.select; - if ( - null != select && - null != dependency.lastSelectedValue && - !checkIfSelectedContextValuesChanged( - dependency.lastSelectedValue, - select(dependency.context._currentValue) - ) - ) - continue b; list.lanes |= renderLanes; dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); @@ -7440,37 +7397,19 @@ function propagateParentContextChanges( ); workInProgress.flags |= 262144; } -function checkIfSelectedContextValuesChanged( - oldComparedValue, - newComparedValue -) { - if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { - if (oldComparedValue.length !== newComparedValue.length) return !0; - for (var i = 0; i < oldComparedValue.length; i++) - if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; - } else throw Error(formatProdErrorMessage(541)); - return !1; -} function checkIfContextChanged(currentDependencies) { for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { - var newValue = currentDependencies.context._currentValue, - oldValue = currentDependencies.memoizedValue; if ( - null != currentDependencies.select && - null != currentDependencies.lastSelectedValue - ) { - if ( - checkIfSelectedContextValuesChanged( - currentDependencies.lastSelectedValue, - currentDependencies.select(newValue) - ) + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue ) - return !0; - } else if (!objectIs(newValue, oldValue)) return !0; + ) + return !0; currentDependencies = currentDependencies.next; } return !1; @@ -12818,12 +12757,6 @@ function createFiberFromTypeAndProps( }), key ); - case REACT_DEBUG_TRACING_MODE_TYPE: - if (enableDebugTracing) { - fiberTag = 8; - mode |= 4; - break; - } default: if ("object" === typeof type && null !== type) switch (type.$$typeof) { @@ -13169,7 +13102,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -13681,19 +13619,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$374; + var JSCompiler_inline_result$jscomp$371; if (canUseDOM) { - var isSupported$jscomp$inline_1643 = "oninput" in document; - if (!isSupported$jscomp$inline_1643) { - var element$jscomp$inline_1644 = document.createElement("div"); - element$jscomp$inline_1644.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1643 = - "function" === typeof element$jscomp$inline_1644.oninput; + var isSupported$jscomp$inline_1634 = "oninput" in document; + if (!isSupported$jscomp$inline_1634) { + var element$jscomp$inline_1635 = document.createElement("div"); + element$jscomp$inline_1635.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1634 = + "function" === typeof element$jscomp$inline_1635.oninput; } - JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1643; - } else JSCompiler_inline_result$jscomp$374 = !1; + JSCompiler_inline_result$jscomp$371 = isSupported$jscomp$inline_1634; + } else JSCompiler_inline_result$jscomp$371 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$374 && + JSCompiler_inline_result$jscomp$371 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14104,20 +14042,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1684 = 0; - i$jscomp$inline_1684 < simpleEventPluginEvents.length; - i$jscomp$inline_1684++ + var i$jscomp$inline_1675 = 0; + i$jscomp$inline_1675 < simpleEventPluginEvents.length; + i$jscomp$inline_1675++ ) { - var eventName$jscomp$inline_1685 = - simpleEventPluginEvents[i$jscomp$inline_1684], - domEventName$jscomp$inline_1686 = - eventName$jscomp$inline_1685.toLowerCase(), - capitalizedEvent$jscomp$inline_1687 = - eventName$jscomp$inline_1685[0].toUpperCase() + - eventName$jscomp$inline_1685.slice(1); + var eventName$jscomp$inline_1676 = + simpleEventPluginEvents[i$jscomp$inline_1675], + domEventName$jscomp$inline_1677 = + eventName$jscomp$inline_1676.toLowerCase(), + capitalizedEvent$jscomp$inline_1678 = + eventName$jscomp$inline_1676[0].toUpperCase() + + eventName$jscomp$inline_1676.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1686, - "on" + capitalizedEvent$jscomp$inline_1687 + domEventName$jscomp$inline_1677, + "on" + capitalizedEvent$jscomp$inline_1678 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -17235,8 +17173,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -17694,16 +17633,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1857 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1848 = React.version; if ( - "19.0.0-www-modern-7283a213-20241206" !== - isomorphicReactPackageVersion$jscomp$inline_1857 + "19.1.0-www-modern-d4287258-20241217" !== + isomorphicReactPackageVersion$jscomp$inline_1848 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1857, - "19.0.0-www-modern-7283a213-20241206" + isomorphicReactPackageVersion$jscomp$inline_1848, + "19.1.0-www-modern-d4287258-20241217" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17719,28 +17658,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1859 = { +var internals$jscomp$inline_1850 = { bundleType: 0, - version: "19.0.0-www-modern-7283a213-20241206", + version: "19.1.0-www-modern-d4287258-20241217", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-7283a213-20241206" + reconcilerVersion: "19.1.0-www-modern-d4287258-20241217" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1859.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1859.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1850.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1850.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2349 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2333 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2349.isDisabled && - hook$jscomp$inline_2349.supportsFiber + !hook$jscomp$inline_2333.isDisabled && + hook$jscomp$inline_2333.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2349.inject( - internals$jscomp$inline_1859 + (rendererID = hook$jscomp$inline_2333.inject( + internals$jscomp$inline_1850 )), - (injectedHook = hook$jscomp$inline_2349); + (injectedHook = hook$jscomp$inline_2333); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17925,11 +17863,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = emptyContextObject; options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -18091,7 +18031,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-7283a213-20241206"; +exports.version = "19.1.0-www-modern-d4287258-20241217"; "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 62c947a65afed..a792d9536e0ee 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -2167,7 +2167,7 @@ __DEV__ && : children$jscomp$6; Array.isArray(children$jscomp$6) && 1 < children$jscomp$6.length ? error$jscomp$2( - "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", + "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be common to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", children$jscomp$6.length ) : "function" === typeof child || "symbol" === typeof child @@ -4041,9 +4041,6 @@ __DEV__ && null === thenableState && (thenableState = []); return trackUsedThenable(thenableState, thenable, index); } - function unsupportedRefresh() { - throw Error("Cache cannot be refreshed during server rendering."); - } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -4264,11 +4261,32 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) return type.prototype && type.prototype.isReactComponent - ? ((type = describeNativeComponentFrame(type, !0)), type) + ? describeNativeComponentFrame(type, !0) : describeNativeComponentFrame(type, !1); if ("object" === typeof type && null !== type) { switch (type.$$typeof) { @@ -4429,7 +4447,8 @@ __DEV__ && emptyTreeContext, null, !1, - emptyContextObject + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4475,7 +4494,8 @@ __DEV__ && treeContext, componentStack, isFallback, - legacyContext + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4501,6 +4521,7 @@ __DEV__ && isFallback: isFallback }; task.legacyContext = legacyContext; + enableOwnerStacks && (task.debugTask = debugTask); abortSet.add(task); return task; } @@ -4519,7 +4540,8 @@ __DEV__ && treeContext, componentStack, isFallback, - legacyContext + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4546,6 +4568,7 @@ __DEV__ && isFallback: isFallback }; task.legacyContext = legacyContext; + enableOwnerStacks && (task.debugTask = debugTask); abortSet.add(task); return task; } @@ -4571,22 +4594,68 @@ __DEV__ && }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + if (enableOwnerStacks) { + var componentStack = currentTaskInDEV.componentStack; + if (enableOwnerStacks) + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + else JSCompiler_inline_result$jscomp$0 = ""; + return JSCompiler_inline_result$jscomp$0; + } + return getStackByComponentStackNode(currentTaskInDEV.componentStack); } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; - "string" === typeof componentInfo.name && - (task.componentStack = { + "string" !== typeof componentInfo.name || + (enableOwnerStacks && void 0 === componentInfo.debugStack) || + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: enableOwnerStacks ? componentInfo.debugStack : null + }), + enableOwnerStacks && (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4595,13 +4664,15 @@ __DEV__ && switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = enableOwnerStacks ? node._debugStack : null; pushServerComponentStack(task, node._debugInfo); + enableOwnerStacks && (task.debugTask = node._debugTask); task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4650,9 +4721,12 @@ __DEV__ && boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error$1, errorInfo) { + function logRecoverableError(request, error$1, errorInfo, debugTask) { request = request.onError; - error$1 = request(error$1, errorInfo); + error$1 = + enableOwnerStacks && debugTask + ? debugTask.run(request.bind(null, error$1, errorInfo)) + : request(error$1, errorInfo); if (null != error$1 && "string" !== typeof error$1) error$jscomp$2( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4660,11 +4734,13 @@ __DEV__ && ); else return error$1; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + enableOwnerStacks && debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) : ((request.status = 13), (request.fatalError = error)); @@ -5400,7 +5476,6 @@ __DEV__ && } else { switch (type) { case REACT_LEGACY_HIDDEN_TYPE: - case REACT_DEBUG_TRACING_MODE_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_PROFILER_TYPE: case REACT_FRAGMENT_TYPE: @@ -5522,7 +5597,8 @@ __DEV__ && task.treeContext, task.componentStack, task.isFallback, - task.legacyContext + task.legacyContext, + enableOwnerStacks ? task.debugTask : null ); pushComponentStack(suspendedPrimaryTask); request.pingedTasks.push(suspendedPrimaryTask); @@ -5560,7 +5636,8 @@ __DEV__ && var errorDigest = logRecoverableError( request, error, - thrownInfo + thrownInfo, + enableOwnerStacks ? task.debugTask : null ); encodeErrorForBoundary( newBoundary, @@ -5591,7 +5668,8 @@ __DEV__ && task.treeContext, task.componentStack, !0, - task.legacyContext + task.legacyContext, + enableOwnerStacks ? task.debugTask : null ); pushComponentStack(suspendedFallbackTask); request.pingedTasks.push(suspendedFallbackTask); @@ -5729,15 +5807,187 @@ __DEV__ && (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError( + props, + keyPath, + type, + enableOwnerStacks ? task.debugTask : null + ); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children; + props = props.fallback; + var fallbackAbortSet = new Set(), + resumedBoundary = createSuspenseBoundary( + request, + fallbackAbortSet + ); + resumedBoundary.parentFlushed = !0; + resumedBoundary.rootSegmentID = type; + task.blockedBoundary = resumedBoundary; + task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if ( + 0 === resumedBoundary.pendingTasks && + resumedBoundary.status === PENDING + ) { + resumedBoundary.status = COMPLETED; + request.completedBoundaries.push(resumedBoundary); + break a; + } + } catch (error$3) { + (resumedBoundary.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error$3, + childNodes, + enableOwnerStacks ? task.debugTask : null + )), + encodeErrorForBoundary( + resumedBoundary, + replay, + error$3, + childNodes, + !1 + ), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(resumedBoundary); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + props, + -1, + parentBoundary, + resumedBoundary.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + task.legacyContext, + enableOwnerStacks ? task.debugTask : null + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = enableOwnerStacks ? task.debugTask : null), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + enableOwnerStacks && (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5747,171 +5997,56 @@ __DEV__ && switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children; - props = props.fallback; - var fallbackAbortSet = new Set(), - resumedBoundary = createSuspenseBoundary( - request, - fallbackAbortSet - ); - resumedBoundary.parentFlushed = !0; - resumedBoundary.rootSegmentID = ref; - task.blockedBoundary = resumedBoundary; - task.hoistableState = resumedBoundary.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === resumedBoundary.pendingTasks && - resumedBoundary.status === PENDING - ) { - resumedBoundary.status = COMPLETED; - request.completedBoundaries.push(resumedBoundary); - break a; - } - } catch (error$3) { - (resumedBoundary.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error$3, - childNodes - )), - encodeErrorForBoundary( - resumedBoundary, - type, - error$3, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push( - resumedBoundary - ); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - props, - -1, - parentBoundary, - resumedBoundary.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0, - task.legacyContext - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = enableOwnerStacks ? task.debugTask : null, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5928,21 +6063,20 @@ __DEV__ && return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || error$jscomp$2( @@ -5950,18 +6084,18 @@ __DEV__ && ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (error$jscomp$2( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -5982,39 +6116,39 @@ __DEV__ && node._currentValue2, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), error$jscomp$2( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && error$jscomp$2( @@ -6023,9 +6157,11 @@ __DEV__ && )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, - previousComponentStack = task.componentStack; + previousComponentStack = task.componentStack, + previousDebugTask = null; + enableOwnerStacks && (previousDebugTask = task.debugTask); pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -6043,7 +6179,7 @@ __DEV__ && node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -6060,14 +6196,25 @@ __DEV__ && ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + enableOwnerStacks ? task.debugTask : null + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -6077,6 +6224,7 @@ __DEV__ && } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); return; } replay = task.treeContext; @@ -6085,98 +6233,98 @@ __DEV__ && null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: enableOwnerStacks ? error._debugStack : null }; error$jscomp$2( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6203,7 +6351,8 @@ __DEV__ && task.treeContext, task.componentStack, task.isFallback, - task.legacyContext + task.legacyContext, + enableOwnerStacks ? task.debugTask : null ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6233,7 +6382,8 @@ __DEV__ && task.treeContext, task.componentStack, task.isFallback, - task.legacyContext + task.legacyContext, + enableOwnerStacks ? task.debugTask : null ); } function renderNode(request, task, node, childIndex) { @@ -6243,6 +6393,7 @@ __DEV__ && previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = enableOwnerStacks ? task.debugTask : null, segment = task.blockedSegment; if (null === segment) try { @@ -6270,6 +6421,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6283,6 +6435,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6318,6 +6471,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6331,6 +6485,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6345,26 +6500,6 @@ __DEV__ && switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6448,14 +6583,14 @@ __DEV__ && if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6473,7 +6608,7 @@ __DEV__ && boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6548,7 +6683,7 @@ __DEV__ && } } } catch (error$5) { - logRecoverableError(request, error$5, {}); + logRecoverableError(request, error$5, {}, null); } } function completeShell(request) { @@ -6620,10 +6755,10 @@ __DEV__ && request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6631,16 +6766,16 @@ __DEV__ && var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6688,16 +6823,32 @@ __DEV__ && } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error, + errorInfo$jscomp$0, + enableOwnerStacks ? request.debugTask : null + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6710,97 +6861,108 @@ __DEV__ && currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - pushSegmentFinale( - segment$jscomp$0.chunks, - request.renderState, - segment$jscomp$0.lastPushedText, - segment$jscomp$0.textEmbedded - ), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 - ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + pushSegmentFinale( + request$jscomp$1.chunks, + request.renderState, + request$jscomp$1.lastPushedText, + request$jscomp$1.textEmbedded + ), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = enableOwnerStacks + ? errorDigest.debugTask + : null; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 + ))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error$6) { - logRecoverableError(request$jscomp$1, error$6, {}), - fatalError(request$jscomp$1, error$6); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error$6, pingedTasks, null), + fatalError(request$jscomp$2, error$6, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7435,8 +7597,9 @@ __DEV__ && try { flushCompletedQueues(request, destination); } catch (error$7) { - logRecoverableError(request, error$7, {}), - fatalError(request, error$7); + (destination = {}), + logRecoverableError(request, error$7, destination, null), + fatalError(request, error$7, destination, null); } } } @@ -7462,7 +7625,9 @@ __DEV__ && null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$8) { - logRecoverableError(request, error$8, {}), fatalError(request, error$8); + (reason = {}), + logRecoverableError(request, error$8, reason, null), + fatalError(request, error$8, reason, null); } } function onError() {} @@ -7524,7 +7689,10 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableUseResourceEffectHook = + dynamicFeatureFlags.enableUseResourceEffectHook, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -7542,11 +7710,9 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, isArrayImpl = Array.isArray, jsxPropsParents = new WeakMap(), @@ -8890,28 +9056,21 @@ __DEV__ && ); return getServerSnapshot(); }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; }, + useActionState: useActionState, + useFormState: useActionState, useHostTransitionStatus: function () { resolveCurrentlyRenderingComponent(); return NotPending; }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; + useEffectEvent: function () { + return throwOnUseEffectEventCall; } }; - HooksDispatcher.useFormState = useActionState; - HooksDispatcher.useActionState = useActionState; + enableUseResourceEffectHook && (HooksDispatcher.useResourceEffect = noop$1); var currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { @@ -8991,5 +9150,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-classic-7283a213-20241206"; + exports.version = "19.1.0-www-classic-d4287258-20241217"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 30a7ea3a61fc4..5c26d0999436e 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -2167,7 +2167,7 @@ __DEV__ && : children$jscomp$6; Array.isArray(children$jscomp$6) && 1 < children$jscomp$6.length ? error$jscomp$2( - "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", + "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be common to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", children$jscomp$6.length ) : "function" === typeof child || "symbol" === typeof child @@ -4033,9 +4033,6 @@ __DEV__ && null === thenableState && (thenableState = []); return trackUsedThenable(thenableState, thenable, index); } - function unsupportedRefresh() { - throw Error("Cache cannot be refreshed during server rendering."); - } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -4256,11 +4253,32 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } + function formatOwnerStack(error) { + var prevPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + error = error.stack; + Error.prepareStackTrace = prevPrepareStackTrace; + error.startsWith("Error: react-stack-top-frame\n") && + (error = error.slice(29)); + prevPrepareStackTrace = error.indexOf("\n"); + -1 !== prevPrepareStackTrace && + (error = error.slice(prevPrepareStackTrace + 1)); + prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame"); + -1 !== prevPrepareStackTrace && + (prevPrepareStackTrace = error.lastIndexOf( + "\n", + prevPrepareStackTrace + )); + if (-1 !== prevPrepareStackTrace) + error = error.slice(0, prevPrepareStackTrace); + else return ""; + return error; + } function describeComponentStackByType(type) { if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) return type.prototype && type.prototype.isReactComponent - ? ((type = describeNativeComponentFrame(type, !0)), type) + ? describeNativeComponentFrame(type, !0) : describeNativeComponentFrame(type, !1); if ("object" === typeof type && null !== type) { switch (type.$$typeof) { @@ -4420,7 +4438,9 @@ __DEV__ && null, emptyTreeContext, null, - !1 + !1, + emptyContextObject, + null ); pushComponentStack(children); resumableState.pingedTasks.push(children); @@ -4465,7 +4485,9 @@ __DEV__ && context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4490,6 +4512,7 @@ __DEV__ && thenableState: thenableState, isFallback: isFallback }; + enableOwnerStacks && (task.debugTask = debugTask); abortSet.add(task); return task; } @@ -4507,7 +4530,9 @@ __DEV__ && context, treeContext, componentStack, - isFallback + isFallback, + legacyContext, + debugTask ) { request.allPendingTasks++; null === blockedBoundary @@ -4533,6 +4558,7 @@ __DEV__ && thenableState: thenableState, isFallback: isFallback }; + enableOwnerStacks && (task.debugTask = debugTask); abortSet.add(task); return task; } @@ -4558,22 +4584,68 @@ __DEV__ && }; } function getCurrentStackInDEV() { - return null === currentTaskInDEV || - null === currentTaskInDEV.componentStack - ? "" - : getStackByComponentStackNode(currentTaskInDEV.componentStack); + if (null === currentTaskInDEV || null === currentTaskInDEV.componentStack) + return ""; + if (enableOwnerStacks) { + var componentStack = currentTaskInDEV.componentStack; + if (enableOwnerStacks) + try { + var info = ""; + if ("string" === typeof componentStack.type) + info += describeBuiltInComponentFrame(componentStack.type); + else if ("function" === typeof componentStack.type) { + if (!componentStack.owner) { + var JSCompiler_temp_const = info, + fn = componentStack.type, + name = fn ? fn.displayName || fn.name : ""; + var JSCompiler_inline_result = name + ? describeBuiltInComponentFrame(name) + : ""; + info = JSCompiler_temp_const + JSCompiler_inline_result; + } + } else + componentStack.owner || + (info += describeComponentStackByType(componentStack.type)); + for (; componentStack; ) + (JSCompiler_temp_const = null), + null != componentStack.debugStack + ? (JSCompiler_temp_const = formatOwnerStack( + componentStack.debugStack + )) + : ((JSCompiler_inline_result = componentStack), + null != JSCompiler_inline_result.stack && + (JSCompiler_temp_const = + "string" !== typeof JSCompiler_inline_result.stack + ? (JSCompiler_inline_result.stack = formatOwnerStack( + JSCompiler_inline_result.stack + )) + : JSCompiler_inline_result.stack)), + (componentStack = componentStack.owner) && + JSCompiler_temp_const && + (info += "\n" + JSCompiler_temp_const); + var JSCompiler_inline_result$jscomp$0 = info; + } catch (x) { + JSCompiler_inline_result$jscomp$0 = + "\nError generating stack: " + x.message + "\n" + x.stack; + } + else JSCompiler_inline_result$jscomp$0 = ""; + return JSCompiler_inline_result$jscomp$0; + } + return getStackByComponentStackNode(currentTaskInDEV.componentStack); } function pushServerComponentStack(task, debugInfo) { if (null != debugInfo) for (var i = 0; i < debugInfo.length; i++) { var componentInfo = debugInfo[i]; - "string" === typeof componentInfo.name && - (task.componentStack = { + "string" !== typeof componentInfo.name || + (enableOwnerStacks && void 0 === componentInfo.debugStack) || + ((task.componentStack = { parent: task.componentStack, type: componentInfo, owner: componentInfo.owner, - stack: null - }); + stack: enableOwnerStacks ? componentInfo.debugStack : null + }), + enableOwnerStacks && (task.debugTask = componentInfo.debugTask)); } } function pushComponentStack(task) { @@ -4582,13 +4654,15 @@ __DEV__ && switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - owner = node._owner; + owner = node._owner, + stack = enableOwnerStacks ? node._debugStack : null; pushServerComponentStack(task, node._debugInfo); + enableOwnerStacks && (task.debugTask = node._debugTask); task.componentStack = { parent: task.componentStack, type: type, owner: owner, - stack: null + stack: stack }; break; case REACT_LAZY_TYPE: @@ -4637,9 +4711,12 @@ __DEV__ && boundary.errorStack = null !== error ? wasAborted + error : null; boundary.errorComponentStack = thrownInfo.componentStack; } - function logRecoverableError(request, error$1, errorInfo) { + function logRecoverableError(request, error$1, errorInfo, debugTask) { request = request.onError; - error$1 = request(error$1, errorInfo); + error$1 = + enableOwnerStacks && debugTask + ? debugTask.run(request.bind(null, error$1, errorInfo)) + : request(error$1, errorInfo); if (null != error$1 && "string" !== typeof error$1) error$jscomp$2( 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "%s" instead', @@ -4647,11 +4724,13 @@ __DEV__ && ); else return error$1; } - function fatalError(request, error) { - var onShellError = request.onShellError, - onFatalError = request.onFatalError; - onShellError(error); - onFatalError(error); + function fatalError(request, error, errorInfo, debugTask) { + errorInfo = request.onShellError; + var onFatalError = request.onFatalError; + enableOwnerStacks && debugTask + ? (debugTask.run(errorInfo.bind(null, error)), + debugTask.run(onFatalError.bind(null, error))) + : (errorInfo(error), onFatalError(error)); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) : ((request.status = 13), (request.fatalError = error)); @@ -5270,7 +5349,6 @@ __DEV__ && else { switch (type) { case REACT_LEGACY_HIDDEN_TYPE: - case REACT_DEBUG_TRACING_MODE_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_PROFILER_TYPE: case REACT_FRAGMENT_TYPE: @@ -5377,7 +5455,9 @@ __DEV__ && task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + enableOwnerStacks ? task.debugTask : null ); pushComponentStack(task); request.pingedTasks.push(task); @@ -5414,7 +5494,8 @@ __DEV__ && (addendum = logRecoverableError( request, newProps, - defaultProps + defaultProps, + enableOwnerStacks ? task.debugTask : null )), encodeErrorForBoundary( propName, @@ -5444,7 +5525,9 @@ __DEV__ && task.context, task.treeContext, task.componentStack, - !0 + !0, + emptyContextObject, + enableOwnerStacks ? task.debugTask : null ); pushComponentStack(task); request.pingedTasks.push(task); @@ -5560,15 +5643,187 @@ __DEV__ && (task.replay = prevReplay), (task.blockedSegment = null); } } + function replayElement( + request, + task, + keyPath, + name, + keyOrIndex, + childIndex, + type, + props, + ref, + replay + ) { + childIndex = replay.nodes; + for (var i = 0; i < childIndex.length; i++) { + var node = childIndex[i]; + if (keyOrIndex === node[1]) { + if (4 === node.length) { + if (null !== name && name !== node[0]) + throw Error( + "Expected the resume to render <" + + node[0] + + "> in this slot but instead it rendered <" + + name + + ">. The tree doesn't match so React will fallback to client rendering." + ); + var childNodes = node[2]; + node = node[3]; + name = task.node; + task.replay = { nodes: childNodes, slots: node, pendingTasks: 1 }; + try { + renderElement(request, task, keyPath, type, props, ref); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + } catch (x) { + if ( + "object" === typeof x && + null !== x && + (x === SuspenseException || "function" === typeof x.then) + ) + throw (task.node === name && (task.replay = replay), x); + task.replay.pendingTasks--; + type = getThrownInfo(task.componentStack); + props = request; + request = task.blockedBoundary; + keyPath = x; + ref = node; + node = logRecoverableError( + props, + keyPath, + type, + enableOwnerStacks ? task.debugTask : null + ); + abortRemainingReplayNodes( + props, + request, + childNodes, + ref, + keyPath, + node, + type, + !1 + ); + } + task.replay = replay; + } else { + if (type !== REACT_SUSPENSE_TYPE) + throw Error( + "Expected the resume to render in this slot but instead it rendered <" + + (getComponentNameFromType(type) || "Unknown") + + ">. The tree doesn't match so React will fallback to client rendering." + ); + a: { + replay = void 0; + type = node[5]; + ref = node[2]; + name = node[3]; + keyOrIndex = null === node[4] ? [] : node[4][2]; + node = null === node[4] ? null : node[4][3]; + var prevKeyPath = task.keyPath, + previousReplaySet = task.replay, + parentBoundary = task.blockedBoundary, + parentHoistableState = task.hoistableState, + content = props.children; + props = props.fallback; + var fallbackAbortSet = new Set(), + resumedBoundary = createSuspenseBoundary( + request, + fallbackAbortSet + ); + resumedBoundary.parentFlushed = !0; + resumedBoundary.rootSegmentID = type; + task.blockedBoundary = resumedBoundary; + task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; + task.replay = { nodes: ref, slots: name, pendingTasks: 1 }; + try { + renderNode(request, task, content, -1); + if ( + 1 === task.replay.pendingTasks && + 0 < task.replay.nodes.length + ) + throw Error( + "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." + ); + task.replay.pendingTasks--; + if ( + 0 === resumedBoundary.pendingTasks && + resumedBoundary.status === PENDING + ) { + resumedBoundary.status = COMPLETED; + request.completedBoundaries.push(resumedBoundary); + break a; + } + } catch (error$3) { + (resumedBoundary.status = CLIENT_RENDERED), + (childNodes = getThrownInfo(task.componentStack)), + (replay = logRecoverableError( + request, + error$3, + childNodes, + enableOwnerStacks ? task.debugTask : null + )), + encodeErrorForBoundary( + resumedBoundary, + replay, + error$3, + childNodes, + !1 + ), + task.replay.pendingTasks--, + request.clientRenderedBoundaries.push(resumedBoundary); + } finally { + (task.blockedBoundary = parentBoundary), + (task.hoistableState = parentHoistableState), + (task.replay = previousReplaySet), + (task.keyPath = prevKeyPath); + } + props = createReplayTask( + request, + null, + { nodes: keyOrIndex, slots: node, pendingTasks: 0 }, + props, + -1, + parentBoundary, + resumedBoundary.fallbackState, + fallbackAbortSet, + [keyPath[0], "Suspense Fallback", keyPath[2]], + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + !0, + emptyContextObject, + enableOwnerStacks ? task.debugTask : null + ); + pushComponentStack(props); + request.pingedTasks.push(props); + } + } + childIndex.splice(i, 1); + break; + } + } + } function renderNodeDestructive(request, task, node, childIndex) { null !== task.replay && "number" === typeof task.replay.slots ? resumeNode(request, task, task.replay.slots, node, childIndex) : ((task.node = node), (task.childIndex = childIndex), (node = task.componentStack), + (childIndex = enableOwnerStacks ? task.debugTask : null), pushComponentStack(task), retryNode(request, task), - (task.componentStack = node)); + (task.componentStack = node), + enableOwnerStacks && (task.debugTask = childIndex)); } function retryNode(request, task) { var node = task.node, @@ -5578,170 +5833,56 @@ __DEV__ && switch (node.$$typeof) { case REACT_ELEMENT_TYPE: var type = node.type, - key = node.key, - props = node.props; - node = props.ref; - var ref = void 0 !== node ? node : null, - name = getComponentNameFromType(type), - keyOrIndex = - null == key ? (-1 === childIndex ? 0 : childIndex) : key, - keyPath = [task.keyPath, name, keyOrIndex]; - if (null !== task.replay) { - var replay = task.replay; - childIndex = replay.nodes; - for (node = 0; node < childIndex.length; node++) - if (((key = childIndex[node]), keyOrIndex === key[1])) { - if (4 === key.length) { - if (null !== name && name !== key[0]) - throw Error( - "Expected the resume to render <" + - key[0] + - "> in this slot but instead it rendered <" + - name + - ">. The tree doesn't match so React will fallback to client rendering." - ); - var childNodes = key[2]; - key = key[3]; - name = task.node; - task.replay = { - nodes: childNodes, - slots: key, - pendingTasks: 1 - }; - try { - renderElement(request, task, keyPath, type, props, ref); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - } catch (x) { - if ( - "object" === typeof x && - null !== x && - (x === SuspenseException || - "function" === typeof x.then) - ) - throw ( - (task.node === name && (task.replay = replay), x) - ); - task.replay.pendingTasks--; - props = getThrownInfo(task.componentStack); - erroredReplay( - request, - task.blockedBoundary, - x, - props, - childNodes, - key - ); - } - task.replay = replay; - } else { - if (type !== REACT_SUSPENSE_TYPE) - throw Error( - "Expected the resume to render in this slot but instead it rendered <" + - (getComponentNameFromType(type) || "Unknown") + - ">. The tree doesn't match so React will fallback to client rendering." - ); - a: { - type = void 0; - ref = key[5]; - replay = key[2]; - name = key[3]; - keyOrIndex = null === key[4] ? [] : key[4][2]; - key = null === key[4] ? null : key[4][3]; - var prevKeyPath = task.keyPath, - previousReplaySet = task.replay, - parentBoundary = task.blockedBoundary, - parentHoistableState = task.hoistableState, - content = props.children; - props = props.fallback; - var fallbackAbortSet = new Set(), - resumedBoundary = createSuspenseBoundary( - request, - fallbackAbortSet - ); - resumedBoundary.parentFlushed = !0; - resumedBoundary.rootSegmentID = ref; - task.blockedBoundary = resumedBoundary; - task.hoistableState = resumedBoundary.contentState; - task.keyPath = keyPath; - task.replay = { - nodes: replay, - slots: name, - pendingTasks: 1 - }; - try { - renderNode(request, task, content, -1); - if ( - 1 === task.replay.pendingTasks && - 0 < task.replay.nodes.length - ) - throw Error( - "Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering." - ); - task.replay.pendingTasks--; - if ( - 0 === resumedBoundary.pendingTasks && - resumedBoundary.status === PENDING - ) { - resumedBoundary.status = COMPLETED; - request.completedBoundaries.push(resumedBoundary); - break a; - } - } catch (error$3) { - (resumedBoundary.status = CLIENT_RENDERED), - (childNodes = getThrownInfo(task.componentStack)), - (type = logRecoverableError( - request, - error$3, - childNodes - )), - encodeErrorForBoundary( - resumedBoundary, - type, - error$3, - childNodes, - !1 - ), - task.replay.pendingTasks--, - request.clientRenderedBoundaries.push( - resumedBoundary - ); - } finally { - (task.blockedBoundary = parentBoundary), - (task.hoistableState = parentHoistableState), - (task.replay = previousReplaySet), - (task.keyPath = prevKeyPath); - } - childNodes = createReplayTask( - request, - null, - { nodes: keyOrIndex, slots: key, pendingTasks: 0 }, - props, - -1, - parentBoundary, - resumedBoundary.fallbackState, - fallbackAbortSet, - [keyPath[0], "Suspense Fallback", keyPath[2]], - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - !0 - ); - pushComponentStack(childNodes); - request.pingedTasks.push(childNodes); - } - } - childIndex.splice(node, 1); - break; - } - } else renderElement(request, task, keyPath, type, props, ref); + key = node.key; + node = node.props; + var refProp = node.ref; + refProp = void 0 !== refProp ? refProp : null; + var debugTask = enableOwnerStacks ? task.debugTask : null, + name = getComponentNameFromType(type); + key = null == key ? (-1 === childIndex ? 0 : childIndex) : key; + var keyPath = [task.keyPath, name, key]; + null !== task.replay + ? debugTask + ? debugTask.run( + replayElement.bind( + null, + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + ) + : replayElement( + request, + task, + keyPath, + name, + key, + childIndex, + type, + node, + refProp, + task.replay + ) + : debugTask + ? debugTask.run( + renderElement.bind( + null, + request, + task, + keyPath, + type, + node, + refProp + ) + ) + : renderElement(request, task, keyPath, type, node, refProp); return; case REACT_PORTAL_TYPE: throw Error( @@ -5758,21 +5899,20 @@ __DEV__ && return; } null === node || "object" !== typeof node - ? (props = null) - : ((childNodes = + ? (key = null) + : ((type = (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) || node["@@iterator"]), - (props = "function" === typeof childNodes ? childNodes : null)); - if (props && (childNodes = props.call(node))) { - if (childNodes === node) { + (key = "function" === typeof type ? type : null)); + if (key && (type = key.call(node))) { + if (type === node) { if ( -1 !== childIndex || null === task.componentStack || "function" !== typeof task.componentStack.type || "[object GeneratorFunction]" !== Object.prototype.toString.call(task.componentStack.type) || - "[object Generator]" !== - Object.prototype.toString.call(childNodes) + "[object Generator]" !== Object.prototype.toString.call(type) ) didWarnAboutGenerators || error$jscomp$2( @@ -5780,18 +5920,18 @@ __DEV__ && ), (didWarnAboutGenerators = !0); } else - node.entries !== props || + node.entries !== key || didWarnAboutMaps || (error$jscomp$2( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), (didWarnAboutMaps = !0)); - node = childNodes.next(); + node = type.next(); if (!node.done) { - props = []; - do props.push(node.value), (node = childNodes.next()); + key = []; + do key.push(node.value), (node = type.next()); while (!node.done); - renderChildrenArray(request, task, props, childIndex); + renderChildrenArray(request, task, key, childIndex); } return; } @@ -5812,39 +5952,39 @@ __DEV__ && node._currentValue2, childIndex ); - childIndex = Object.prototype.toString.call(node); + request = Object.prototype.toString.call(node); throw Error( "Objects are not valid as a React child (found: " + - ("[object Object]" === childIndex + ("[object Object]" === request ? "object with keys {" + Object.keys(node).join(", ") + "}" - : childIndex) + + : request) + "). If you meant to render a collection of children, use an array instead." ); } "string" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : "number" === typeof node || "bigint" === typeof node - ? ((childIndex = task.blockedSegment), - null !== childIndex && - (childIndex.lastPushedText = pushTextInstance( - childIndex.chunks, + ? ((task = task.blockedSegment), + null !== task && + (task.lastPushedText = pushTextInstance( + task.chunks, "" + node, request.renderState, - childIndex.lastPushedText + task.lastPushedText ))) : ("function" === typeof node && - ((childIndex = node.displayName || node.name || "Component"), + ((request = node.displayName || node.name || "Component"), error$jscomp$2( "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.", - childIndex, - childIndex + request, + request )), "symbol" === typeof node && error$jscomp$2( @@ -5853,9 +5993,11 @@ __DEV__ && )); } } - function renderChildrenArray(request$jscomp$0, task, children, childIndex) { + function renderChildrenArray(request, task, children, childIndex) { var prevKeyPath = task.keyPath, - previousComponentStack = task.componentStack; + previousComponentStack = task.componentStack, + previousDebugTask = null; + enableOwnerStacks && (previousDebugTask = task.debugTask); pushServerComponentStack(task, task.node._debugInfo); if ( -1 !== childIndex && @@ -5873,7 +6015,7 @@ __DEV__ && node = node[3]; task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 }; try { - renderChildrenArray(request$jscomp$0, task, children, -1); + renderChildrenArray(request, task, children, -1); if ( 1 === task.replay.pendingTasks && 0 < task.replay.nodes.length @@ -5890,14 +6032,25 @@ __DEV__ && ) throw x; task.replay.pendingTasks--; - children = getThrownInfo(task.componentStack); - erroredReplay( - request$jscomp$0, - task.blockedBoundary, - x, + var thrownInfo = getThrownInfo(task.componentStack); + children = task.blockedBoundary; + var error = x, + resumeSlots = node; + node = logRecoverableError( + request, + error, + thrownInfo, + enableOwnerStacks ? task.debugTask : null + ); + abortRemainingReplayNodes( + request, children, childIndex, - node + resumeSlots, + error, + node, + thrownInfo, + !1 ); } task.replay = replay; @@ -5907,6 +6060,7 @@ __DEV__ && } task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); return; } replay = task.treeContext; @@ -5915,98 +6069,98 @@ __DEV__ && null !== task.replay && ((j = task.replay.slots), null !== j && "object" === typeof j) ) { - for (childIndex = 0; childIndex < replayNodes; childIndex++) { - node = children[childIndex]; - task.treeContext = pushTreeContext(replay, replayNodes, childIndex); - var resumeSegmentID = j[childIndex]; - "number" === typeof resumeSegmentID - ? (resumeNode( - request$jscomp$0, - task, - resumeSegmentID, - node, - childIndex - ), - delete j[childIndex]) - : renderNode(request$jscomp$0, task, node, childIndex); - } + for (childIndex = 0; childIndex < replayNodes; childIndex++) + (node = children[childIndex]), + (task.treeContext = pushTreeContext( + replay, + replayNodes, + childIndex + )), + (error = j[childIndex]), + "number" === typeof error + ? (resumeNode(request, task, error, node, childIndex), + delete j[childIndex]) + : renderNode(request, task, node, childIndex); task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); return; } for (j = 0; j < replayNodes; j++) { childIndex = children[j]; - var request = request$jscomp$0; + resumeSlots = request; node = task; - resumeSegmentID = childIndex; + error = childIndex; if ( - null !== resumeSegmentID && - "object" === typeof resumeSegmentID && - (resumeSegmentID.$$typeof === REACT_ELEMENT_TYPE || - resumeSegmentID.$$typeof === REACT_PORTAL_TYPE) && - resumeSegmentID._store && - ((!resumeSegmentID._store.validated && null == resumeSegmentID.key) || - 2 === resumeSegmentID._store.validated) + null !== error && + "object" === typeof error && + (error.$$typeof === REACT_ELEMENT_TYPE || + error.$$typeof === REACT_PORTAL_TYPE) && + error._store && + ((!error._store.validated && null == error.key) || + 2 === error._store.validated) ) { - if ("object" !== typeof resumeSegmentID._store) + if ("object" !== typeof error._store) throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); - resumeSegmentID._store.validated = 1; - var didWarnForKey = request.didWarnForKey; - null == didWarnForKey && - (didWarnForKey = request.didWarnForKey = new WeakSet()); - request = node.componentStack; - if (null !== request && !didWarnForKey.has(request)) { - didWarnForKey.add(request); - var componentName = getComponentNameFromType(resumeSegmentID.type); - didWarnForKey = resumeSegmentID._owner; - var parentOwner = request.owner; - request = ""; + error._store.validated = 1; + thrownInfo = resumeSlots.didWarnForKey; + null == thrownInfo && + (thrownInfo = resumeSlots.didWarnForKey = new WeakSet()); + resumeSlots = node.componentStack; + if (null !== resumeSlots && !thrownInfo.has(resumeSlots)) { + thrownInfo.add(resumeSlots); + var componentName = getComponentNameFromType(error.type); + thrownInfo = error._owner; + var parentOwner = resumeSlots.owner; + resumeSlots = ""; if (parentOwner && "undefined" !== typeof parentOwner.type) { var name = getComponentNameFromType(parentOwner.type); name && - (request = "\n\nCheck the render method of `" + name + "`."); + (resumeSlots = + "\n\nCheck the render method of `" + name + "`."); } - request || + resumeSlots || (componentName && - (request = + (resumeSlots = "\n\nCheck the top-level render call using <" + componentName + ">.")); componentName = ""; - null != didWarnForKey && - parentOwner !== didWarnForKey && + null != thrownInfo && + parentOwner !== thrownInfo && ((parentOwner = null), - "undefined" !== typeof didWarnForKey.type - ? (parentOwner = getComponentNameFromType(didWarnForKey.type)) - : "string" === typeof didWarnForKey.name && - (parentOwner = didWarnForKey.name), + "undefined" !== typeof thrownInfo.type + ? (parentOwner = getComponentNameFromType(thrownInfo.type)) + : "string" === typeof thrownInfo.name && + (parentOwner = thrownInfo.name), parentOwner && (componentName = " It was passed a child from " + parentOwner + ".")); - didWarnForKey = node.componentStack; + thrownInfo = node.componentStack; node.componentStack = { parent: node.componentStack, - type: resumeSegmentID.type, - owner: resumeSegmentID._owner, - stack: null + type: error.type, + owner: error._owner, + stack: enableOwnerStacks ? error._debugStack : null }; error$jscomp$2( 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', - request, + resumeSlots, componentName ); - node.componentStack = didWarnForKey; + node.componentStack = thrownInfo; } } task.treeContext = pushTreeContext(replay, replayNodes, j); - renderNode(request$jscomp$0, task, childIndex, j); + renderNode(request, task, childIndex, j); } task.treeContext = replay; task.keyPath = prevKeyPath; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); } function untrackBoundary(request, boundary) { request = request.trackedPostpones; @@ -6032,7 +6186,9 @@ __DEV__ && task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + enableOwnerStacks ? task.debugTask : null ); } function spawnNewSuspendedRenderTask(request, task, thenableState) { @@ -6061,7 +6217,9 @@ __DEV__ && task.context, task.treeContext, task.componentStack, - task.isFallback + task.isFallback, + emptyContextObject, + enableOwnerStacks ? task.debugTask : null ); } function renderNode(request, task, node, childIndex) { @@ -6070,6 +6228,7 @@ __DEV__ && previousKeyPath = task.keyPath, previousTreeContext = task.treeContext, previousComponentStack = task.componentStack, + previousDebugTask = enableOwnerStacks ? task.debugTask : null, segment = task.blockedSegment; if (null === segment) try { @@ -6096,6 +6255,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6108,6 +6268,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6142,6 +6303,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6154,6 +6316,7 @@ __DEV__ && task.keyPath = previousKeyPath; task.treeContext = previousTreeContext; task.componentStack = previousComponentStack; + enableOwnerStacks && (task.debugTask = previousDebugTask); switchContext(previousContext); return; } @@ -6167,26 +6330,6 @@ __DEV__ && switchContext(previousContext); throw node; } - function erroredReplay( - request, - boundary, - error, - errorInfo, - replayNodes, - resumeSlots - ) { - var errorDigest = logRecoverableError(request, error, errorInfo); - abortRemainingReplayNodes( - request, - boundary, - replayNodes, - resumeSlots, - error, - errorDigest, - errorInfo, - !1 - ); - } function abortTaskSoft(task) { var boundary = task.blockedBoundary; task = task.blockedSegment; @@ -6270,14 +6413,14 @@ __DEV__ && if (13 !== request.status && request.status !== CLOSED) { boundary = task.replay; if (null === boundary) { - logRecoverableError(request, error, segment); - fatalError(request, error); + logRecoverableError(request, error, segment, null); + fatalError(request, error, segment, null); return; } boundary.pendingTasks--; 0 === boundary.pendingTasks && 0 < boundary.nodes.length && - ((task = logRecoverableError(request, error, segment)), + ((task = logRecoverableError(request, error, segment, null)), abortRemainingReplayNodes( request, null, @@ -6295,7 +6438,7 @@ __DEV__ && boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = logRecoverableError(request, error, segment)), + (task = logRecoverableError(request, error, segment, null)), (boundary.status = CLIENT_RENDERED), encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), @@ -6370,7 +6513,7 @@ __DEV__ && } } } catch (error$5) { - logRecoverableError(request, error$5, {}); + logRecoverableError(request, error$5, {}, null); } } function completeShell(request) { @@ -6442,10 +6585,10 @@ __DEV__ && request.allPendingTasks--; 0 === request.allPendingTasks && completeAll(request); } - function performWork(request$jscomp$1) { + function performWork(request$jscomp$2) { if ( - request$jscomp$1.status !== CLOSED && - 13 !== request$jscomp$1.status + request$jscomp$2.status !== CLOSED && + 13 !== request$jscomp$2.status ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; @@ -6453,16 +6596,16 @@ __DEV__ && var prevAsyncDispatcher = ReactSharedInternals.A; ReactSharedInternals.A = DefaultAsyncDispatcher; var prevRequest = currentRequest; - currentRequest = request$jscomp$1; + currentRequest = request$jscomp$2; var prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack; ReactSharedInternals.getCurrentStack = getCurrentStackInDEV; var prevResumableState = currentResumableState; - currentResumableState = request$jscomp$1.resumableState; + currentResumableState = request$jscomp$2.resumableState; try { - var pingedTasks = request$jscomp$1.pingedTasks, + var pingedTasks = request$jscomp$2.pingedTasks, i; for (i = 0; i < pingedTasks.length; i++) { - var request = request$jscomp$1, + var request = request$jscomp$2, task = pingedTasks[i], segment = task.blockedSegment; if (null === segment) { @@ -6510,16 +6653,32 @@ __DEV__ && } else { request.replay.pendingTasks--; request.abortSet.delete(request); - var errorInfo = getThrownInfo(request.componentStack); - erroredReplay( - request$jscomp$0, - request.blockedBoundary, - 12 === request$jscomp$0.status - ? request$jscomp$0.fatalError - : x, - errorInfo, - request.replay.nodes, - request.replay.slots + var errorInfo = getThrownInfo(request.componentStack), + errorDigest = void 0, + request$jscomp$1 = request$jscomp$0, + boundary = request.blockedBoundary, + error = + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, + errorInfo$jscomp$0 = errorInfo, + replayNodes = request.replay.nodes, + resumeSlots = request.replay.slots; + errorDigest = logRecoverableError( + request$jscomp$1, + error, + errorInfo$jscomp$0, + enableOwnerStacks ? request.debugTask : null + ); + abortRemainingReplayNodes( + request$jscomp$1, + boundary, + replayNodes, + resumeSlots, + error, + errorDigest, + errorInfo$jscomp$0, + !1 ); request$jscomp$0.pendingRootTasks--; 0 === request$jscomp$0.pendingRootTasks && @@ -6532,97 +6691,108 @@ __DEV__ && currentTaskInDEV = prevTaskInDEV; } } - } else { - request$jscomp$0 = prevTaskInDEV = void 0; - var task$jscomp$0 = task, - segment$jscomp$0 = segment; - if (segment$jscomp$0.status === PENDING) { - segment$jscomp$0.status = 6; - switchContext(task$jscomp$0.context); - request$jscomp$0 = currentTaskInDEV; - currentTaskInDEV = task$jscomp$0; - var childrenLength = segment$jscomp$0.children.length, - chunkLength = segment$jscomp$0.chunks.length; - try { - retryNode(request, task$jscomp$0), - pushSegmentFinale( - segment$jscomp$0.chunks, - request.renderState, - segment$jscomp$0.lastPushedText, - segment$jscomp$0.textEmbedded - ), - task$jscomp$0.abortSet.delete(task$jscomp$0), - (segment$jscomp$0.status = COMPLETED), - finishedTask( - request, - task$jscomp$0.blockedBoundary, - segment$jscomp$0 - ); - } catch (thrownValue) { - resetHooksState(); - segment$jscomp$0.children.length = childrenLength; - segment$jscomp$0.chunks.length = chunkLength; - var x$jscomp$0 = - thrownValue === SuspenseException - ? getSuspendedThenable() - : 12 === request.status - ? request.fatalError - : thrownValue; - if ( - "object" === typeof x$jscomp$0 && - null !== x$jscomp$0 && - "function" === typeof x$jscomp$0.then - ) { - segment$jscomp$0.status = PENDING; - task$jscomp$0.thenableState = - getThenableStateAfterSuspending(); - var ping$jscomp$0 = task$jscomp$0.ping; - x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); - } else { - var errorInfo$jscomp$0 = getThrownInfo( - task$jscomp$0.componentStack - ); - task$jscomp$0.abortSet.delete(task$jscomp$0); - segment$jscomp$0.status = 4; - var boundary = task$jscomp$0.blockedBoundary; - prevTaskInDEV = logRecoverableError( - request, - x$jscomp$0, - errorInfo$jscomp$0 - ); - null === boundary - ? fatalError(request, x$jscomp$0) - : (boundary.pendingTasks--, - boundary.status !== CLIENT_RENDERED && - ((boundary.status = CLIENT_RENDERED), - encodeErrorForBoundary( - boundary, - prevTaskInDEV, - x$jscomp$0, - errorInfo$jscomp$0, - !1 - ), - untrackBoundary(request, boundary), - boundary.parentFlushed && - request.clientRenderedBoundaries.push(boundary))); - request.allPendingTasks--; - 0 === request.allPendingTasks && completeAll(request); - } - } finally { - currentTaskInDEV = request$jscomp$0; + } else if ( + ((request$jscomp$0 = prevTaskInDEV = void 0), + (errorDigest = task), + (request$jscomp$1 = segment), + request$jscomp$1.status === PENDING) + ) { + request$jscomp$1.status = 6; + switchContext(errorDigest.context); + request$jscomp$0 = currentTaskInDEV; + currentTaskInDEV = errorDigest; + var childrenLength = request$jscomp$1.children.length, + chunkLength = request$jscomp$1.chunks.length; + try { + retryNode(request, errorDigest), + pushSegmentFinale( + request$jscomp$1.chunks, + request.renderState, + request$jscomp$1.lastPushedText, + request$jscomp$1.textEmbedded + ), + errorDigest.abortSet.delete(errorDigest), + (request$jscomp$1.status = COMPLETED), + finishedTask( + request, + errorDigest.blockedBoundary, + request$jscomp$1 + ); + } catch (thrownValue) { + resetHooksState(); + request$jscomp$1.children.length = childrenLength; + request$jscomp$1.chunks.length = chunkLength; + var x$jscomp$0 = + thrownValue === SuspenseException + ? getSuspendedThenable() + : 12 === request.status + ? request.fatalError + : thrownValue; + if ( + "object" === typeof x$jscomp$0 && + null !== x$jscomp$0 && + "function" === typeof x$jscomp$0.then + ) { + request$jscomp$1.status = PENDING; + errorDigest.thenableState = getThenableStateAfterSuspending(); + var ping$jscomp$0 = errorDigest.ping; + x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0); + } else { + var errorInfo$jscomp$1 = getThrownInfo( + errorDigest.componentStack + ); + errorDigest.abortSet.delete(errorDigest); + request$jscomp$1.status = 4; + var boundary$jscomp$0 = errorDigest.blockedBoundary, + debugTask = enableOwnerStacks + ? errorDigest.debugTask + : null; + prevTaskInDEV = logRecoverableError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ); + null === boundary$jscomp$0 + ? fatalError( + request, + x$jscomp$0, + errorInfo$jscomp$1, + debugTask + ) + : (boundary$jscomp$0.pendingTasks--, + boundary$jscomp$0.status !== CLIENT_RENDERED && + ((boundary$jscomp$0.status = CLIENT_RENDERED), + encodeErrorForBoundary( + boundary$jscomp$0, + prevTaskInDEV, + x$jscomp$0, + errorInfo$jscomp$1, + !1 + ), + untrackBoundary(request, boundary$jscomp$0), + boundary$jscomp$0.parentFlushed && + request.clientRenderedBoundaries.push( + boundary$jscomp$0 + ))); + request.allPendingTasks--; + 0 === request.allPendingTasks && completeAll(request); } + } finally { + currentTaskInDEV = request$jscomp$0; } } } pingedTasks.splice(0, i); - null !== request$jscomp$1.destination && + null !== request$jscomp$2.destination && flushCompletedQueues( - request$jscomp$1, - request$jscomp$1.destination + request$jscomp$2, + request$jscomp$2.destination ); } catch (error$6) { - logRecoverableError(request$jscomp$1, error$6, {}), - fatalError(request$jscomp$1, error$6); + (pingedTasks = {}), + logRecoverableError(request$jscomp$2, error$6, pingedTasks, null), + fatalError(request$jscomp$2, error$6, pingedTasks, null); } finally { (currentResumableState = prevResumableState), (ReactSharedInternals.H = prevDispatcher), @@ -7257,8 +7427,9 @@ __DEV__ && try { flushCompletedQueues(request, destination); } catch (error$7) { - logRecoverableError(request, error$7, {}), - fatalError(request, error$7); + (destination = {}), + logRecoverableError(request, error$7, destination, null), + fatalError(request, error$7, destination, null); } } } @@ -7284,7 +7455,9 @@ __DEV__ && null !== request.destination && flushCompletedQueues(request, request.destination); } catch (error$8) { - logRecoverableError(request, error$8, {}), fatalError(request, error$8); + (reason = {}), + logRecoverableError(request, error$8, reason, null), + fatalError(request, error$8, reason, null); } } function onError() {} @@ -7344,7 +7517,10 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableUseResourceEffectHook = + dynamicFeatureFlags.enableUseResourceEffectHook, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -7362,11 +7538,9 @@ __DEV__ && REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, isArrayImpl = Array.isArray, jsxPropsParents = new WeakMap(), @@ -8708,28 +8882,21 @@ __DEV__ && ); return getServerSnapshot(); }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; }, + useActionState: useActionState, + useFormState: useActionState, useHostTransitionStatus: function () { resolveCurrentlyRenderingComponent(); return NotPending; }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; + useEffectEvent: function () { + return throwOnUseEffectEventCall; } }; - HooksDispatcher.useFormState = useActionState; - HooksDispatcher.useActionState = useActionState; + enableUseResourceEffectHook && (HooksDispatcher.useResourceEffect = noop$1); var currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { @@ -8809,5 +8976,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-modern-7283a213-20241206"; + exports.version = "19.1.0-www-modern-d4287258-20241217"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 90f9766d636dd..8413be7e7ef2f 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -59,6 +59,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, + enableUseResourceEffectHook = dynamicFeatureFlags.enableUseResourceEffectHook, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -77,11 +78,9 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, isArrayImpl = Array.isArray; function murmurhash3_32_gc(key, seed) { @@ -2680,16 +2679,16 @@ function createRenderState(resumableState, generateStaticMarkup) { "\x3c/script>" ); bootstrapScriptContent = idPrefix + "P:"; - var JSCompiler_object_inline_segmentPrefix_1630 = idPrefix + "S:"; + var JSCompiler_object_inline_segmentPrefix_1627 = idPrefix + "S:"; idPrefix += "B:"; - var JSCompiler_object_inline_preconnects_1644 = new Set(), - JSCompiler_object_inline_fontPreloads_1645 = new Set(), - JSCompiler_object_inline_highImagePreloads_1646 = new Set(), - JSCompiler_object_inline_styles_1647 = new Map(), - JSCompiler_object_inline_bootstrapScripts_1648 = new Set(), - JSCompiler_object_inline_scripts_1649 = new Set(), - JSCompiler_object_inline_bulkPreloads_1650 = new Set(), - JSCompiler_object_inline_preloads_1651 = { + var JSCompiler_object_inline_preconnects_1641 = new Set(), + JSCompiler_object_inline_fontPreloads_1642 = new Set(), + JSCompiler_object_inline_highImagePreloads_1643 = new Set(), + JSCompiler_object_inline_styles_1644 = new Map(), + JSCompiler_object_inline_bootstrapScripts_1645 = new Set(), + JSCompiler_object_inline_scripts_1646 = new Set(), + JSCompiler_object_inline_bulkPreloads_1647 = new Set(), + JSCompiler_object_inline_preloads_1648 = { images: new Map(), stylesheets: new Map(), scripts: new Map(), @@ -2726,7 +2725,7 @@ function createRenderState(resumableState, generateStaticMarkup) { scriptConfig.moduleScriptResources[href] = null; scriptConfig = []; pushLinkImpl(scriptConfig, props); - JSCompiler_object_inline_bootstrapScripts_1648.add(scriptConfig); + JSCompiler_object_inline_bootstrapScripts_1645.add(scriptConfig); bootstrapChunks.push('