From 1180f1b48157a84c249241388881c3d47f02dcab Mon Sep 17 00:00:00 2001 From: syi0808 Date: Thu, 1 Aug 2024 08:25:05 -0700 Subject: [PATCH] [DevTools] Make Element Inspection Feel Snappy (#30555) There's two problems. The biggest one is that it turns out that Chrome is throttling looping timers that we're using both while polling and for batching bridge traffic. This means that bridge traffic a lot of the time just slows down to 1 second at a time. No wonder it feels sluggish. The only solution is to not use timers for this. Even when it doesn't like in Firefox the batching into 100ms still feels too sluggish. The fix I use is to batch using a microtask instead so we can still batch multiple commands sent in a single event but we never artificially slow down an interaction. I don't think we've reevaluated this for a long time since this was in the initial commit of DevTools to this repo. If it causes other issues we can follow up on those. We really shouldn't use timers for debouncing and such. In fact, React itself recommends against it because we have a better technique with scheduling in Concurrent Mode. The correct way to implement this in the bridge is using a form of back-pressure where we don't keep sending messages until we get a message back and only send the last one that matters. E.g. when moving the cursor over a the elements tab we shouldn't let the backend one-by-one move the DOM node to each one we have ever passed. We should just move to the last one we're currently hovering over. But this can't be done at the bridge layer since it doesn't know if it's a last-one-wins or imperative operation where each one needs to be sent. It needs to be done higher. I'm not currently seeing any perf problems with this new approach but I'm curious on React Native or some thing. RN might need the back-pressure approach. That can be a follow up if we ever find a test case. Finally, the other problem is that we use a Suspense boundary around the Element Inspection. Suspense boundaries are for things that are expected to take a long time to load. This shows a loading state immediately. To avoid flashing when it ends up being fast, React throttles the reveal to 200ms. This means that we take a minimum of 200ms to show the props. The way to show fast async data in React is using a Transition (either using startTransition or useDeferredValue). This lets the old value remaining in place while we're loading the next one. We already implement this using `inspectedElementID` which is the async one. It would be more idiomatic to implement this with useDeferredValue rather than the reducer we have now but same principle. We were just using the wrong ID in a few places so when it synchronously updated they suspended. So I just made them use the inspectedElementID instead. Then I can simply remove the Suspense boundary. Now the selection updates in the tree view synchronously and the sidebar lags a frame or two but it feels instant. It doesn't flash to white between which is key. DiffTrain build for [4ea12a11d1848c1398f9a8babcfbcd51e150f1d9](https://github.com/facebook/react/commit/4ea12a11d1848c1398f9a8babcfbcd51e150f1d9) --- .../facebook-www/JSXDEVRuntime-dev.classic.js | 31 +- .../facebook-www/JSXDEVRuntime-dev.modern.js | 31 +- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 79 +- compiled/facebook-www/React-dev.modern.js | 79 +- compiled/facebook-www/React-prod.classic.js | 14 +- compiled/facebook-www/React-prod.modern.js | 14 +- .../facebook-www/React-profiling.classic.js | 14 +- .../facebook-www/React-profiling.modern.js | 14 +- compiled/facebook-www/ReactART-dev.classic.js | 2054 ++++----- compiled/facebook-www/ReactART-dev.modern.js | 1994 ++++---- .../facebook-www/ReactART-prod.classic.js | 1239 +++-- compiled/facebook-www/ReactART-prod.modern.js | 1254 +++-- compiled/facebook-www/ReactDOM-dev.classic.js | 4062 ++++++++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 2755 ++++++----- .../facebook-www/ReactDOM-prod.classic.js | 1116 +++-- compiled/facebook-www/ReactDOM-prod.modern.js | 1117 +++-- .../ReactDOM-profiling.classic.js | 1714 ++++--- .../facebook-www/ReactDOM-profiling.modern.js | 1687 ++++--- .../ReactDOMServer-dev.classic.js | 541 ++- .../facebook-www/ReactDOMServer-dev.modern.js | 824 ++-- .../ReactDOMServer-prod.classic.js | 563 ++- .../ReactDOMServer-prod.modern.js | 517 ++- .../ReactDOMServerStreaming-dev.modern.js | 784 ++-- .../ReactDOMServerStreaming-prod.modern.js | 455 +- .../ReactDOMTesting-dev.classic.js | 4064 ++++++++--------- .../ReactDOMTesting-dev.modern.js | 2757 ++++++----- .../ReactDOMTesting-prod.classic.js | 1118 +++-- .../ReactDOMTesting-prod.modern.js | 1058 ++--- .../ReactFreshRuntime-dev.classic.js | 16 - .../ReactFreshRuntime-dev.modern.js | 16 - .../ReactReconciler-dev.classic.js | 1805 ++++---- .../ReactReconciler-dev.modern.js | 1719 ++++--- .../ReactReconciler-prod.classic.js | 976 ++-- .../ReactReconciler-prod.modern.js | 921 ++-- .../ReactTestRenderer-dev.classic.js | 1282 +++--- .../ReactTestRenderer-dev.modern.js | 1282 +++--- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../facebook-www/eslint-plugin-react-hooks.js | 88 +- 41 files changed, 19378 insertions(+), 20684 deletions(-) diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js index f26a60ee3f39f..52f93e85cb663 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -185,8 +185,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -598,13 +598,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -638,11 +640,7 @@ __DEV__ && hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -813,7 +811,6 @@ __DEV__ && disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -867,9 +864,7 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, - didWarnAboutKeySpread = {}, + var didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function ( diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js index 4c6aafb93fc27..6f6fd917767f1 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js @@ -185,8 +185,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -595,13 +595,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -635,11 +637,7 @@ __DEV__ && hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -810,7 +808,6 @@ __DEV__ && disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing; dynamicFeatureFlags = dynamicFeatureFlags.renameElementSymbol; @@ -863,9 +860,7 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, - didWarnAboutKeySpread = {}, + var didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function ( diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 5050ef78f3306..d97cdd083f849 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0117239720b6ea830376f4f8605957ccae8b3735 +4ea12a11d1848c1398f9a8babcfbcd51e150f1d9 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 5050ef78f3306..d97cdd083f849 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -0117239720b6ea830376f4f8605957ccae8b3735 +4ea12a11d1848c1398f9a8babcfbcd51e150f1d9 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index e3ac833be7175..bab2be536e834 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -272,8 +272,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -660,13 +660,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error$jscomp$0( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -700,11 +702,7 @@ __DEV__ && hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -1202,7 +1200,6 @@ __DEV__ && disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -1319,9 +1316,7 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, - didWarnAboutKeySpread = {}, + var didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, @@ -1688,13 +1683,13 @@ __DEV__ && isArrayImpl(type) ? (typeString = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); + ? ((typeString = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (i = + " Did you accidentally export a JSX literal instead of a component?")) + : (typeString = typeof type); error$jscomp$0( "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, @@ -1769,18 +1764,18 @@ __DEV__ && "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." ) : "function" !== typeof render - ? error$jscomp$0( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - error$jscomp$0( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); + ? error$jscomp$0( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + error$jscomp$0( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); null != render && null != render.defaultProps && error$jscomp$0( @@ -1926,6 +1921,14 @@ __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); @@ -1998,7 +2001,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-01172397-20240716"; + exports.version = "19.0.0-www-classic-4ea12a11-20240801"; "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 73ecb8f709f21..633911070c4b8 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -272,8 +272,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -657,13 +657,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error$jscomp$0( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -697,11 +699,7 @@ __DEV__ && hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -1199,7 +1197,6 @@ __DEV__ && disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -1315,9 +1312,7 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, - didWarnAboutKeySpread = {}, + var didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, @@ -1668,13 +1663,13 @@ __DEV__ && isArrayImpl(type) ? (typeString = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); + ? ((typeString = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (i = + " Did you accidentally export a JSX literal instead of a component?")) + : (typeString = typeof type); error$jscomp$0( "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, @@ -1749,18 +1744,18 @@ __DEV__ && "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." ) : "function" !== typeof render - ? error$jscomp$0( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - error$jscomp$0( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); + ? error$jscomp$0( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + error$jscomp$0( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); null != render && null != render.defaultProps && error$jscomp$0( @@ -1906,6 +1901,14 @@ __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); @@ -1978,7 +1981,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-01172397-20240716"; + exports.version = "19.0.0-www-modern-4ea12a11-20240801"; "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 2e5833a422ca8..b0f5e30336f79 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -14,7 +14,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -97,8 +96,6 @@ function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; return { @@ -114,11 +111,7 @@ function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -608,6 +601,9 @@ 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); @@ -669,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-01172397-20240716"; +exports.version = "19.0.0-www-classic-4ea12a11-20240801"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 17097526ea39b..a93c49616e70d 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -14,7 +14,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -97,8 +96,6 @@ function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; return { @@ -114,11 +111,7 @@ function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -608,6 +601,9 @@ 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); @@ -669,4 +665,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-01172397-20240716"; +exports.version = "19.0.0-www-modern-4ea12a11-20240801"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index e63aa87d0d726..36773c9d3d07d 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -18,7 +18,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -101,8 +100,6 @@ function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; return { @@ -118,11 +115,7 @@ function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -612,6 +605,9 @@ 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); @@ -673,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-01172397-20240716"; +exports.version = "19.0.0-www-classic-4ea12a11-20240801"; "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 1059c9313545e..053dd5157ab23 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -18,7 +18,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -101,8 +100,6 @@ function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; return { @@ -118,11 +115,7 @@ function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ("ref" in config || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && @@ -612,6 +605,9 @@ 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); @@ -673,7 +669,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-01172397-20240716"; +exports.version = "19.0.0-www-modern-4ea12a11-20240801"; "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 4a312297b59f6..edca2c20ad33f 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -72,20 +72,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork()); @@ -392,8 +378,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -549,28 +535,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -658,96 +622,6 @@ __DEV__ && } return 3 === node.tag ? nearestMounted : null; } - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); - } - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); - } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; - } - function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; - } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -773,8 +647,8 @@ __DEV__ && ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } function injectInternals(internals) { @@ -789,13 +663,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -855,21 +723,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -928,41 +781,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -978,21 +830,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -1023,25 +875,25 @@ __DEV__ && return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1065,11 +917,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1085,34 +937,23 @@ __DEV__ && originallyAttemptedLanes ) { if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); + root = root.pendingLanes & -536870913; + return 0 !== root ? root : root & 536870912 ? 536870912 : 0; } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -1143,7 +984,7 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; } @@ -1156,8 +997,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1289,14 +1130,14 @@ __DEV__ && null != props.scaleX ? props.scaleX : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; var scaleY = null != props.scaleY ? props.scaleY : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; pooledTransform .transformTo(1, 0, 0, 1, 0, 0) .move(props.x || 0, props.y || 0) @@ -1386,12 +1227,12 @@ __DEV__ && JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1407,6 +1248,9 @@ __DEV__ && "string" === typeof props.children || "number" === typeof props.children ); } + function getInstanceFromNode() { + return null; + } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1714,10 +1558,10 @@ __DEV__ && : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } function describeTextDiff(clientText, serverProps, indent) { var maxLength = 120 - 2 * indent; @@ -1811,10 +1655,10 @@ __DEV__ && return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } function describeExpandedElement(type, props, rowPrefix) { var remainingRowLength = 120 - rowPrefix.length - type.length, @@ -1832,17 +1676,17 @@ __DEV__ && return 0 === properties.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } function describePropertiesDiff(clientObject, serverObject, indent) { var properties = "", @@ -2065,16 +1909,16 @@ __DEV__ && )), indent++) : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent - )), - indent++); + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); var propName = ""; i = node.fiber.child; for ( @@ -2177,7 +2021,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -2228,9 +2072,7 @@ __DEV__ && ? workInProgressRootRenderLanes$jscomp$0 : 0 ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && + 0 !== (workInProgressRootRenderLanes$jscomp$0 & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot( root, @@ -2260,8 +2102,7 @@ __DEV__ && null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev)) : ((prev = root), - 0 !== (nextLanes & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } currentEventTransitionLane = 0; @@ -2275,7 +2116,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -2306,12 +2147,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -2481,10 +2322,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -2580,7 +2418,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -3150,7 +2988,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3231,7 +3069,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3328,7 +3166,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3805,7 +3643,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3920,12 +3758,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -4107,8 +3945,8 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = 0 !== (workInProgress.mode & 8); var children = callComponentInDEV(Component, props, secondArg); @@ -4162,9 +4000,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -4297,6 +4134,34 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + 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 }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -4428,7 +4293,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -4545,12 +4410,11 @@ __DEV__ && ), (didWarnUncachedGetSnapshot = !0)); } - cachedSnapshot = workInProgressRoot; - if (null === cachedSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) || + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -4615,12 +4479,11 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -4654,13 +4517,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -4783,8 +4646,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -4800,8 +4663,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -5160,7 +5023,7 @@ __DEV__ && function mountDeferredValueImpl(hook, value, initialValue) { return enableUseDeferredValueInitialArg && void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) + 0 === (renderLanes & 1073741824) ? ((hook.memoizedState = initialValue), (hook = requestDeferredLane()), (currentlyRenderingFiber$1.lanes |= hook), @@ -5176,7 +5039,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -5222,11 +5085,11 @@ __DEV__ && ); dispatchSetState(fiber, queue, thenableForFinishedState); } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { + } catch (error$9) { dispatchSetState(fiber, queue, { then: function () {}, status: "rejected", - reason: error$5 + reason: error$9 }); } finally { (currentUpdatePriority = previousPriority), @@ -5274,8 +5137,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -5392,7 +5254,7 @@ __DEV__ && null === workInProgressRoot && finishQueueingConcurrentUpdates(); return; } - } catch (error$6) { + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } @@ -5429,7 +5291,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -5445,11 +5307,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -5468,7 +5330,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5635,12 +5497,12 @@ __DEV__ && void 0 === context ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", @@ -6072,12 +5934,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -6098,16 +5957,14 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || 0 !== (sourceFiber.mode & 1) || @@ -6140,20 +5997,20 @@ __DEV__ && ? ((currentSourceFiber.flags |= 65536), (currentSourceFiber.lanes = rootRenderLanes)) : currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(SyncLane)), - (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, SyncLane)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= SyncLane)); + ? (currentSourceFiber.flags |= 65536) + : ((currentSourceFiber.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)); value === noopSuspenseyCommitThenable ? (currentSourceFiber.flags |= 16384) : ((returnFiber = currentSourceFiber.updateQueue), @@ -6434,7 +6291,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -6592,7 +6449,7 @@ __DEV__ && ); } if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) - if (0 !== (renderLanes & OffscreenLane)) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -6606,8 +6463,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = - OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -6663,8 +6519,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -6738,7 +6593,7 @@ __DEV__ && : contextStackCursor$1.current; context = getMaskedContext(workInProgress, context); } - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, @@ -6766,7 +6621,7 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -6827,7 +6682,7 @@ __DEV__ && isContextProvider(Component) ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -6962,8 +6817,7 @@ __DEV__ && unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -6985,8 +6839,7 @@ __DEV__ && newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -7271,47 +7124,47 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - showFallback, - 0, - null - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + showFallback, + 0, + null + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isSuspenseInstanceFallback()) @@ -7345,8 +7198,7 @@ __DEV__ && renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, @@ -7359,18 +7211,17 @@ __DEV__ && JSCompiler_temp = workInProgressRoot; if (null !== JSCompiler_temp) { nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & SyncUpdateLanes)) - nextProps = SyncHydrationLane; + if (0 !== (nextProps & 42)) nextProps = 1; else switch (nextProps) { - case SyncLane: - nextProps = SyncHydrationLane; + case 2: + nextProps = 1; break; - case InputContinuousLane: - nextProps = InputContinuousHydrationLane; + case 8: + nextProps = 4; break; - case DefaultLane: - nextProps = DefaultHydrationLane; + case 32: + nextProps = 16; break; case 128: case 256: @@ -7391,10 +7242,10 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - nextProps = TransitionHydrationLane; + nextProps = 64; break; - case IdleLane: - nextProps = IdleHydrationLane; + case 268435456: + nextProps = 134217728; break; default: nextProps = 0; @@ -7506,16 +7357,17 @@ __DEV__ && retryQueue: null }) : currentFallbackChildFragment === primaryChildProps - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== primaryChildProps - ? primaryChildProps.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)))); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = + didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -7843,7 +7695,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -7871,12 +7723,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -7953,8 +7802,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -8159,9 +8007,10 @@ __DEV__ && current.$$typeof === REACT_LAZY_TYPE && (workInProgress = " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; throw Error( "Element type is invalid. Received a promise that resolves to: " + - current + + renderLanes + ". Lazy element type must resolve to a class or function." + workInProgress ); @@ -8219,7 +8068,12 @@ __DEV__ && var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== prevSibling.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); prevSibling = nextProps.element; prevSibling === returnFiber @@ -8259,16 +8113,7 @@ __DEV__ && null, renderLanes )), - (HostTransitionContext._currentValue2 = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = prevSibling)), markRef(current, workInProgress), reconcileChildren( current, @@ -8359,48 +8204,27 @@ __DEV__ && workInProgress.child ); case 10: - a: { - returnFiber = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = prevSibling.value; + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, returnFiber, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if ( - nextProps.children === prevSibling.children && - !didPerformWorkStackCursor.current - ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, prevSibling.children, renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + ), + workInProgress.child + ); case 9: return ( enableRenderableContext @@ -8413,7 +8237,7 @@ __DEV__ && error$jscomp$0( "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." ), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (prevSibling = readContext(prevSibling)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), @@ -8477,7 +8301,7 @@ __DEV__ && isContextProvider(returnFiber) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); constructClassInstance(workInProgress, returnFiber, prevSibling); mountClassInstance( workInProgress, @@ -8538,7 +8362,7 @@ __DEV__ && ); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (returnFiber = readContext(CacheContext)), null === current ? ((prevSibling = peekCacheFromPool()), @@ -8576,10 +8400,11 @@ __DEV__ && : ((returnFiber = nextProps.cache), pushProvider(workInProgress, CacheContext, returnFiber), returnFiber !== prevSibling.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -8682,147 +8507,80 @@ __DEV__ && "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; 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); scheduleContextWorkOnParentPath( - fiber.return, + list.return, renderLanes, workInProgress ); - list.lanes |= renderLanes; - break; + forcePropagateEntireTree || (nextFiber = null); + break a; } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } - fiber = nextFiber; - } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -8831,85 +8589,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + 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) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -8918,9 +8681,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -8936,7 +8698,7 @@ __DEV__ && ); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -8983,16 +8745,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -9099,7 +8861,11 @@ __DEV__ && : null; } function containsNode() { - throw Error("Not implemented."); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = getInstanceFromScope(); @@ -9119,7 +8885,7 @@ __DEV__ && ? (workInProgress.flags |= 4) : workInProgress.flags & 16384 && ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { @@ -9542,7 +9308,7 @@ __DEV__ && 2 * now$1() - fallthroughToNormalSuspensePath.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(fallthroughToNormalSuspensePath, !1), @@ -9600,7 +9366,7 @@ __DEV__ && : newProps && (workInProgress.flags |= 8192)), !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) ? bubbleProperties(workInProgress) - : 0 !== (renderLanes & OffscreenLane) && + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -9807,25 +9573,25 @@ __DEV__ && nearestMountedAncestor, instance ) { - try { - if ( - ((instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - )), - (instance.state = current.memoizedState), - shouldProfile(current)) - ) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); - } catch (error$7) { - captureCommitPhaseError(current, nearestMountedAncestor, error$7); - } + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startLayoutEffectTimer(), + callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ); } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -9859,8 +9625,8 @@ __DEV__ && ), (ref.current = instanceToUse); } - } catch (error$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + } catch (error$11) { + captureCommitPhaseError(current, nearestMountedAncestor, error$11); } } function safelyDetachRef(current, nearestMountedAncestor) { @@ -9876,8 +9642,8 @@ __DEV__ && recordLayoutEffectDuration(current); } else refCleanup(); - } catch (error$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); + } catch (error$12) { + captureCommitPhaseError(current, nearestMountedAncestor, error$12); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9892,18 +9658,11 @@ __DEV__ && recordLayoutEffectDuration(current); } else ref(null); - } catch (error$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + } catch (error$13) { + captureCommitPhaseError(current, nearestMountedAncestor, error$13); } else ref.current = null; } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); - } - } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; for (nextEffect = firstChild; null !== nextEffect; ) { @@ -9921,8 +9680,8 @@ __DEV__ && root = nextEffect; try { runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$12) { - captureCommitPhaseError(root, root.return, error$12); + } catch (error$14) { + captureCommitPhaseError(root, root.return, error$14); } firstChild = root.sibling; if (null !== firstChild) { @@ -10060,7 +9819,7 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -10101,11 +9860,8 @@ __DEV__ && injectedProfilingHooks.markComponentLayoutEffectMountStarted( finishedWork )); - var create = effect.create; (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; + var destroy = callCreateInDEV(effect); (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); enableSchedulingProfiler && ((flags & Passive) !== NoFlags @@ -10120,27 +9876,27 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = + if (void 0 !== destroy && "function" !== typeof destroy) { + var hookName = 0 !== (effect.tag & Layout) ? "useLayoutEffect" : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), + ? "useInsertionEffect" + : "useEffect"; error$jscomp$0( "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create + hookName, + null === destroy ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + create - )); + : "function" === typeof destroy.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + destroy + ); + } } effect = effect.next; } while (effect !== updateQueue); @@ -10183,15 +9939,15 @@ __DEV__ && try { startLayoutEffectTimer(), commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } catch (error$15) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$15); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); } } function commitClassCallbacks(finishedWork) { @@ -10213,8 +9969,8 @@ __DEV__ && )); try { commitCallbacks(updateQueue, instance); - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); + } catch (error$17) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$17); } } } @@ -10257,8 +10013,8 @@ __DEV__ && } parentFiber = parentFiber.return; } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } catch (error$19) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$19); } } function commitLayoutEffectOnFiber( @@ -10288,42 +10044,24 @@ __DEV__ && ); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )), - shouldProfile(finishedWork)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidMountInDEV(finishedWork, finishedRoot), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidMountInDEV(finishedWork, finishedRoot); else { committedLanes = resolveClassComponentProps( finishedWork.type, @@ -10344,36 +10082,23 @@ __DEV__ && "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( + finishedRoot, committedLanes, prevState, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$18 + finishedRoot, + committedLanes, + prevState, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); @@ -10400,11 +10125,11 @@ __DEV__ && } try { commitCallbacks(flags, finishedRoot); - } catch (error$22) { + } catch (error$20) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$20 ); } } @@ -10839,7 +10564,7 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -10850,14 +10575,14 @@ __DEV__ && shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -10954,10 +10679,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -10967,10 +10692,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -11045,8 +10770,8 @@ __DEV__ && var alternate = root.alternate; null !== alternate && (alternate.return = null); root.return = null; - } catch (error$25) { - captureCommitPhaseError(childToDelete, parentFiber, error$25); + } catch (error$23) { + captureCommitPhaseError(childToDelete, parentFiber, error$23); } } if (parentFiber.subtreeFlags & 13878) @@ -11078,11 +10803,11 @@ __DEV__ && finishedWork.return ), commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error$26) { + } catch (error$24) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$26 + error$24 ); } if (shouldProfile(finishedWork)) { @@ -11093,11 +10818,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$27) { + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$27 + error$25 ); } recordLayoutEffectDuration(finishedWork); @@ -11108,11 +10833,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$28) { + } catch (error$26) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$28 + error$26 ); } } @@ -11148,11 +10873,11 @@ __DEV__ && current = null !== current ? current.memoizedProps : newProps; try { _instance2._applyProps(_instance2, newProps, current); - } catch (error$30) { + } catch (error$28) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + error$28 ); } } @@ -11203,11 +10928,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$32) { + } catch (error$30) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + error$30 ); } flags = finishedWork.updateQueue; @@ -11264,11 +10989,11 @@ __DEV__ && : ((newProps = root.memoizedProps), (null == newProps.visible || newProps.visible) && root.stateNode.show()); - } catch (error$23) { + } catch (error$21) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$23 + error$21 ); } } @@ -11364,8 +11089,8 @@ __DEV__ && "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." ); } - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); + } catch (error$31) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$31); } finishedWork.flags &= -3; } @@ -11481,11 +11206,11 @@ __DEV__ && if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); - } catch (error$34) { + } catch (error$32) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$32 ); } var updateQueue = finishedWork.updateQueue; @@ -11571,15 +11296,15 @@ __DEV__ && passiveEffectStartTime = now(); try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$35) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$35); + } catch (error$33) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$33); } recordPassiveEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); + } catch (error$34) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$34); } } function commitOffscreenPassiveMountEffects( @@ -11803,34 +11528,34 @@ __DEV__ && committedTransitions ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( + recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, - committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -11939,20 +11664,20 @@ __DEV__ && includeWorkInProgressEffects ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance4._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -12350,8 +12075,8 @@ __DEV__ && case 15: try { commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$37) { - captureCommitPhaseError(fiber, fiber.return, error$37); + } catch (error$35) { + captureCommitPhaseError(fiber, fiber.return, error$35); } break; case 1: @@ -12359,8 +12084,8 @@ __DEV__ && if ("function" === typeof instance.componentDidMount) try { instance.componentDidMount(); - } catch (error$38) { - captureCommitPhaseError(fiber, fiber.return, error$38); + } catch (error$36) { + captureCommitPhaseError(fiber, fiber.return, error$36); } } } @@ -12371,8 +12096,8 @@ __DEV__ && case 15: try { commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$39) { - captureCommitPhaseError(fiber, fiber.return, error$39); + } catch (error$37) { + captureCommitPhaseError(fiber, fiber.return, error$37); } } } @@ -12387,8 +12112,8 @@ __DEV__ && fiber, fiber.return ); - } catch (error$40) { - captureCommitPhaseError(fiber, fiber.return, error$40); + } catch (error$38) { + captureCommitPhaseError(fiber, fiber.return, error$38); } break; case 1: @@ -12408,8 +12133,8 @@ __DEV__ && fiber, fiber.return ); - } catch (error$41) { - captureCommitPhaseError(fiber, fiber.return, error$41); + } catch (error$39) { + captureCommitPhaseError(fiber, fiber.return, error$39); } } } @@ -12491,7 +12216,7 @@ __DEV__ && } function requestUpdateLane(fiber) { var mode = fiber.mode; - if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; + if (!disableLegacyMode && 0 === (mode & 1)) return 2; if ( (executionContext & RenderContext) !== NoContext && 0 !== workInProgressRootRenderLanes @@ -12508,8 +12233,8 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? OffscreenLane + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 : claimNextTransitionLane()); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); @@ -12589,7 +12314,7 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); - lane !== SyncLane || + 2 !== lane || executionContext !== NoContext || disableLegacyMode || 0 !== (fiber.mode & 1) || @@ -12611,7 +12336,7 @@ __DEV__ && ); if (0 === lanes) return null; var shouldTimeSlice = - !includesBlockingLane(root, lanes) && + 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && (disableSchedulerTimeoutInWorkLoop || !didTimeout); didTimeout = shouldTimeSlice @@ -12665,7 +12390,7 @@ __DEV__ && case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, @@ -12693,7 +12418,7 @@ __DEV__ && ); else { if ( - (lanes & RetryLanes) === lanes && + (lanes & 62914560) === lanes && (alwaysThrottleRetries || didTimeout === RootSuspended) && ((didTimeout = globalMostRecentFallbackTime + @@ -12808,7 +12533,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$42) { + } catch (error$40) { return !1; } } @@ -12830,7 +12555,7 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && + 268435456 !== updatedLanes && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext @@ -12950,9 +12675,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -12979,12 +12702,12 @@ __DEV__ && var handler = suspenseHandlerStackCursor.current; workInProgressSuspendedReason = (null !== handler && - ((workInProgressRootRenderLanes & TransitionLanes) === + ((workInProgressRootRenderLanes & 4194176) === workInProgressRootRenderLanes ? null !== shellBoundary - : ((workInProgressRootRenderLanes & RetryLanes) !== + : ((workInProgressRootRenderLanes & 62914560) !== workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & OffscreenLane)) || + 0 === (workInProgressRootRenderLanes & 536870912)) || handler !== shellBoundary)) || 0 !== (workInProgressRootSkippedLanes & 134217727) || 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -12998,10 +12721,10 @@ __DEV__ && thrownValue === SelectiveHydrationException ? SuspendedOnHydration : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; handler = workInProgress; if (null === handler) @@ -13111,8 +12834,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$43) { - handleThrow(root, thrownValue$43); + } catch (thrownValue$41) { + handleThrow(root, thrownValue$41); } while (1); lanes && root.shellSuspendCounter++; @@ -13254,8 +12977,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$44) { - handleThrow(root, thrownValue$44); + } catch (thrownValue$42) { + handleThrow(root, thrownValue$42); } while (1); resetContextDependencies(); @@ -13399,9 +13122,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$45) { + } catch (error$43) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$45); + throw ((workInProgress = returnFiber), error$43); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -13637,13 +13360,13 @@ __DEV__ && remainingLanes.value, transitions ); - 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + 0 === (pendingPassiveEffectsLanes & 3) || (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -13794,15 +13517,10 @@ __DEV__ && } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -13832,12 +13550,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -13845,7 +13559,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -13895,7 +13609,7 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && @@ -13909,7 +13623,7 @@ __DEV__ && (retryLane = disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() - : SyncLane)); + : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -14111,8 +13825,8 @@ __DEV__ && ); }) : "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT - ? IS_REACT_ACT_ENVIRONMENT - : void 0; + ? IS_REACT_ACT_ENVIRONMENT + : void 0; } function resolveFunctionForHotReloading(type) { if (null === resolveFamily) return type; @@ -14219,9 +13933,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -14236,83 +13949,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -14621,21 +14257,21 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null + ? owner.name + : null : null; fiberTag && (resolvedType += @@ -14784,18 +14420,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], identifierPrefix = 0; - identifierPrefix < TotalLanes; + 31 > identifierPrefix; identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for ( - identifierPrefix = 0; - identifierPrefix < TotalLanes; - identifierPrefix++ - ) + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) containerInfo.push(new Set()); if (disableLegacyMode) this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; @@ -14815,8 +14447,7 @@ __DEV__ && callback ) { 0 === container.tag && flushPassiveEffects(); - var rootFiber = container.current, - lane = SyncLane; + var rootFiber = container.current; if ( injectedHook && "function" === typeof injectedHook.onScheduleFiberRoot @@ -14835,7 +14466,7 @@ __DEV__ && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markRenderScheduled && - injectedProfilingHooks.markRenderScheduled(lane); + injectedProfilingHooks.markRenderScheduled(2); a: if (parentComponent) { parentComponent = parentComponent._reactInternals; b: { @@ -14890,7 +14521,7 @@ __DEV__ && "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown" )); - container = createUpdate(lane); + container = createUpdate(2); container.payload = { element: element }; callback = void 0 === callback ? null : callback; null !== callback && @@ -14900,23 +14531,26 @@ __DEV__ && callback ), (container.callback = callback)); - element = enqueueUpdate(rootFiber, container, lane); + element = enqueueUpdate(rootFiber, container, 2); null !== element && - (scheduleUpdateOnFiber(element, rootFiber, lane), - entangleTransitions(element, rootFiber, lane)); - return SyncLane; - } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; + (scheduleUpdateOnFiber(element, rootFiber, 2), + entangleTransitions(element, rootFiber, 2)); + return 2; } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -14944,8 +14578,6 @@ __DEV__ && dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, @@ -15037,30 +14669,12 @@ __DEV__ && clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, - TotalLanes = 31, - SyncHydrationLane = 1, - SyncLane = 2, - InputContinuousHydrationLane = 4, - InputContinuousLane = 8, - DefaultHydrationLane = 16, - DefaultLane = 32, - SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane, - TransitionHydrationLane = 64, - TransitionLanes = 4194176, - RetryLanes = 62914560, - SelectiveHydrationLane = 67108864, - IdleHydrationLane = 134217728, - IdleLane = 268435456, - OffscreenLane = 536870912, - DeferredLane = 1073741824, - UpdateLanes = - SyncLane | InputContinuousLane | DefaultLane | TransitionLanes, nextTransitionLane = 128, nextRetryLane = 4194304, - DiscreteEventPriority = SyncLane, - ContinuousEventPriority = InputContinuousLane, - DefaultEventPriority = DefaultLane, - IdleEventPriority = IdleLane, + DiscreteEventPriority = 2, + ContinuousEventPriority = 8, + DefaultEventPriority = 32, + IdleEventPriority = 268435456, isSuspenseInstancePending = shim$2, isSuspenseInstanceFallback = shim$2, getSuspenseInstanceFallbackErrorDetails = shim$2, @@ -15077,6 +14691,14 @@ __DEV__ && var scheduleTimeout = setTimeout, cancelTimeout = clearTimeout, currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = []; var fiberStack = []; var index$jscomp$0 = -1; @@ -15098,14 +14720,6 @@ __DEV__ && contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, @@ -15341,6 +14955,120 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, + callComponent = { + "react-stack-bottom-frame": function (Component, props, secondArg) { + var wasRendering = isRendering; + isRendering = !0; + try { + return Component(props, secondArg); + } finally { + isRendering = wasRendering; + } + } + }, + callComponentInDEV = + callComponent["react-stack-bottom-frame"].bind(callComponent), + callRender = { + "react-stack-bottom-frame": function (instance) { + var wasRendering = isRendering; + isRendering = !0; + try { + return instance.render(); + } finally { + isRendering = wasRendering; + } + } + }, + callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender), + callComponentDidMount = { + "react-stack-bottom-frame": function (finishedWork, instance) { + try { + instance.componentDidMount(); + } catch (error$2) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$2); + } + } + }, + callComponentDidMountInDEV = callComponentDidMount[ + "react-stack-bottom-frame" + ].bind(callComponentDidMount), + callComponentDidUpdate = { + "react-stack-bottom-frame": function ( + finishedWork, + instance, + prevProps, + prevState, + snapshot + ) { + try { + instance.componentDidUpdate(prevProps, prevState, snapshot); + } catch (error$3) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$3); + } + } + }, + callComponentDidUpdateInDEV = callComponentDidUpdate[ + "react-stack-bottom-frame" + ].bind(callComponentDidUpdate), + callComponentDidCatch = { + "react-stack-bottom-frame": function (instance, errorInfo) { + var stack = errorInfo.stack; + instance.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + } + }, + callComponentDidCatchInDEV = callComponentDidCatch[ + "react-stack-bottom-frame" + ].bind(callComponentDidCatch), + callComponentWillUnmount = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + instance + ) { + try { + instance.componentWillUnmount(); + } catch (error$4) { + captureCommitPhaseError(current, nearestMountedAncestor, error$4); + } + } + }, + callComponentWillUnmountInDEV = callComponentWillUnmount[ + "react-stack-bottom-frame" + ].bind(callComponentWillUnmount), + callCreate = { + "react-stack-bottom-frame": function (effect) { + var create = effect.create; + effect = effect.inst; + create = create(); + return (effect.destroy = create); + } + }, + callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate), + callDestroy = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + destroy + ) { + try { + destroy(); + } catch (error$5) { + captureCommitPhaseError(current, nearestMountedAncestor, error$5); + } + } + }, + callDestroyInDEV = + callDestroy["react-stack-bottom-frame"].bind(callDestroy), + callLazyInit = { + "react-stack-bottom-frame": function (lazy) { + var init = lazy._init; + return init(lazy._payload); + } + }, + callLazyInitInDEV = + callLazyInit["react-stack-bottom-frame"].bind(callLazyInit), thenableState$1 = null, thenableIndexCounter$1 = 0, currentDebugInfo = null, @@ -15463,6 +15191,8 @@ __DEV__ && ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; + ContextOnlyDispatcher.unstable_useContextWithBailout = + throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15606,6 +15336,14 @@ __DEV__ && 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); @@ -15743,6 +15481,12 @@ __DEV__ && 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); @@ -15873,6 +15617,14 @@ __DEV__ && 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); @@ -16003,6 +15755,14 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16163,6 +15923,15 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16320,6 +16089,13 @@ __DEV__ && 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(); @@ -16479,6 +16255,13 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; var now = Scheduler.unstable_now, commitTime = 0, layoutEffectStartTime = -1, @@ -16809,8 +16592,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateDeletePath = function (fiber, id, path) { id = findHook(fiber, id); @@ -16819,8 +16602,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { id = findHook(fiber, id); @@ -16829,20 +16612,20 @@ __DEV__ && (id.memoizedState = oldPath), (id.baseState = oldPath), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane)); + (oldPath = enqueueConcurrentRenderForLane(fiber, 2)), + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2)); }; overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename( @@ -16851,12 +16634,12 @@ __DEV__ && newPath ); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane); + oldPath = enqueueConcurrentRenderForLane(fiber, 2); + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); }; scheduleUpdate = function (fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; @@ -16996,41 +16779,33 @@ __DEV__ && }; return Text; })(React.Component); - (function (devToolsConfig) { - return injectInternals({ - bundleType: devToolsConfig.bundleType, - version: devToolsConfig.version, - rendererPackageName: devToolsConfig.rendererPackageName, - rendererConfig: devToolsConfig.rendererConfig, - overrideHookState: overrideHookState, - overrideHookStateDeletePath: overrideHookStateDeletePath, - overrideHookStateRenamePath: overrideHookStateRenamePath, - overrideProps: overrideProps, - overridePropsDeletePath: overridePropsDeletePath, - overridePropsRenamePath: overridePropsRenamePath, - setErrorHandler: setErrorHandler, - setSuspenseHandler: setSuspenseHandler, - scheduleUpdate: scheduleUpdate, + (function () { + var internals = { + bundleType: 1, + version: "19.0.0-www-classic-4ea12a11-20240801", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: findHostInstanceByFiber, - findFiberByHostInstance: - devToolsConfig.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: findHostInstancesForRefresh, - scheduleRefresh: scheduleRefresh, - scheduleRoot: scheduleRoot, - setRefreshHandler: setRefreshHandler, - getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-01172397-20240716" - }); - })({ - findFiberByHostInstance: function () { - return null; - }, - bundleType: 1, - version: "19.0.0-www-classic-01172397-20240716", - rendererPackageName: "react-art" - }); + findFiberByHostInstance: getInstanceFromNode, + reconcilerVersion: "19.0.0-www-classic-4ea12a11-20240801" + }; + internals.overrideHookState = overrideHookState; + internals.overrideHookStateDeletePath = overrideHookStateDeletePath; + internals.overrideHookStateRenamePath = overrideHookStateRenamePath; + internals.overrideProps = overrideProps; + internals.overridePropsDeletePath = overridePropsDeletePath; + internals.overridePropsRenamePath = overridePropsRenamePath; + internals.scheduleUpdate = scheduleUpdate; + internals.setErrorHandler = setErrorHandler; + internals.setSuspenseHandler = setSuspenseHandler; + internals.scheduleRefresh = scheduleRefresh; + internals.scheduleRoot = scheduleRoot; + internals.setRefreshHandler = setRefreshHandler; + internals.getCurrentFiber = getCurrentFiberForDevTools; + enableSchedulingProfiler && + ((internals.getLaneLabelMap = getLaneLabelMap), + (internals.injectProfilingHooks = injectProfilingHooks)); + return injectInternals(internals); + })(); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, Group = TYPES.GROUP, Shape = TYPES.SHAPE, @@ -17045,6 +16820,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; + exports.version = "19.0.0-www-classic-4ea12a11-20240801"; "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 2658258396ffd..e6f22dad24ce1 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -72,20 +72,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork()); @@ -389,8 +375,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -546,28 +532,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -641,110 +605,6 @@ __DEV__ && isRendering = !1; current = null; } - function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; - } - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); - } - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); - } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; - } - function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; - } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -770,8 +630,8 @@ __DEV__ && ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } function injectInternals(internals) { @@ -786,13 +646,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -852,21 +706,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -925,41 +764,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -975,21 +813,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -1020,25 +858,25 @@ __DEV__ && return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1062,11 +900,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1082,34 +920,23 @@ __DEV__ && originallyAttemptedLanes ) { if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); + root = root.pendingLanes & -536870913; + return 0 !== root ? root : root & 536870912 ? 536870912 : 0; } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -1140,7 +967,7 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; } @@ -1153,8 +980,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1286,14 +1113,14 @@ __DEV__ && null != props.scaleX ? props.scaleX : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; var scaleY = null != props.scaleY ? props.scaleY : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; pooledTransform .transformTo(1, 0, 0, 1, 0, 0) .move(props.x || 0, props.y || 0) @@ -1383,12 +1210,12 @@ __DEV__ && JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1404,6 +1231,9 @@ __DEV__ && "string" === typeof props.children || "number" === typeof props.children ); } + function getInstanceFromNode() { + return null; + } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1617,10 +1447,10 @@ __DEV__ && : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } function describeTextDiff(clientText, serverProps, indent) { var maxLength = 120 - 2 * indent; @@ -1714,10 +1544,10 @@ __DEV__ && return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } function describeExpandedElement(type, props, rowPrefix) { var remainingRowLength = 120 - rowPrefix.length - type.length, @@ -1735,17 +1565,17 @@ __DEV__ && return 0 === properties.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } function describePropertiesDiff(clientObject, serverObject, indent) { var properties = "", @@ -1968,16 +1798,16 @@ __DEV__ && )), indent++) : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent - )), - indent++); + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); var propName = ""; i = node.fiber.child; for ( @@ -2080,7 +1910,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -2127,9 +1957,7 @@ __DEV__ && ? workInProgressRootRenderLanes$jscomp$0 : 0 ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && + 0 !== (workInProgressRootRenderLanes$jscomp$0 & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot( root, @@ -2159,8 +1987,7 @@ __DEV__ && null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev)) : ((prev = root), - 0 !== (nextLanes & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } currentEventTransitionLane = 0; @@ -2174,7 +2001,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -2205,12 +2032,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -2380,10 +2207,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -2479,7 +2303,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -3049,7 +2873,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3130,7 +2954,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3227,7 +3051,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3704,7 +3528,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3811,12 +3635,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -3998,8 +3822,8 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = 0 !== (workInProgress.mode & 8); var children = callComponentInDEV(Component, props, secondArg); @@ -4052,9 +3876,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -4187,6 +4010,34 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + 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 }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -4318,7 +4169,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -4435,12 +4286,11 @@ __DEV__ && ), (didWarnUncachedGetSnapshot = !0)); } - cachedSnapshot = workInProgressRoot; - if (null === cachedSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) || + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -4505,12 +4355,11 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -4544,13 +4393,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -4673,8 +4522,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -4690,8 +4539,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -5050,7 +4899,7 @@ __DEV__ && function mountDeferredValueImpl(hook, value, initialValue) { return enableUseDeferredValueInitialArg && void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) + 0 === (renderLanes & 1073741824) ? ((hook.memoizedState = initialValue), (hook = requestDeferredLane()), (currentlyRenderingFiber$1.lanes |= hook), @@ -5066,7 +4915,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -5112,11 +4961,11 @@ __DEV__ && ); dispatchSetState(fiber, queue, thenableForFinishedState); } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { + } catch (error$9) { dispatchSetState(fiber, queue, { then: function () {}, status: "rejected", - reason: error$5 + reason: error$9 }); } finally { (currentUpdatePriority = previousPriority), @@ -5164,8 +5013,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -5282,7 +5130,7 @@ __DEV__ && null === workInProgressRoot && finishQueueingConcurrentUpdates(); return; } - } catch (error$6) { + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } @@ -5319,7 +5167,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -5335,11 +5183,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -5358,7 +5206,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5649,12 +5497,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -5675,15 +5520,14 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && - propagateParentContextChanges( - returnFiber, - sourceFiber, - rootRenderLanes, - !0 - )); + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); enableDebugTracing && sourceFiber.mode & 4 && ((returnFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), @@ -5971,7 +5815,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -6128,7 +5972,7 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & OffscreenLane)) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -6142,7 +5986,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -6193,8 +6037,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -6262,7 +6105,7 @@ __DEV__ && "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName )))); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, @@ -6290,7 +6133,7 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -6348,7 +6191,7 @@ __DEV__ && ); enqueueCapturedUpdate(workInProgress, lane); } - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) { state = emptyContextObject; _instance = Component.contextType; @@ -6361,12 +6204,12 @@ __DEV__ && void 0 === _instance ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(Component) || "Component", @@ -6749,8 +6592,7 @@ __DEV__ && state !== newApiName || oldState !== newState || hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies)) ? ("function" === typeof unresolvedOldProps && @@ -6772,8 +6614,7 @@ __DEV__ && newState, lane ) || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies))) ? (oldContext || @@ -7022,44 +6863,44 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - showFallback - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + showFallback + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isSuspenseInstanceFallback()) @@ -7093,8 +6934,7 @@ __DEV__ && renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, @@ -7107,18 +6947,17 @@ __DEV__ && JSCompiler_temp = workInProgressRoot; if (null !== JSCompiler_temp) { nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & SyncUpdateLanes)) - nextProps = SyncHydrationLane; + if (0 !== (nextProps & 42)) nextProps = 1; else switch (nextProps) { - case SyncLane: - nextProps = SyncHydrationLane; + case 2: + nextProps = 1; break; - case InputContinuousLane: - nextProps = InputContinuousHydrationLane; + case 8: + nextProps = 4; break; - case DefaultLane: - nextProps = DefaultHydrationLane; + case 32: + nextProps = 16; break; case 128: case 256: @@ -7139,10 +6978,10 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - nextProps = TransitionHydrationLane; + nextProps = 64; break; - case IdleLane: - nextProps = IdleHydrationLane; + case 268435456: + nextProps = 134217728; break; default: nextProps = 0; @@ -7246,16 +7085,16 @@ __DEV__ && retryQueue: null }) : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== currentOffscreenQueue + ? currentOffscreenQueue.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)); } nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, @@ -7558,7 +7397,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -7586,12 +7425,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -7667,8 +7503,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -7870,9 +7705,10 @@ __DEV__ && current.$$typeof === REACT_LAZY_TYPE && (workInProgress = " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; throw Error( "Element type is invalid. Received a promise that resolves to: " + - current + + renderLanes + ". Lazy element type must resolve to a class or function." + workInProgress ); @@ -7933,7 +7769,12 @@ __DEV__ && var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== prevSibling.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); prevSibling = nextProps.element; prevSibling === returnFiber @@ -7973,16 +7814,7 @@ __DEV__ && null, renderLanes )), - (HostTransitionContext._currentValue2 = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = prevSibling)), markRef(current, workInProgress), reconcileChildren( current, @@ -8073,45 +7905,27 @@ __DEV__ && workInProgress.child ); case 10: - a: { - returnFiber = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = prevSibling.value; + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, returnFiber, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if (nextProps.children === prevSibling.children) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, prevSibling.children, renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + ), + workInProgress.child + ); case 9: return ( enableRenderableContext @@ -8124,7 +7938,7 @@ __DEV__ && error$jscomp$0( "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." ), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (prevSibling = readContext(prevSibling)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), @@ -8203,7 +8017,7 @@ __DEV__ && ); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (returnFiber = readContext(CacheContext)), null === current ? ((prevSibling = peekCacheFromPool()), @@ -8241,10 +8055,11 @@ __DEV__ && : ((returnFiber = nextProps.cache), pushProvider(workInProgress, CacheContext, returnFiber), returnFiber !== prevSibling.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -8347,147 +8162,80 @@ __DEV__ && "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; 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); scheduleContextWorkOnParentPath( - fiber.return, + list.return, renderLanes, workInProgress ); - list.lanes |= renderLanes; - break; + forcePropagateEntireTree || (nextFiber = null); + break a; } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } - fiber = nextFiber; - } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -8496,85 +8244,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + 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) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -8583,9 +8336,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -8601,7 +8353,7 @@ __DEV__ && ); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -8648,16 +8400,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -8764,7 +8516,11 @@ __DEV__ && : null; } function containsNode() { - throw Error("Not implemented."); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = getInstanceFromScope(); @@ -8784,7 +8540,7 @@ __DEV__ && ? (workInProgress.flags |= 4) : workInProgress.flags & 16384 && ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { @@ -9194,7 +8950,7 @@ __DEV__ && 2 * now$1() - fallthroughToNormalSuspensePath.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(fallthroughToNormalSuspensePath, !1), @@ -9251,7 +9007,7 @@ __DEV__ && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), newProps - ? 0 !== (renderLanes & OffscreenLane) && + ? 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -9444,20 +9200,30 @@ __DEV__ && (executionContext & CommitContext) !== NoContext ); } - function callComponentWillUnmountWithTimer(current, instance) { + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { instance.props = resolveClassComponentProps( current.type, current.memoizedProps, current.elementType === current.type ); instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + shouldProfile(current) + ? (startLayoutEffectTimer(), + callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ); } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -9491,8 +9257,8 @@ __DEV__ && ), (ref.current = instanceToUse); } - } catch (error$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + } catch (error$11) { + captureCommitPhaseError(current, nearestMountedAncestor, error$11); } } function safelyDetachRef(current, nearestMountedAncestor) { @@ -9508,8 +9274,8 @@ __DEV__ && recordLayoutEffectDuration(current); } else refCleanup(); - } catch (error$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); + } catch (error$12) { + captureCommitPhaseError(current, nearestMountedAncestor, error$12); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9524,18 +9290,11 @@ __DEV__ && recordLayoutEffectDuration(current); } else ref(null); - } catch (error$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + } catch (error$13) { + captureCommitPhaseError(current, nearestMountedAncestor, error$13); } else ref.current = null; } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); - } - } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; for (nextEffect = firstChild; null !== nextEffect; ) { @@ -9553,8 +9312,8 @@ __DEV__ && root = nextEffect; try { runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$12) { - captureCommitPhaseError(root, root.return, error$12); + } catch (error$14) { + captureCommitPhaseError(root, root.return, error$14); } firstChild = root.sibling; if (null !== firstChild) { @@ -9692,7 +9451,7 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -9733,11 +9492,8 @@ __DEV__ && injectedProfilingHooks.markComponentLayoutEffectMountStarted( finishedWork )); - var create = effect.create; (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; + var destroy = callCreateInDEV(effect); (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); enableSchedulingProfiler && ((flags & Passive) !== NoFlags @@ -9752,27 +9508,27 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = + if (void 0 !== destroy && "function" !== typeof destroy) { + var hookName = 0 !== (effect.tag & Layout) ? "useLayoutEffect" : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), + ? "useInsertionEffect" + : "useEffect"; error$jscomp$0( "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create + hookName, + null === destroy ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + create - )); + : "function" === typeof destroy.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + destroy + ); + } } effect = effect.next; } while (effect !== updateQueue); @@ -9815,15 +9571,15 @@ __DEV__ && try { startLayoutEffectTimer(), commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } catch (error$15) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$15); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); } } function commitClassCallbacks(finishedWork) { @@ -9845,8 +9601,8 @@ __DEV__ && )); try { commitCallbacks(updateQueue, instance); - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); + } catch (error$17) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$17); } } } @@ -9889,8 +9645,8 @@ __DEV__ && } parentFiber = parentFiber.return; } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } catch (error$19) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$19); } } function commitLayoutEffectOnFiber( @@ -9920,42 +9676,24 @@ __DEV__ && ); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )), - shouldProfile(finishedWork)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidMountInDEV(finishedWork, finishedRoot), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidMountInDEV(finishedWork, finishedRoot); else { committedLanes = resolveClassComponentProps( finishedWork.type, @@ -9976,36 +9714,23 @@ __DEV__ && "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( + finishedRoot, committedLanes, prevState, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$18 + finishedRoot, + committedLanes, + prevState, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); @@ -10032,11 +9757,11 @@ __DEV__ && } try { commitCallbacks(flags, finishedRoot); - } catch (error$22) { + } catch (error$20) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$20 ); } } @@ -10461,7 +10186,7 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -10472,14 +10197,14 @@ __DEV__ && shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -10496,21 +10221,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (_prevHostParent = deletedFiber.stateNode), - "function" === typeof _prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, _prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof _prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + _prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10576,10 +10295,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -10589,10 +10308,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -10667,8 +10386,8 @@ __DEV__ && var alternate = root.alternate; null !== alternate && (alternate.return = null); root.return = null; - } catch (error$25) { - captureCommitPhaseError(childToDelete, parentFiber, error$25); + } catch (error$23) { + captureCommitPhaseError(childToDelete, parentFiber, error$23); } } if (parentFiber.subtreeFlags & 13878) @@ -10700,11 +10419,11 @@ __DEV__ && finishedWork.return ), commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error$26) { + } catch (error$24) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$26 + error$24 ); } if (shouldProfile(finishedWork)) { @@ -10715,11 +10434,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$27) { + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$27 + error$25 ); } recordLayoutEffectDuration(finishedWork); @@ -10730,11 +10449,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$28) { + } catch (error$26) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$28 + error$26 ); } } @@ -10770,11 +10489,11 @@ __DEV__ && current = null !== current ? current.memoizedProps : newProps; try { _instance2._applyProps(_instance2, newProps, current); - } catch (error$30) { + } catch (error$28) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + error$28 ); } } @@ -10825,11 +10544,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$32) { + } catch (error$30) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + error$30 ); } flags = finishedWork.updateQueue; @@ -10883,11 +10602,11 @@ __DEV__ && : ((newProps = root.memoizedProps), (null == newProps.visible || newProps.visible) && root.stateNode.show()); - } catch (error$23) { + } catch (error$21) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$23 + error$21 ); } } @@ -10983,8 +10702,8 @@ __DEV__ && "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." ); } - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); + } catch (error$31) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$31); } finishedWork.flags &= -3; } @@ -11044,18 +10763,12 @@ __DEV__ && case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -11106,11 +10819,11 @@ __DEV__ && if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); - } catch (error$34) { + } catch (error$32) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$32 ); } var updateQueue = finishedWork.updateQueue; @@ -11196,15 +10909,15 @@ __DEV__ && passiveEffectStartTime = now(); try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$35) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$35); + } catch (error$33) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$33); } recordPassiveEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); + } catch (error$34) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$34); } } function commitOffscreenPassiveMountEffects( @@ -11434,20 +11147,20 @@ __DEV__ && committedTransitions ) : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -12044,8 +11757,8 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? OffscreenLane + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 : claimNextTransitionLane()); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); @@ -12139,7 +11852,7 @@ __DEV__ && ); if (0 === lanes) return null; var shouldTimeSlice = - !includesBlockingLane(root, lanes) && + 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && (disableSchedulerTimeoutInWorkLoop || !didTimeout); didTimeout = shouldTimeSlice @@ -12193,7 +11906,7 @@ __DEV__ && case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, @@ -12221,7 +11934,7 @@ __DEV__ && ); else { if ( - (lanes & RetryLanes) === lanes && + (lanes & 62914560) === lanes && (alwaysThrottleRetries || didTimeout === RootSuspended) && ((didTimeout = globalMostRecentFallbackTime + @@ -12336,7 +12049,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$37) { + } catch (error$35) { return !1; } } @@ -12358,7 +12071,7 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && + 268435456 !== updatedLanes && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext @@ -12478,9 +12191,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -12507,12 +12218,12 @@ __DEV__ && var handler = suspenseHandlerStackCursor.current; workInProgressSuspendedReason = (null !== handler && - ((workInProgressRootRenderLanes & TransitionLanes) === + ((workInProgressRootRenderLanes & 4194176) === workInProgressRootRenderLanes ? null !== shellBoundary - : ((workInProgressRootRenderLanes & RetryLanes) !== + : ((workInProgressRootRenderLanes & 62914560) !== workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & OffscreenLane)) || + 0 === (workInProgressRootRenderLanes & 536870912)) || handler !== shellBoundary)) || 0 !== (workInProgressRootSkippedLanes & 134217727) || 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -12526,10 +12237,10 @@ __DEV__ && thrownValue === SelectiveHydrationException ? SuspendedOnHydration : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; handler = workInProgress; if (null === handler) @@ -12639,8 +12350,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$38) { - handleThrow(root, thrownValue$38); + } catch (thrownValue$36) { + handleThrow(root, thrownValue$36); } while (1); lanes && root.shellSuspendCounter++; @@ -12782,8 +12493,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$39) { - handleThrow(root, thrownValue$39); + } catch (thrownValue$37) { + handleThrow(root, thrownValue$37); } while (1); resetContextDependencies(); @@ -12923,9 +12634,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$40) { + } catch (error$38) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$40); + throw ((workInProgress = returnFiber), error$38); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -13161,12 +12872,11 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) && - flushPassiveEffects(); + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -13317,15 +13027,10 @@ __DEV__ && } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -13355,12 +13060,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -13368,7 +13069,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -13417,7 +13118,7 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && @@ -13697,9 +13398,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -13714,83 +13414,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -14097,21 +13720,21 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null + ? owner.name + : null : null; fiberTag && (resolvedType += @@ -14260,14 +13883,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], tag = 0; - tag < TotalLanes; + 31 > tag; tag++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; tag < TotalLanes; tag++) containerInfo.push(new Set()); + for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; } function updateContainerSync( @@ -14278,7 +13901,6 @@ __DEV__ && ) { 0 === container.tag && flushPassiveEffects(); parentComponent = container.current; - var lane = SyncLane; if ( injectedHook && "function" === typeof injectedHook.onScheduleFiberRoot @@ -14297,7 +13919,7 @@ __DEV__ && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markRenderScheduled && - injectedProfilingHooks.markRenderScheduled(lane); + injectedProfilingHooks.markRenderScheduled(2); var context = emptyContextObject; null === container.context ? (container.context = context) @@ -14310,7 +13932,7 @@ __DEV__ && "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown" )); - container = createUpdate(lane); + container = createUpdate(2); container.payload = { element: element }; callback = void 0 === callback ? null : callback; null !== callback && @@ -14320,23 +13942,26 @@ __DEV__ && callback ), (container.callback = callback)); - element = enqueueUpdate(parentComponent, container, lane); + element = enqueueUpdate(parentComponent, container, 2); null !== element && - (scheduleUpdateOnFiber(element, parentComponent, lane), - entangleTransitions(element, parentComponent, lane)); - return SyncLane; - } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; + (scheduleUpdateOnFiber(element, parentComponent, 2), + entangleTransitions(element, parentComponent, 2)); + return 2; } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -14362,8 +13987,6 @@ __DEV__ && dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, @@ -14454,30 +14077,12 @@ __DEV__ && clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, - TotalLanes = 31, - SyncHydrationLane = 1, - SyncLane = 2, - InputContinuousHydrationLane = 4, - InputContinuousLane = 8, - DefaultHydrationLane = 16, - DefaultLane = 32, - SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane, - TransitionHydrationLane = 64, - TransitionLanes = 4194176, - RetryLanes = 62914560, - SelectiveHydrationLane = 67108864, - IdleHydrationLane = 134217728, - IdleLane = 268435456, - OffscreenLane = 536870912, - DeferredLane = 1073741824, - UpdateLanes = - SyncLane | InputContinuousLane | DefaultLane | TransitionLanes, nextTransitionLane = 128, nextRetryLane = 4194304, - DiscreteEventPriority = SyncLane, - ContinuousEventPriority = InputContinuousLane, - DefaultEventPriority = DefaultLane, - IdleEventPriority = IdleLane, + DiscreteEventPriority = 2, + ContinuousEventPriority = 8, + DefaultEventPriority = 32, + IdleEventPriority = 268435456, isSuspenseInstancePending = shim$2, isSuspenseInstanceFallback = shim$2, getSuspenseInstanceFallbackErrorDetails = shim$2, @@ -14494,6 +14099,14 @@ __DEV__ && var scheduleTimeout = setTimeout, cancelTimeout = clearTimeout, currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = []; var fiberStack = []; var index$jscomp$0 = -1, @@ -14511,14 +14124,6 @@ __DEV__ && contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, @@ -14754,6 +14359,120 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, + callComponent = { + "react-stack-bottom-frame": function (Component, props, secondArg) { + var wasRendering = isRendering; + isRendering = !0; + try { + return Component(props, secondArg); + } finally { + isRendering = wasRendering; + } + } + }, + callComponentInDEV = + callComponent["react-stack-bottom-frame"].bind(callComponent), + callRender = { + "react-stack-bottom-frame": function (instance) { + var wasRendering = isRendering; + isRendering = !0; + try { + return instance.render(); + } finally { + isRendering = wasRendering; + } + } + }, + callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender), + callComponentDidMount = { + "react-stack-bottom-frame": function (finishedWork, instance) { + try { + instance.componentDidMount(); + } catch (error$2) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$2); + } + } + }, + callComponentDidMountInDEV = callComponentDidMount[ + "react-stack-bottom-frame" + ].bind(callComponentDidMount), + callComponentDidUpdate = { + "react-stack-bottom-frame": function ( + finishedWork, + instance, + prevProps, + prevState, + snapshot + ) { + try { + instance.componentDidUpdate(prevProps, prevState, snapshot); + } catch (error$3) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$3); + } + } + }, + callComponentDidUpdateInDEV = callComponentDidUpdate[ + "react-stack-bottom-frame" + ].bind(callComponentDidUpdate), + callComponentDidCatch = { + "react-stack-bottom-frame": function (instance, errorInfo) { + var stack = errorInfo.stack; + instance.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + } + }, + callComponentDidCatchInDEV = callComponentDidCatch[ + "react-stack-bottom-frame" + ].bind(callComponentDidCatch), + callComponentWillUnmount = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + instance + ) { + try { + instance.componentWillUnmount(); + } catch (error$4) { + captureCommitPhaseError(current, nearestMountedAncestor, error$4); + } + } + }, + callComponentWillUnmountInDEV = callComponentWillUnmount[ + "react-stack-bottom-frame" + ].bind(callComponentWillUnmount), + callCreate = { + "react-stack-bottom-frame": function (effect) { + var create = effect.create; + effect = effect.inst; + create = create(); + return (effect.destroy = create); + } + }, + callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate), + callDestroy = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + destroy + ) { + try { + destroy(); + } catch (error$5) { + captureCommitPhaseError(current, nearestMountedAncestor, error$5); + } + } + }, + callDestroyInDEV = + callDestroy["react-stack-bottom-frame"].bind(callDestroy), + callLazyInit = { + "react-stack-bottom-frame": function (lazy) { + var init = lazy._init; + return init(lazy._payload); + } + }, + callLazyInitInDEV = + callLazyInit["react-stack-bottom-frame"].bind(callLazyInit), thenableState$1 = null, thenableIndexCounter$1 = 0, currentDebugInfo = null, @@ -14876,6 +14595,8 @@ __DEV__ && ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; + ContextOnlyDispatcher.unstable_useContextWithBailout = + throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15019,6 +14740,14 @@ __DEV__ && 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); @@ -15156,6 +14885,12 @@ __DEV__ && 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); @@ -15286,6 +15021,14 @@ __DEV__ && 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); @@ -15416,6 +15159,14 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15576,6 +15327,15 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15733,6 +15493,13 @@ __DEV__ && 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(); @@ -15892,6 +15659,13 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; var now = Scheduler.unstable_now, commitTime = 0, layoutEffectStartTime = -1, @@ -15923,9 +15697,20 @@ __DEV__ && ); instance._warnedAboutRefsInRender = !0; } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + component = component._reactInternals; + if (!component) return !1; + instance = owner = component; + if (component.alternate) for (; owner.return; ) owner = owner.return; + else { + var nextNode = owner; + do + (owner = nextNode), + 0 !== (owner.flags & 4098) && (instance = owner.return), + (nextNode = owner.return); + while (nextNode); + } + owner = 3 === owner.tag ? instance : null; + return owner === component; }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; @@ -16221,8 +16006,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateDeletePath = function (fiber, id, path) { id = findHook(fiber, id); @@ -16231,8 +16016,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { id = findHook(fiber, id); @@ -16241,20 +16026,20 @@ __DEV__ && (id.memoizedState = oldPath), (id.baseState = oldPath), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane)); + (oldPath = enqueueConcurrentRenderForLane(fiber, 2)), + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2)); }; overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename( @@ -16263,12 +16048,12 @@ __DEV__ && newPath ); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane); + oldPath = enqueueConcurrentRenderForLane(fiber, 2); + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); }; scheduleUpdate = function (fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; @@ -16407,41 +16192,33 @@ __DEV__ && }; return Text; })(React.Component); - (function (devToolsConfig) { - return injectInternals({ - bundleType: devToolsConfig.bundleType, - version: devToolsConfig.version, - rendererPackageName: devToolsConfig.rendererPackageName, - rendererConfig: devToolsConfig.rendererConfig, - overrideHookState: overrideHookState, - overrideHookStateDeletePath: overrideHookStateDeletePath, - overrideHookStateRenamePath: overrideHookStateRenamePath, - overrideProps: overrideProps, - overridePropsDeletePath: overridePropsDeletePath, - overridePropsRenamePath: overridePropsRenamePath, - setErrorHandler: setErrorHandler, - setSuspenseHandler: setSuspenseHandler, - scheduleUpdate: scheduleUpdate, + (function () { + var internals = { + bundleType: 1, + version: "19.0.0-www-modern-4ea12a11-20240801", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: findHostInstanceByFiber, - findFiberByHostInstance: - devToolsConfig.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: findHostInstancesForRefresh, - scheduleRefresh: scheduleRefresh, - scheduleRoot: scheduleRoot, - setRefreshHandler: setRefreshHandler, - getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-01172397-20240716" - }); - })({ - findFiberByHostInstance: function () { - return null; - }, - bundleType: 1, - version: "19.0.0-www-modern-01172397-20240716", - rendererPackageName: "react-art" - }); + findFiberByHostInstance: getInstanceFromNode, + reconcilerVersion: "19.0.0-www-modern-4ea12a11-20240801" + }; + internals.overrideHookState = overrideHookState; + internals.overrideHookStateDeletePath = overrideHookStateDeletePath; + internals.overrideHookStateRenamePath = overrideHookStateRenamePath; + internals.overrideProps = overrideProps; + internals.overridePropsDeletePath = overridePropsDeletePath; + internals.overridePropsRenamePath = overridePropsRenamePath; + internals.scheduleUpdate = scheduleUpdate; + internals.setErrorHandler = setErrorHandler; + internals.setSuspenseHandler = setSuspenseHandler; + internals.scheduleRefresh = scheduleRefresh; + internals.scheduleRoot = scheduleRoot; + internals.setRefreshHandler = setRefreshHandler; + internals.getCurrentFiber = getCurrentFiberForDevTools; + enableSchedulingProfiler && + ((internals.getLaneLabelMap = getLaneLabelMap), + (internals.injectProfilingHooks = injectProfilingHooks)); + return injectInternals(internals); + })(); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, Group = TYPES.GROUP, Shape = TYPES.SHAPE, @@ -16456,6 +16233,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; + exports.version = "19.0.0-www-modern-4ea12a11-20240801"; "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 cd34a4872054c..ebc0c6fc33702 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -74,8 +74,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, @@ -259,8 +257,8 @@ function describeBuiltInComponentFrame(name) { -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -448,88 +446,6 @@ function getNearestMountedFiber(fiber) { } return 3 === node.tag ? nearestMounted : null; } -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$3 = parentA.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) { - for (child$3 = parentB.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -570,8 +486,8 @@ function childrenAsString(children) { ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, @@ -687,14 +603,14 @@ function getNextLanes(root, wipLanes) { return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { @@ -744,9 +660,6 @@ function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { root = root.pendingLanes & -536870913; return 0 !== root ? root : root & 536870912 ? 536870912 : 0; } -function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60); -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -779,18 +692,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$7 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$7; - remainingLanes[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$6; + remainingLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -810,21 +723,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - index$10 = root.transitionLanes[index$10]; - null !== index$10 && - index$10.forEach(function (transition) { + var index$9 = 31 - clz32(lanes), + lane = 1 << index$9; + index$9 = root.transitionLanes[index$9]; + null !== index$9 && + index$9.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -834,10 +747,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$11 = 31 - clz32(lanes), - lane = 1 << index$11; - null !== root.transitionLanes[index$11] && - (root.transitionLanes[index$11] = null); + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + null !== root.transitionLanes[index$10] && + (root.transitionLanes[index$10] = null); lanes &= ~lane; } } @@ -995,12 +908,12 @@ function applyTextProps(instance, props) { JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1019,6 +932,14 @@ function shouldSetTextContent(type, props) { ); } var currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -1129,15 +1050,7 @@ function createCapturedValueAtFiber(value, source) { var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; + hostTransitionProviderCursor = createCursor(null); function pushHostContainer(fiber, nextRootInstance) { push(rootInstanceStackCursor, nextRootInstance); push(contextFiberStackCursor, fiber); @@ -1268,14 +1181,14 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { - var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$13 = getNextLanes( + var workInProgressRootRenderLanes$12 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$12 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$12 : 0 ); - 0 !== (workInProgressRootRenderLanes$13 & 3) && + 0 !== (workInProgressRootRenderLanes$12 & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); + performSyncWorkOnRoot(root, workInProgressRootRenderLanes$12)); } root = root.next; } @@ -1315,12 +1228,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$5 = 31 - clz32(pendingLanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(pendingLanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1565,20 +1478,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$15 = workInProgress$jscomp$0.alternate; - null !== current$15 && - ((current$15 = current$15.updateQueue), - (pendingQueue = current$15.lastBaseUpdate), + var current$14 = workInProgress$jscomp$0.alternate; + null !== current$14 && + ((current$14 = current$14.updateQueue), + (pendingQueue = current$14.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$15.firstBaseUpdate = firstPendingUpdate) + ? (current$14.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$15.lastBaseUpdate = lastPendingUpdate))); + (current$14.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$15 = firstPendingUpdate = lastPendingUpdate = null; + current$14 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1591,8 +1504,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$15 && - (current$15 = current$15.next = + null !== current$14 && + (current$14 = current$14.next = { lane: 0, tag: pendingQueue.tag, @@ -1645,10 +1558,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$15 - ? ((firstPendingUpdate = current$15 = isHiddenUpdate), + null === current$14 + ? ((firstPendingUpdate = current$14 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$15 = current$15.next = isHiddenUpdate), + : (current$14 = current$14.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1661,10 +1574,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$15 && (lastPendingUpdate = newState); + null === current$14 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$15; + queue.lastBaseUpdate = current$14; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -1996,7 +1909,7 @@ function createChildReconciler(shouldTrackSideEffects) { if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2045,7 +1958,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2115,7 +2028,7 @@ function createChildReconciler(shouldTrackSideEffects) { existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2439,7 +2352,7 @@ function createChildReconciler(shouldTrackSideEffects) { return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2526,8 +2439,8 @@ function pushPrimaryTreeSuspenseHandler(handler) { ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler) - : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); + ? push(suspenseHandlerStackCursor, handler) + : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -2536,9 +2449,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$44 = fiber.alternate; - null !== current$44 && - null !== current$44.memoizedState && + var current$43 = fiber.alternate; + null !== current$43 && + null !== current$43.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2634,9 +2547,8 @@ function finishRenderingHooks(current) { thenableIndexCounter = 0; thenableState = null; if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -2741,6 +2653,31 @@ 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; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + 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 () { return { lastEffect: null, events: null, stores: null, memoCache: null }; @@ -2774,16 +2711,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$46 = currentlyRenderingFiber$1.alternate; - null !== current$46 && - ((current$46 = current$46.updateQueue), - null !== current$46 && - ((current$46 = current$46.memoCache), - null != current$46 && + var current$45 = currentlyRenderingFiber$1.alternate; + null !== current$45 && + ((current$45 = current$45.updateQueue), + null !== current$45 && + ((current$45 = current$45.memoCache), + null != current$45 && (memoCache = { data: enableNoCloningMemoCache - ? current$46.data - : current$46.data.map(function (array) { + ? current$45.data + : current$45.data.map(function (array) { return array.slice(); }), index: 0 @@ -2798,11 +2735,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$46 = 0; - current$46 < size; - current$46++ + current$45 = 0; + current$45 < size; + current$45++ ) - updateQueue[current$46] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$45] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2835,7 +2772,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$47 = !1; + didReadFromEntangledAsyncAction$46 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2856,11 +2793,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$46 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$46 = !0); continue; } else (updateLane = { @@ -2906,7 +2843,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$47 && + didReadFromEntangledAsyncAction$46 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2964,9 +2901,8 @@ function updateSyncExternalStore(subscribe, getSnapshot) { { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(subscribe, renderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -3094,8 +3030,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$51) { - onActionError(actionQueue, node, error$51); + } catch (error$50) { + onActionError(actionQueue, node, error$50); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3428,8 +3364,7 @@ function startTransition( } } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function updateId() { return updateWorkInProgressHook().memoizedState; @@ -3585,6 +3520,7 @@ ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; +ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3681,20 +3617,19 @@ var HooksDispatcherOnMount = { var fiber = currentlyRenderingFiber$1, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); - var root = workInProgressRoot; - if (null === root) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root, workInProgressRootRenderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; - root = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = root; - mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [ + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ subscribe ]); fiber.flags |= 2048; pushEffect( 9, - updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), { destroy: void 0 }, null ); @@ -3748,6 +3683,8 @@ HooksDispatcherOnMount.useOptimistic = function (passthrough) { queue.dispatch = hook; return [passthrough, hook]; }; +HooksDispatcherOnMount.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3796,6 +3733,8 @@ 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, @@ -3849,6 +3788,8 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +HooksDispatcherOnRerender.unstable_useContextWithBailout = + unstable_useContextWithBailout; function applyDerivedStateFromProps( workInProgress, ctor, @@ -3919,8 +3860,8 @@ function checkShouldComponentUpdate( return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = !1, @@ -4014,9 +3955,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$52 in Component) + void 0 === newProps[propName$52] && + (newProps[propName$52] = Component[propName$52]); } return newProps; } @@ -4136,16 +4077,14 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || 0 !== (sourceFiber.mode & 1) || @@ -4173,20 +4112,20 @@ function throwException( ? ((currentSourceFiber.flags |= 65536), (currentSourceFiber.lanes = rootRenderLanes)) : currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)); + ? (currentSourceFiber.flags |= 65536) + : ((currentSourceFiber.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)); value === noopSuspenseyCommitThenable ? (currentSourceFiber.flags |= 16384) : ((returnFiber = currentSourceFiber.updateQueue), @@ -4446,7 +4385,7 @@ function updateForwardRef( for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooks( current, workInProgress, @@ -4646,8 +4585,7 @@ function deferHiddenOffscreenComponent( null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -4691,7 +4629,7 @@ function updateFunctionComponent( : contextStackCursor$1.current; context = getMaskedContext(workInProgress, context); } - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); Component = renderWithHooks( current, workInProgress, @@ -4717,7 +4655,7 @@ function replayFunctionComponent( secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4745,7 +4683,7 @@ function updateClassComponent( var hasContext = !0; pushContextProvider(workInProgress); } else hasContext = !1; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -4874,8 +4812,7 @@ function updateClassComponent( unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -4897,8 +4834,7 @@ function updateClassComponent( newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -5112,46 +5048,47 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - showFallback, - 0, - null - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + showFallback, + 0, + null + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2())) (JSCompiler_temp = shim$2().digest), (nextProps = Error(formatProdErrorMessage(419))), @@ -5167,8 +5104,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges(current, workInProgress, renderLanes, !1), (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), didReceiveUpdate || JSCompiler_temp) @@ -5317,14 +5253,16 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { retryQueue: null }) : currentFallbackChildFragment === primaryChildProps - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== primaryChildProps ? primaryChildProps.retryQueue : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)))); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -5537,7 +5475,7 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { null !== current && (workInProgress.dependencies = current.dependencies); workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -5565,12 +5503,9 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -5629,8 +5564,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( case 19: var didSuspendBefore = 0 !== (current.flags & 128); state = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !state && + state || (propagateParentContextChanges( current, workInProgress, @@ -5760,7 +5694,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - throw Error(formatProdErrorMessage(306, current, "")); + workInProgress = getComponentNameFromType(current) || current; + throw Error(formatProdErrorMessage(306, workInProgress, "")); } } return workInProgress; @@ -5812,7 +5747,12 @@ function beginWork(current, workInProgress, renderLanes) { var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== elementType.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); elementType = nextProps.element; elementType === props @@ -5847,16 +5787,7 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = elementType), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== elementType && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = elementType)), markRef(current, workInProgress), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5930,44 +5861,25 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.child ); case 10: - a: { - props = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - elementType = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = elementType.value; - pushProvider(workInProgress, props, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if ( - nextProps.children === elementType.children && - !didPerformWorkStackCursor.current - ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren( - current, + return ( + (props = workInProgress.pendingProps), + pushProvider( workInProgress, - elementType.children, - renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context, + props.value + ), + reconcileChildren(current, workInProgress, props.children, renderLanes), + workInProgress.child + ); case 9: return ( (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (elementType = readContext(elementType)), (props = props(elementType)), (workInProgress.flags |= 1), @@ -6013,7 +5925,7 @@ function beginWork(current, workInProgress, renderLanes) { isContextProvider(props) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); constructClassInstance(workInProgress, props, elementType); mountClassInstance(workInProgress, props, elementType, renderLanes); return finishClassComponent( @@ -6056,7 +5968,7 @@ function beginWork(current, workInProgress, renderLanes) { return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (props = readContext(CacheContext)), null === current ? ((elementType = peekCacheFromPool()), @@ -6091,10 +6003,11 @@ function beginWork(current, workInProgress, renderLanes) { : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== elementType.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -6171,133 +6084,73 @@ function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { parent = parent.return; } } -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} function propagateContextChanges( workInProgress, contexts, renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; 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); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; } - nextFiber = nextFiber.return; + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - fiber = nextFiber; - } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -6306,83 +6159,92 @@ function propagateParentContextChanges( renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + 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) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } -function prepareToReadContext(workInProgress, renderLanes) { +function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { return readContextForConsumer(currentlyRenderingFiber, context); } -function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -6395,7 +6257,7 @@ function readContextForConsumer(consumer, context) { if (null === consumer) throw Error(formatProdErrorMessage(308)); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -6470,8 +6332,11 @@ function pushTransition( (null === transitionStack.current ? push(transitionStack, newTransitions) : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); + ? push(transitionStack, transitionStack.current) + : push( + transitionStack, + transitionStack.current.concat(newTransitions) + )); } function popTransition(workInProgress, current) { null !== current && @@ -6573,7 +6438,11 @@ function DO_NOT_USE_queryFirstNode(fn) { : null; } function containsNode() { - throw Error(formatProdErrorMessage(248)); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = shim$1(); @@ -6606,14 +6475,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$99 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$99 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$99 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$99.sibling = null); } } function bubbleProperties(completedWork) { @@ -6623,19 +6492,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$100 = completedWork.child; null !== child$100; ) + (newChildLanes |= child$100.lanes | child$100.childLanes), + (subtreeFlags |= child$100.subtreeFlags & 31457280), + (subtreeFlags |= child$100.flags & 31457280), + (child$100.return = completedWork), + (child$100 = child$100.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$100 = completedWork.child; null !== child$100; ) + (newChildLanes |= child$100.lanes | child$100.childLanes), + (subtreeFlags |= child$100.subtreeFlags), + (subtreeFlags |= child$100.flags), + (child$100.return = completedWork), + (child$100 = child$100.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6814,11 +6683,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$105 = null; + var cache$104 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$105 = newProps.memoizedState.cachePool.pool); - cache$105 !== instance && (newProps.flags |= 2048); + (cache$104 = newProps.memoizedState.cachePool.pool); + cache$104 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6851,8 +6720,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$105 = instance.rendering; - if (null === cache$105) + cache$104 = instance.rendering; + if (null === cache$104) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6860,11 +6729,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$105 = findFirstSuspended(current); - if (null !== cache$105) { + cache$104 = findFirstSuspended(current); + if (null !== cache$104) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$105.updateQueue; + current = cache$104.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6889,7 +6758,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$105)), null !== current)) { + if (((current = findFirstSuspended(cache$104)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6899,7 +6768,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$105.alternate) + !cache$104.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6911,13 +6780,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$105.sibling = workInProgress.child), - (workInProgress.child = cache$105)) + ? ((cache$104.sibling = workInProgress.child), + (workInProgress.child = cache$104)) : ((current = instance.last), null !== current - ? (current.sibling = cache$105) - : (workInProgress.child = cache$105), - (instance.last = cache$105)); + ? (current.sibling = cache$104) + : (workInProgress.child = cache$104), + (instance.last = cache$104)); } if (null !== instance.tail) return ( @@ -7142,14 +7011,22 @@ var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null; -function callComponentWillUnmountWithTimer(current, instance) { +function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance +) { instance.props = resolveClassComponentProps( current.type, current.memoizedProps, current.elementType === current.type ); instance.state = current.memoizedState; - instance.componentWillUnmount(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -7191,8 +7068,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$123) { - captureCommitPhaseError(current, nearestMountedAncestor, error$123); + } catch (error$122) { + captureCommitPhaseError(current, nearestMountedAncestor, error$122); } else ref.current = null; } @@ -7338,10 +7215,10 @@ function commitHookEffectListMount(flags, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & flags) === flags) { - var create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; + var destroy = effect.create; + var inst = effect.inst; + destroy = destroy(); + inst.destroy = destroy; } effect = effect.next; } while (effect !== finishedWork); @@ -7396,11 +7273,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$124) { + } catch (error$123) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$124 + error$123 ); } } @@ -7830,17 +7707,15 @@ function commitDeletionEffectsOnFiber( ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); - } + "function" === typeof prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7991,8 +7866,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); + } catch (error$131) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$131); } } break; @@ -8025,8 +7900,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = null !== current ? current.memoizedProps : newProps; try { flags._applyProps(flags, newProps, current); - } catch (error$135) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$135); + } catch (error$134) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$134); } } break; @@ -8062,8 +7937,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$137) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$137); + } catch (error$136) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$136); } flags = finishedWork.updateQueue; null !== flags && @@ -8203,12 +8078,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$127 = JSCompiler_inline_result.stateNode.containerInfo, - before$128 = getHostSibling(finishedWork); + var parent$126 = JSCompiler_inline_result.stateNode.containerInfo, + before$127 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$128, - parent$127 + before$127, + parent$126 ); break; default: @@ -8241,15 +8116,12 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(current, instance); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -8561,29 +8433,32 @@ function commitPassiveMountOnFiber( committedTransitions ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -8666,9 +8541,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$147 = finishedWork.stateNode; + var instance$146 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$147._visibility & 4 + ? instance$146._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8677,19 +8552,19 @@ function recursivelyTraverseReconnectPassiveEffects( includeWorkInProgressEffects ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork - ) - : ((instance$147._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((instance$147._visibility |= 4), + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((instance$146._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$146._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8702,7 +8577,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$147 + instance$146 ); break; case 24: @@ -8796,12 +8671,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$152 = fiber.alternate; - null !== current$152 && null !== current$152.memoizedState - ? ((current$152 = suspenseyCommitFlag), + var current$151 = fiber.alternate; + null !== current$151 && null !== current$151.memoizedState + ? ((current$151 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$152)) + (suspenseyCommitFlag = current$151)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -9109,9 +8984,9 @@ function requestUpdateLane(fiber) { ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes : null !== ReactSharedInternals.T - ? ((fiber = currentEntangledLane), - 0 !== fiber ? fiber : requestTransitionLane()) - : currentUpdatePriority || 32 + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : currentUpdatePriority || 32 : 2; } function requestDeferredLane() { @@ -9146,11 +9021,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing) ) { var transitionLanesMap = root.transitionLanes, - index$9 = 31 - clz32(lane), - transitions = transitionLanesMap[index$9]; + index$8 = 31 - clz32(lane), + transitions = transitionLanesMap[index$8]; null === transitions && (transitions = new Set()); transitions.add(transition); - transitionLanesMap[index$9] = transitions; + transitionLanesMap[index$8] = transitions; } } root === workInProgressRoot && @@ -9182,7 +9057,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { ); if (0 === lanes) return null; var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && + 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && (disableSchedulerTimeoutInWorkLoop || !didTimeout)) ? renderRootConcurrent(root, lanes) @@ -9403,9 +9278,9 @@ function markRootSuspended(root, suspendedLanes, spawnedLane) { 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - expirationTimes[index$6] = -1; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -9501,7 +9376,7 @@ function prepareFreshStack(root, lanes) { workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -9509,9 +9384,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -9546,10 +9421,10 @@ function handleThrow(root, thrownValue) { thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); workInProgressThrownValue = thrownValue; null === workInProgress && ((workInProgressRootExitStatus = 1), @@ -9611,8 +9486,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$158) { - handleThrow(root, thrownValue$158); + } catch (thrownValue$157) { + handleThrow(root, thrownValue$157); } while (1); lanes && root.shellSuspendCounter++; @@ -9721,8 +9596,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$160) { - handleThrow(root, thrownValue$160); + } catch (thrownValue$159) { + handleThrow(root, thrownValue$159); } while (1); resetContextDependencies(); @@ -10616,9 +10491,6 @@ function updateContainerSync(element, container, parentComponent, callback) { entangleTransitions(element, current, 2)); return 2; } -function emptyFindFiberByHostInstance() { - return null; -} Mode$1.setCurrent(FastNoSideEffects); var slice = Array.prototype.slice, LinearGradient = (function () { @@ -10747,56 +10619,28 @@ var slice = Array.prototype.slice, ); }; return Text; - })(React.Component), - devToolsConfig$jscomp$inline_1174 = { - findFiberByHostInstance: function () { - return null; - }, - bundleType: 0, - version: "19.0.0-www-classic-01172397-20240716", - rendererPackageName: "react-art" - }; -var internals$jscomp$inline_1386 = { - bundleType: devToolsConfig$jscomp$inline_1174.bundleType, - version: devToolsConfig$jscomp$inline_1174.version, - rendererPackageName: devToolsConfig$jscomp$inline_1174.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1174.rendererConfig, - overrideHookState: null, - overrideHookStateDeletePath: null, - overrideHookStateRenamePath: null, - overrideProps: null, - overridePropsDeletePath: null, - overridePropsRenamePath: null, - setErrorHandler: null, - setSuspenseHandler: null, - scheduleUpdate: null, + })(React.Component); +var internals$jscomp$inline_1361 = { + bundleType: 0, + version: "19.0.0-www-classic-4ea12a11-20240801", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: function (fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; + findFiberByHostInstance: function () { + return null; }, - findFiberByHostInstance: - devToolsConfig$jscomp$inline_1174.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: null, - scheduleRefresh: null, - scheduleRoot: null, - setRefreshHandler: null, - getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-01172397-20240716" + reconcilerVersion: "19.0.0-www-classic-4ea12a11-20240801" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1362 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1387.isDisabled && - hook$jscomp$inline_1387.supportsFiber + !hook$jscomp$inline_1362.isDisabled && + hook$jscomp$inline_1362.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1387.inject( - internals$jscomp$inline_1386 + (rendererID = hook$jscomp$inline_1362.inject( + internals$jscomp$inline_1361 )), - (injectedHook = hook$jscomp$inline_1387); + (injectedHook = hook$jscomp$inline_1362); } catch (err) {} } var Path = Mode$1.Path; @@ -10810,3 +10654,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; +exports.version = "19.0.0-www-classic-4ea12a11-20240801"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 8d9ed5b1bcdc5..42fe2839993d9 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -72,8 +72,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, @@ -115,7 +113,66 @@ function getIteratorFn(maybeIterable) { maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } -Symbol.for("react.client.reference"); +var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, prefix, @@ -131,8 +188,8 @@ function describeBuiltInComponentFrame(name) { -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -306,102 +363,6 @@ function getStackByFiberInDevAndProd(workInProgress) { } } var current = null; -function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$3 = parentA.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) { - for (child$3 = parentB.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -442,8 +403,8 @@ function childrenAsString(children) { ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, @@ -559,14 +520,14 @@ function getNextLanes(root, wipLanes) { return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { @@ -616,9 +577,6 @@ function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { root = root.pendingLanes & -536870913; return 0 !== root ? root : root & 536870912 ? 536870912 : 0; } -function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60); -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -651,18 +609,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$7 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$7; - remainingLanes[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$6; + remainingLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -682,21 +640,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - index$10 = root.transitionLanes[index$10]; - null !== index$10 && - index$10.forEach(function (transition) { + var index$9 = 31 - clz32(lanes), + lane = 1 << index$9; + index$9 = root.transitionLanes[index$9]; + null !== index$9 && + index$9.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -706,10 +664,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$11 = 31 - clz32(lanes), - lane = 1 << index$11; - null !== root.transitionLanes[index$11] && - (root.transitionLanes[index$11] = null); + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + null !== root.transitionLanes[index$10] && + (root.transitionLanes[index$10] = null); lanes &= ~lane; } } @@ -867,12 +825,12 @@ function applyTextProps(instance, props) { JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -891,6 +849,14 @@ function shouldSetTextContent(type, props) { ); } var currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -923,15 +889,7 @@ function createCapturedValueAtFiber(value, source) { var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; + hostTransitionProviderCursor = createCursor(null); function pushHostContainer(fiber, nextRootInstance) { push(rootInstanceStackCursor, nextRootInstance); push(contextFiberStackCursor, fiber); @@ -1062,14 +1020,14 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { if (!onlyLegacy) { - var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$13 = getNextLanes( + var workInProgressRootRenderLanes$12 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$12 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$12 : 0 ); - 0 !== (workInProgressRootRenderLanes$13 & 3) && + 0 !== (workInProgressRootRenderLanes$12 & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); + performSyncWorkOnRoot(root, workInProgressRootRenderLanes$12)); } root = root.next; } @@ -1109,12 +1067,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$5 = 31 - clz32(pendingLanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(pendingLanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1359,20 +1317,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$15 = workInProgress$jscomp$0.alternate; - null !== current$15 && - ((current$15 = current$15.updateQueue), - (pendingQueue = current$15.lastBaseUpdate), + var current$14 = workInProgress$jscomp$0.alternate; + null !== current$14 && + ((current$14 = current$14.updateQueue), + (pendingQueue = current$14.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$15.firstBaseUpdate = firstPendingUpdate) + ? (current$14.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$15.lastBaseUpdate = lastPendingUpdate))); + (current$14.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$15 = firstPendingUpdate = lastPendingUpdate = null; + current$14 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1385,8 +1343,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$15 && - (current$15 = current$15.next = + null !== current$14 && + (current$14 = current$14.next = { lane: 0, tag: pendingQueue.tag, @@ -1439,10 +1397,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$15 - ? ((firstPendingUpdate = current$15 = isHiddenUpdate), + null === current$14 + ? ((firstPendingUpdate = current$14 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$15 = current$15.next = isHiddenUpdate), + : (current$14 = current$14.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1455,10 +1413,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$15 && (lastPendingUpdate = newState); + null === current$14 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$15; + queue.lastBaseUpdate = current$14; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -1790,7 +1748,7 @@ function createChildReconciler(shouldTrackSideEffects) { if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -1839,7 +1797,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -1909,7 +1867,7 @@ function createChildReconciler(shouldTrackSideEffects) { existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2233,7 +2191,7 @@ function createChildReconciler(shouldTrackSideEffects) { return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2312,8 +2270,8 @@ function pushPrimaryTreeSuspenseHandler(handler) { ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler) - : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); + ? push(suspenseHandlerStackCursor, handler) + : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -2322,9 +2280,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$44 = fiber.alternate; - null !== current$44 && - null !== current$44.memoizedState && + var current$43 = fiber.alternate; + null !== current$43 && + null !== current$43.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2420,9 +2378,8 @@ function finishRenderingHooks(current) { thenableIndexCounter = 0; thenableState = null; if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -2527,6 +2484,31 @@ 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; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + 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 () { return { lastEffect: null, events: null, stores: null, memoCache: null }; @@ -2560,16 +2542,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$46 = currentlyRenderingFiber$1.alternate; - null !== current$46 && - ((current$46 = current$46.updateQueue), - null !== current$46 && - ((current$46 = current$46.memoCache), - null != current$46 && + var current$45 = currentlyRenderingFiber$1.alternate; + null !== current$45 && + ((current$45 = current$45.updateQueue), + null !== current$45 && + ((current$45 = current$45.memoCache), + null != current$45 && (memoCache = { data: enableNoCloningMemoCache - ? current$46.data - : current$46.data.map(function (array) { + ? current$45.data + : current$45.data.map(function (array) { return array.slice(); }), index: 0 @@ -2584,11 +2566,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$46 = 0; - current$46 < size; - current$46++ + current$45 = 0; + current$45 < size; + current$45++ ) - updateQueue[current$46] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$45] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2621,7 +2603,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$47 = !1; + didReadFromEntangledAsyncAction$46 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2642,11 +2624,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$46 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$46 = !0); continue; } else (updateLane = { @@ -2692,7 +2674,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$47 && + didReadFromEntangledAsyncAction$46 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2750,9 +2732,8 @@ function updateSyncExternalStore(subscribe, getSnapshot) { { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(subscribe, renderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -2880,8 +2861,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$51) { - onActionError(actionQueue, node, error$51); + } catch (error$50) { + onActionError(actionQueue, node, error$50); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3214,8 +3195,7 @@ function startTransition( } } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function updateId() { return updateWorkInProgressHook().memoizedState; @@ -3371,6 +3351,7 @@ ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; +ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3467,20 +3448,19 @@ var HooksDispatcherOnMount = { var fiber = currentlyRenderingFiber$1, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); - var root = workInProgressRoot; - if (null === root) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root, workInProgressRootRenderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; - root = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = root; - mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [ + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ subscribe ]); fiber.flags |= 2048; pushEffect( 9, - updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), { destroy: void 0 }, null ); @@ -3534,6 +3514,8 @@ HooksDispatcherOnMount.useOptimistic = function (passthrough) { queue.dispatch = hook; return [passthrough, hook]; }; +HooksDispatcherOnMount.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3582,6 +3564,8 @@ 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, @@ -3635,6 +3619,8 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +HooksDispatcherOnRerender.unstable_useContextWithBailout = + unstable_useContextWithBailout; function applyDerivedStateFromProps( workInProgress, ctor, @@ -3653,9 +3639,25 @@ function applyDerivedStateFromProps( } var classComponentUpdater = { isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + component = component._reactInternals; + if (!component) return !1; + var JSCompiler_inline_result; + var nearestMounted = (JSCompiler_inline_result = component); + if (component.alternate) + for (; JSCompiler_inline_result.return; ) + JSCompiler_inline_result = JSCompiler_inline_result.return; + else { + var nextNode = JSCompiler_inline_result; + do + (JSCompiler_inline_result = nextNode), + 0 !== (JSCompiler_inline_result.flags & 4098) && + (nearestMounted = JSCompiler_inline_result.return), + (nextNode = JSCompiler_inline_result.return); + while (nextNode); + } + JSCompiler_inline_result = + 3 === JSCompiler_inline_result.tag ? nearestMounted : null; + return JSCompiler_inline_result === component; }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; @@ -3705,8 +3707,8 @@ function checkShouldComponentUpdate( return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } function callComponentWillReceiveProps( workInProgress, @@ -3738,9 +3740,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$52 in Component) + void 0 === newProps[propName$52] && + (newProps[propName$52] = Component[propName$52]); } return newProps; } @@ -3860,15 +3862,14 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && - propagateParentContextChanges( - returnFiber, - sourceFiber, - rootRenderLanes, - !0 - )); + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); returnFiber = suspenseHandlerStackCursor.current; if (null !== returnFiber) { switch (returnFiber.tag) { @@ -4131,7 +4132,7 @@ function updateForwardRef( for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooks( current, workInProgress, @@ -4323,8 +4324,7 @@ function deferHiddenOffscreenComponent( null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -4362,7 +4362,7 @@ function updateFunctionComponent( nextProps, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); Component = renderWithHooks( current, workInProgress, @@ -4388,7 +4388,7 @@ function replayFunctionComponent( secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4412,7 +4412,7 @@ function updateClassComponent( nextProps, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) { var context = emptyContextObject, contextType = Component.contextType; @@ -4577,8 +4577,7 @@ function updateClassComponent( contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies)) ? ("function" === typeof unresolvedOldProps && @@ -4600,8 +4599,7 @@ function updateClassComponent( newState, oldProps ) || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies))) ? (oldContext || @@ -4784,43 +4782,44 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - showFallback - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + showFallback + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2())) (JSCompiler_temp = shim$2().digest), (nextProps = Error(formatProdErrorMessage(419))), @@ -4836,8 +4835,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges(current, workInProgress, renderLanes, !1), (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), didReceiveUpdate || JSCompiler_temp) @@ -4981,16 +4979,16 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { retryQueue: null }) : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== currentOffscreenQueue + ? currentOffscreenQueue.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)); } nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, @@ -5184,7 +5182,7 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { null !== current && (workInProgress.dependencies = current.dependencies); workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -5212,12 +5210,9 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -5272,8 +5267,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( case 19: var didSuspendBefore = 0 !== (current.flags & 128); state = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !state && + state || (propagateParentContextChanges( current, workInProgress, @@ -5396,7 +5390,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - throw Error(formatProdErrorMessage(306, current, "")); + workInProgress = getComponentNameFromType(current) || current; + throw Error(formatProdErrorMessage(306, workInProgress, "")); } } return workInProgress; @@ -5442,7 +5437,12 @@ function beginWork(current, workInProgress, renderLanes) { var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== init.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); init = nextProps.element; init === props @@ -5477,16 +5477,7 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = init), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== init && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = init)), markRef(current, workInProgress), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5554,36 +5545,25 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.child ); case 10: - a: { - props = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - init = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, props, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if (nextProps.children === init.children) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); - workInProgress = workInProgress.child; - } - return workInProgress; + return ( + (props = workInProgress.pendingProps), + pushProvider( + workInProgress, + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context, + props.value + ), + reconcileChildren(current, workInProgress, props.children, renderLanes), + workInProgress.child + ); case 9: return ( (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (init = readContext(init)), (props = props(init)), (workInProgress.flags |= 1), @@ -5625,7 +5605,7 @@ function beginWork(current, workInProgress, renderLanes) { return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (props = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), @@ -5656,10 +5636,11 @@ function beginWork(current, workInProgress, renderLanes) { : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== init.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -5736,133 +5717,73 @@ function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { parent = parent.return; } } -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} function propagateContextChanges( workInProgress, contexts, renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; 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); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; } - nextFiber = nextFiber.return; + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - fiber = nextFiber; - } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -5871,83 +5792,92 @@ function propagateParentContextChanges( renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + 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) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } -function prepareToReadContext(workInProgress, renderLanes) { +function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { return readContextForConsumer(currentlyRenderingFiber, context); } -function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -5960,7 +5890,7 @@ function readContextForConsumer(consumer, context) { if (null === consumer) throw Error(formatProdErrorMessage(308)); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -6035,8 +5965,11 @@ function pushTransition( (null === transitionStack.current ? push(transitionStack, newTransitions) : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); + ? push(transitionStack, transitionStack.current) + : push( + transitionStack, + transitionStack.current.concat(newTransitions) + )); } function popTransition(workInProgress, current) { null !== current && @@ -6138,7 +6071,11 @@ function DO_NOT_USE_queryFirstNode(fn) { : null; } function containsNode() { - throw Error(formatProdErrorMessage(248)); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = shim$1(); @@ -6171,14 +6108,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$92 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$92 = lastTailNode), + for (var lastTailNode$91 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$91 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$92 + null === lastTailNode$91 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$92.sibling = null); + : (lastTailNode$91.sibling = null); } } function bubbleProperties(completedWork) { @@ -6188,19 +6125,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags & 31457280), - (subtreeFlags |= child$93.flags & 31457280), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (var child$92 = completedWork.child; null !== child$92; ) + (newChildLanes |= child$92.lanes | child$92.childLanes), + (subtreeFlags |= child$92.subtreeFlags & 31457280), + (subtreeFlags |= child$92.flags & 31457280), + (child$92.return = completedWork), + (child$92 = child$92.sibling); else - for (child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags), - (subtreeFlags |= child$93.flags), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (child$92 = completedWork.child; null !== child$92; ) + (newChildLanes |= child$92.lanes | child$92.childLanes), + (subtreeFlags |= child$92.subtreeFlags), + (subtreeFlags |= child$92.flags), + (child$92.return = completedWork), + (child$92 = child$92.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6371,11 +6308,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$97 = null; + var cache$96 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$97 = newProps.memoizedState.cachePool.pool); - cache$97 !== instance && (newProps.flags |= 2048); + (cache$96 = newProps.memoizedState.cachePool.pool); + cache$96 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6403,8 +6340,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$97 = instance.rendering; - if (null === cache$97) + cache$96 = instance.rendering; + if (null === cache$96) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6412,11 +6349,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$97 = findFirstSuspended(current); - if (null !== cache$97) { + cache$96 = findFirstSuspended(current); + if (null !== cache$96) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$97.updateQueue; + current = cache$96.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6441,7 +6378,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$97)), null !== current)) { + if (((current = findFirstSuspended(cache$96)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6451,7 +6388,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$97.alternate) + !cache$96.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6463,13 +6400,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$97.sibling = workInProgress.child), - (workInProgress.child = cache$97)) + ? ((cache$96.sibling = workInProgress.child), + (workInProgress.child = cache$96)) : ((current = instance.last), null !== current - ? (current.sibling = cache$97) - : (workInProgress.child = cache$97), - (instance.last = cache$97)); + ? (current.sibling = cache$96) + : (workInProgress.child = cache$96), + (instance.last = cache$96)); } if (null !== instance.tail) return ( @@ -6683,14 +6620,22 @@ var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null; -function callComponentWillUnmountWithTimer(current, instance) { +function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance +) { instance.props = resolveClassComponentProps( current.type, current.memoizedProps, current.elementType === current.type ); instance.state = current.memoizedState; - instance.componentWillUnmount(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -6732,8 +6677,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$113) { + captureCommitPhaseError(current, nearestMountedAncestor, error$113); } else ref.current = null; } @@ -6879,10 +6824,10 @@ function commitHookEffectListMount(flags, finishedWork) { var effect = (finishedWork = finishedWork.next); do { if ((effect.tag & flags) === flags) { - var create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; + var destroy = effect.create; + var inst = effect.inst; + destroy = destroy(); + inst.destroy = destroy; } effect = effect.next; } while (effect !== finishedWork); @@ -6937,11 +6882,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } } @@ -7366,17 +7311,15 @@ function commitDeletionEffectsOnFiber( ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); - } + "function" === typeof prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7521,8 +7464,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { } try { commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); + } catch (error$122) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$122); } } break; @@ -7555,8 +7498,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { current = null !== current ? current.memoizedProps : newProps; try { flags._applyProps(flags, newProps, current); - } catch (error$126) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$126); + } catch (error$125) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$125); } } break; @@ -7592,8 +7535,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$128) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$128); + } catch (error$127) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$127); } flags = finishedWork.updateQueue; null !== flags && @@ -7730,12 +7673,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$117 = JSCompiler_inline_result.stateNode.containerInfo, + before$118 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$118, + parent$117 ); break; default: @@ -7768,15 +7711,12 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(current, instance); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -8089,20 +8029,20 @@ function commitPassiveMountOnFiber( ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -8185,9 +8125,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$138 = finishedWork.stateNode; + var instance$137 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$138._visibility & 4 + ? instance$137._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8199,7 +8139,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$138._visibility |= 4), + : ((instance$137._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8212,7 +8152,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$138 + instance$137 ); break; case 24: @@ -8306,12 +8246,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$143 = fiber.alternate; - null !== current$143 && null !== current$143.memoizedState - ? ((current$143 = suspenseyCommitFlag), + var current$142 = fiber.alternate; + null !== current$142 && null !== current$142.memoizedState + ? ((current$142 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$143)) + (suspenseyCommitFlag = current$142)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8654,11 +8594,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$9 = 31 - clz32(lane), - transitions = transitionLanesMap[index$9]; + index$8 = 31 - clz32(lane), + transitions = transitionLanesMap[index$8]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$9] = transitions; + transitionLanesMap[index$8] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8683,7 +8623,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { ); if (0 === lanes) return null; var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && + 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && (disableSchedulerTimeoutInWorkLoop || !didTimeout)) ? renderRootConcurrent(root, lanes) @@ -8904,9 +8844,9 @@ function markRootSuspended(root, suspendedLanes, spawnedLane) { 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - expirationTimes[index$6] = -1; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -9002,7 +8942,7 @@ function prepareFreshStack(root, lanes) { workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -9010,9 +8950,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -9047,10 +8987,10 @@ function handleThrow(root, thrownValue) { thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); workInProgressThrownValue = thrownValue; null === workInProgress && ((workInProgressRootExitStatus = 1), @@ -9112,8 +9052,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$149) { - handleThrow(root, thrownValue$149); + } catch (thrownValue$148) { + handleThrow(root, thrownValue$148); } while (1); lanes && root.shellSuspendCounter++; @@ -9222,8 +9162,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$151) { - handleThrow(root, thrownValue$151); + } catch (thrownValue$150) { + handleThrow(root, thrownValue$150); } while (1); resetContextDependencies(); @@ -10066,9 +10006,6 @@ function updateContainerSync(element, container, parentComponent, callback) { entangleTransitions(element, parentComponent, 2)); return 2; } -function emptyFindFiberByHostInstance() { - return null; -} Mode$1.setCurrent(FastNoSideEffects); var slice = Array.prototype.slice, LinearGradient = (function () { @@ -10196,56 +10133,28 @@ var slice = Array.prototype.slice, ); }; return Text; - })(React.Component), - devToolsConfig$jscomp$inline_1138 = { - findFiberByHostInstance: function () { - return null; - }, - bundleType: 0, - version: "19.0.0-www-modern-01172397-20240716", - rendererPackageName: "react-art" - }; -var internals$jscomp$inline_1372 = { - bundleType: devToolsConfig$jscomp$inline_1138.bundleType, - version: devToolsConfig$jscomp$inline_1138.version, - rendererPackageName: devToolsConfig$jscomp$inline_1138.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1138.rendererConfig, - overrideHookState: null, - overrideHookStateDeletePath: null, - overrideHookStateRenamePath: null, - overrideProps: null, - overridePropsDeletePath: null, - overridePropsRenamePath: null, - setErrorHandler: null, - setSuspenseHandler: null, - scheduleUpdate: null, + })(React.Component); +var internals$jscomp$inline_1353 = { + bundleType: 0, + version: "19.0.0-www-modern-4ea12a11-20240801", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: function (fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; + findFiberByHostInstance: function () { + return null; }, - findFiberByHostInstance: - devToolsConfig$jscomp$inline_1138.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: null, - scheduleRefresh: null, - scheduleRoot: null, - setRefreshHandler: null, - getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-01172397-20240716" + reconcilerVersion: "19.0.0-www-modern-4ea12a11-20240801" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1354 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1373.isDisabled && - hook$jscomp$inline_1373.supportsFiber + !hook$jscomp$inline_1354.isDisabled && + hook$jscomp$inline_1354.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1373.inject( - internals$jscomp$inline_1372 + (rendererID = hook$jscomp$inline_1354.inject( + internals$jscomp$inline_1353 )), - (injectedHook = hook$jscomp$inline_1373); + (injectedHook = hook$jscomp$inline_1354); } catch (err) {} } var Path = Mode$1.Path; @@ -10259,3 +10168,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; +exports.version = "19.0.0-www-modern-4ea12a11-20240801"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 160d51a1527f1..b6d6a688bbfba 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -75,20 +75,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork$1()); @@ -242,8 +228,8 @@ __DEV__ && return "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null; + ? owner.name + : null; } function getComponentNameFromFiber(fiber) { var type = fiber.type; @@ -376,8 +362,8 @@ __DEV__ && -1 < x.stack.indexOf("\n at") ? " ()" : -1 < x.stack.indexOf("@") - ? "@unknown:0:0" - : ""; + ? "@unknown:0:0" + : ""; } return "\n" + prefix + name + suffix; } @@ -533,28 +519,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -796,13 +760,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -862,21 +820,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -935,41 +878,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -985,21 +927,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -1030,25 +972,25 @@ __DEV__ && return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1072,11 +1014,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1092,34 +1034,23 @@ __DEV__ && originallyAttemptedLanes ) { if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); + root = root.pendingLanes & -536870913; + return 0 !== root ? root : root & 536870912 ? 536870912 : 0; } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } function markRootFinished(root, remainingLanes, spawnedLane) { @@ -1150,7 +1081,7 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; } @@ -1163,8 +1094,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1249,15 +1180,14 @@ __DEV__ && ); return dispatcher; } - function printToConsole(methodName, args, badgeName) { + function bindToConsole(methodName, args, badgeName) { var offset = 0; switch (methodName) { case "dir": case "dirxml": case "groupEnd": case "table": - console[methodName].apply(console, args); - return; + return bind.apply(console[methodName], [console].concat(args)); case "assert": offset = 1; } @@ -1279,7 +1209,8 @@ __DEV__ && " " + badgeName + " ", "" ); - console[methodName].apply(console, args); + args.unshift(console); + return bind.apply(console[methodName], args); } function createCursor(defaultValue) { return { current: defaultValue }; @@ -1384,7 +1315,7 @@ __DEV__ && (pop(contextStackCursor$1, fiber), pop(contextFiberStackCursor, fiber)); hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor, fiber), - (HostTransitionContext._currentValue = null)); + (HostTransitionContext._currentValue = NotPendingTransition)); } function typeName(value) { return ( @@ -1741,8 +1672,8 @@ __DEV__ && null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue - ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : null != lastDefaultValue && element.removeAttribute("value"); + ? setDefaultValue(element, type, getToStringValue(defaultValue)) + : null != lastDefaultValue && element.removeAttribute("value"); null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked); @@ -1996,10 +1927,10 @@ __DEV__ && : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } function describeTextDiff(clientText, serverProps, indent) { var maxLength = 120 - 2 * indent; @@ -2093,10 +2024,10 @@ __DEV__ && return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } function describeExpandedElement(type, props, rowPrefix) { var remainingRowLength = 120 - rowPrefix.length - type.length, @@ -2114,17 +2045,17 @@ __DEV__ && return 0 === properties.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } function describePropertiesDiff(clientObject, serverObject, indent) { var properties = "", @@ -2347,16 +2278,16 @@ __DEV__ && )), indent++) : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent - )), - indent++); + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); var propName = ""; i = node.fiber.child; for ( @@ -2713,23 +2644,23 @@ __DEV__ && camelize(styleName.replace(msPattern, "ms-")) )) : badVendoredStyleNamePattern.test(styleName) - ? (warnedStyleNames.hasOwnProperty(styleName) && - warnedStyleNames[styleName]) || - ((warnedStyleNames[styleName] = !0), - error$jscomp$0( - "Unsupported vendor-prefixed style property %s. Did you mean %s?", - styleName, - styleName.charAt(0).toUpperCase() + styleName.slice(1) - )) - : !badStyleValueWithSemicolonPattern.test(value) || - (warnedStyleValues.hasOwnProperty(value) && - warnedStyleValues[value]) || - ((warnedStyleValues[value] = !0), - error$jscomp$0( - 'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.', - styleName, - value.replace(badStyleValueWithSemicolonPattern, "") - )), + ? (warnedStyleNames.hasOwnProperty(styleName) && + warnedStyleNames[styleName]) || + ((warnedStyleNames[styleName] = !0), + error$jscomp$0( + "Unsupported vendor-prefixed style property %s. Did you mean %s?", + styleName, + styleName.charAt(0).toUpperCase() + styleName.slice(1) + )) + : !badStyleValueWithSemicolonPattern.test(value) || + (warnedStyleValues.hasOwnProperty(value) && + warnedStyleValues[value]) || + ((warnedStyleValues[value] = !0), + error$jscomp$0( + 'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.', + styleName, + value.replace(badStyleValueWithSemicolonPattern, "") + )), "number" === typeof value && (isNaN(value) ? warnedForNaNValue || @@ -2749,18 +2680,18 @@ __DEV__ && ? isCustomProperty ? style.setProperty(styleName, "") : "float" === styleName - ? (style.cssFloat = "") - : (style[styleName] = "") + ? (style.cssFloat = "") + : (style[styleName] = "") : isCustomProperty - ? style.setProperty(styleName, value) - : "number" !== typeof value || - 0 === value || - unitlessNumbers.has(styleName) - ? "float" === styleName - ? (style.cssFloat = value) - : (checkCSSPropertyStringCoercion(value, styleName), - (style[styleName] = ("" + value).trim())) - : (style[styleName] = value + "px"); + ? style.setProperty(styleName, value) + : "number" !== typeof value || + 0 === value || + unitlessNumbers.has(styleName) + ? "float" === styleName + ? (style.cssFloat = value) + : (checkCSSPropertyStringCoercion(value, styleName), + (style[styleName] = ("" + value).trim())) + : (style[styleName] = value + "px"); } function setValueForStyles(node, styles, prevStyles) { if (null != styles && "object" !== typeof styles) @@ -2825,8 +2756,8 @@ __DEV__ && (0 === styleName.indexOf("--") ? node.setProperty(styleName, "") : "float" === styleName - ? (node.cssFloat = "") - : (node[styleName] = "")); + ? (node.cssFloat = "") + : (node[styleName] = "")); for (var _styleName in styles) (_key2 = styles[_styleName]), styles.hasOwnProperty(_styleName) && @@ -3855,7 +3786,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -3906,9 +3837,7 @@ __DEV__ && ? workInProgressRootRenderLanes$jscomp$0 : 0 ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && + 0 !== (workInProgressRootRenderLanes$jscomp$0 & 3) && ((didPerformSomeWork = !0), performSyncWorkOnRoot( root, @@ -3938,8 +3867,8 @@ __DEV__ && ) { var root$jscomp$0 = root, lane = currentEventTransitionLane; - root$jscomp$0.pendingLanes |= SyncLane; - root$jscomp$0.entangledLanes |= SyncLane; + root$jscomp$0.pendingLanes |= 2; + root$jscomp$0.entangledLanes |= 2; root$jscomp$0.entanglements[1] |= lane; } root$jscomp$0 = scheduleTaskForRootDuringMicrotask(root, currentTime); @@ -3948,8 +3877,7 @@ __DEV__ && null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev)) : ((prev = root), - 0 !== (root$jscomp$0 & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + 0 !== (root$jscomp$0 & 3) && (mightHavePendingSyncWork = !0)); root = next; } currentEventTransitionLane = 0; @@ -3963,7 +3891,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -3994,12 +3922,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -4173,10 +4101,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4272,7 +4197,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -4306,7 +4231,7 @@ __DEV__ && newState, nextProps ); - if (updateLane.mode & 8) { + if (updateLane.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { partialState.call(instance, newState, nextProps); @@ -4331,7 +4256,7 @@ __DEV__ && newState, nextProps ); - if (updateLane.mode & 8) { + if (updateLane.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { nextState.call(instance, newState, nextProps); @@ -4843,7 +4768,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -4924,7 +4849,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -5021,7 +4946,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -5506,7 +5431,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -5563,7 +5488,7 @@ __DEV__ && if ( x === SuspenseException || (!disableLegacyMode && - 0 === (returnFiber.mode & 1) && + (returnFiber.mode & ConcurrentMode) === NoMode && "object" === typeof x && null !== x && "function" === typeof x.then) @@ -5621,12 +5546,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -5809,10 +5734,10 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - 0 !== (workInProgress.mode & 8); + (workInProgress.mode & StrictLegacyMode) !== NoMode; var children = callComponentInDEV(Component, props, secondArg); shouldDoubleInvokeUserFnsInHooksDEV = !1; didScheduleRenderPhaseUpdateDuringThisPass && @@ -5853,7 +5778,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; null === current || (current.flags & 31457280) === (workInProgress.flags & 31457280) || - (!disableLegacyMode && 0 === (current.mode & 1)) || + (!disableLegacyMode && (current.mode & ConcurrentMode) === NoMode) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5864,9 +5789,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -5925,7 +5849,7 @@ __DEV__ && function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; workInProgress.flags = - 0 !== (workInProgress.mode & 16) + (workInProgress.mode & StrictEffectsMode) !== NoMode ? workInProgress.flags & -201328645 : workInProgress.flags & -2053; current.lanes &= ~lanes; @@ -6004,6 +5928,34 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + 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 }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -6135,7 +6087,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -6264,15 +6216,12 @@ __DEV__ && "The result of getSnapshot should be cached to avoid an infinite loop" ), (didWarnUncachedGetSnapshot = !0))); - getServerSnapshot = workInProgressRoot; - if (null === getServerSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane( - getServerSnapshot, - workInProgressRootRenderLanes - ) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -6349,13 +6298,12 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6389,13 +6337,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -6518,8 +6466,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -6535,8 +6483,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -6776,8 +6724,8 @@ __DEV__ && ))); } function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode ? mountEffectImpl(142608384, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps); } @@ -6820,7 +6768,8 @@ __DEV__ && } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); return mountEffectImpl(fiberFlags, Layout, create, deps); } function imperativeHandleEffect(create, ref) { @@ -6853,7 +6802,8 @@ __DEV__ && ); deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); mountEffectImpl( fiberFlags, Layout, @@ -6943,7 +6893,7 @@ __DEV__ && function mountDeferredValueImpl(hook, value, initialValue) { return enableUseDeferredValueInitialArg && void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) + 0 === (renderLanes & 1073741824) ? ((hook.memoizedState = initialValue), (hook = requestDeferredLane()), (currentlyRenderingFiber$1.lanes |= hook), @@ -6959,7 +6909,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -7005,11 +6955,11 @@ __DEV__ && ); dispatchSetState(fiber, queue, thenableForFinishedState); } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { + } catch (error$9) { dispatchSetState(fiber, queue, { then: function () {}, status: "rejected", - reason: error$5 + reason: error$9 }); } finally { (Internals.p = previousPriority), @@ -7119,8 +7069,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : NotPendingTransition; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -7249,7 +7198,7 @@ __DEV__ && null === workInProgressRoot && finishQueueingConcurrentUpdates(); return; } - } catch (error$6) { + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } @@ -7286,7 +7235,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -7302,11 +7251,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -7325,7 +7274,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -7334,7 +7283,7 @@ __DEV__ && } } function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & 4) { + if (enableDebugTracing && fiber.mode & DebugTracingMode) { var name = getComponentNameFromFiber(fiber) || "Unknown"; logStateUpdateScheduled(name, lane, action); } @@ -7414,7 +7363,7 @@ __DEV__ && ) { var prevState = workInProgress.memoizedState, partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { partialState = getDerivedStateFromProps(nextProps, prevState); @@ -7454,7 +7403,7 @@ __DEV__ && newState, nextContext ); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { oldProps = instance.shouldComponentUpdate( @@ -7492,12 +7441,12 @@ __DEV__ && void 0 === context ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", @@ -7516,7 +7465,7 @@ __DEV__ && ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject)); addendum = new ctor(props, context); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { addendum = new ctor(props, context); @@ -7776,7 +7725,7 @@ __DEV__ && "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", name ))); - workInProgress.mode & 8 && + workInProgress.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, instance @@ -7814,7 +7763,8 @@ __DEV__ && (instance.state = workInProgress.memoizedState)); "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); } function resolveClassComponentProps( Component, @@ -7888,7 +7838,7 @@ __DEV__ && "object" === typeof error$1 && null !== error$1 && "string" === typeof error$1.environmentName - ? printToConsole( + ? bindToConsole( "error", [ "%o\n\n%s\n\n%s\n", @@ -7897,7 +7847,7 @@ __DEV__ && recreateMessage ], error$1.environmentName - ) + )() : error$jscomp$0( "%o\n\n%s\n\n%s\n", error$1, @@ -7995,12 +7945,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -8014,7 +7961,10 @@ __DEV__ && root, rootRenderLanes ) { - if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + if ( + !disableLegacyMode && + (suspenseBoundary.mode & ConcurrentMode) === NoMode + ) return ( suspenseBoundary === returnFiber ? (suspenseBoundary.flags |= 65536) @@ -8024,13 +7974,13 @@ __DEV__ && 1 === sourceFiber.tag ? null === sourceFiber.alternate ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(SyncLane)), + : ((returnFiber = createUpdate(2)), (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, SyncLane)) + enqueueUpdate(sourceFiber, returnFiber, 2)) : 0 === sourceFiber.tag && null === sourceFiber.alternate && (sourceFiber.tag = 28), - (sourceFiber.lanes |= SyncLane)), + (sourceFiber.lanes |= 2)), suspenseBoundary ); suspenseBoundary.flags |= 65536; @@ -8051,19 +8001,17 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || - 0 !== (sourceFiber.mode & 1) || + (sourceFiber.mode & ConcurrentMode) !== NoMode || (0 !== currentSourceFiber && 11 !== currentSourceFiber && 15 !== currentSourceFiber) || @@ -8074,10 +8022,10 @@ __DEV__ && : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); isHydrating && - (disableLegacyMode || sourceFiber.mode & 1) && + (disableLegacyMode || sourceFiber.mode & ConcurrentMode) && (didSuspendOrErrorDEV = !0); enableDebugTracing && - sourceFiber.mode & 4 && + sourceFiber.mode & DebugTracingMode && ((currentSourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), logComponentSuspended(currentSourceFiber, value)); @@ -8085,7 +8033,7 @@ __DEV__ && if (null !== currentSourceFiber) { switch (currentSourceFiber.tag) { case 13: - if (disableLegacyMode || sourceFiber.mode & 1) + if (disableLegacyMode || sourceFiber.mode & ConcurrentMode) null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === currentSourceFiber.alternate && @@ -8105,11 +8053,12 @@ __DEV__ && null === sourceFiber ? (currentSourceFiber.updateQueue = new Set([value])) : sourceFiber.add(value), - (disableLegacyMode || currentSourceFiber.mode & 1) && + (disableLegacyMode || + currentSourceFiber.mode & ConcurrentMode) && attachPingListener(root, value, rootRenderLanes)); return !1; case 22: - if (disableLegacyMode || currentSourceFiber.mode & 1) + if (disableLegacyMode || currentSourceFiber.mode & ConcurrentMode) return ( (currentSourceFiber.flags |= 65536), value === noopSuspenseyCommitThenable @@ -8146,7 +8095,10 @@ __DEV__ && "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } - if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) + if ( + isHydrating && + (disableLegacyMode || sourceFiber.mode & ConcurrentMode) + ) return ( (didSuspendOrErrorDEV = !0), (currentSourceFiber = suspenseHandlerStackCursor.current), @@ -8428,7 +8380,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -8587,8 +8539,11 @@ __DEV__ && renderLanes ); } - if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) - if (0 !== (renderLanes & OffscreenLane)) + if ( + disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode + ) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -8602,8 +8557,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = - OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -8659,8 +8613,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -8713,7 +8666,7 @@ __DEV__ && ), (didWarnAboutBadClass[componentName] = !0)); } - workInProgress.mode & 8 && + workInProgress.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, null @@ -8734,7 +8687,7 @@ __DEV__ && : contextStackCursor.current; context = getMaskedContext(workInProgress, context); } - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, @@ -8764,7 +8717,7 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = @@ -8827,7 +8780,7 @@ __DEV__ && isContextProvider(Component) ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -8903,11 +8856,11 @@ __DEV__ && state.UNSAFE_componentWillMount()), "function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864)) : ("function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), @@ -8917,7 +8870,7 @@ __DEV__ && (state = lane)) : ("function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864), (state = !1)); } else { @@ -8962,8 +8915,7 @@ __DEV__ && unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -8985,8 +8937,7 @@ __DEV__ && newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -9081,7 +9032,7 @@ __DEV__ && } else { enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextChildren = callRenderInDEV(shouldUpdate); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { callRenderInDEV(shouldUpdate); @@ -9187,32 +9138,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2433; - var JSCompiler_object_inline_stack_2434 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2421; + var JSCompiler_object_inline_stack_2422 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2435 = !1; + var JSCompiler_object_inline_componentStack_2423 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2433 = didSuspend) || - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2421 = didSuspend) || + (JSCompiler_object_inline_digest_2421 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2433 && - ((JSCompiler_object_inline_componentStack_2435 = !0), + JSCompiler_object_inline_digest_2421 && + ((JSCompiler_object_inline_componentStack_2423 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2433 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2421 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2423 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2432 = nextHydratableInstance; + var JSCompiler_object_inline_message_2420 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2432)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2420)) { c: { - var instance = JSCompiler_object_inline_message_2432; + var instance = JSCompiler_object_inline_message_2420; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9238,9 +9189,9 @@ __DEV__ && null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null, - retryLane: OffscreenLane + retryLane: 536870912 }), - (instance = createFiber(18, null, null, 0)), + (instance = createFiber(18, null, null, NoMode)), (instance.stateNode = JSCompiler_temp), (instance.return = workInProgress), (workInProgress.child = instance), @@ -9253,47 +9204,47 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2420 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2432 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2420 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2432 && - ((JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_message_2432.dehydrated), - null !== JSCompiler_object_inline_message_2432) + null !== JSCompiler_object_inline_message_2420 && + ((JSCompiler_object_inline_message_2420 = + JSCompiler_object_inline_message_2420.dehydrated), + null !== JSCompiler_object_inline_message_2420) ) return ( - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2420.data === SUSPENSE_FALLBACK_START_DATA - ? (workInProgress.lanes = DefaultHydrationLane) - : (workInProgress.lanes = OffscreenLane), + ? (workInProgress.lanes = 16) + : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_stack_2434.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2434.fallback; - if (JSCompiler_object_inline_componentStack_2435) + JSCompiler_object_inline_message_2420 = + JSCompiler_object_inline_stack_2422.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2422.fallback; + if (JSCompiler_object_inline_componentStack_2423) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2422 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2420, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2423 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2423.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2423.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2421, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9306,9 +9257,9 @@ __DEV__ && ? markerInstanceStack.current : null), (current = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2423.updateQueue), null === current - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = + ? (JSCompiler_object_inline_componentStack_2423.updateQueue = { transitions: workInProgress, markerInstances: renderLanes, @@ -9316,46 +9267,46 @@ __DEV__ && }) : ((current.transitions = workInProgress), (current.markerInstances = renderLanes)))), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2422 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2434.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2422.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2422 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2420, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2423 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2423.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2423.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2421, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2422 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2420 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2432 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2432) + ((JSCompiler_object_inline_message_2420 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2420) ) { if (didSuspend) workInProgress.flags & 256 @@ -9367,100 +9318,102 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2435 = - JSCompiler_object_inline_stack_2434.fallback), - (JSCompiler_object_inline_message_2432 = workInProgress.mode), - (JSCompiler_object_inline_stack_2434 = createFiberFromOffscreen( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2434.children - }, - JSCompiler_object_inline_message_2432, - 0, - null - )), - (JSCompiler_object_inline_componentStack_2435 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, - renderLanes, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2423 = + JSCompiler_object_inline_stack_2422.fallback), + (JSCompiler_object_inline_message_2420 = workInProgress.mode), + (JSCompiler_object_inline_stack_2422 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2422.children + }, + JSCompiler_object_inline_message_2420, + 0, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2), - (JSCompiler_object_inline_stack_2434.return = workInProgress), - (JSCompiler_object_inline_componentStack_2435.return = - workInProgress), - (JSCompiler_object_inline_stack_2434.sibling = - JSCompiler_object_inline_componentStack_2435), - (workInProgress.child = JSCompiler_object_inline_stack_2434), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2434 = workInProgress.child), - (JSCompiler_object_inline_stack_2434.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2434.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2433, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_componentStack_2435)); + (JSCompiler_object_inline_componentStack_2423 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2423, + JSCompiler_object_inline_message_2420, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2423.flags |= 2), + (JSCompiler_object_inline_stack_2422.return = workInProgress), + (JSCompiler_object_inline_componentStack_2423.return = + workInProgress), + (JSCompiler_object_inline_stack_2422.sibling = + JSCompiler_object_inline_componentStack_2423), + (workInProgress.child = JSCompiler_object_inline_stack_2422), + (disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2422 = workInProgress.child), + (JSCompiler_object_inline_stack_2422.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2422.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2421, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = + JSCompiler_object_inline_componentStack_2423)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2420.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2433 = - JSCompiler_object_inline_message_2432.nextSibling && - JSCompiler_object_inline_message_2432.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2433) { - JSCompiler_temp = JSCompiler_object_inline_digest_2433.dgst; - var message = JSCompiler_object_inline_digest_2433.msg; - instance = JSCompiler_object_inline_digest_2433.stck; - var componentStack = JSCompiler_object_inline_digest_2433.cstck; + JSCompiler_object_inline_digest_2421 = + JSCompiler_object_inline_message_2420.nextSibling && + JSCompiler_object_inline_message_2420.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2421) { + JSCompiler_temp = JSCompiler_object_inline_digest_2421.dgst; + var message = JSCompiler_object_inline_digest_2421.msg; + instance = JSCompiler_object_inline_digest_2421.stck; + var componentStack = JSCompiler_object_inline_digest_2421.cstck; } - JSCompiler_object_inline_message_2432 = message; - JSCompiler_object_inline_digest_2433 = JSCompiler_temp; - JSCompiler_object_inline_stack_2434 = instance; - JSCompiler_object_inline_componentStack_2435 = componentStack; - JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_message_2432 - ? Error(JSCompiler_object_inline_message_2432) + JSCompiler_object_inline_message_2420 = message; + JSCompiler_object_inline_digest_2421 = JSCompiler_temp; + JSCompiler_object_inline_stack_2422 = instance; + JSCompiler_object_inline_componentStack_2423 = componentStack; + JSCompiler_object_inline_message_2420 = + JSCompiler_object_inline_message_2420 + ? Error(JSCompiler_object_inline_message_2420) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2432.stack = - JSCompiler_object_inline_stack_2434 || ""; - JSCompiler_object_inline_message_2432.digest = - JSCompiler_object_inline_digest_2433; - JSCompiler_object_inline_digest_2433 = - void 0 === JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_message_2420.stack = + JSCompiler_object_inline_stack_2422 || ""; + JSCompiler_object_inline_message_2420.digest = + JSCompiler_object_inline_digest_2421; + JSCompiler_object_inline_digest_2421 = + void 0 === JSCompiler_object_inline_componentStack_2423 ? null - : JSCompiler_object_inline_componentStack_2435; - "string" === typeof JSCompiler_object_inline_digest_2433 && + : JSCompiler_object_inline_componentStack_2423; + "string" === typeof JSCompiler_object_inline_digest_2421 && CapturedStacks.set( - JSCompiler_object_inline_message_2432, - JSCompiler_object_inline_digest_2433 + JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_digest_2421 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2432, + value: JSCompiler_object_inline_message_2420, source: null, - stack: JSCompiler_object_inline_digest_2433 + stack: JSCompiler_object_inline_digest_2421 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9468,34 +9421,32 @@ __DEV__ && renderLanes ); } else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, renderLanes, !1 ), - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2421 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2433) + didReceiveUpdate || JSCompiler_object_inline_digest_2421) ) { - JSCompiler_object_inline_digest_2433 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2433) { - JSCompiler_object_inline_stack_2434 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2434 & SyncUpdateLanes)) - JSCompiler_object_inline_stack_2434 = SyncHydrationLane; + JSCompiler_object_inline_digest_2421 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2421) { + JSCompiler_object_inline_stack_2422 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2422 & 42)) + JSCompiler_object_inline_stack_2422 = 1; else - switch (JSCompiler_object_inline_stack_2434) { - case SyncLane: - JSCompiler_object_inline_stack_2434 = SyncHydrationLane; + switch (JSCompiler_object_inline_stack_2422) { + case 2: + JSCompiler_object_inline_stack_2422 = 1; break; - case InputContinuousLane: - JSCompiler_object_inline_stack_2434 = - InputContinuousHydrationLane; + case 8: + JSCompiler_object_inline_stack_2422 = 4; break; - case DefaultLane: - JSCompiler_object_inline_stack_2434 = DefaultHydrationLane; + case 32: + JSCompiler_object_inline_stack_2422 = 16; break; case 128: case 256: @@ -9516,40 +9467,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2434 = TransitionHydrationLane; + JSCompiler_object_inline_stack_2422 = 64; break; - case IdleLane: - JSCompiler_object_inline_stack_2434 = IdleHydrationLane; + case 268435456: + JSCompiler_object_inline_stack_2422 = 134217728; break; default: - JSCompiler_object_inline_stack_2434 = 0; + JSCompiler_object_inline_stack_2422 = 0; } - JSCompiler_object_inline_stack_2434 = + JSCompiler_object_inline_stack_2422 = 0 !== - (JSCompiler_object_inline_stack_2434 & - (JSCompiler_object_inline_digest_2433.suspendedLanes | + (JSCompiler_object_inline_stack_2422 & + (JSCompiler_object_inline_digest_2421.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2434; + : JSCompiler_object_inline_stack_2422; if ( - 0 !== JSCompiler_object_inline_stack_2434 && - JSCompiler_object_inline_stack_2434 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2422 && + JSCompiler_object_inline_stack_2422 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2434), + ((prevState.retryLane = JSCompiler_object_inline_stack_2422), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2422 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2421, current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2422 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2420.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9557,7 +9508,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2420.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9565,12 +9516,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2432._reactRetry = + (JSCompiler_object_inline_message_2420._reactRetry = workInProgress), (workInProgress = null)) : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2432.nextSibling + JSCompiler_object_inline_message_2420.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9588,73 +9539,73 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2434.children + JSCompiler_object_inline_stack_2422.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2435) + if (JSCompiler_object_inline_componentStack_2423) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2435 = - JSCompiler_object_inline_stack_2434.fallback), - (JSCompiler_object_inline_message_2432 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2423 = + JSCompiler_object_inline_stack_2422.fallback), + (JSCompiler_object_inline_message_2420 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), (componentStack = { mode: "hidden", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2422.children }), disableLegacyMode || - 0 !== (JSCompiler_object_inline_message_2432 & 1) || + (JSCompiler_object_inline_message_2420 & ConcurrentMode) !== NoMode || workInProgress.child === JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2434 = createWorkInProgress( + ? ((JSCompiler_object_inline_stack_2422 = createWorkInProgress( JSCompiler_temp, componentStack )), - (JSCompiler_object_inline_stack_2434.subtreeFlags = + (JSCompiler_object_inline_stack_2422.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)) - : ((JSCompiler_object_inline_stack_2434 = workInProgress.child), - (JSCompiler_object_inline_stack_2434.childLanes = 0), - (JSCompiler_object_inline_stack_2434.pendingProps = + : ((JSCompiler_object_inline_stack_2422 = workInProgress.child), + (JSCompiler_object_inline_stack_2422.childLanes = 0), + (JSCompiler_object_inline_stack_2422.pendingProps = componentStack), - workInProgress.mode & 2 && - ((JSCompiler_object_inline_stack_2434.actualDuration = 0), - (JSCompiler_object_inline_stack_2434.actualStartTime = -1), - (JSCompiler_object_inline_stack_2434.selfBaseDuration = + workInProgress.mode & ProfileMode && + ((JSCompiler_object_inline_stack_2422.actualDuration = 0), + (JSCompiler_object_inline_stack_2422.actualStartTime = -1), + (JSCompiler_object_inline_stack_2422.selfBaseDuration = JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2434.treeBaseDuration = + (JSCompiler_object_inline_stack_2422.treeBaseDuration = JSCompiler_temp.treeBaseDuration)), (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2435 = + ? (JSCompiler_object_inline_componentStack_2423 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2423 )) - : ((JSCompiler_object_inline_componentStack_2435 = + : ((JSCompiler_object_inline_componentStack_2423 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_componentStack_2423, + JSCompiler_object_inline_message_2420, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2)), - (JSCompiler_object_inline_componentStack_2435.return = + (JSCompiler_object_inline_componentStack_2423.flags |= 2)), + (JSCompiler_object_inline_componentStack_2423.return = workInProgress), - (JSCompiler_object_inline_stack_2434.return = workInProgress), - (JSCompiler_object_inline_stack_2434.sibling = - JSCompiler_object_inline_componentStack_2435), - (workInProgress.child = JSCompiler_object_inline_stack_2434), - (JSCompiler_object_inline_stack_2434 = - JSCompiler_object_inline_componentStack_2435), - (JSCompiler_object_inline_componentStack_2435 = workInProgress.child), - (JSCompiler_object_inline_message_2432 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2432 - ? (JSCompiler_object_inline_message_2432 = + (JSCompiler_object_inline_stack_2422.return = workInProgress), + (JSCompiler_object_inline_stack_2422.sibling = + JSCompiler_object_inline_componentStack_2423), + (workInProgress.child = JSCompiler_object_inline_stack_2422), + (JSCompiler_object_inline_stack_2422 = + JSCompiler_object_inline_componentStack_2423), + (JSCompiler_object_inline_componentStack_2423 = workInProgress.child), + (JSCompiler_object_inline_message_2420 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2420 + ? (JSCompiler_object_inline_message_2420 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2432.cachePool), + JSCompiler_object_inline_message_2420.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9662,73 +9613,76 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2432 = { + (JSCompiler_object_inline_message_2420 = { baseLanes: - JSCompiler_object_inline_message_2432.baseLanes | renderLanes, + JSCompiler_object_inline_message_2420.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2435.memoizedState = - JSCompiler_object_inline_message_2432), + (JSCompiler_object_inline_componentStack_2423.memoizedState = + JSCompiler_object_inline_message_2420), enableTransitionTracing && - ((JSCompiler_object_inline_message_2432 = enableTransitionTracing + ((JSCompiler_object_inline_message_2420 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2432 && + null !== JSCompiler_object_inline_message_2420 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2423.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, + ? (JSCompiler_object_inline_componentStack_2423.updateQueue = { + transitions: JSCompiler_object_inline_message_2420, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, - markerInstances: JSCompiler_temp, - retryQueue: - null !== componentStack ? componentStack.retryQueue : null - }) - : ((instance.transitions = - JSCompiler_object_inline_message_2432), - (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2435.childLanes = + ? (JSCompiler_object_inline_componentStack_2423.updateQueue = + { + transitions: JSCompiler_object_inline_message_2420, + markerInstances: JSCompiler_temp, + retryQueue: + null !== componentStack + ? componentStack.retryQueue + : null + }) + : ((instance.transitions = + JSCompiler_object_inline_message_2420), + (instance.markerInstances = JSCompiler_temp)))), + (JSCompiler_object_inline_componentStack_2423.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2421, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2422 ); pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2433 = current.child; - current = JSCompiler_object_inline_digest_2433.sibling; - JSCompiler_object_inline_digest_2433 = createWorkInProgress( - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2421 = current.child; + current = JSCompiler_object_inline_digest_2421.sibling; + JSCompiler_object_inline_digest_2421 = createWorkInProgress( + JSCompiler_object_inline_digest_2421, { mode: "visible", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2422.children } ); disableLegacyMode || - 0 !== (workInProgress.mode & 1) || - (JSCompiler_object_inline_digest_2433.lanes = renderLanes); - JSCompiler_object_inline_digest_2433.return = workInProgress; - JSCompiler_object_inline_digest_2433.sibling = null; + (workInProgress.mode & ConcurrentMode) !== NoMode || + (JSCompiler_object_inline_digest_2421.lanes = renderLanes); + JSCompiler_object_inline_digest_2421.return = workInProgress; + JSCompiler_object_inline_digest_2421.sibling = null; null !== current && ((renderLanes = workInProgress.deletions), null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2433; + workInProgress.child = JSCompiler_object_inline_digest_2421; workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2433; + return JSCompiler_object_inline_digest_2421; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = createFiberFromOffscreen( @@ -9750,7 +9704,7 @@ __DEV__ && progressedPrimaryFragment = workInProgress.child; primaryChildren = { mode: "hidden", children: primaryChildren }; disableLegacyMode || - 0 !== (mode & 1) || + (mode & ConcurrentMode) !== NoMode || null === progressedPrimaryFragment ? (progressedPrimaryFragment = createFiberFromOffscreen( primaryChildren, @@ -9760,7 +9714,7 @@ __DEV__ && )) : ((progressedPrimaryFragment.childLanes = 0), (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & 2 && + workInProgress.mode & ProfileMode && ((progressedPrimaryFragment.actualDuration = 0), (progressedPrimaryFragment.actualStartTime = -1), (progressedPrimaryFragment.selfBaseDuration = 0), @@ -9955,7 +9909,10 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if ( + disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode + ) switch (revealOrder) { case "forwards": renderLanes = workInProgress.child; @@ -10012,7 +9969,7 @@ __DEV__ && } function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { disableLegacyMode || - 0 !== (workInProgress.mode & 1) || + (workInProgress.mode & ConcurrentMode) !== NoMode || null === current || ((current.alternate = null), (workInProgress.alternate = null), @@ -10027,7 +9984,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -10055,12 +10012,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -10138,8 +10092,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -10191,7 +10144,7 @@ __DEV__ && } function beginWork(current, workInProgress, renderLanes) { if (workInProgress._debugNeedsRemount && null !== current) { - var copiedFiber = createFiberFromTypeAndProps( + renderLanes = createFiberFromTypeAndProps( workInProgress.type, workInProgress.key, workInProgress.pendingProps, @@ -10203,13 +10156,13 @@ __DEV__ && if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; workInProgress.alternate = null; - copiedFiber.index = workInProgress.index; - copiedFiber.sibling = workInProgress.sibling; - copiedFiber.return = workInProgress.return; - copiedFiber.ref = workInProgress.ref; - copiedFiber._debugInfo = workInProgress._debugInfo; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; if (workInProgress === returnFiber.child) - returnFiber.child = copiedFiber; + returnFiber.child = renderLanes; else { var prevSibling = returnFiber.child; if (null === prevSibling) @@ -10217,14 +10170,14 @@ __DEV__ && for (; prevSibling.sibling !== workInProgress; ) if (((prevSibling = prevSibling.sibling), null === prevSibling)) throw Error("Expected to find the previous sibling."); - prevSibling.sibling = copiedFiber; + prevSibling.sibling = renderLanes; } - var deletions = returnFiber.deletions; - null === deletions + workInProgress = returnFiber.deletions; + null === workInProgress ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : deletions.push(current); - copiedFiber.flags |= 2; - return copiedFiber; + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; } if (null !== current) if ( @@ -10250,142 +10203,153 @@ __DEV__ && } else { didReceiveUpdate = !1; - var JSCompiler_temp; - if ((JSCompiler_temp = isHydrating)) + if ((returnFiber = isHydrating)) warnIfNotHydrating(), - (JSCompiler_temp = 0 !== (workInProgress.flags & 1048576)); - if (JSCompiler_temp) { - var slotIndex = workInProgress.index; - warnIfNotHydrating(); - pushTreeId(workInProgress, treeForkCount, slotIndex); - } + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); } workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: - a: { - var elementType = workInProgress.elementType; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - var props = workInProgress.pendingProps; - var Component = callLazyInitInDEV(elementType); - workInProgress.type = Component; - if ("function" === typeof Component) - if (shouldConstruct(Component)) { - var resolvedProps = resolveClassComponentProps( - Component, - props, + a: if ( + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber, !1 - ); - workInProgress.tag = 1; - workInProgress.type = Component = - resolveFunctionForHotReloading(Component); - var JSCompiler_inline_result = updateClassComponent( + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( null, workInProgress, - Component, - resolvedProps, + current, + returnFiber, + renderLanes + ))) + : ((returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + )), + (workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + ); + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, renderLanes ); - } else { - var _resolvedProps = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 0; - validateFunctionComponentInDev(workInProgress, Component); - workInProgress.type = Component = - resolveFunctionForHotReloading(Component); - JSCompiler_inline_result = updateFunctionComponent( + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + ); + workInProgress.tag = 14; + workInProgress = updateMemoComponent( null, workInProgress, - Component, - _resolvedProps, + current, + disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current.type, + returnFiber + ), renderLanes ); + break a; } - else { - if (void 0 !== Component && null !== Component) { - var $$typeof = Component.$$typeof; - if ($$typeof === REACT_FORWARD_REF_TYPE) { - var _resolvedProps2 = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 11; - workInProgress.type = Component = - resolveForwardRefForHotReloading(Component); - JSCompiler_inline_result = updateForwardRef( - null, - workInProgress, - Component, - _resolvedProps2, - renderLanes - ); - break a; - } else if ($$typeof === REACT_MEMO_TYPE) { - var _resolvedProps3 = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 14; - JSCompiler_inline_result = updateMemoComponent( - null, - workInProgress, - Component, - disableDefaultPropsExceptForClasses - ? _resolvedProps3 - : resolveDefaultPropsOnNonClassComponent( - Component.type, - _resolvedProps3 - ), - renderLanes - ); - break a; - } - } - var hint = ""; - null !== Component && - "object" === typeof Component && - Component.$$typeof === REACT_LAZY_TYPE && - (hint = - " Did you wrap a component in React.lazy() more than once?"); - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - Component + - ". Lazy element type must resolve to a class or function." + - hint - ); - } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + renderLanes + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); } - return JSCompiler_inline_result; + return workInProgress; case 0: - var Component$jscomp$0 = workInProgress.type, - unresolvedProps = workInProgress.pendingProps, - resolvedProps$jscomp$0 = + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses || - workInProgress.elementType === Component$jscomp$0 - ? unresolvedProps + workInProgress.elementType === returnFiber + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - Component$jscomp$0, - unresolvedProps - ); - return updateFunctionComponent( - current, - workInProgress, - Component$jscomp$0, - resolvedProps$jscomp$0, - renderLanes + returnFiber, + prevSibling + )), + updateFunctionComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 1: - var _Component = workInProgress.type, - _resolvedProps4 = resolveClassComponentProps( - _Component, + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, workInProgress.pendingProps, - workInProgress.elementType === _Component - ); - return updateClassComponent( - current, - workInProgress, - _Component, - _resolvedProps4, - renderLanes + workInProgress.elementType === returnFiber + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 3: a: { @@ -10394,325 +10358,326 @@ __DEV__ && throw Error( "Should have a current fiber. This is a bug in React." ); - var nextProps = workInProgress.pendingProps, - prevState = workInProgress.memoizedState, - prevChildren = prevState.element; + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions, workInProgress); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - var nextCache = nextState.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== prevState.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); - var nextChildren = nextState.element; - if (prevState.isDehydrated) { - var overrideState = { - element: nextChildren, - isDehydrated: !1, - cache: nextState.cache - }; - workInProgress.updateQueue.baseState = overrideState; - workInProgress.memoizedState = overrideState; - if (workInProgress.flags & 256) { - var JSCompiler_inline_result$jscomp$0 = - mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); break a; - } else if (nextChildren !== prevChildren) { - var recoverableError = createCapturedValueAtFiber( + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( Error( "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." ), workInProgress ); - queueHydrationError(recoverableError); - JSCompiler_inline_result$jscomp$0 = - mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ); - break a; - } else { - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ); - hydrationParentFiber = workInProgress; - isHydrating = !0; - hydrationErrors = null; - didSuspendOrErrorDEV = !1; - hydrationDiffRootDEV = null; - rootOrSingletonContext = !0; + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else for ( - var child = mountChildFibers( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( workInProgress, null, - nextChildren, + nextProps, renderLanes ), - node = (workInProgress.child = child); - node; + workInProgress.child = renderLanes; + renderLanes; ) - (node.flags = (node.flags & -3) | 4096), - (node = node.sibling); - } - } else { + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { resetHydrationState(); - if (nextChildren === prevChildren) { - JSCompiler_inline_result$jscomp$0 = - bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } reconcileChildren( current, workInProgress, - nextChildren, + nextProps, renderLanes ); } - JSCompiler_inline_result$jscomp$0 = workInProgress.child; + workInProgress = workInProgress.child; } - return JSCompiler_inline_result$jscomp$0; + return workInProgress; case 26: - markRef(current, workInProgress); - if (null === current) { - var resource = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - ); - if (resource) workInProgress.memoizedState = resource; - else if (!isHydrating) { - var type = workInProgress.type, - props$jscomp$0 = workInProgress.pendingProps, - rootContainerInstance = requiredContext( - rootInstanceStackCursor.current - ), - domElement = getOwnerDocumentFromRootContainer( - rootContainerInstance - ).createElement(type); - domElement[internalInstanceKey] = workInProgress; - domElement[internalPropsKey] = props$jscomp$0; - setInitialProperties(domElement, type, props$jscomp$0); - markNodeAsHoistable(domElement); - workInProgress.stateNode = domElement; - } - } else - workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - ); - return null; + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(renderLanes)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = current), + setInitialProperties(returnFiber, renderLanes, current), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); case 27: - pushHostContext(workInProgress); - if (null === current && isHydrating) { - var currentRootContainer = requiredContext( - rootInstanceStackCursor.current - ), - currentHostContext = getHostContext(), - instance = (workInProgress.stateNode = resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - currentRootContainer, - currentHostContext, - !1 - )); - if (!didSuspendOrErrorDEV) { - var differences = diffHydratedProperties( - instance, + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( workInProgress.type, - workInProgress.pendingProps, - currentHostContext - ); - null !== differences && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - differences); - } - hydrationParentFiber = workInProgress; - rootOrSingletonContext = !0; - nextHydratableInstance = getNextHydratable(instance.firstChild); - } - var nextChildren$jscomp$0 = workInProgress.pendingProps.children; - null !== current || isHydrating - ? reconcileChildren( + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( current, workInProgress, - nextChildren$jscomp$0, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, + TransitionAwareHostComponent, + null, null, - nextChildren$jscomp$0, renderLanes - )); - markRef(current, workInProgress); - return workInProgress.child; - case 5: - if (null === current && isHydrating) { - var currentHostContext$jscomp$0 = getHostContext(), - shouldKeepWarning = validateDOMNesting( - workInProgress.type, - currentHostContext$jscomp$0.ancestorInfo - ), - nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if (!(JSCompiler_temp$jscomp$0 = !nextInstance)) { - var instance$jscomp$0 = canHydrateInstance( - nextInstance, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - ); - if (null !== instance$jscomp$0) { - workInProgress.stateNode = instance$jscomp$0; - if (!didSuspendOrErrorDEV) { - var differences$jscomp$0 = diffHydratedProperties( - instance$jscomp$0, - workInProgress.type, - workInProgress.pendingProps, - currentHostContext$jscomp$0 - ); - null !== differences$jscomp$0 && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - differences$jscomp$0); - } - hydrationParentFiber = workInProgress; - nextHydratableInstance = getNextHydratable( - instance$jscomp$0.firstChild - ); - rootOrSingletonContext = !1; - var JSCompiler_inline_result$jscomp$1 = !0; - } else JSCompiler_inline_result$jscomp$1 = !1; - JSCompiler_temp$jscomp$0 = !JSCompiler_inline_result$jscomp$1; - } - JSCompiler_temp$jscomp$0 && - (shouldKeepWarning && - warnNonHydratedInstance(workInProgress, nextInstance), - throwOnHydrationMismatch(workInProgress)); - } - pushHostContext(workInProgress); - var type$jscomp$0 = workInProgress.type, - nextProps$jscomp$0 = workInProgress.pendingProps, - prevProps = null !== current ? current.memoizedProps : null, - nextChildren$jscomp$1 = nextProps$jscomp$0.children; - shouldSetTextContent(type$jscomp$0, nextProps$jscomp$0) - ? (nextChildren$jscomp$1 = null) - : null !== prevProps && - shouldSetTextContent(type$jscomp$0, prevProps) && - (workInProgress.flags |= 32); - if (null !== workInProgress.memoizedState) { - var newState = renderWithHooks( + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( current, workInProgress, - TransitionAwareHostComponent, - null, - null, + returnFiber, renderLanes - ); - HostTransitionContext._currentValue = newState; - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== newState && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - )); - } - markRef(current, workInProgress); - reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$1, - renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 6: - if (null === current && isHydrating) { - var text = workInProgress.pendingProps, - ancestor = getHostContext().ancestorInfo.current; - var shouldKeepWarning$jscomp$0 = - null != ancestor ? validateTextNesting(text, ancestor.tag) : !0; - var nextInstance$jscomp$0 = nextHydratableInstance, - JSCompiler_temp$jscomp$1; - if (!(JSCompiler_temp$jscomp$1 = !nextInstance$jscomp$0)) { - var textInstance = canHydrateTextInstance( - nextInstance$jscomp$0, - workInProgress.pendingProps, - rootOrSingletonContext - ); - if (null !== textInstance) { - workInProgress.stateNode = textInstance; - hydrationParentFiber = workInProgress; - nextHydratableInstance = null; - var JSCompiler_inline_result$jscomp$2 = !0; - } else JSCompiler_inline_result$jscomp$2 = !1; - JSCompiler_temp$jscomp$1 = !JSCompiler_inline_result$jscomp$2; - } - JSCompiler_temp$jscomp$1 && - (shouldKeepWarning$jscomp$0 && - warnNonHydratedInstance(workInProgress, nextInstance$jscomp$0), - throwOnHydrationMismatch(workInProgress)); - } - return null; + return ( + null === current && + isHydrating && + ((renderLanes = workInProgress.pendingProps), + (current = getHostContext().ancestorInfo.current), + (renderLanes = + null != current + ? validateTextNesting(renderLanes, current.tag) + : !0), + (current = nextHydratableInstance), + (returnFiber = !current) || + ((returnFiber = canHydrateTextInstance( + current, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (renderLanes && + warnNonHydratedInstance(workInProgress, current), + throwOnHydrationMismatch(workInProgress))), + null + ); case 13: return updateSuspenseComponent(current, workInProgress, renderLanes); case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - var nextChildren$jscomp$2 = workInProgress.pendingProps; - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - nextChildren$jscomp$2, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$2, - renderLanes - ); - return workInProgress.child; case 11: - var type$jscomp$1 = workInProgress.type, - _unresolvedProps2 = workInProgress.pendingProps, - _resolvedProps5 = + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses || - workInProgress.elementType === type$jscomp$1 - ? _unresolvedProps2 + workInProgress.elementType === returnFiber + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - type$jscomp$1, - _unresolvedProps2 - ); - return updateForwardRef( - current, - workInProgress, - type$jscomp$1, - _resolvedProps5, - renderLanes + returnFiber, + prevSibling + )), + updateForwardRef( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 7: return ( @@ -10735,103 +10700,95 @@ __DEV__ && workInProgress.child ); case 12: - workInProgress.flags |= 4; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes + return ( + (workInProgress.flags |= 4), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = 0), + (returnFiber.passiveEffectDuration = 0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 10: - a: { - var context = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - var newProps = workInProgress.pendingProps, - oldProps = workInProgress.memoizedProps, - newValue = newProps.value; - "value" in newProps || + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, context, newValue); - if (!enableLazyContextPropagation && null !== oldProps) - if (objectIs(oldProps.value, newValue)) { - if ( - oldProps.children === newProps.children && - !didPerformWorkStackCursor.current - ) { - var JSCompiler_inline_result$jscomp$3 = - bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange(workInProgress, context, renderLanes); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, - newProps.children, + prevSibling.children, renderLanes - ); - JSCompiler_inline_result$jscomp$3 = workInProgress.child; - } - return JSCompiler_inline_result$jscomp$3; + ), + workInProgress.child + ); case 9: - if (enableRenderableContext) - var context$jscomp$0 = workInProgress.type._context; - else - (context$jscomp$0 = workInProgress.type), - void 0 !== context$jscomp$0._context && - (context$jscomp$0 = context$jscomp$0._context); - var render = workInProgress.pendingProps.children; - "function" !== typeof render && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ); - prepareToReadContext(workInProgress, renderLanes); - var newValue$jscomp$0 = readContext(context$jscomp$0); - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - var newChildren = callComponentInDEV( - render, - newValue$jscomp$0, - void 0 + return ( + enableRenderableContext + ? (prevSibling = workInProgress.type._context) + : ((prevSibling = workInProgress.type), + void 0 !== prevSibling._context && + (prevSibling = prevSibling._context)), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + enableSchedulingProfiler && + markComponentRenderStarted(workInProgress), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + enableSchedulingProfiler && markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - enableSchedulingProfiler && markComponentRenderStopped(); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, newChildren, renderLanes); - return workInProgress.child; case 14: - var _type = workInProgress.type, - _unresolvedProps3 = workInProgress.pendingProps, - _resolvedProps6 = disableDefaultPropsExceptForClasses - ? _unresolvedProps3 + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - _type, - _unresolvedProps3 - ); - _resolvedProps6 = disableDefaultPropsExceptForClasses - ? _resolvedProps6 - : resolveDefaultPropsOnNonClassComponent( - _type.type, - _resolvedProps6 - ); - return updateMemoComponent( - current, - workInProgress, - _type, - _resolvedProps6, - renderLanes + returnFiber, + prevSibling + )), + (prevSibling = disableDefaultPropsExceptForClasses + ? prevSibling + : resolveDefaultPropsOnNonClassComponent( + returnFiber.type, + prevSibling + )), + updateMemoComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -10843,49 +10800,48 @@ __DEV__ && ); case 17: if (disableLegacyMode) break; - var _Component2 = workInProgress.type, - _resolvedProps7 = resolveClassComponentProps( - _Component2, - workInProgress.pendingProps, - workInProgress.elementType === _Component2 - ); + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); workInProgress.tag = 1; - if (isContextProvider(_Component2)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress, renderLanes); - constructClassInstance(workInProgress, _Component2, _resolvedProps7); + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress); + constructClassInstance(workInProgress, returnFiber, prevSibling); mountClassInstance( workInProgress, - _Component2, - _resolvedProps7, + returnFiber, + prevSibling, renderLanes ); return finishClassComponent( null, workInProgress, - _Component2, + returnFiber, !0, - hasContext, + current, renderLanes ); case 28: if (disableLegacyMode) break; - var _Component3 = workInProgress.type, - _resolvedProps8 = resolveClassComponentProps( - _Component3, - workInProgress.pendingProps, - workInProgress.elementType === _Component3 - ); + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); workInProgress.tag = 0; return updateFunctionComponent( null, workInProgress, - _Component3, - _resolvedProps8, + returnFiber, + prevSibling, renderLanes ); case 19: @@ -10895,15 +10851,17 @@ __DEV__ && renderLanes ); case 21: - var nextChildren$jscomp$3 = workInProgress.pendingProps.children; - markRef(current, workInProgress); - reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$3, - renderLanes + return ( + (returnFiber = workInProgress.pendingProps.children), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 22: return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: @@ -10913,96 +10871,95 @@ __DEV__ && renderLanes ); case 24: - prepareToReadContext(workInProgress, renderLanes); - var parentCache = readContext(CacheContext); - if (null === current) { - var cacheFromPool = peekCacheFromPool(); - if (null !== cacheFromPool) var freshCache = cacheFromPool; - else { - var root = workInProgressRoot, - freshCache$jscomp$0 = createCache(); - root.pooledCache = freshCache$jscomp$0; - retainCache(freshCache$jscomp$0); - null !== freshCache$jscomp$0 && - (root.pooledCacheLanes |= renderLanes); - freshCache = freshCache$jscomp$0; - } - workInProgress.memoizedState = { - parent: parentCache, - cache: freshCache - }; - initializeUpdateQueue(workInProgress); - pushProvider(workInProgress, CacheContext, freshCache); - } else { - 0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()); - var prevState$jscomp$0 = current.memoizedState, - nextState$jscomp$0 = workInProgress.memoizedState; - if (prevState$jscomp$0.parent !== parentCache) { - var derivedState = { parent: parentCache, cache: parentCache }; - workInProgress.memoizedState = derivedState; - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - derivedState); - pushProvider(workInProgress, CacheContext, parentCache); - } else { - var nextCache$jscomp$0 = nextState$jscomp$0.cache; - pushProvider(workInProgress, CacheContext, nextCache$jscomp$0); - nextCache$jscomp$0 !== prevState$jscomp$0.cache && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ); - } - } - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 25: - if (enableTransitionTracing) { - if (enableTransitionTracing) { - if (null === current) { - var currentTransitions = enableTransitionTracing - ? transitionStack.current - : null; - if (null !== currentTransitions) { - var markerInstance = { - tag: TransitionTracingMarker, - transitions: new Set(currentTransitions), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }; - workInProgress.stateNode = markerInstance; - workInProgress.flags |= 2048; - } - } else - current.memoizedProps.name !== - workInProgress.pendingProps.name && - error$jscomp$0( - "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." - ); - var instance$jscomp$1 = workInProgress.stateNode; - null !== instance$jscomp$1 && - pushMarkerInstance(workInProgress, instance$jscomp$1); - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ); - var JSCompiler_inline_result$jscomp$4 = workInProgress.child; - } else JSCompiler_inline_result$jscomp$4 = null; - return JSCompiler_inline_result$jscomp$4; - } + if (enableTransitionTracing) + return ( + enableTransitionTracing + ? (null === current + ? ((returnFiber = enableTransitionTracing + ? transitionStack.current + : null), + null !== returnFiber && + ((returnFiber = { + tag: TransitionTracingMarker, + transitions: new Set(returnFiber), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }), + (workInProgress.stateNode = returnFiber), + (workInProgress.flags |= 2048))) + : current.memoizedProps.name !== + workInProgress.pendingProps.name && + error$jscomp$0( + "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." + ), + (returnFiber = workInProgress.stateNode), + null !== returnFiber && + pushMarkerInstance(workInProgress, returnFiber), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + (workInProgress = workInProgress.child)) + : (workInProgress = null), + workInProgress + ); break; case 29: throw workInProgress.pendingProps; @@ -11060,147 +11017,80 @@ __DEV__ && "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; 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); scheduleContextWorkOnParentPath( - fiber.return, + list.return, renderLanes, workInProgress ); - list.lanes |= renderLanes; - break; + forcePropagateEntireTree || (nextFiber = null); + break a; } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } - fiber = nextFiber; - } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -11209,85 +11099,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + 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) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -11296,9 +11191,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -11314,7 +11208,7 @@ __DEV__ && ); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -11361,16 +11255,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -11477,7 +11371,7 @@ __DEV__ && : null; } function containsNode$1(node) { - for (node = getClosestInstanceFromNode(node) || null; null !== node; ) { + for (node = getClosestInstanceFromNode(node); null !== node; ) { if (21 === node.tag && node.stateNode === this) return !0; node = node.return; } @@ -11518,7 +11412,7 @@ __DEV__ && ? (workInProgress.flags |= 4) : workInProgress.flags & 16384 && ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { @@ -11553,7 +11447,7 @@ __DEV__ && newChildLanes = 0, subtreeFlags = 0; if (didBailout) - if (0 !== (completedWork.mode & 2)) { + if ((completedWork.mode & ProfileMode) !== NoMode) { for ( var _treeBaseDuration = completedWork.selfBaseDuration, _child2 = completedWork.child; @@ -11578,7 +11472,7 @@ __DEV__ && (subtreeFlags |= _treeBaseDuration.flags & 31457280), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); - else if (0 !== (completedWork.mode & 2)) { + else if ((completedWork.mode & ProfileMode) !== NoMode) { _treeBaseDuration = completedWork.actualDuration; _child2 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) @@ -11677,19 +11571,19 @@ __DEV__ && : (bubbleProperties(workInProgress), (workInProgress.flags &= -16777217))) : renderLanes - ? renderLanes !== current.memoizedState - ? (markUpdate(workInProgress), + ? renderLanes !== current.memoizedState + ? (markUpdate(workInProgress), + bubbleProperties(workInProgress), + preloadResourceAndSuspendIfNeeded( + workInProgress, + renderLanes + )) + : (bubbleProperties(workInProgress), + (workInProgress.flags &= -16777217)) + : (current.memoizedProps !== newProps && + markUpdate(workInProgress), bubbleProperties(workInProgress), - preloadResourceAndSuspendIfNeeded( - workInProgress, - renderLanes - )) - : (bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)) - : (current.memoizedProps !== newProps && - markUpdate(workInProgress), - bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)), + (workInProgress.flags &= -16777217)), null ); case 27: @@ -11953,7 +11847,7 @@ __DEV__ && ); _type[internalInstanceKey] = workInProgress; bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && null !== newProps && ((_type = workInProgress.child), null !== _type && @@ -11966,7 +11860,7 @@ __DEV__ && (workInProgress.memoizedState = null), (workInProgress.flags |= 4), bubbleProperties(workInProgress), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && null !== newProps && ((_type = workInProgress.child), null !== _type && @@ -11989,7 +11883,7 @@ __DEV__ && if (0 !== (workInProgress.flags & 128)) return ( (workInProgress.lanes = renderLanes), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress ); @@ -12015,7 +11909,7 @@ __DEV__ && null != workInProgress.memoizedProps.suspenseCallback && (workInProgress.flags |= 4); bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && newProps && ((current = workInProgress.child), null !== current && @@ -12112,7 +12006,7 @@ __DEV__ && } else 2 * now$1() - _type.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(_type, !1), @@ -12169,9 +12063,11 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + !newProps || + (!disableLegacyMode && + (workInProgress.mode & ConcurrentMode) === NoMode) ? bubbleProperties(workInProgress) - : 0 !== (renderLanes & OffscreenLane) && + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -12231,7 +12127,7 @@ __DEV__ && (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null @@ -12268,7 +12164,7 @@ __DEV__ && current = workInProgress.flags; return current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null; @@ -12295,7 +12191,7 @@ __DEV__ && (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null @@ -12370,7 +12266,7 @@ __DEV__ && } function shouldProfile(current) { return ( - 0 !== (current.mode & 2) && + (current.mode & ProfileMode) !== NoMode && (executionContext & CommitContext) !== NoContext ); } @@ -12379,25 +12275,25 @@ __DEV__ && nearestMountedAncestor, instance ) { - try { - if ( - ((instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - )), - (instance.state = current.memoizedState), - shouldProfile(current)) - ) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); - } catch (error$7) { - captureCommitPhaseError(current, nearestMountedAncestor, error$7); - } + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startLayoutEffectTimer(), + callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : callComponentWillUnmountInDEV( + current, + nearestMountedAncestor, + instance + ); } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -12431,8 +12327,8 @@ __DEV__ && ), (ref.current = instanceToUse); } - } catch (error$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + } catch (error$11) { + captureCommitPhaseError(current, nearestMountedAncestor, error$11); } } function safelyDetachRef(current, nearestMountedAncestor) { @@ -12448,8 +12344,8 @@ __DEV__ && recordLayoutEffectDuration(current); } else refCleanup(); - } catch (error$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); + } catch (error$12) { + captureCommitPhaseError(current, nearestMountedAncestor, error$12); } finally { (current.refCleanup = null), (current = current.alternate), @@ -12464,18 +12360,11 @@ __DEV__ && recordLayoutEffectDuration(current); } else ref(null); - } catch (error$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + } catch (error$13) { + captureCommitPhaseError(current, nearestMountedAncestor, error$13); } else ref.current = null; } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); - } - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -12500,7 +12389,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$50) { + } catch (e$48) { JSCompiler_temp = null; break a; } @@ -12583,8 +12472,8 @@ __DEV__ && commitBeforeMutationEffectsOnFiber, firstChild ); - } catch (error$12) { - captureCommitPhaseError(firstChild, firstChild.return, error$12); + } catch (error$14) { + captureCommitPhaseError(firstChild, firstChild.return, error$14); } root = firstChild.sibling; if (null !== root) { @@ -12729,7 +12618,7 @@ __DEV__ && markComponentLayoutEffectUnmountStarted(finishedWork)), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1), enableSchedulingProfiler && @@ -12770,11 +12659,8 @@ __DEV__ && injectedProfilingHooks.markComponentLayoutEffectMountStarted( finishedWork )); - var create = effect.create; (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; + var destroy = callCreateInDEV(effect); (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); enableSchedulingProfiler && ((flags & Passive) !== NoFlags @@ -12789,27 +12675,27 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = + if (void 0 !== destroy && "function" !== typeof destroy) { + var hookName = 0 !== (effect.tag & Layout) ? "useLayoutEffect" : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), + ? "useInsertionEffect" + : "useEffect"; error$jscomp$0( "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create + hookName, + null === destroy ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + create - )); + : "function" === typeof destroy.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + destroy + ); + } } effect = effect.next; } while (effect !== updateQueue); @@ -12852,15 +12738,15 @@ __DEV__ && try { startLayoutEffectTimer(), commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } catch (error$15) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$15); } recordLayoutEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); } } function commitClassCallbacks(finishedWork) { @@ -12882,8 +12768,8 @@ __DEV__ && )); try { commitCallbacks(updateQueue, instance); - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); + } catch (error$17) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$17); } } } @@ -12900,10 +12786,12 @@ __DEV__ && props.autoFocus && instance.focus(); break a; case "img": - props.src && (instance.src = props.src); + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); } - } catch (error$20) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$20); + } catch (error$18) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$18); } } function commitProfilerUpdate(finishedWork, current) { @@ -12945,8 +12833,8 @@ __DEV__ && } parentFiber = parentFiber.return; } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } catch (error$19) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$19); } } function commitLayoutEffectOnFiber( @@ -12976,42 +12864,24 @@ __DEV__ && ); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )), - shouldProfile(finishedWork)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidMountInDEV(finishedWork, finishedRoot), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidMountInDEV(finishedWork, finishedRoot); else { committedLanes = resolveClassComponentProps( finishedWork.type, @@ -13032,36 +12902,23 @@ __DEV__ && "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( + finishedRoot, committedLanes, prevState, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : callComponentDidUpdateInDEV( finishedWork, - finishedWork.return, - error$18 + finishedRoot, + committedLanes, + prevState, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); @@ -13088,11 +12945,11 @@ __DEV__ && } try { commitCallbacks(flags, finishedRoot); - } catch (error$22) { + } catch (error$20) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$20 ); } } @@ -13135,7 +12992,10 @@ __DEV__ && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + disableLegacyMode || + (finishedWork.mode & ConcurrentMode) !== NoMode + ) { if ( ((prevState = null !== finishedWork.memoizedState || @@ -13596,7 +13456,7 @@ __DEV__ && void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -13607,14 +13467,14 @@ __DEV__ && shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - safelyCallDestroy( + callDestroyInDEV( deletedFiber, nearestMountedAncestor, destroy @@ -13656,7 +13516,7 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - disableLegacyMode || deletedFiber.mode & 1 + disableLegacyMode || deletedFiber.mode & ConcurrentMode ? ((offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState), @@ -13696,11 +13556,11 @@ __DEV__ && var onHydrated = hydrationCallbacks.onHydrated; onHydrated && onHydrated(current); } - } catch (error$25) { + } catch (error$23) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$25 + error$23 ); } } @@ -13736,10 +13596,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -13749,10 +13609,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -13827,8 +13687,8 @@ __DEV__ && var alternate = root.alternate; null !== alternate && (alternate.return = null); root.return = null; - } catch (error$26) { - captureCommitPhaseError(childToDelete, parentFiber, error$26); + } catch (error$24) { + captureCommitPhaseError(childToDelete, parentFiber, error$24); } } if (parentFiber.subtreeFlags & 13878) @@ -13860,11 +13720,11 @@ __DEV__ && finishedWork.return ), commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error$27) { + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$27 + error$25 ); } if (shouldProfile(finishedWork)) { @@ -13875,11 +13735,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$28) { + } catch (error$26) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$28 + error$26 ); } recordLayoutEffectDuration(finishedWork); @@ -13890,11 +13750,11 @@ __DEV__ && finishedWork, finishedWork.return ); - } catch (error$29) { + } catch (error$27) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$29 + error$27 ); } } @@ -14080,11 +13940,11 @@ __DEV__ && newProps ); domElement[internalPropsKey] = newProps; - } catch (error$30) { + } catch (error$28) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + error$28 ); } break; @@ -14140,11 +14000,11 @@ __DEV__ && root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$31) { + } catch (error$29) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$31 + error$29 ); } } @@ -14155,11 +14015,11 @@ __DEV__ && try { updateProperties(root, hoistableRoot, current, lanes), (root[internalPropsKey] = lanes); - } catch (error$32) { + } catch (error$30) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + error$30 ); } } @@ -14182,11 +14042,11 @@ __DEV__ && current = finishedWork.memoizedProps; try { flags.nodeValue = current; - } catch (error$33) { + } catch (error$31) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$33 + error$31 ); } } @@ -14205,11 +14065,11 @@ __DEV__ && ) try { retryIfBlockedOn(root.containerInfo); - } catch (error$34) { + } catch (error$32) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$32 ); } needsFormReset && @@ -14245,11 +14105,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$35) { + } catch (error$33) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$35 + error$33 ); } flags = finishedWork.updateQueue; @@ -14264,7 +14124,7 @@ __DEV__ && safelyDetachRef(current, current.return); domElement = null !== finishedWork.memoizedState; newProps = null !== current && null !== current.memoizedState; - disableLegacyMode || finishedWork.mode & 1 + disableLegacyMode || finishedWork.mode & ConcurrentMode ? ((suspenseCallback = offscreenSubtreeIsHidden), (retryQueue = offscreenSubtreeWasHidden), (offscreenSubtreeIsHidden = suspenseCallback || domElement), @@ -14288,7 +14148,8 @@ __DEV__ && null === current || newProps || root || - ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + ((disableLegacyMode || + (finishedWork.mode & ConcurrentMode) !== NoMode) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) @@ -14316,11 +14177,11 @@ __DEV__ && null == nodeName || "boolean" === typeof nodeName ? "" : ("" + nodeName).trim())); - } catch (error$23) { + } catch (error$21) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$23 + error$21 ); } } @@ -14330,11 +14191,11 @@ __DEV__ && root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$24) { + } catch (error$22) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$24 + error$22 ); } } else if ( @@ -14440,8 +14301,8 @@ __DEV__ && ); } } - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); + } catch (error$34) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$34); } finishedWork.flags &= -3; } @@ -14566,11 +14427,11 @@ __DEV__ && if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); - } catch (error$37) { + } catch (error$35) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$37 + error$35 ); } var updateQueue = finishedWork.updateQueue; @@ -14663,15 +14524,15 @@ __DEV__ && passiveEffectStartTime = now(); try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$38) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$38); + } catch (error$36) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$36); } recordPassiveEffectDuration(finishedWork); } else try { commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$39) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$39); + } catch (error$37) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$37); } } function commitOffscreenPassiveMountEffects( @@ -14894,35 +14755,35 @@ __DEV__ && committedLanes, committedTransitions ) - : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + : disableLegacyMode || finishedWork.mode & ConcurrentMode + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -15030,21 +14891,21 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance4._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) + : disableLegacyMode || finishedWork.mode & ConcurrentMode + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((_instance4._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) : ((_instance4._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, @@ -15451,8 +15312,8 @@ __DEV__ && case 15: try { commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$40) { - captureCommitPhaseError(fiber, fiber.return, error$40); + } catch (error$38) { + captureCommitPhaseError(fiber, fiber.return, error$38); } break; case 1: @@ -15460,8 +15321,8 @@ __DEV__ && if ("function" === typeof instance.componentDidMount) try { instance.componentDidMount(); - } catch (error$41) { - captureCommitPhaseError(fiber, fiber.return, error$41); + } catch (error$39) { + captureCommitPhaseError(fiber, fiber.return, error$39); } } } @@ -15472,8 +15333,8 @@ __DEV__ && case 15: try { commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$42) { - captureCommitPhaseError(fiber, fiber.return, error$42); + } catch (error$40) { + captureCommitPhaseError(fiber, fiber.return, error$40); } } } @@ -15488,8 +15349,8 @@ __DEV__ && fiber, fiber.return ); - } catch (error$43) { - captureCommitPhaseError(fiber, fiber.return, error$43); + } catch (error$41) { + captureCommitPhaseError(fiber, fiber.return, error$41); } break; case 1: @@ -15509,8 +15370,8 @@ __DEV__ && fiber, fiber.return ); - } catch (error$44) { - captureCommitPhaseError(fiber, fiber.return, error$44); + } catch (error$42) { + captureCommitPhaseError(fiber, fiber.return, error$42); } } } @@ -15614,7 +15475,7 @@ __DEV__ && } function requestUpdateLane(fiber) { var mode = fiber.mode; - if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; + if (!disableLegacyMode && (mode & ConcurrentMode) === NoMode) return 2; if ( (executionContext & RenderContext) !== NoContext && 0 !== workInProgressRootRenderLanes @@ -15631,9 +15492,9 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 === (workInProgressRootRenderLanes & OffscreenLane) || isHydrating + 0 === (workInProgressRootRenderLanes & 536870912) || isHydrating ? claimNextTransitionLane() - : OffscreenLane); + : 536870912); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); return workInProgressDeferredLane; @@ -15712,10 +15573,10 @@ __DEV__ && workInProgressDeferredLane )); ensureRootIsScheduled(root); - lane !== SyncLane || + 2 !== lane || executionContext !== NoContext || disableLegacyMode || - 0 !== (fiber.mode & 1) || + (fiber.mode & ConcurrentMode) !== NoMode || ReactSharedInternals.isBatchingLegacy || ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); @@ -15734,7 +15595,7 @@ __DEV__ && ); if (0 === lanes) return null; var shouldTimeSlice = - !includesBlockingLane(root, lanes) && + 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && (disableSchedulerTimeoutInWorkLoop || !didTimeout); didTimeout = shouldTimeSlice @@ -15788,7 +15649,7 @@ __DEV__ && case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, @@ -15816,7 +15677,7 @@ __DEV__ && ); else { if ( - (lanes & RetryLanes) === lanes && + (lanes & 62914560) === lanes && (alwaysThrottleRetries || didTimeout === RootSuspended) && ((didTimeout = globalMostRecentFallbackTime + @@ -15951,7 +15812,7 @@ __DEV__ && check = check.value; try { if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$45) { + } catch (error$43) { return !1; } } @@ -15973,7 +15834,7 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && + 268435456 !== updatedLanes && ((root.suspendedLanes = 0), (root.pingedLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext @@ -16107,9 +15968,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -16140,16 +15999,16 @@ __DEV__ && ? SuspendedOnData : SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = SuspendedOnInstance)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? SuspendedOnHydration - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = SuspendedOnInstance)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? SuspendedOnHydration + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; var erroredWork = workInProgress; if (null === erroredWork) @@ -16159,7 +16018,7 @@ __DEV__ && createCapturedValueAtFiber(thrownValue, root.current) ); else if ( - (erroredWork.mode & 2 && + (erroredWork.mode & ProfileMode && stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), enableSchedulingProfiler) ) @@ -16194,16 +16053,16 @@ __DEV__ && var handler = suspenseHandlerStackCursor.current; return null === handler ? !0 - : (workInProgressRootRenderLanes & TransitionLanes) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & RetryLanes) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? handler === shellBoundary - : !1; + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? handler === shellBoundary + : !1; } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; @@ -16274,8 +16133,8 @@ __DEV__ && } workLoopSync(); break; - } catch (thrownValue$46) { - handleThrow(root, thrownValue$46); + } catch (thrownValue$44) { + handleThrow(root, thrownValue$44); } while (1); lanes && root.shellSuspendCounter++; @@ -16417,8 +16276,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$47) { - handleThrow(root, thrownValue$47); + } catch (thrownValue$45) { + handleThrow(root, thrownValue$45); } while (1); resetContextDependencies(); @@ -16447,7 +16306,7 @@ __DEV__ && } function performUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; - 0 !== (unitOfWork.mode & 2) + (unitOfWork.mode & ProfileMode) !== NoMode ? (startProfilerTimer(unitOfWork), (current = runWithFiberInDEV( unitOfWork, @@ -16478,7 +16337,7 @@ __DEV__ && } function replayBeginWork(unitOfWork) { var current = unitOfWork.alternate, - isProfilingMode = 0 !== (unitOfWork.mode & 2); + isProfilingMode = (unitOfWork.mode & ProfileMode) !== NoMode; isProfilingMode && startProfilerTimer(unitOfWork); switch (unitOfWork.tag) { case 15: @@ -16562,9 +16421,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$48) { + } catch (error$46) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$48); + throw ((workInProgress = returnFiber), error$46); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -16583,7 +16442,7 @@ __DEV__ && workInProgress = unitOfWork; break a; } - if (0 !== (root.mode & 2)) { + if ((root.mode & ProfileMode) !== NoMode) { stopProfilerTimerIfRunningAndRecordDelta(root, !1); unitOfWork = root.actualDuration; for (thrownValue = root.child; null !== thrownValue; ) @@ -16612,7 +16471,7 @@ __DEV__ && ); var current = completedWork.alternate; unitOfWork = completedWork.return; - 0 === (completedWork.mode & 2) + (completedWork.mode & ProfileMode) === NoMode ? (current = runWithFiberInDEV( completedWork, completeWork, @@ -16811,13 +16670,13 @@ __DEV__ && remainingLanes.value, transitions ); - 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + 0 === (pendingPassiveEffectsLanes & 3) || (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ @@ -16986,15 +16845,10 @@ __DEV__ && } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -17024,12 +16878,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -17037,7 +16887,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -17087,7 +16937,7 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && @@ -17099,9 +16949,9 @@ __DEV__ && 0 === retryLane && ((retryLane = boundaryFiber.mode), (retryLane = - disableLegacyMode || 0 !== (retryLane & 1) + disableLegacyMode || (retryLane & ConcurrentMode) !== NoMode ? claimNextRetryLane() - : SyncLane)); + : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -17175,7 +17025,7 @@ __DEV__ && doubleInvokeEffectsOnFiber, root, fiber, - 0 === (fiber.mode & 64) + (fiber.mode & NoStrictPassiveEffectsMode) === NoMode ) : recursivelyTraverseAndDoubleInvokeEffectsInDEV( root, @@ -17216,7 +17066,7 @@ __DEV__ && disableLegacyMode || 0 !== root.tag ? ((hasPassiveEffects = !0), (!disableLegacyMode && 1 !== root.tag) || - root.current.mode & 24 || + root.current.mode & (StrictLegacyMode | StrictEffectsMode) || (hasPassiveEffects = !1), recursivelyTraverseAndDoubleInvokeEffectsInDEV( root, @@ -17256,7 +17106,7 @@ __DEV__ && function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { if ( (executionContext & RenderContext) === NoContext && - (disableLegacyMode || fiber.mode & 1) + (disableLegacyMode || fiber.mode & ConcurrentMode) ) { var tag = fiber.tag; if ( @@ -17293,7 +17143,7 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - if (disableLegacyMode || fiber.mode & 1) { + if (disableLegacyMode || fiber.mode & ConcurrentMode) { if (!isConcurrentActEnvironment()) return; } else if ( !isLegacyActEnvironment() || @@ -17414,9 +17264,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -17431,83 +17280,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag || 27 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -17700,8 +17472,8 @@ __DEV__ && (fiberTag = isHostHoistableType(type, pendingProps, fiberTag) ? 26 : "html" === type || "head" === type || "body" === type - ? 27 - : 5); + ? 27 + : 5); else a: switch (type) { case REACT_FRAGMENT_TYPE: @@ -17713,12 +17485,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 8; - if (disableLegacyMode || 0 !== (mode & 1)) - (mode |= 16), + mode |= StrictLegacyMode; + if (disableLegacyMode || (mode & ConcurrentMode) !== NoMode) + (mode |= StrictEffectsMode), enableDO_NOT_USE_disableStrictPassiveEffect && pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + (mode |= NoStrictPassiveEffectsMode); break; case REACT_PROFILER_TYPE: return ( @@ -17728,7 +17500,7 @@ __DEV__ && 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof type.id ), - (key = createFiber(12, type, key, mode | 2)), + (key = createFiber(12, type, key, mode | ProfileMode)), (key.elementType = REACT_PROFILER_TYPE), (key.lanes = lanes), (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), @@ -17779,7 +17551,7 @@ __DEV__ && case REACT_DEBUG_TRACING_MODE_TYPE: if (enableDebugTracing) { fiberTag = 8; - mode |= 4; + mode |= DebugTracingMode; break; } default: @@ -17822,15 +17594,15 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); (fiberTag = owner ? getComponentNameFromOwner(owner) : null) && (resolvedType += "\n\nCheck the render method of `" + fiberTag + "`."); @@ -17978,18 +17750,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], identifierPrefix = 0; - identifierPrefix < TotalLanes; + 31 > identifierPrefix; identifierPrefix++ ) containerInfo.push(null); this.passiveEffectDuration = this.effectDuration = 0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for ( - identifierPrefix = 0; - identifierPrefix < TotalLanes; - identifierPrefix++ - ) + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) containerInfo.push(new Set()); if (disableLegacyMode) this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; @@ -18009,7 +17777,6 @@ __DEV__ && initialChildren, hydrationCallbacks, isStrictMode, - concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, @@ -18031,22 +17798,21 @@ __DEV__ && enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); disableLegacyMode || 1 === tag - ? ((tag = 1), - !0 === isStrictMode && (tag |= 24), - concurrentUpdatesByDefaultOverride && (tag |= 32)) - : (tag = 0); - isDevToolsPresent && (tag |= 2); + ? ((tag = ConcurrentMode), + !0 === isStrictMode && (tag |= StrictLegacyMode | StrictEffectsMode)) + : (tag = NoMode); + isDevToolsPresent && (tag |= ProfileMode); isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; - concurrentUpdatesByDefaultOverride = createCache(); - retainCache(concurrentUpdatesByDefaultOverride); - containerInfo.pooledCache = concurrentUpdatesByDefaultOverride; - retainCache(concurrentUpdatesByDefaultOverride); + tag = createCache(); + retainCache(tag); + containerInfo.pooledCache = tag; + retainCache(tag); isStrictMode.memoizedState = { element: initialChildren, isDehydrated: hydrate, - cache: concurrentUpdatesByDefaultOverride + cache: tag }; initializeUpdateQueue(isStrictMode); return containerInfo; @@ -18118,12 +17884,12 @@ __DEV__ && } component = findCurrentHostFiber(fiber); if (null === component) return null; - if (component.mode & 8) { + if (component.mode & StrictLegacyMode) { var componentName = getComponentNameFromFiber(fiber) || "Component"; didWarnAboutFindNodeInStrictMode[componentName] || ((didWarnAboutFindNodeInStrictMode[componentName] = !0), runWithFiberInDEV(component, function () { - fiber.mode & 8 + fiber.mode & StrictLegacyMode ? error$jscomp$0( "%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", methodName, @@ -18162,7 +17928,6 @@ __DEV__ && initialChildren, hydrationCallbacks, isStrictMode, - concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, @@ -18204,13 +17969,13 @@ __DEV__ && 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, - SyncLane, + 2, element, container, parentComponent, callback ); - return SyncLane; + return 2; } function updateContainerImpl( rootFiber, @@ -18290,22 +18055,25 @@ __DEV__ && } function attemptContinuousHydration(fiber) { if (13 === fiber.tag) { - var lane = SelectiveHydrationLane, - root = enqueueConcurrentRenderForLane(fiber, lane); - null !== root && scheduleUpdateOnFiber(root, fiber, lane); - markRetryLaneIfNotHydrated(fiber, lane); + var root = enqueueConcurrentRenderForLane(fiber, 67108864); + null !== root && scheduleUpdateOnFiber(root, fiber, 67108864); + markRetryLaneIfNotHydrated(fiber, 67108864); } } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentHostFiber(fiber); - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; - } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } function batchedUpdates(fn, a, b) { if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; @@ -18458,8 +18226,8 @@ __DEV__ && return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) - ? !!nativeEvent[keyArg] - : !1; + ? !!nativeEvent[keyArg] + : !1; } function getEventModifierState() { return modifierStateGetter; @@ -18544,8 +18312,8 @@ __DEV__ && return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName - ? !0 - : !1; + ? !0 + : !1; } function isEventSupported(eventNameSuffix) { if (!canUseDOM) return !1; @@ -18664,14 +18432,14 @@ __DEV__ && ? outerNode === innerNode ? !0 : outerNode && 3 === outerNode.nodeType - ? !1 - : innerNode && 3 === innerNode.nodeType - ? containsNode(outerNode, innerNode.parentNode) - : "contains" in outerNode - ? outerNode.contains(innerNode) - : outerNode.compareDocumentPosition - ? !!(outerNode.compareDocumentPosition(innerNode) & 16) - : !1 + ? !1 + : innerNode && 3 === innerNode.nodeType + ? containsNode(outerNode, innerNode.parentNode) + : "contains" in outerNode + ? outerNode.contains(innerNode) + : outerNode.compareDocumentPosition + ? !!(outerNode.compareDocumentPosition(innerNode) & 16) + : !1 : !1; } function getActiveElementDeep() { @@ -18814,8 +18582,8 @@ __DEV__ && nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === DOCUMENT_NODE - ? nativeEventTarget - : nativeEventTarget.ownerDocument; + ? nativeEventTarget + : nativeEventTarget.ownerDocument; mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || @@ -19001,8 +18769,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$51) { - reportGlobalError(error$51); + } catch (error$49) { + reportGlobalError(error$49); } previousInstance.currentTarget = null; previousInstance = instance; @@ -19023,8 +18791,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$51) { - reportGlobalError(error$51); + } catch (error$49) { + reportGlobalError(error$49); } previousInstance.currentTarget = null; previousInstance = instance; @@ -19127,17 +18895,17 @@ __DEV__ && eventSystemFlags ) : void 0 !== isPassiveListener - ? EventListenerWWW.bubbleWithPassiveFlag( - targetContainer, - domEventName, - eventSystemFlags, - isPassiveListener - ) - : EventListenerWWW.listen( - targetContainer, - domEventName, - eventSystemFlags - ); + ? EventListenerWWW.bubbleWithPassiveFlag( + targetContainer, + domEventName, + eventSystemFlags, + isPassiveListener + ) + : EventListenerWWW.listen( + targetContainer, + domEventName, + eventSystemFlags + ); } function dispatchEventForPluginEventSystem( domEventName, @@ -19352,8 +19120,8 @@ __DEV__ && nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) - ? reactName.defaultView || reactName.parentWindow - : window; + ? reactName.defaultView || reactName.parentWindow + : window; if (SyntheticEventCtor) { if ( ((reactEventType = @@ -19989,50 +19757,53 @@ __DEV__ && "Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window." ))) : "input" === tag || "button" === tag - ? "action" === key - ? error$jscomp$0( - "You can only pass the action prop to
. Use the formAction prop on or