Remove defaultProps support (except for classes) (#28733)

This removes defaultProps support for all component types except for
classes. We've chosen to continue supporting defaultProps for classes
because lots of older code relies on it, and unlike function components,
(which can use default params), there's no straightforward alternative.

By implication, it also removes support for setting defaultProps on
`React.lazy` wrapper. So this will not work:

```js
const MyClassComponent = React.lazy(() => import('./MyClassComponent'));
// MyClassComponent is not actually a class; it's a lazy wrapper. So
// defaultProps does not work.
MyClassComponent.defaultProps = { foo: 'bar' };
```

However, if you set the default props on the class itself, then it's
fine.

For classes, this change also moves where defaultProps are resolved.
Previously, defaultProps were resolved by the JSX runtime. This change
is only observable if you introspect a JSX element, which is relatively
rare but does happen.

In other words, previously `<ClassWithDefaultProp />.props.aDefaultProp`
would resolve to the default prop value, but now it does not.

DiffTrain build for [48b4ecc901](https://github.com/facebook/react/commit/48b4ecc9012638ed51b275aad24b2086b8215e32)
This commit is contained in:
kassens
2024-04-11 18:03:18 +00:00
parent e45e8f386b
commit 60928e358c
41 changed files with 43882 additions and 45798 deletions
@@ -84,10 +84,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -110,11 +112,8 @@ if (__DEV__) {
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses; // On WWW, false is used for a new modern build.
// because JSX is an extremely hot path.
var disableStringRefs = false;
function getWrappedName$1(outerType, innerType, wrapperName) {
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
@@ -127,7 +126,7 @@ if (__DEV__) {
: wrapperName;
} // Keep in sync with react-reconciler/getComponentNameFromFiber
function getContextName$1(type) {
function getContextName(type) {
return type.displayName || "Context";
}
@@ -194,28 +193,28 @@ if (__DEV__) {
return null;
} else {
var provider = type;
return getContextName$1(provider._context) + ".Provider";
return getContextName(provider._context) + ".Provider";
}
case REACT_CONTEXT_TYPE:
var context = type;
if (enableRenderableContext) {
return getContextName$1(context) + ".Provider";
return getContextName(context) + ".Provider";
} else {
return getContextName$1(context) + ".Consumer";
return getContextName(context) + ".Consumer";
}
case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName$1(consumer._context) + ".Consumer";
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_FORWARD_REF_TYPE:
return getWrappedName$1(type, type.render, "ForwardRef");
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
@@ -244,7 +243,7 @@ if (__DEV__) {
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// $FlowFixMe[method-unbinding]
var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -324,20 +323,6 @@ if (__DEV__) {
}
}
}
function checkPropStringCoercion(value, propName) {
{
if (willCoercionThrow(value)) {
error(
"The provided `%s` prop is an unsupported type %s." +
" This value must be coerced to a string before using it here.",
propName,
typeName(value)
);
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
}
}
}
var REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference");
function isValidElementType(type) {
@@ -484,8 +469,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -537,13 +523,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternals.H = null;
ReactCurrentDispatcher.current = null;
disableLogs();
}
/**
@@ -736,7 +722,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternals.H = previousDispatcher;
ReactCurrentDispatcher.current = previousDispatcher;
reenableLogs();
}
@@ -754,7 +740,7 @@ if (__DEV__) {
return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -765,7 +751,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}
function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
@@ -795,7 +781,7 @@ if (__DEV__) {
case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
case REACT_LAZY_TYPE: {
var lazyComponent = type;
@@ -804,7 +790,10 @@ if (__DEV__) {
try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
@@ -813,157 +802,8 @@ if (__DEV__) {
return "";
}
var FunctionComponent = 0;
var ClassComponent = 1;
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedFragment = 18;
var SuspenseListComponent = 19;
var ScopeComponent = 21;
var OffscreenComponent = 22;
var LegacyHiddenComponent = 23;
var CacheComponent = 24;
var TracingMarkerComponent = 25;
var HostHoistable = 26;
var HostSingleton = 27;
var IncompleteFunctionComponent = 28;
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || "";
return (
outerType.displayName ||
(functionName !== ""
? wrapperName + "(" + functionName + ")"
: wrapperName)
);
} // Keep in sync with shared/getComponentNameFromType
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromFiber(fiber) {
var tag = fiber.tag,
type = fiber.type;
switch (tag) {
case CacheComponent:
return "Cache";
case ContextConsumer:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
var context = type;
return getContextName(context) + ".Consumer";
}
case ContextProvider:
if (enableRenderableContext) {
var _context = type;
return getContextName(_context) + ".Provider";
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case DehydratedFragment:
return "DehydratedFragment";
case ForwardRef:
return getWrappedName(type, type.render, "ForwardRef");
case Fragment:
return "Fragment";
case HostHoistable:
case HostSingleton:
case HostComponent:
// Host component type is the display name (e.g. "div", "View")
return type;
case HostPortal:
return "Portal";
case HostRoot:
return "Root";
case HostText:
return "Text";
case LazyComponent:
// Name comes from the type in this case; we don't have a tag.
return getComponentNameFromType(type);
case Mode:
if (type === REACT_STRICT_MODE_TYPE) {
// Don't be less specific than shared/getComponentNameFromType
return "StrictMode";
}
return "Mode";
case OffscreenComponent:
return "Offscreen";
case Profiler:
return "Profiler";
case ScopeComponent:
return "Scope";
case SuspenseComponent:
return "Suspense";
case SuspenseListComponent:
return "SuspenseList";
case TracingMarkerComponent:
return "TracingMarker";
// The display name for these tags come from the user-provided type:
case IncompleteClassComponent:
case IncompleteFunctionComponent:
// Fallthrough
case ClassComponent:
case FunctionComponent:
case MemoComponent:
case SimpleMemoComponent:
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
break;
case LegacyHiddenComponent: {
return "LegacyHidden";
}
}
return null;
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
@@ -1007,12 +847,12 @@ if (__DEV__) {
{
if (
typeof config.ref === "string" &&
ReactSharedInternals.owner &&
ReactCurrentOwner.current &&
self &&
ReactSharedInternals.owner.stateNode !== self
ReactCurrentOwner.current.stateNode !== self
) {
var componentName = getComponentNameFromType(
ReactSharedInternals.owner.type
ReactCurrentOwner.current.type
);
if (!didWarnAboutStringRefs[componentName]) {
@@ -1023,7 +863,7 @@ if (__DEV__) {
"We ask you to manually fix this case by using useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
getComponentNameFromType(ReactSharedInternals.owner.type),
getComponentNameFromType(ReactCurrentOwner.current.type),
config.ref
);
@@ -1347,6 +1187,9 @@ if (__DEV__) {
}
}
var propName; // Reserved names are extracted
var props = {};
var key = null;
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
@@ -1374,49 +1217,20 @@ if (__DEV__) {
if (hasValidRef(config)) {
if (!enableRefAsProp) {
ref = config.ref;
{
ref = coerceStringRef(ref, ReactSharedInternals.owner, type);
}
}
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
}
} // Remaining properties are added to a new props object
var props;
if (enableRefAsProp && disableStringRefs && !("key" in config)) {
// If key was not spread in, we can reuse the original props object. This
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
// target and the compiler always passes a new object. For `createElement`,
// we can't assume a new object is passed every time because it can be
// called manually.
//
// Spreading key is a warning in dev. In a future release, we will not
// remove a spread key from the props object. (But we'll still warn.) We'll
// always pass the object straight through.
props = config;
} else {
// We need to remove reserved props (key, prop, ref). Create a fresh props
// object and copy over all the non-reserved props. We don't use `delete`
// because in V8 it will deopt the object to dictionary mode.
props = {};
for (var propName in config) {
// Skip over reserved prop names
if (propName !== "key" && (enableRefAsProp || propName !== "ref")) {
if (enableRefAsProp && !disableStringRefs && propName === "ref") {
props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
);
} else {
props[propName] = config[propName];
}
}
for (propName in config) {
if (
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
propName !== "key" &&
(enableRefAsProp || propName !== "ref")
) {
props[propName] = config[propName];
}
}
@@ -1425,9 +1239,9 @@ if (__DEV__) {
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (var _propName2 in defaultProps) {
if (props[_propName2] === undefined) {
props[_propName2] = defaultProps[_propName2];
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
@@ -1454,7 +1268,7 @@ if (__DEV__) {
ref,
self,
source,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
@@ -1468,8 +1282,8 @@ if (__DEV__) {
function getDeclarationErrorAddendum() {
{
if (ReactSharedInternals.owner) {
var name = getComponentNameFromType(ReactSharedInternals.owner.type);
if (ReactCurrentOwner.current) {
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
if (name) {
return "\n\nCheck the render method of `" + name + "`.";
@@ -1583,18 +1397,14 @@ if (__DEV__) {
if (
element &&
element._owner != null &&
element._owner !== ReactSharedInternals.owner
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;
if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.
childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}
setCurrentlyValidatingElement(element);
@@ -1613,10 +1423,14 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
ReactSharedInternals.setExtraStackFrame(stack);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactSharedInternals.setExtraStackFrame(null);
ReactDebugCurrentFrame.setExtraStackFrame(null);
}
}
}
@@ -1674,96 +1488,6 @@ if (__DEV__) {
}
}
function coerceStringRef(mixedRef, owner, type) {
var stringRef;
if (typeof mixedRef === "string") {
stringRef = mixedRef;
} else {
if (typeof mixedRef === "number" || typeof mixedRef === "boolean") {
{
checkPropStringCoercion(mixedRef, "ref");
}
stringRef = "" + mixedRef;
} else {
return mixedRef;
}
}
return stringRefAsCallbackRef.bind(null, stringRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner) {
throw new Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of" +
" the following reasons:\n" +
"1. You may be adding a ref to a function component\n" +
"2. You may be adding a ref to a component that was not created inside a component's render method\n" +
"3. You have multiple copies of React loaded\n" +
"See https://react.dev/link/refs-must-have-owner for more information."
);
}
if (owner.tag !== ClassComponent) {
throw new Error(
"Function components cannot have string refs. " +
"We recommend using useRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref"
);
}
{
if (
// Will already warn with "Function components cannot be given refs"
!(typeof type === "function" && !isReactClass(type))
) {
var componentName = getComponentNameFromFiber(owner) || "Component";
if (!didWarnAboutStringRefs[componentName]) {
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
componentName,
stringRef
);
didWarnAboutStringRefs[componentName] = true;
}
}
}
var inst = owner.stateNode;
if (!inst) {
throw new Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a " +
"bug in React. Please file an issue."
);
}
var refs = inst.refs;
if (value === null) {
delete refs[stringRef];
} else {
refs[stringRef] = value;
}
}
function isReactClass(type) {
return type.prototype && type.prototype.isReactComponent;
}
var jsxDEV = jsxDEV$1;
exports.Fragment = REACT_FRAGMENT_TYPE;
+62 -340
View File
@@ -84,10 +84,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -110,11 +112,8 @@ if (__DEV__) {
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses; // On WWW, true is used for a new modern build.
// because JSX is an extremely hot path.
var disableStringRefs = false;
function getWrappedName$1(outerType, innerType, wrapperName) {
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
@@ -127,7 +126,7 @@ if (__DEV__) {
: wrapperName;
} // Keep in sync with react-reconciler/getComponentNameFromFiber
function getContextName$1(type) {
function getContextName(type) {
return type.displayName || "Context";
}
@@ -194,28 +193,28 @@ if (__DEV__) {
return null;
} else {
var provider = type;
return getContextName$1(provider._context) + ".Provider";
return getContextName(provider._context) + ".Provider";
}
case REACT_CONTEXT_TYPE:
var context = type;
if (enableRenderableContext) {
return getContextName$1(context) + ".Provider";
return getContextName(context) + ".Provider";
} else {
return getContextName$1(context) + ".Consumer";
return getContextName(context) + ".Consumer";
}
case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName$1(consumer._context) + ".Consumer";
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_FORWARD_REF_TYPE:
return getWrappedName$1(type, type.render, "ForwardRef");
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
@@ -244,7 +243,7 @@ if (__DEV__) {
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// $FlowFixMe[method-unbinding]
var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -324,20 +323,6 @@ if (__DEV__) {
}
}
}
function checkPropStringCoercion(value, propName) {
{
if (willCoercionThrow(value)) {
error(
"The provided `%s` prop is an unsupported type %s." +
" This value must be coerced to a string before using it here.",
propName,
typeName(value)
);
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
}
}
}
var REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference");
function isValidElementType(type) {
@@ -484,8 +469,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -537,13 +523,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternals.H = null;
ReactCurrentDispatcher.current = null;
disableLogs();
}
/**
@@ -736,7 +722,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternals.H = previousDispatcher;
ReactCurrentDispatcher.current = previousDispatcher;
reenableLogs();
}
@@ -754,7 +740,7 @@ if (__DEV__) {
return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -765,7 +751,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}
function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
@@ -795,7 +781,7 @@ if (__DEV__) {
case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
case REACT_LAZY_TYPE: {
var lazyComponent = type;
@@ -804,7 +790,10 @@ if (__DEV__) {
try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
@@ -813,159 +802,8 @@ if (__DEV__) {
return "";
}
var FunctionComponent = 0;
var ClassComponent = 1;
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedFragment = 18;
var SuspenseListComponent = 19;
var ScopeComponent = 21;
var OffscreenComponent = 22;
var LegacyHiddenComponent = 23;
var CacheComponent = 24;
var TracingMarkerComponent = 25;
var HostHoistable = 26;
var HostSingleton = 27;
var IncompleteFunctionComponent = 28;
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || "";
return (
outerType.displayName ||
(functionName !== ""
? wrapperName + "(" + functionName + ")"
: wrapperName)
);
} // Keep in sync with shared/getComponentNameFromType
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromFiber(fiber) {
var tag = fiber.tag,
type = fiber.type;
switch (tag) {
case CacheComponent:
return "Cache";
case ContextConsumer:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
var context = type;
return getContextName(context) + ".Consumer";
}
case ContextProvider:
if (enableRenderableContext) {
var _context = type;
return getContextName(_context) + ".Provider";
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case DehydratedFragment:
return "DehydratedFragment";
case ForwardRef:
return getWrappedName(type, type.render, "ForwardRef");
case Fragment:
return "Fragment";
case HostHoistable:
case HostSingleton:
case HostComponent:
// Host component type is the display name (e.g. "div", "View")
return type;
case HostPortal:
return "Portal";
case HostRoot:
return "Root";
case HostText:
return "Text";
case LazyComponent:
// Name comes from the type in this case; we don't have a tag.
return getComponentNameFromType(type);
case Mode:
if (type === REACT_STRICT_MODE_TYPE) {
// Don't be less specific than shared/getComponentNameFromType
return "StrictMode";
}
return "Mode";
case OffscreenComponent:
return "Offscreen";
case Profiler:
return "Profiler";
case ScopeComponent:
return "Scope";
case SuspenseComponent:
return "Suspense";
case SuspenseListComponent:
return "SuspenseList";
case TracingMarkerComponent:
return "TracingMarker";
// The display name for these tags come from the user-provided type:
case IncompleteClassComponent:
case IncompleteFunctionComponent: {
break;
}
// Fallthrough
case ClassComponent:
case FunctionComponent:
case MemoComponent:
case SimpleMemoComponent:
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
break;
case LegacyHiddenComponent: {
return "LegacyHidden";
}
}
return null;
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
@@ -1009,12 +847,12 @@ if (__DEV__) {
{
if (
typeof config.ref === "string" &&
ReactSharedInternals.owner &&
ReactCurrentOwner.current &&
self &&
ReactSharedInternals.owner.stateNode !== self
ReactCurrentOwner.current.stateNode !== self
) {
var componentName = getComponentNameFromType(
ReactSharedInternals.owner.type
ReactCurrentOwner.current.type
);
if (!didWarnAboutStringRefs[componentName]) {
@@ -1025,7 +863,7 @@ if (__DEV__) {
"We ask you to manually fix this case by using useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
getComponentNameFromType(ReactSharedInternals.owner.type),
getComponentNameFromType(ReactCurrentOwner.current.type),
config.ref
);
@@ -1349,6 +1187,9 @@ if (__DEV__) {
}
}
var propName; // Reserved names are extracted
var props = {};
var key = null;
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
@@ -1376,49 +1217,20 @@ if (__DEV__) {
if (hasValidRef(config)) {
if (!enableRefAsProp) {
ref = config.ref;
{
ref = coerceStringRef(ref, ReactSharedInternals.owner, type);
}
}
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
}
} // Remaining properties are added to a new props object
var props;
if (enableRefAsProp && disableStringRefs && !("key" in config)) {
// If key was not spread in, we can reuse the original props object. This
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
// target and the compiler always passes a new object. For `createElement`,
// we can't assume a new object is passed every time because it can be
// called manually.
//
// Spreading key is a warning in dev. In a future release, we will not
// remove a spread key from the props object. (But we'll still warn.) We'll
// always pass the object straight through.
props = config;
} else {
// We need to remove reserved props (key, prop, ref). Create a fresh props
// object and copy over all the non-reserved props. We don't use `delete`
// because in V8 it will deopt the object to dictionary mode.
props = {};
for (var propName in config) {
// Skip over reserved prop names
if (propName !== "key" && (enableRefAsProp || propName !== "ref")) {
if (enableRefAsProp && !disableStringRefs && propName === "ref") {
props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
);
} else {
props[propName] = config[propName];
}
}
for (propName in config) {
if (
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
propName !== "key" &&
(enableRefAsProp || propName !== "ref")
) {
props[propName] = config[propName];
}
}
@@ -1427,9 +1239,9 @@ if (__DEV__) {
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (var _propName2 in defaultProps) {
if (props[_propName2] === undefined) {
props[_propName2] = defaultProps[_propName2];
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
@@ -1456,7 +1268,7 @@ if (__DEV__) {
ref,
self,
source,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
@@ -1470,8 +1282,8 @@ if (__DEV__) {
function getDeclarationErrorAddendum() {
{
if (ReactSharedInternals.owner) {
var name = getComponentNameFromType(ReactSharedInternals.owner.type);
if (ReactCurrentOwner.current) {
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
if (name) {
return "\n\nCheck the render method of `" + name + "`.";
@@ -1585,18 +1397,14 @@ if (__DEV__) {
if (
element &&
element._owner != null &&
element._owner !== ReactSharedInternals.owner
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;
if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.
childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}
setCurrentlyValidatingElement(element);
@@ -1615,10 +1423,14 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
ReactSharedInternals.setExtraStackFrame(stack);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactSharedInternals.setExtraStackFrame(null);
ReactDebugCurrentFrame.setExtraStackFrame(null);
}
}
}
@@ -1676,96 +1488,6 @@ if (__DEV__) {
}
}
function coerceStringRef(mixedRef, owner, type) {
var stringRef;
if (typeof mixedRef === "string") {
stringRef = mixedRef;
} else {
if (typeof mixedRef === "number" || typeof mixedRef === "boolean") {
{
checkPropStringCoercion(mixedRef, "ref");
}
stringRef = "" + mixedRef;
} else {
return mixedRef;
}
}
return stringRefAsCallbackRef.bind(null, stringRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner) {
throw new Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of" +
" the following reasons:\n" +
"1. You may be adding a ref to a function component\n" +
"2. You may be adding a ref to a component that was not created inside a component's render method\n" +
"3. You have multiple copies of React loaded\n" +
"See https://react.dev/link/refs-must-have-owner for more information."
);
}
if (owner.tag !== ClassComponent) {
throw new Error(
"Function components cannot have string refs. " +
"We recommend using useRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref"
);
}
{
if (
// Will already warn with "Function components cannot be given refs"
!(typeof type === "function" && !isReactClass(type))
) {
var componentName = getComponentNameFromFiber(owner) || "Component";
if (!didWarnAboutStringRefs[componentName]) {
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
componentName,
stringRef
);
didWarnAboutStringRefs[componentName] = true;
}
}
}
var inst = owner.stateNode;
if (!inst) {
throw new Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a " +
"bug in React. Please file an issue."
);
}
var refs = inst.refs;
if (value === null) {
delete refs[stringRef];
} else {
refs[stringRef] = value;
}
}
function isReactClass(type) {
return type.prototype && type.prototype.isReactComponent;
}
var jsxDEV = jsxDEV$1;
exports.Fragment = REACT_FRAGMENT_TYPE;
+1 -1
View File
@@ -1 +1 @@
da69b6af9697b8042834644b14d0e715d4ace18a
48b4ecc9012638ed51b275aad24b2086b8215e32
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+69 -108
View File
@@ -87,8 +87,17 @@ var isArrayImpl = Array.isArray,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
ReactSharedInternals = { H: null, C: null, T: null, owner: null },
hasOwnProperty = Object.prototype.hasOwnProperty;
ReactCurrentDispatcher = { current: null },
ReactCurrentCache = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: { current: null }
},
hasOwnProperty = Object.prototype.hasOwnProperty,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function ReactElement(type, key, _ref, self, source, owner, props) {
enableRefAsProp &&
((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null));
@@ -102,39 +111,29 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
};
}
function jsxProd(type, config, maybeKey) {
var key = null,
var propName,
props = {},
key = null,
ref = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type)));
maybeKey = {};
for (var propName in config)
"key" === propName ||
(!enableRefAsProp && "ref" === propName) ||
(enableRefAsProp && "ref" === propName
? (maybeKey.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (maybeKey[propName] = config[propName]));
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) {
config = type.defaultProps;
for (var propName$0 in config)
void 0 === maybeKey[propName$0] &&
(maybeKey[propName$0] = config[propName$0]);
}
void 0 === config.ref || enableRefAsProp || (ref = config.ref);
for (propName in config)
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
(enableRefAsProp || "ref" !== propName) &&
(props[propName] = config[propName]);
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps)
for (propName in ((config = type.defaultProps), config))
void 0 === props[propName] && (props[propName] = config[propName]);
return ReactElement(
type,
key,
ref,
void 0,
void 0,
ReactSharedInternals.owner,
maybeKey
ReactCurrentOwner.current,
props
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -155,34 +154,6 @@ function isValidElement(object) {
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function coerceStringRef(mixedRef, owner, type) {
if ("string" !== typeof mixedRef)
if ("number" === typeof mixedRef || "boolean" === typeof mixedRef)
mixedRef = "" + mixedRef;
else return mixedRef;
return stringRefAsCallbackRef.bind(null, mixedRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner)
throw Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information."
);
if (1 !== owner.tag)
throw Error(
"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref"
);
type = owner.stateNode;
if (!type)
throw Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a bug in React. Please file an issue."
);
type = type.refs;
null === value ? delete type[stringRef] : (type[stringRef] = value);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
@@ -436,7 +407,7 @@ exports.Profiler = REACT_PROFILER_TYPE;
exports.PureComponent = PureComponent;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.act = function () {
throw Error("act(...) is not supported in production builds of React.");
@@ -457,10 +428,8 @@ exports.cloneElement = function (element, config, children) {
owner = element._owner;
if (null != config) {
void 0 !== config.ref &&
((owner = ReactSharedInternals.owner),
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, owner, element.type))));
(enableRefAsProp || (ref = config.ref),
(owner = ReactCurrentOwner.current));
void 0 !== config.key && (key = "" + config.key);
if (
!disableDefaultPropsExceptForClasses &&
@@ -475,17 +444,12 @@ exports.cloneElement = function (element, config, children) {
"__self" === propName ||
"__source" === propName ||
(enableRefAsProp && "ref" === propName && void 0 === config.ref) ||
(disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
owner,
element.type
))
: (props[propName] = config[propName])
: (props[propName] = defaultProps[propName]));
(props[propName] =
disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? config[propName]
: defaultProps[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
@@ -526,8 +490,7 @@ exports.createElement = function (type, config, children) {
if (null != config)
for (propName in (void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type))),
(ref = config.ref),
void 0 !== config.key && (key = "" + config.key),
config))
hasOwnProperty.call(config, propName) &&
@@ -535,13 +498,7 @@ exports.createElement = function (type, config, children) {
(enableRefAsProp || "ref" !== propName) &&
"__self" !== propName &&
"__source" !== propName &&
(enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (props[propName] = config[propName]));
(props[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) props.children = children;
else if (1 < childrenLength) {
@@ -559,7 +516,7 @@ exports.createElement = function (type, config, children) {
ref,
void 0,
void 0,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
};
@@ -567,7 +524,7 @@ exports.createRef = function () {
return { current: null };
};
exports.experimental_useEffectEvent = function (callback) {
return ReactSharedInternals.H.useEffectEvent(callback);
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -591,15 +548,15 @@ exports.memo = function (type, compare) {
};
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig.transition,
callbacks = new Set();
ReactSharedInternals.T = { _callbacks: callbacks };
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = { _callbacks: callbacks };
var currentTransition = ReactCurrentBatchConfig.transition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
var returnValue = scope();
"object" === typeof returnValue &&
@@ -612,7 +569,7 @@ exports.startTransition = function (scope, options) {
} catch (error) {
reportGlobalError(error);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Activity = REACT_OFFSCREEN_TYPE;
@@ -622,73 +579,77 @@ exports.unstable_Scope = REACT_SCOPE_TYPE;
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useMemoCache = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
return ReactCurrentDispatcher.current.use(usable);
};
exports.useActionState = function (action, initialState, permalink) {
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
return ReactCurrentDispatcher.current.useActionState(
action,
initialState,
permalink
);
};
exports.useCallback = function (callback, deps) {
return ReactSharedInternals.H.useCallback(callback, deps);
return ReactCurrentDispatcher.current.useCallback(callback, deps);
};
exports.useContext = function (Context) {
return ReactSharedInternals.H.useContext(Context);
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
return ReactCurrentDispatcher.current.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
return ReactCurrentDispatcher.current.useId();
};
exports.useImperativeHandle = function (ref, create, deps) {
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
return ReactCurrentDispatcher.current.useImperativeHandle(ref, create, deps);
};
exports.useInsertionEffect = function (create, deps) {
return ReactSharedInternals.H.useInsertionEffect(create, deps);
return ReactCurrentDispatcher.current.useInsertionEffect(create, deps);
};
exports.useLayoutEffect = function (create, deps) {
return ReactSharedInternals.H.useLayoutEffect(create, deps);
return ReactCurrentDispatcher.current.useLayoutEffect(create, deps);
};
exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps);
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.useOptimistic = function (passthrough, reducer) {
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.useReducer = function (reducer, initialArg, init) {
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
};
exports.useRef = function (initialValue) {
return ReactSharedInternals.H.useRef(initialValue);
return ReactCurrentDispatcher.current.useRef(initialValue);
};
exports.useState = function (initialState) {
return ReactSharedInternals.H.useState(initialState);
return ReactCurrentDispatcher.current.useState(initialState);
};
exports.useSyncExternalStore = function (
subscribe,
getSnapshot,
getServerSnapshot
) {
return ReactSharedInternals.H.useSyncExternalStore(
return ReactCurrentDispatcher.current.useSyncExternalStore(
subscribe,
getSnapshot,
getServerSnapshot
);
};
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-classic-0eabe82a";
exports.version = "19.0.0-www-classic-6f7d270a";
+69 -108
View File
@@ -87,8 +87,17 @@ var isArrayImpl = Array.isArray,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
ReactSharedInternals = { H: null, C: null, T: null, owner: null },
hasOwnProperty = Object.prototype.hasOwnProperty;
ReactCurrentDispatcher = { current: null },
ReactCurrentCache = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: { current: null }
},
hasOwnProperty = Object.prototype.hasOwnProperty,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function ReactElement(type, key, _ref, self, source, owner, props) {
enableRefAsProp &&
((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null));
@@ -102,39 +111,29 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
};
}
function jsxProd(type, config, maybeKey) {
var key = null,
var propName,
props = {},
key = null,
ref = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type)));
maybeKey = {};
for (var propName in config)
"key" === propName ||
(!enableRefAsProp && "ref" === propName) ||
(enableRefAsProp && "ref" === propName
? (maybeKey.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (maybeKey[propName] = config[propName]));
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) {
config = type.defaultProps;
for (var propName$0 in config)
void 0 === maybeKey[propName$0] &&
(maybeKey[propName$0] = config[propName$0]);
}
void 0 === config.ref || enableRefAsProp || (ref = config.ref);
for (propName in config)
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
(enableRefAsProp || "ref" !== propName) &&
(props[propName] = config[propName]);
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps)
for (propName in ((config = type.defaultProps), config))
void 0 === props[propName] && (props[propName] = config[propName]);
return ReactElement(
type,
key,
ref,
void 0,
void 0,
ReactSharedInternals.owner,
maybeKey
ReactCurrentOwner.current,
props
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -155,34 +154,6 @@ function isValidElement(object) {
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function coerceStringRef(mixedRef, owner, type) {
if ("string" !== typeof mixedRef)
if ("number" === typeof mixedRef || "boolean" === typeof mixedRef)
mixedRef = "" + mixedRef;
else return mixedRef;
return stringRefAsCallbackRef.bind(null, mixedRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner)
throw Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information."
);
if (1 !== owner.tag)
throw Error(
"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref"
);
type = owner.stateNode;
if (!type)
throw Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a bug in React. Please file an issue."
);
type = type.refs;
null === value ? delete type[stringRef] : (type[stringRef] = value);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
@@ -436,7 +407,7 @@ exports.Profiler = REACT_PROFILER_TYPE;
exports.PureComponent = PureComponent;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.act = function () {
throw Error("act(...) is not supported in production builds of React.");
@@ -457,10 +428,8 @@ exports.cloneElement = function (element, config, children) {
owner = element._owner;
if (null != config) {
void 0 !== config.ref &&
((owner = ReactSharedInternals.owner),
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, owner, element.type))));
(enableRefAsProp || (ref = config.ref),
(owner = ReactCurrentOwner.current));
void 0 !== config.key && (key = "" + config.key);
if (
!disableDefaultPropsExceptForClasses &&
@@ -475,17 +444,12 @@ exports.cloneElement = function (element, config, children) {
"__self" === propName ||
"__source" === propName ||
(enableRefAsProp && "ref" === propName && void 0 === config.ref) ||
(disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
owner,
element.type
))
: (props[propName] = config[propName])
: (props[propName] = defaultProps[propName]));
(props[propName] =
disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? config[propName]
: defaultProps[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
@@ -526,8 +490,7 @@ exports.createElement = function (type, config, children) {
if (null != config)
for (propName in (void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type))),
(ref = config.ref),
void 0 !== config.key && (key = "" + config.key),
config))
hasOwnProperty.call(config, propName) &&
@@ -535,13 +498,7 @@ exports.createElement = function (type, config, children) {
(enableRefAsProp || "ref" !== propName) &&
"__self" !== propName &&
"__source" !== propName &&
(enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (props[propName] = config[propName]));
(props[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) props.children = children;
else if (1 < childrenLength) {
@@ -559,7 +516,7 @@ exports.createElement = function (type, config, children) {
ref,
void 0,
void 0,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
};
@@ -567,7 +524,7 @@ exports.createRef = function () {
return { current: null };
};
exports.experimental_useEffectEvent = function (callback) {
return ReactSharedInternals.H.useEffectEvent(callback);
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -591,15 +548,15 @@ exports.memo = function (type, compare) {
};
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig.transition,
callbacks = new Set();
ReactSharedInternals.T = { _callbacks: callbacks };
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = { _callbacks: callbacks };
var currentTransition = ReactCurrentBatchConfig.transition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
var returnValue = scope();
"object" === typeof returnValue &&
@@ -612,7 +569,7 @@ exports.startTransition = function (scope, options) {
} catch (error) {
reportGlobalError(error);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Activity = REACT_OFFSCREEN_TYPE;
@@ -622,73 +579,77 @@ exports.unstable_Scope = REACT_SCOPE_TYPE;
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useMemoCache = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
return ReactCurrentDispatcher.current.use(usable);
};
exports.useActionState = function (action, initialState, permalink) {
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
return ReactCurrentDispatcher.current.useActionState(
action,
initialState,
permalink
);
};
exports.useCallback = function (callback, deps) {
return ReactSharedInternals.H.useCallback(callback, deps);
return ReactCurrentDispatcher.current.useCallback(callback, deps);
};
exports.useContext = function (Context) {
return ReactSharedInternals.H.useContext(Context);
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
return ReactCurrentDispatcher.current.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
return ReactCurrentDispatcher.current.useId();
};
exports.useImperativeHandle = function (ref, create, deps) {
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
return ReactCurrentDispatcher.current.useImperativeHandle(ref, create, deps);
};
exports.useInsertionEffect = function (create, deps) {
return ReactSharedInternals.H.useInsertionEffect(create, deps);
return ReactCurrentDispatcher.current.useInsertionEffect(create, deps);
};
exports.useLayoutEffect = function (create, deps) {
return ReactSharedInternals.H.useLayoutEffect(create, deps);
return ReactCurrentDispatcher.current.useLayoutEffect(create, deps);
};
exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps);
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.useOptimistic = function (passthrough, reducer) {
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.useReducer = function (reducer, initialArg, init) {
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
};
exports.useRef = function (initialValue) {
return ReactSharedInternals.H.useRef(initialValue);
return ReactCurrentDispatcher.current.useRef(initialValue);
};
exports.useState = function (initialState) {
return ReactSharedInternals.H.useState(initialState);
return ReactCurrentDispatcher.current.useState(initialState);
};
exports.useSyncExternalStore = function (
subscribe,
getSnapshot,
getServerSnapshot
) {
return ReactSharedInternals.H.useSyncExternalStore(
return ReactCurrentDispatcher.current.useSyncExternalStore(
subscribe,
getSnapshot,
getServerSnapshot
);
};
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-modern-0eabe82a";
exports.version = "19.0.0-www-modern-6f7d270a";
+69 -108
View File
@@ -91,8 +91,17 @@ var isArrayImpl = Array.isArray,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
ReactSharedInternals = { H: null, C: null, T: null, owner: null },
hasOwnProperty = Object.prototype.hasOwnProperty;
ReactCurrentDispatcher = { current: null },
ReactCurrentCache = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: { current: null }
},
hasOwnProperty = Object.prototype.hasOwnProperty,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function ReactElement(type, key, _ref, self, source, owner, props) {
enableRefAsProp &&
((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null));
@@ -106,39 +115,29 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
};
}
function jsxProd(type, config, maybeKey) {
var key = null,
var propName,
props = {},
key = null,
ref = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type)));
maybeKey = {};
for (var propName in config)
"key" === propName ||
(!enableRefAsProp && "ref" === propName) ||
(enableRefAsProp && "ref" === propName
? (maybeKey.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (maybeKey[propName] = config[propName]));
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) {
config = type.defaultProps;
for (var propName$0 in config)
void 0 === maybeKey[propName$0] &&
(maybeKey[propName$0] = config[propName$0]);
}
void 0 === config.ref || enableRefAsProp || (ref = config.ref);
for (propName in config)
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
(enableRefAsProp || "ref" !== propName) &&
(props[propName] = config[propName]);
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps)
for (propName in ((config = type.defaultProps), config))
void 0 === props[propName] && (props[propName] = config[propName]);
return ReactElement(
type,
key,
ref,
void 0,
void 0,
ReactSharedInternals.owner,
maybeKey
ReactCurrentOwner.current,
props
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -159,34 +158,6 @@ function isValidElement(object) {
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function coerceStringRef(mixedRef, owner, type) {
if ("string" !== typeof mixedRef)
if ("number" === typeof mixedRef || "boolean" === typeof mixedRef)
mixedRef = "" + mixedRef;
else return mixedRef;
return stringRefAsCallbackRef.bind(null, mixedRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner)
throw Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information."
);
if (1 !== owner.tag)
throw Error(
"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref"
);
type = owner.stateNode;
if (!type)
throw Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a bug in React. Please file an issue."
);
type = type.refs;
null === value ? delete type[stringRef] : (type[stringRef] = value);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
@@ -440,7 +411,7 @@ exports.Profiler = REACT_PROFILER_TYPE;
exports.PureComponent = PureComponent;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.act = function () {
throw Error("act(...) is not supported in production builds of React.");
@@ -461,10 +432,8 @@ exports.cloneElement = function (element, config, children) {
owner = element._owner;
if (null != config) {
void 0 !== config.ref &&
((owner = ReactSharedInternals.owner),
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, owner, element.type))));
(enableRefAsProp || (ref = config.ref),
(owner = ReactCurrentOwner.current));
void 0 !== config.key && (key = "" + config.key);
if (
!disableDefaultPropsExceptForClasses &&
@@ -479,17 +448,12 @@ exports.cloneElement = function (element, config, children) {
"__self" === propName ||
"__source" === propName ||
(enableRefAsProp && "ref" === propName && void 0 === config.ref) ||
(disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
owner,
element.type
))
: (props[propName] = config[propName])
: (props[propName] = defaultProps[propName]));
(props[propName] =
disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? config[propName]
: defaultProps[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
@@ -530,8 +494,7 @@ exports.createElement = function (type, config, children) {
if (null != config)
for (propName in (void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type))),
(ref = config.ref),
void 0 !== config.key && (key = "" + config.key),
config))
hasOwnProperty.call(config, propName) &&
@@ -539,13 +502,7 @@ exports.createElement = function (type, config, children) {
(enableRefAsProp || "ref" !== propName) &&
"__self" !== propName &&
"__source" !== propName &&
(enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (props[propName] = config[propName]));
(props[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) props.children = children;
else if (1 < childrenLength) {
@@ -563,7 +520,7 @@ exports.createElement = function (type, config, children) {
ref,
void 0,
void 0,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
};
@@ -571,7 +528,7 @@ exports.createRef = function () {
return { current: null };
};
exports.experimental_useEffectEvent = function (callback) {
return ReactSharedInternals.H.useEffectEvent(callback);
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -595,15 +552,15 @@ exports.memo = function (type, compare) {
};
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig.transition,
callbacks = new Set();
ReactSharedInternals.T = { _callbacks: callbacks };
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = { _callbacks: callbacks };
var currentTransition = ReactCurrentBatchConfig.transition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
var returnValue = scope();
"object" === typeof returnValue &&
@@ -616,7 +573,7 @@ exports.startTransition = function (scope, options) {
} catch (error) {
reportGlobalError(error);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Activity = REACT_OFFSCREEN_TYPE;
@@ -626,76 +583,80 @@ exports.unstable_Scope = REACT_SCOPE_TYPE;
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useMemoCache = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
return ReactCurrentDispatcher.current.use(usable);
};
exports.useActionState = function (action, initialState, permalink) {
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
return ReactCurrentDispatcher.current.useActionState(
action,
initialState,
permalink
);
};
exports.useCallback = function (callback, deps) {
return ReactSharedInternals.H.useCallback(callback, deps);
return ReactCurrentDispatcher.current.useCallback(callback, deps);
};
exports.useContext = function (Context) {
return ReactSharedInternals.H.useContext(Context);
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
return ReactCurrentDispatcher.current.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
return ReactCurrentDispatcher.current.useId();
};
exports.useImperativeHandle = function (ref, create, deps) {
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
return ReactCurrentDispatcher.current.useImperativeHandle(ref, create, deps);
};
exports.useInsertionEffect = function (create, deps) {
return ReactSharedInternals.H.useInsertionEffect(create, deps);
return ReactCurrentDispatcher.current.useInsertionEffect(create, deps);
};
exports.useLayoutEffect = function (create, deps) {
return ReactSharedInternals.H.useLayoutEffect(create, deps);
return ReactCurrentDispatcher.current.useLayoutEffect(create, deps);
};
exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps);
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.useOptimistic = function (passthrough, reducer) {
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.useReducer = function (reducer, initialArg, init) {
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
};
exports.useRef = function (initialValue) {
return ReactSharedInternals.H.useRef(initialValue);
return ReactCurrentDispatcher.current.useRef(initialValue);
};
exports.useState = function (initialState) {
return ReactSharedInternals.H.useState(initialState);
return ReactCurrentDispatcher.current.useState(initialState);
};
exports.useSyncExternalStore = function (
subscribe,
getSnapshot,
getServerSnapshot
) {
return ReactSharedInternals.H.useSyncExternalStore(
return ReactCurrentDispatcher.current.useSyncExternalStore(
subscribe,
getSnapshot,
getServerSnapshot
);
};
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-classic-aab80d0a";
exports.version = "19.0.0-www-classic-26c19df2";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+69 -108
View File
@@ -91,8 +91,17 @@ var isArrayImpl = Array.isArray,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
ReactSharedInternals = { H: null, C: null, T: null, owner: null },
hasOwnProperty = Object.prototype.hasOwnProperty;
ReactCurrentDispatcher = { current: null },
ReactCurrentCache = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: { current: null }
},
hasOwnProperty = Object.prototype.hasOwnProperty,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function ReactElement(type, key, _ref, self, source, owner, props) {
enableRefAsProp &&
((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null));
@@ -106,39 +115,29 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
};
}
function jsxProd(type, config, maybeKey) {
var key = null,
var propName,
props = {},
key = null,
ref = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type)));
maybeKey = {};
for (var propName in config)
"key" === propName ||
(!enableRefAsProp && "ref" === propName) ||
(enableRefAsProp && "ref" === propName
? (maybeKey.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (maybeKey[propName] = config[propName]));
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) {
config = type.defaultProps;
for (var propName$0 in config)
void 0 === maybeKey[propName$0] &&
(maybeKey[propName$0] = config[propName$0]);
}
void 0 === config.ref || enableRefAsProp || (ref = config.ref);
for (propName in config)
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
(enableRefAsProp || "ref" !== propName) &&
(props[propName] = config[propName]);
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps)
for (propName in ((config = type.defaultProps), config))
void 0 === props[propName] && (props[propName] = config[propName]);
return ReactElement(
type,
key,
ref,
void 0,
void 0,
ReactSharedInternals.owner,
maybeKey
ReactCurrentOwner.current,
props
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -159,34 +158,6 @@ function isValidElement(object) {
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function coerceStringRef(mixedRef, owner, type) {
if ("string" !== typeof mixedRef)
if ("number" === typeof mixedRef || "boolean" === typeof mixedRef)
mixedRef = "" + mixedRef;
else return mixedRef;
return stringRefAsCallbackRef.bind(null, mixedRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner)
throw Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information."
);
if (1 !== owner.tag)
throw Error(
"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref"
);
type = owner.stateNode;
if (!type)
throw Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a bug in React. Please file an issue."
);
type = type.refs;
null === value ? delete type[stringRef] : (type[stringRef] = value);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
@@ -440,7 +411,7 @@ exports.Profiler = REACT_PROFILER_TYPE;
exports.PureComponent = PureComponent;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.act = function () {
throw Error("act(...) is not supported in production builds of React.");
@@ -461,10 +432,8 @@ exports.cloneElement = function (element, config, children) {
owner = element._owner;
if (null != config) {
void 0 !== config.ref &&
((owner = ReactSharedInternals.owner),
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, owner, element.type))));
(enableRefAsProp || (ref = config.ref),
(owner = ReactCurrentOwner.current));
void 0 !== config.key && (key = "" + config.key);
if (
!disableDefaultPropsExceptForClasses &&
@@ -479,17 +448,12 @@ exports.cloneElement = function (element, config, children) {
"__self" === propName ||
"__source" === propName ||
(enableRefAsProp && "ref" === propName && void 0 === config.ref) ||
(disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
owner,
element.type
))
: (props[propName] = config[propName])
: (props[propName] = defaultProps[propName]));
(props[propName] =
disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? config[propName]
: defaultProps[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
@@ -530,8 +494,7 @@ exports.createElement = function (type, config, children) {
if (null != config)
for (propName in (void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type))),
(ref = config.ref),
void 0 !== config.key && (key = "" + config.key),
config))
hasOwnProperty.call(config, propName) &&
@@ -539,13 +502,7 @@ exports.createElement = function (type, config, children) {
(enableRefAsProp || "ref" !== propName) &&
"__self" !== propName &&
"__source" !== propName &&
(enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (props[propName] = config[propName]));
(props[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) props.children = children;
else if (1 < childrenLength) {
@@ -563,7 +520,7 @@ exports.createElement = function (type, config, children) {
ref,
void 0,
void 0,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
};
@@ -571,7 +528,7 @@ exports.createRef = function () {
return { current: null };
};
exports.experimental_useEffectEvent = function (callback) {
return ReactSharedInternals.H.useEffectEvent(callback);
return ReactCurrentDispatcher.current.useEffectEvent(callback);
};
exports.forwardRef = function (render) {
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
@@ -595,15 +552,15 @@ exports.memo = function (type, compare) {
};
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig.transition,
callbacks = new Set();
ReactSharedInternals.T = { _callbacks: callbacks };
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = { _callbacks: callbacks };
var currentTransition = ReactCurrentBatchConfig.transition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
var returnValue = scope();
"object" === typeof returnValue &&
@@ -616,7 +573,7 @@ exports.startTransition = function (scope, options) {
} catch (error) {
reportGlobalError(error);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Activity = REACT_OFFSCREEN_TYPE;
@@ -626,76 +583,80 @@ exports.unstable_Scope = REACT_SCOPE_TYPE;
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useMemoCache = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
return ReactCurrentDispatcher.current.use(usable);
};
exports.useActionState = function (action, initialState, permalink) {
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
return ReactCurrentDispatcher.current.useActionState(
action,
initialState,
permalink
);
};
exports.useCallback = function (callback, deps) {
return ReactSharedInternals.H.useCallback(callback, deps);
return ReactCurrentDispatcher.current.useCallback(callback, deps);
};
exports.useContext = function (Context) {
return ReactSharedInternals.H.useContext(Context);
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
return ReactCurrentDispatcher.current.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
return ReactCurrentDispatcher.current.useId();
};
exports.useImperativeHandle = function (ref, create, deps) {
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
return ReactCurrentDispatcher.current.useImperativeHandle(ref, create, deps);
};
exports.useInsertionEffect = function (create, deps) {
return ReactSharedInternals.H.useInsertionEffect(create, deps);
return ReactCurrentDispatcher.current.useInsertionEffect(create, deps);
};
exports.useLayoutEffect = function (create, deps) {
return ReactSharedInternals.H.useLayoutEffect(create, deps);
return ReactCurrentDispatcher.current.useLayoutEffect(create, deps);
};
exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps);
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.useOptimistic = function (passthrough, reducer) {
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
return ReactCurrentDispatcher.current.useOptimistic(passthrough, reducer);
};
exports.useReducer = function (reducer, initialArg, init) {
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
};
exports.useRef = function (initialValue) {
return ReactSharedInternals.H.useRef(initialValue);
return ReactCurrentDispatcher.current.useRef(initialValue);
};
exports.useState = function (initialState) {
return ReactSharedInternals.H.useState(initialState);
return ReactCurrentDispatcher.current.useState(initialState);
};
exports.useSyncExternalStore = function (
subscribe,
getSnapshot,
getServerSnapshot
) {
return ReactSharedInternals.H.useSyncExternalStore(
return ReactCurrentDispatcher.current.useSyncExternalStore(
subscribe,
getSnapshot,
getServerSnapshot
);
};
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-modern-aab80d0a";
exports.version = "19.0.0-www-modern-26c19df2";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+292 -201
View File
@@ -60,7 +60,7 @@ function formatProdErrorMessage(code) {
);
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
dynamicFeatureFlags = require("ReactFeatureFlags"),
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableLazyContextPropagation =
@@ -648,6 +648,7 @@ function clearTransitionsForLanes(root, lanes) {
lanes &= ~lane;
}
}
var currentUpdatePriority = 0;
function lanesToEventPriority(lanes) {
lanes &= -lanes;
return 2 < lanes
@@ -825,8 +826,7 @@ function shouldSetTextContent(type, props) {
"string" === typeof props.children || "number" === typeof props.children
);
}
var currentUpdatePriority = 0,
valueStack = [],
var valueStack = [],
index = -1;
function createCursor(defaultValue) {
return { current: defaultValue };
@@ -1770,11 +1770,51 @@ function unwrapThenable(thenable) {
null === thenableState$1 && (thenableState$1 = []);
return trackUsedThenable(thenableState$1, thenable, index);
}
function convertStringRefToCallbackRef(
returnFiber,
current,
element,
mixedRef
) {
function ref(value) {
var refs = inst.refs;
null === value ? delete refs[stringRef] : (refs[stringRef] = value);
}
var stringRef = "" + mixedRef;
returnFiber = element._owner;
if (!returnFiber) throw Error(formatProdErrorMessage(290, stringRef));
if (1 !== returnFiber.tag) throw Error(formatProdErrorMessage(309));
var inst = returnFiber.stateNode;
if (!inst) throw Error(formatProdErrorMessage(147, stringRef));
if (
null !== current &&
null !== current.ref &&
"function" === typeof current.ref &&
current.ref._stringRef === stringRef
)
return current.ref;
ref._stringRef = stringRef;
return ref;
}
function coerceRef(returnFiber, current, workInProgress, element) {
enableRefAsProp
? ((returnFiber = element.props.ref),
(returnFiber = void 0 !== returnFiber ? returnFiber : null))
: (returnFiber = element.ref);
if (enableRefAsProp) {
var mixedRef = element.props.ref;
mixedRef = void 0 !== mixedRef ? mixedRef : null;
} else mixedRef = element.ref;
"string" === typeof mixedRef ||
"number" === typeof mixedRef ||
"boolean" === typeof mixedRef
? ((returnFiber = convertStringRefToCallbackRef(
returnFiber,
current,
element,
mixedRef
)),
enableRefAsProp &&
((current = assign({}, workInProgress.pendingProps)),
(current.ref = returnFiber),
(workInProgress.pendingProps = current)))
: (returnFiber = mixedRef);
workInProgress.ref = returnFiber;
}
function throwOnInvalidObjectType(returnFiber, newChild) {
@@ -2539,7 +2579,9 @@ function findFirstSuspended(row) {
}
return null;
}
var renderLanes = 0,
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
renderLanes = 0,
currentlyRenderingFiber$1 = null,
currentHook = null,
workInProgressHook = null,
@@ -2571,7 +2613,7 @@ function renderWithHooks(
workInProgress.memoizedState = null;
workInProgress.updateQueue = null;
workInProgress.lanes = 0;
ReactSharedInternals.H =
ReactCurrentDispatcher$1.current =
null === current || null === current.memoizedState
? HooksDispatcherOnMount
: HooksDispatcherOnUpdate;
@@ -2589,7 +2631,7 @@ function renderWithHooks(
return nextRenderLanes;
}
function finishRenderingHooks(current) {
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
renderLanes = 0;
workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
@@ -2616,22 +2658,16 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
numberOfReRenders += 1;
workInProgressHook = currentHook = null;
workInProgress.updateQueue = null;
ReactSharedInternals.H = HooksDispatcherOnRerender;
ReactCurrentDispatcher$1.current = HooksDispatcherOnRerender;
var children = Component(props, secondArg);
} while (didScheduleRenderPhaseUpdateDuringThisPass);
return children;
}
function TransitionAwareHostComponent() {
var dispatcher = ReactSharedInternals.H,
maybeThenable = dispatcher.useState()[0];
maybeThenable =
"function" === typeof maybeThenable.then
? useThenable(maybeThenable)
: maybeThenable;
dispatcher = dispatcher.useState()[0];
(null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
(currentlyRenderingFiber$1.flags |= 1024);
return maybeThenable;
var maybeThenable = ReactCurrentDispatcher$1.current.useState()[0];
return "function" === typeof maybeThenable.then
? useThenable(maybeThenable)
: maybeThenable;
}
function bailoutHooks(current, workInProgress, lanes) {
workInProgress.updateQueue = current.updateQueue;
@@ -2717,7 +2753,7 @@ function useThenable(thenable) {
(null === workInProgressHook
? null === currentlyRenderingFiber$1.memoizedState
: null === workInProgressHook.next) &&
(ReactSharedInternals.H = HooksDispatcherOnMount);
(ReactCurrentDispatcher$1.current = HooksDispatcherOnMount);
return thenable;
}
function use(usable) {
@@ -3010,9 +3046,9 @@ function dispatchActionState(
function runActionStateAction(actionQueue, setPendingState, setState, payload) {
var action = actionQueue.action,
prevState = actionQueue.state,
prevTransition = ReactSharedInternals.T,
prevTransition = ReactCurrentBatchConfig$2.transition,
currentTransition = { _callbacks: new Set() };
ReactSharedInternals.T = currentTransition;
ReactCurrentBatchConfig$2.transition = currentTransition;
setPendingState(!0);
try {
var returnValue = action(prevState, payload);
@@ -3045,7 +3081,7 @@ function runActionStateAction(actionQueue, setPendingState, setState, payload) {
setState({ then: function () {}, status: "rejected", reason: error }),
finishRunningActionStateAction(actionQueue, setPendingState, setState);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig$2.transition = prevTransition;
}
}
function finishRunningActionStateAction(
@@ -3316,15 +3352,15 @@ function startTransition(
var previousPriority = currentUpdatePriority;
currentUpdatePriority =
0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig$2.transition,
currentTransition = { _callbacks: new Set() };
ReactSharedInternals.T = currentTransition;
ReactCurrentBatchConfig$2.transition = currentTransition;
dispatchOptimisticSetState(fiber, !1, queue, pendingState);
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((currentTransition.name = options.name),
(currentTransition.startTime = now()));
((ReactCurrentBatchConfig$2.transition.name = options.name),
(ReactCurrentBatchConfig$2.transition.startTime = now()));
try {
var returnValue = callback();
if (
@@ -3347,7 +3383,7 @@ function startTransition(
});
} finally {
(currentUpdatePriority = previousPriority),
(ReactSharedInternals.T = prevTransition);
(ReactCurrentBatchConfig$2.transition = prevTransition);
}
}
function useHostTransitionStatus() {
@@ -3928,20 +3964,19 @@ function resolveClassComponentProps(
alreadyResolvedDefaultProps
) {
var newProps = baseProps;
if (enableRefAsProp && "ref" in baseProps) {
newProps = {};
for (var propName in baseProps)
"ref" !== propName && (newProps[propName] = baseProps[propName]);
}
if (
(Component = Component.defaultProps) &&
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
) {
newProps === baseProps && (newProps = assign({}, newProps, baseProps));
for (var propName$36 in Component)
void 0 === newProps[propName$36] &&
(newProps[propName$36] = Component[propName$36]);
newProps = assign({}, newProps, baseProps);
for (var propName in Component)
void 0 === newProps[propName] &&
(newProps[propName] = Component[propName]);
}
enableRefAsProp &&
"ref" in newProps &&
(newProps === baseProps && (newProps = assign({}, newProps)),
delete newProps.ref);
return newProps;
}
function resolveDefaultPropsOnNonClassComponent(Component, baseProps) {
@@ -4344,7 +4379,8 @@ function pushMarkerInstance(workInProgress, markerInstance) {
markerInstanceStack.current.concat(markerInstance)
));
}
var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
SelectiveHydrationException = Error(formatProdErrorMessage(461)),
didReceiveUpdate = !1;
function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
workInProgress.child =
@@ -4871,7 +4907,7 @@ function finishClassComponent(
bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
);
shouldUpdate = workInProgress.stateNode;
ReactSharedInternals.owner = workInProgress;
ReactCurrentOwner$1.current = workInProgress;
var nextChildren =
didCaptureError && "function" !== typeof Component.getDerivedStateFromError
? null
@@ -6333,8 +6369,9 @@ function releaseCache(cache) {
cache.controller.abort();
});
}
var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
function requestCurrentTransition() {
var transition = ReactSharedInternals.T;
var transition = ReactCurrentBatchConfig$1.transition;
null !== transition && transition._callbacks.add(handleAsyncAction);
return transition;
}
@@ -6502,14 +6539,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
break;
case "collapsed":
lastTailNode = renderState.tail;
for (var lastTailNode$82 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$82 = lastTailNode),
for (var lastTailNode$81 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$81 = lastTailNode),
(lastTailNode = lastTailNode.sibling);
null === lastTailNode$82
null === lastTailNode$81
? hasRenderedATailFallback || null === renderState.tail
? (renderState.tail = null)
: (renderState.tail.sibling = null)
: (lastTailNode$82.sibling = null);
: (lastTailNode$81.sibling = null);
}
}
function bubbleProperties(completedWork) {
@@ -6519,19 +6556,19 @@ function bubbleProperties(completedWork) {
newChildLanes = 0,
subtreeFlags = 0;
if (didBailout)
for (var child$83 = completedWork.child; null !== child$83; )
(newChildLanes |= child$83.lanes | child$83.childLanes),
(subtreeFlags |= child$83.subtreeFlags & 31457280),
(subtreeFlags |= child$83.flags & 31457280),
(child$83.return = completedWork),
(child$83 = child$83.sibling);
for (var child$82 = completedWork.child; null !== child$82; )
(newChildLanes |= child$82.lanes | child$82.childLanes),
(subtreeFlags |= child$82.subtreeFlags & 31457280),
(subtreeFlags |= child$82.flags & 31457280),
(child$82.return = completedWork),
(child$82 = child$82.sibling);
else
for (child$83 = completedWork.child; null !== child$83; )
(newChildLanes |= child$83.lanes | child$83.childLanes),
(subtreeFlags |= child$83.subtreeFlags),
(subtreeFlags |= child$83.flags),
(child$83.return = completedWork),
(child$83 = child$83.sibling);
for (child$82 = completedWork.child; null !== child$82; )
(newChildLanes |= child$82.lanes | child$82.childLanes),
(subtreeFlags |= child$82.subtreeFlags),
(subtreeFlags |= child$82.flags),
(child$82.return = completedWork),
(child$82 = child$82.sibling);
completedWork.subtreeFlags |= subtreeFlags;
completedWork.childLanes = newChildLanes;
return didBailout;
@@ -6709,11 +6746,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(instance = newProps.alternate.memoizedState.cachePool.pool);
var cache$87 = null;
var cache$86 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
(cache$87 = newProps.memoizedState.cachePool.pool);
cache$87 !== instance && (newProps.flags |= 2048);
(cache$86 = newProps.memoizedState.cachePool.pool);
cache$86 !== instance && (newProps.flags |= 2048);
}
renderLanes !== current &&
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
@@ -6747,8 +6784,8 @@ function completeWork(current, workInProgress, renderLanes) {
instance = workInProgress.memoizedState;
if (null === instance) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
cache$87 = instance.rendering;
if (null === cache$87)
cache$86 = instance.rendering;
if (null === cache$86)
if (newProps) cutOffTailIfNeeded(instance, !1);
else {
if (
@@ -6756,11 +6793,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
cache$87 = findFirstSuspended(current);
if (null !== cache$87) {
cache$86 = findFirstSuspended(current);
if (null !== cache$86) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(instance, !1);
current = cache$87.updateQueue;
current = cache$86.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -6785,7 +6822,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
if (((current = findFirstSuspended(cache$87)), null !== current)) {
if (((current = findFirstSuspended(cache$86)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -6795,7 +6832,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !0),
null === instance.tail &&
"hidden" === instance.tailMode &&
!cache$87.alternate)
!cache$86.alternate)
)
return bubbleProperties(workInProgress), null;
} else
@@ -6807,13 +6844,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !1),
(workInProgress.lanes = 4194304));
instance.isBackwards
? ((cache$87.sibling = workInProgress.child),
(workInProgress.child = cache$87))
? ((cache$86.sibling = workInProgress.child),
(workInProgress.child = cache$86))
: ((current = instance.last),
null !== current
? (current.sibling = cache$87)
: (workInProgress.child = cache$87),
(instance.last = cache$87));
? (current.sibling = cache$86)
: (workInProgress.child = cache$86),
(instance.last = cache$86));
}
if (null !== instance.tail)
return (
@@ -7085,8 +7122,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
else if ("function" === typeof ref)
try {
ref(null);
} catch (error$105) {
captureCommitPhaseError(current, nearestMountedAncestor, error$105);
} catch (error$104) {
captureCommitPhaseError(current, nearestMountedAncestor, error$104);
}
else ref.current = null;
}
@@ -7290,11 +7327,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
current,
finishedRoot.__reactInternalSnapshotBeforeUpdate
);
} catch (error$106) {
} catch (error$105) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$106
error$105
);
}
}
@@ -7861,7 +7898,7 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
captureCommitPhaseError(childToDelete, parentFiber, error);
}
}
if (parentFiber.subtreeFlags & 13878)
if (parentFiber.subtreeFlags & 12854)
for (parentFiber = parentFiber.child; null !== parentFiber; )
commitMutationEffectsOnFiber(parentFiber, root$jscomp$0),
(parentFiber = parentFiber.sibling);
@@ -7885,8 +7922,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
}
try {
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
} catch (error$114) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$114);
} catch (error$113) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$113);
}
}
break;
@@ -7920,8 +7957,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
finishedWork.updateQueue = null;
try {
flags._applyProps(flags, newProps, current);
} catch (error$117) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$117);
} catch (error$116) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$116);
}
}
break;
@@ -7957,8 +7994,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
null !== retryQueue && suspenseCallback(new Set(retryQueue));
}
}
} catch (error$119) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$119);
} catch (error$118) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$118);
}
flags = finishedWork.updateQueue;
null !== flags &&
@@ -8098,12 +8135,12 @@ function commitReconciliationEffects(finishedWork) {
break;
case 3:
case 4:
var parent$109 = JSCompiler_inline_result.stateNode.containerInfo,
before$110 = getHostSibling(finishedWork);
var parent$108 = JSCompiler_inline_result.stateNode.containerInfo,
before$109 = getHostSibling(finishedWork);
insertOrAppendPlacementNodeIntoContainer(
finishedWork,
before$110,
parent$109
before$109,
parent$108
);
break;
default:
@@ -8561,9 +8598,9 @@ function recursivelyTraverseReconnectPassiveEffects(
);
break;
case 22:
var instance$125 = finishedWork.stateNode;
var instance$124 = finishedWork.stateNode;
null !== finishedWork.memoizedState
? instance$125._visibility & 4
? instance$124._visibility & 4
? recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -8576,7 +8613,7 @@ function recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork
)
: ((instance$125._visibility |= 4),
: ((instance$124._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -8584,7 +8621,7 @@ function recursivelyTraverseReconnectPassiveEffects(
committedTransitions,
includeWorkInProgressEffects
))
: ((instance$125._visibility |= 4),
: ((instance$124._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -8597,7 +8634,7 @@ function recursivelyTraverseReconnectPassiveEffects(
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork,
instance$125
instance$124
);
break;
case 24:
@@ -8904,6 +8941,10 @@ var DefaultCacheDispatcher = {
}
},
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig,
executionContext = 0,
workInProgressRoot = null,
workInProgress = null,
@@ -8996,14 +9037,16 @@ var legacyErrorBoundariesThatAlreadyFailed = null,
nestedUpdateCount = 0,
rootWithNestedUpdates = null;
function requestUpdateLane(fiber) {
return 0 === (fiber.mode & 1)
? 2
: 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes
? workInProgressRootRenderLanes & -workInProgressRootRenderLanes
: null !== requestCurrentTransition()
? ((fiber = currentEntangledLane),
0 !== fiber ? fiber : requestTransitionLane())
: currentUpdatePriority || 32;
if (0 === (fiber.mode & 1)) return 2;
if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
if (null !== requestCurrentTransition())
return (
(fiber = currentEntangledLane),
0 !== fiber ? fiber : requestTransitionLane()
);
fiber = currentUpdatePriority;
return 0 !== fiber ? fiber : 32;
}
function requestDeferredLane() {
0 === workInProgressDeferredLane &&
@@ -9029,7 +9072,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) {
markRootUpdated(root, lane);
if (0 === (executionContext & 2) || root !== workInProgressRoot) {
if (enableTransitionTracing) {
var transition = ReactSharedInternals.T;
var transition = ReactCurrentBatchConfig.transition;
if (
null !== transition &&
null != transition.name &&
@@ -9097,18 +9140,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
root,
renderWasConcurrent
);
if (
0 !== errorRetryLanes &&
0 !== errorRetryLanes &&
((lanes = errorRetryLanes),
(exitStatus = recoverFromConcurrentError(
root,
renderWasConcurrent,
errorRetryLanes
)),
(renderWasConcurrent = !1),
2 !== exitStatus)
)
continue;
)));
}
if (1 === exitStatus) {
prepareFreshStack(root, 0);
@@ -9342,10 +9380,28 @@ function performSyncWorkOnRoot(root, lanes) {
ensureRootIsScheduled(root);
return null;
}
function flushSyncWork() {
return 0 === (executionContext & 6)
? (flushSyncWorkAcrossRoots_impl(!1), !1)
: !0;
function flushSync(fn) {
null !== rootWithPendingPassiveEffects &&
0 === rootWithPendingPassiveEffects.tag &&
0 === (executionContext & 6) &&
flushPassiveEffects();
var prevExecutionContext = executionContext;
executionContext |= 1;
var prevTransition = ReactCurrentBatchConfig.transition,
previousPriority = currentUpdatePriority;
try {
if (
((ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = 2),
fn)
)
return fn();
} finally {
(currentUpdatePriority = previousPriority),
(ReactCurrentBatchConfig.transition = prevTransition),
(executionContext = prevExecutionContext),
0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1);
}
}
function resetWorkInProgressStack() {
if (null !== workInProgress) {
@@ -9408,8 +9464,8 @@ function prepareFreshStack(root, lanes) {
}
function handleThrow(root, thrownValue) {
currentlyRenderingFiber$1 = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactSharedInternals.owner = null;
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
ReactCurrentOwner.current = null;
if (thrownValue === SuspenseException) {
thrownValue = getSuspendedThenable();
var handler = suspenseHandlerStackCursor.current;
@@ -9447,13 +9503,13 @@ function handleThrow(root, thrownValue) {
));
}
function pushDispatcher() {
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = ContextOnlyDispatcher;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
}
function pushCacheDispatcher() {
var prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
var prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
return prevCacheDispatcher;
}
function renderDidSuspendDelayIfPossible() {
@@ -9499,15 +9555,15 @@ function renderRootSync(root, lanes) {
}
workLoopSync();
break;
} catch (thrownValue$133) {
handleThrow(root, thrownValue$133);
} catch (thrownValue$132) {
handleThrow(root, thrownValue$132);
}
while (1);
lanes && root.shellSuspendCounter++;
resetContextDependencies();
executionContext = prevExecutionContext;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
if (null !== workInProgress) throw Error(formatProdErrorMessage(261));
workInProgressRoot = null;
workInProgressRootRenderLanes = 0;
@@ -9605,13 +9661,13 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
} catch (thrownValue$135) {
handleThrow(root, thrownValue$135);
} catch (thrownValue$134) {
handleThrow(root, thrownValue$134);
}
while (1);
resetContextDependencies();
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
executionContext = prevExecutionContext;
if (null !== workInProgress) return 0;
workInProgressRoot = null;
@@ -9627,7 +9683,7 @@ function performUnitOfWork(unitOfWork) {
var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
unitOfWork.memoizedProps = unitOfWork.pendingProps;
null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next);
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
}
function replaySuspendedUnitOfWork(unitOfWork) {
var current = unitOfWork.alternate;
@@ -9683,7 +9739,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
null === current
? completeUnitOfWork(unitOfWork)
: (workInProgress = current);
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
}
function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) {
resetContextDependencies();
@@ -9770,11 +9826,11 @@ function commitRoot(
didIncludeRenderPhaseUpdate,
spawnedLane
) {
var prevTransition = ReactSharedInternals.T,
previousUpdateLanePriority = currentUpdatePriority;
var previousUpdateLanePriority = currentUpdatePriority,
prevTransition = ReactCurrentBatchConfig.transition;
try {
(currentUpdatePriority = 2),
(ReactSharedInternals.T = null),
(ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = 2),
commitRootImpl(
root,
recoverableErrors,
@@ -9784,7 +9840,7 @@ function commitRoot(
spawnedLane
);
} finally {
(ReactSharedInternals.T = prevTransition),
(ReactCurrentBatchConfig.transition = prevTransition),
(currentUpdatePriority = previousUpdateLanePriority);
}
return null;
@@ -9828,13 +9884,13 @@ function commitRootImpl(
}));
transitions = 0 !== (finishedWork.flags & 15990);
if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) {
transitions = ReactSharedInternals.T;
ReactSharedInternals.T = null;
transitions = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = null;
spawnedLane = currentUpdatePriority;
currentUpdatePriority = 2;
var prevExecutionContext = executionContext;
executionContext |= 4;
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
commitBeforeMutationEffects(root, finishedWork);
commitMutationEffectsOnFiber(finishedWork, root);
root.current = finishedWork;
@@ -9842,7 +9898,7 @@ function commitRootImpl(
requestPaint();
executionContext = prevExecutionContext;
currentUpdatePriority = spawnedLane;
ReactSharedInternals.T = transitions;
ReactCurrentBatchConfig.transition = transitions;
} else root.current = finishedWork;
rootDoesHavePassiveEffects
? ((rootDoesHavePassiveEffects = !1),
@@ -9888,18 +9944,19 @@ function flushPassiveEffects() {
var root = rootWithPendingPassiveEffects,
remainingLanes = pendingPassiveEffectsRemainingLanes;
pendingPassiveEffectsRemainingLanes = 0;
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes),
prevTransition = ReactSharedInternals.T,
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
renderPriority = 32 > renderPriority ? 32 : renderPriority;
var prevTransition = ReactCurrentBatchConfig.transition,
previousPriority = currentUpdatePriority;
try {
return (
(currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority),
(ReactSharedInternals.T = null),
(ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = renderPriority),
flushPassiveEffectsImpl()
);
} finally {
(currentUpdatePriority = previousPriority),
(ReactSharedInternals.T = prevTransition),
(ReactCurrentBatchConfig.transition = prevTransition),
releaseRootPooledCache(root, remainingLanes);
}
}
@@ -10413,9 +10470,54 @@ function FiberRootNode(
)
containerInfo.push(null);
}
function updateContainerSync(element, container, parentComponent, callback) {
0 === container.tag && flushPassiveEffects();
var current = container.current;
function createContainer(
containerInfo,
tag,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride,
identifierPrefix,
onUncaughtError,
onCaughtError,
onRecoverableError,
transitionCallbacks
) {
containerInfo = new FiberRootNode(
containerInfo,
tag,
!1,
identifierPrefix,
onUncaughtError,
onCaughtError,
onRecoverableError,
null
);
containerInfo.hydrationCallbacks = hydrationCallbacks;
enableTransitionTracing &&
(containerInfo.transitionCallbacks = transitionCallbacks);
1 === tag
? ((tag = 1),
!0 === isStrictMode && (tag |= 24),
concurrentUpdatesByDefaultOverride && (tag |= 32))
: (tag = 0);
isStrictMode = createFiber(3, null, null, tag);
containerInfo.current = isStrictMode;
isStrictMode.stateNode = containerInfo;
concurrentUpdatesByDefaultOverride = createCache();
concurrentUpdatesByDefaultOverride.refCount++;
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
concurrentUpdatesByDefaultOverride.refCount++;
isStrictMode.memoizedState = {
element: null,
isDehydrated: !1,
cache: concurrentUpdatesByDefaultOverride
};
initializeUpdateQueue(isStrictMode);
return containerInfo;
}
function updateContainer(element, container, parentComponent, callback) {
var current = container.current,
lane = requestUpdateLane(current);
a: if (parentComponent) {
parentComponent = parentComponent._reactInternals;
b: {
@@ -10459,15 +10561,15 @@ function updateContainerSync(element, container, parentComponent, callback) {
null === container.context
? (container.context = parentComponent)
: (container.pendingContext = parentComponent);
container = createUpdate(2);
container = createUpdate(lane);
container.payload = { element: element };
callback = void 0 === callback ? null : callback;
null !== callback && (container.callback = callback);
element = enqueueUpdate(current, container, 2);
element = enqueueUpdate(current, container, lane);
null !== element &&
(scheduleUpdateOnFiber(element, current, 2),
entangleTransitions(element, current, 2));
return 2;
(scheduleUpdateOnFiber(element, current, lane),
entangleTransitions(element, current, lane));
return lane;
}
function emptyFindFiberByHostInstance() {
return null;
@@ -10508,52 +10610,41 @@ var slice = Array.prototype.slice,
_inheritsLoose(Surface, _React$Component);
var _proto4 = Surface.prototype;
_proto4.componentDidMount = function () {
var _this$props = this.props;
var $jscomp$this = this,
_this$props = this.props;
this._surface = Mode$1.Surface(
+_this$props.width,
+_this$props.height,
this._tagRef
);
_this$props = new FiberRootNode(
this._surface,
0,
!1,
"",
void 0,
void 0,
void 0,
null
);
_this$props.hydrationCallbacks = null;
enableTransitionTracing && (_this$props.transitionCallbacks = void 0);
var JSCompiler_inline_result = createFiber(3, null, null, 0);
_this$props.current = JSCompiler_inline_result;
JSCompiler_inline_result.stateNode = _this$props;
var initialCache = createCache();
initialCache.refCount++;
_this$props.pooledCache = initialCache;
initialCache.refCount++;
JSCompiler_inline_result.memoizedState = {
element: null,
isDehydrated: !1,
cache: initialCache
};
initializeUpdateQueue(JSCompiler_inline_result);
this._mountNode = _this$props;
updateContainerSync(this.props.children, this._mountNode, this);
flushSyncWork();
this._mountNode = createContainer(this._surface, 0, null, !1, !1, "");
flushSync(function () {
updateContainer(
$jscomp$this.props.children,
$jscomp$this._mountNode,
$jscomp$this
);
});
};
_proto4.componentDidUpdate = function (prevProps) {
var props = this.props;
var $jscomp$this = this,
props = this.props;
(props.height === prevProps.height && props.width === prevProps.width) ||
this._surface.resize(+props.width, +props.height);
updateContainerSync(this.props.children, this._mountNode, this);
flushSyncWork();
flushSync(function () {
updateContainer(
$jscomp$this.props.children,
$jscomp$this._mountNode,
$jscomp$this
);
});
this._surface.render && this._surface.render();
};
_proto4.componentWillUnmount = function () {
updateContainerSync(null, this._mountNode, this);
flushSyncWork();
var $jscomp$this = this;
flushSync(function () {
updateContainer(null, $jscomp$this._mountNode, $jscomp$this);
});
};
_proto4.render = function () {
var $jscomp$this = this,
@@ -10600,19 +10691,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1114 = {
devToolsConfig$jscomp$inline_1121 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-52a8955f",
version: "19.0.0-www-classic-442df77a",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1322 = {
bundleType: devToolsConfig$jscomp$inline_1114.bundleType,
version: devToolsConfig$jscomp$inline_1114.version,
rendererPackageName: devToolsConfig$jscomp$inline_1114.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1114.rendererConfig,
var internals$jscomp$inline_1317 = {
bundleType: devToolsConfig$jscomp$inline_1121.bundleType,
version: devToolsConfig$jscomp$inline_1121.version,
rendererPackageName: devToolsConfig$jscomp$inline_1121.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1121.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -10622,33 +10713,33 @@ var internals$jscomp$inline_1322 = {
setErrorHandler: null,
setSuspenseHandler: null,
scheduleUpdate: null,
currentDispatcherRef: ReactSharedInternals,
currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
findHostInstanceByFiber: function (fiber) {
fiber = findCurrentFiberUsingSlowPath(fiber);
fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null;
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1114.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1121.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-52a8955f"
reconcilerVersion: "19.0.0-www-classic-442df77a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1323 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1318 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1323.isDisabled &&
hook$jscomp$inline_1323.supportsFiber
!hook$jscomp$inline_1318.isDisabled &&
hook$jscomp$inline_1318.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1323.inject(
internals$jscomp$inline_1322
(rendererID = hook$jscomp$inline_1318.inject(
internals$jscomp$inline_1317
)),
(injectedHook = hook$jscomp$inline_1323);
(injectedHook = hook$jscomp$inline_1318);
} catch (err) {}
}
var Path = Mode$1.Path;
+276 -192
View File
@@ -60,7 +60,7 @@ function formatProdErrorMessage(code) {
);
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
dynamicFeatureFlags = require("ReactFeatureFlags"),
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableLazyContextPropagation =
@@ -524,6 +524,7 @@ function clearTransitionsForLanes(root, lanes) {
lanes &= ~lane;
}
}
var currentUpdatePriority = 0;
function lanesToEventPriority(lanes) {
lanes &= -lanes;
return 2 < lanes
@@ -701,8 +702,7 @@ function shouldSetTextContent(type, props) {
"string" === typeof props.children || "number" === typeof props.children
);
}
var currentUpdatePriority = 0,
valueStack = [],
var valueStack = [],
index = -1;
function createCursor(defaultValue) {
return { current: defaultValue };
@@ -1568,11 +1568,51 @@ function unwrapThenable(thenable) {
null === thenableState$1 && (thenableState$1 = []);
return trackUsedThenable(thenableState$1, thenable, index);
}
function convertStringRefToCallbackRef(
returnFiber,
current,
element,
mixedRef
) {
function ref(value) {
var refs = inst.refs;
null === value ? delete refs[stringRef] : (refs[stringRef] = value);
}
var stringRef = "" + mixedRef;
returnFiber = element._owner;
if (!returnFiber) throw Error(formatProdErrorMessage(290, stringRef));
if (1 !== returnFiber.tag) throw Error(formatProdErrorMessage(309));
var inst = returnFiber.stateNode;
if (!inst) throw Error(formatProdErrorMessage(147, stringRef));
if (
null !== current &&
null !== current.ref &&
"function" === typeof current.ref &&
current.ref._stringRef === stringRef
)
return current.ref;
ref._stringRef = stringRef;
return ref;
}
function coerceRef(returnFiber, current, workInProgress, element) {
enableRefAsProp
? ((returnFiber = element.props.ref),
(returnFiber = void 0 !== returnFiber ? returnFiber : null))
: (returnFiber = element.ref);
if (enableRefAsProp) {
var mixedRef = element.props.ref;
mixedRef = void 0 !== mixedRef ? mixedRef : null;
} else mixedRef = element.ref;
"string" === typeof mixedRef ||
"number" === typeof mixedRef ||
"boolean" === typeof mixedRef
? ((returnFiber = convertStringRefToCallbackRef(
returnFiber,
current,
element,
mixedRef
)),
enableRefAsProp &&
((current = assign({}, workInProgress.pendingProps)),
(current.ref = returnFiber),
(workInProgress.pendingProps = current)))
: (returnFiber = mixedRef);
workInProgress.ref = returnFiber;
}
function throwOnInvalidObjectType(returnFiber, newChild) {
@@ -2337,7 +2377,9 @@ function findFirstSuspended(row) {
}
return null;
}
var renderLanes = 0,
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
renderLanes = 0,
currentlyRenderingFiber$1 = null,
currentHook = null,
workInProgressHook = null,
@@ -2369,7 +2411,7 @@ function renderWithHooks(
workInProgress.memoizedState = null;
workInProgress.updateQueue = null;
workInProgress.lanes = 0;
ReactSharedInternals.H =
ReactCurrentDispatcher$1.current =
null === current || null === current.memoizedState
? HooksDispatcherOnMount
: HooksDispatcherOnUpdate;
@@ -2387,7 +2429,7 @@ function renderWithHooks(
return nextRenderLanes;
}
function finishRenderingHooks(current) {
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
renderLanes = 0;
workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
@@ -2414,22 +2456,16 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
numberOfReRenders += 1;
workInProgressHook = currentHook = null;
workInProgress.updateQueue = null;
ReactSharedInternals.H = HooksDispatcherOnRerender;
ReactCurrentDispatcher$1.current = HooksDispatcherOnRerender;
var children = Component(props, secondArg);
} while (didScheduleRenderPhaseUpdateDuringThisPass);
return children;
}
function TransitionAwareHostComponent() {
var dispatcher = ReactSharedInternals.H,
maybeThenable = dispatcher.useState()[0];
maybeThenable =
"function" === typeof maybeThenable.then
? useThenable(maybeThenable)
: maybeThenable;
dispatcher = dispatcher.useState()[0];
(null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
(currentlyRenderingFiber$1.flags |= 1024);
return maybeThenable;
var maybeThenable = ReactCurrentDispatcher$1.current.useState()[0];
return "function" === typeof maybeThenable.then
? useThenable(maybeThenable)
: maybeThenable;
}
function bailoutHooks(current, workInProgress, lanes) {
workInProgress.updateQueue = current.updateQueue;
@@ -2515,7 +2551,7 @@ function useThenable(thenable) {
(null === workInProgressHook
? null === currentlyRenderingFiber$1.memoizedState
: null === workInProgressHook.next) &&
(ReactSharedInternals.H = HooksDispatcherOnMount);
(ReactCurrentDispatcher$1.current = HooksDispatcherOnMount);
return thenable;
}
function use(usable) {
@@ -2808,9 +2844,9 @@ function dispatchActionState(
function runActionStateAction(actionQueue, setPendingState, setState, payload) {
var action = actionQueue.action,
prevState = actionQueue.state,
prevTransition = ReactSharedInternals.T,
prevTransition = ReactCurrentBatchConfig$2.transition,
currentTransition = { _callbacks: new Set() };
ReactSharedInternals.T = currentTransition;
ReactCurrentBatchConfig$2.transition = currentTransition;
setPendingState(!0);
try {
var returnValue = action(prevState, payload);
@@ -2843,7 +2879,7 @@ function runActionStateAction(actionQueue, setPendingState, setState, payload) {
setState({ then: function () {}, status: "rejected", reason: error }),
finishRunningActionStateAction(actionQueue, setPendingState, setState);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig$2.transition = prevTransition;
}
}
function finishRunningActionStateAction(
@@ -3114,15 +3150,15 @@ function startTransition(
var previousPriority = currentUpdatePriority;
currentUpdatePriority =
0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig$2.transition,
currentTransition = { _callbacks: new Set() };
ReactSharedInternals.T = currentTransition;
ReactCurrentBatchConfig$2.transition = currentTransition;
dispatchOptimisticSetState(fiber, !1, queue, pendingState);
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((currentTransition.name = options.name),
(currentTransition.startTime = now()));
((ReactCurrentBatchConfig$2.transition.name = options.name),
(ReactCurrentBatchConfig$2.transition.startTime = now()));
try {
var returnValue = callback();
if (
@@ -3145,7 +3181,7 @@ function startTransition(
});
} finally {
(currentUpdatePriority = previousPriority),
(ReactSharedInternals.T = prevTransition);
(ReactCurrentBatchConfig$2.transition = prevTransition);
}
}
function useHostTransitionStatus() {
@@ -3664,20 +3700,19 @@ function resolveClassComponentProps(
alreadyResolvedDefaultProps
) {
var newProps = baseProps;
if (enableRefAsProp && "ref" in baseProps) {
newProps = {};
for (var propName in baseProps)
"ref" !== propName && (newProps[propName] = baseProps[propName]);
}
if (
(Component = Component.defaultProps) &&
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
) {
newProps === baseProps && (newProps = assign({}, newProps, baseProps));
for (var propName$36 in Component)
void 0 === newProps[propName$36] &&
(newProps[propName$36] = Component[propName$36]);
newProps = assign({}, newProps, baseProps);
for (var propName in Component)
void 0 === newProps[propName] &&
(newProps[propName] = Component[propName]);
}
enableRefAsProp &&
"ref" in newProps &&
(newProps === baseProps && (newProps = assign({}, newProps)),
delete newProps.ref);
return newProps;
}
function resolveDefaultPropsOnNonClassComponent(Component, baseProps) {
@@ -4040,7 +4075,8 @@ function pushMarkerInstance(workInProgress, markerInstance) {
markerInstanceStack.current.concat(markerInstance)
));
}
var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
SelectiveHydrationException = Error(formatProdErrorMessage(461)),
didReceiveUpdate = !1;
function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
workInProgress.child =
@@ -4570,7 +4606,7 @@ function updateClassComponent(
nextProps = 0 !== (workInProgress.flags & 128);
context || nextProps
? ((context = workInProgress.stateNode),
(ReactSharedInternals.owner = workInProgress),
(ReactCurrentOwner$1.current = workInProgress),
(Component =
nextProps && "function" !== typeof Component.getDerivedStateFromError
? null
@@ -5921,8 +5957,9 @@ function releaseCache(cache) {
cache.controller.abort();
});
}
var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
function requestCurrentTransition() {
var transition = ReactSharedInternals.T;
var transition = ReactCurrentBatchConfig$1.transition;
null !== transition && transition._callbacks.add(handleAsyncAction);
return transition;
}
@@ -6090,14 +6127,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
break;
case "collapsed":
lastTailNode = renderState.tail;
for (var lastTailNode$74 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$74 = lastTailNode),
for (var lastTailNode$73 = null; null !== lastTailNode; )
null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode),
(lastTailNode = lastTailNode.sibling);
null === lastTailNode$74
null === lastTailNode$73
? hasRenderedATailFallback || null === renderState.tail
? (renderState.tail = null)
: (renderState.tail.sibling = null)
: (lastTailNode$74.sibling = null);
: (lastTailNode$73.sibling = null);
}
}
function bubbleProperties(completedWork) {
@@ -6107,19 +6144,19 @@ function bubbleProperties(completedWork) {
newChildLanes = 0,
subtreeFlags = 0;
if (didBailout)
for (var child$75 = completedWork.child; null !== child$75; )
(newChildLanes |= child$75.lanes | child$75.childLanes),
(subtreeFlags |= child$75.subtreeFlags & 31457280),
(subtreeFlags |= child$75.flags & 31457280),
(child$75.return = completedWork),
(child$75 = child$75.sibling);
for (var child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags & 31457280),
(subtreeFlags |= child$74.flags & 31457280),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
else
for (child$75 = completedWork.child; null !== child$75; )
(newChildLanes |= child$75.lanes | child$75.childLanes),
(subtreeFlags |= child$75.subtreeFlags),
(subtreeFlags |= child$75.flags),
(child$75.return = completedWork),
(child$75 = child$75.sibling);
for (child$74 = completedWork.child; null !== child$74; )
(newChildLanes |= child$74.lanes | child$74.childLanes),
(subtreeFlags |= child$74.subtreeFlags),
(subtreeFlags |= child$74.flags),
(child$74.return = completedWork),
(child$74 = child$74.sibling);
completedWork.subtreeFlags |= subtreeFlags;
completedWork.childLanes = newChildLanes;
return didBailout;
@@ -6290,11 +6327,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(instance = newProps.alternate.memoizedState.cachePool.pool);
var cache$79 = null;
var cache$78 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
(cache$79 = newProps.memoizedState.cachePool.pool);
cache$79 !== instance && (newProps.flags |= 2048);
(cache$78 = newProps.memoizedState.cachePool.pool);
cache$78 !== instance && (newProps.flags |= 2048);
}
renderLanes !== current &&
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
@@ -6322,8 +6359,8 @@ function completeWork(current, workInProgress, renderLanes) {
instance = workInProgress.memoizedState;
if (null === instance) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
cache$79 = instance.rendering;
if (null === cache$79)
cache$78 = instance.rendering;
if (null === cache$78)
if (newProps) cutOffTailIfNeeded(instance, !1);
else {
if (
@@ -6331,11 +6368,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
cache$79 = findFirstSuspended(current);
if (null !== cache$79) {
cache$78 = findFirstSuspended(current);
if (null !== cache$78) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(instance, !1);
current = cache$79.updateQueue;
current = cache$78.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -6360,7 +6397,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
if (((current = findFirstSuspended(cache$79)), null !== current)) {
if (((current = findFirstSuspended(cache$78)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -6370,7 +6407,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !0),
null === instance.tail &&
"hidden" === instance.tailMode &&
!cache$79.alternate)
!cache$78.alternate)
)
return bubbleProperties(workInProgress), null;
} else
@@ -6382,13 +6419,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(instance, !1),
(workInProgress.lanes = 4194304));
instance.isBackwards
? ((cache$79.sibling = workInProgress.child),
(workInProgress.child = cache$79))
? ((cache$78.sibling = workInProgress.child),
(workInProgress.child = cache$78))
: ((current = instance.last),
null !== current
? (current.sibling = cache$79)
: (workInProgress.child = cache$79),
(instance.last = cache$79));
? (current.sibling = cache$78)
: (workInProgress.child = cache$78),
(instance.last = cache$78));
}
if (null !== instance.tail)
return (
@@ -6651,8 +6688,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
else if ("function" === typeof ref)
try {
ref(null);
} catch (error$96) {
captureCommitPhaseError(current, nearestMountedAncestor, error$96);
} catch (error$95) {
captureCommitPhaseError(current, nearestMountedAncestor, error$95);
}
else ref.current = null;
}
@@ -6856,11 +6893,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
current,
finishedRoot.__reactInternalSnapshotBeforeUpdate
);
} catch (error$97) {
} catch (error$96) {
captureCommitPhaseError(
finishedWork,
finishedWork.return,
error$97
error$96
);
}
}
@@ -7416,7 +7453,7 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
captureCommitPhaseError(childToDelete, parentFiber, error);
}
}
if (parentFiber.subtreeFlags & 13878)
if (parentFiber.subtreeFlags & 12854)
for (parentFiber = parentFiber.child; null !== parentFiber; )
commitMutationEffectsOnFiber(parentFiber, root$jscomp$0),
(parentFiber = parentFiber.sibling);
@@ -7440,8 +7477,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
}
try {
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
} catch (error$105) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
} catch (error$104) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$104);
}
}
break;
@@ -7475,8 +7512,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
finishedWork.updateQueue = null;
try {
flags._applyProps(flags, newProps, current);
} catch (error$108) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$108);
} catch (error$107) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$107);
}
}
break;
@@ -7512,8 +7549,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
null !== retryQueue && suspenseCallback(new Set(retryQueue));
}
}
} catch (error$110) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
} catch (error$109) {
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
}
flags = finishedWork.updateQueue;
null !== flags &&
@@ -7650,12 +7687,12 @@ function commitReconciliationEffects(finishedWork) {
break;
case 3:
case 4:
var parent$100 = JSCompiler_inline_result.stateNode.containerInfo,
before$101 = getHostSibling(finishedWork);
var parent$99 = JSCompiler_inline_result.stateNode.containerInfo,
before$100 = getHostSibling(finishedWork);
insertOrAppendPlacementNodeIntoContainer(
finishedWork,
before$101,
parent$100
before$100,
parent$99
);
break;
default:
@@ -8105,9 +8142,9 @@ function recursivelyTraverseReconnectPassiveEffects(
);
break;
case 22:
var instance$116 = finishedWork.stateNode;
var instance$115 = finishedWork.stateNode;
null !== finishedWork.memoizedState
? instance$116._visibility & 4
? instance$115._visibility & 4
? recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -8119,7 +8156,7 @@ function recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork
)
: ((instance$116._visibility |= 4),
: ((instance$115._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
@@ -8132,7 +8169,7 @@ function recursivelyTraverseReconnectPassiveEffects(
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork,
instance$116
instance$115
);
break;
case 24:
@@ -8439,6 +8476,10 @@ var DefaultCacheDispatcher = {
}
},
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig,
executionContext = 0,
workInProgressRoot = null,
workInProgress = null,
@@ -8537,7 +8578,8 @@ function requestUpdateLane() {
var actionScopeLane = currentEntangledLane;
return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane();
}
return currentUpdatePriority || 32;
actionScopeLane = currentUpdatePriority;
return 0 !== actionScopeLane ? actionScopeLane : 32;
}
function requestDeferredLane() {
0 === workInProgressDeferredLane &&
@@ -8564,7 +8606,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) {
if (0 === (executionContext & 2) || root !== workInProgressRoot) {
if (
enableTransitionTracing &&
((fiber = ReactSharedInternals.T),
((fiber = ReactCurrentBatchConfig.transition),
null !== fiber &&
null != fiber.name &&
(-1 === fiber.startTime && (fiber.startTime = now()),
@@ -8625,18 +8667,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
root,
renderWasConcurrent
);
if (
0 !== errorRetryLanes &&
0 !== errorRetryLanes &&
((lanes = errorRetryLanes),
(exitStatus = recoverFromConcurrentError(
root,
renderWasConcurrent,
errorRetryLanes
)),
(renderWasConcurrent = !1),
2 !== exitStatus)
)
continue;
)));
}
if (1 === exitStatus) {
prepareFreshStack(root, 0);
@@ -8870,10 +8907,24 @@ function performSyncWorkOnRoot(root, lanes) {
ensureRootIsScheduled(root);
return null;
}
function flushSyncWork() {
return 0 === (executionContext & 6)
? (flushSyncWorkAcrossRoots_impl(!1), !1)
: !0;
function flushSync(fn) {
var prevExecutionContext = executionContext;
executionContext |= 1;
var prevTransition = ReactCurrentBatchConfig.transition,
previousPriority = currentUpdatePriority;
try {
if (
((ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = 2),
fn)
)
return fn();
} finally {
(currentUpdatePriority = previousPriority),
(ReactCurrentBatchConfig.transition = prevTransition),
(executionContext = prevExecutionContext),
0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1);
}
}
function resetWorkInProgressStack() {
if (null !== workInProgress) {
@@ -8936,8 +8987,8 @@ function prepareFreshStack(root, lanes) {
}
function handleThrow(root, thrownValue) {
currentlyRenderingFiber$1 = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactSharedInternals.owner = null;
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
ReactCurrentOwner.current = null;
if (thrownValue === SuspenseException) {
thrownValue = getSuspendedThenable();
var handler = suspenseHandlerStackCursor.current;
@@ -8975,13 +9026,13 @@ function handleThrow(root, thrownValue) {
));
}
function pushDispatcher() {
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = ContextOnlyDispatcher;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
}
function pushCacheDispatcher() {
var prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
var prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
return prevCacheDispatcher;
}
function renderDidSuspendDelayIfPossible() {
@@ -9027,15 +9078,15 @@ function renderRootSync(root, lanes) {
}
workLoopSync();
break;
} catch (thrownValue$124) {
handleThrow(root, thrownValue$124);
} catch (thrownValue$123) {
handleThrow(root, thrownValue$123);
}
while (1);
lanes && root.shellSuspendCounter++;
resetContextDependencies();
executionContext = prevExecutionContext;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
if (null !== workInProgress) throw Error(formatProdErrorMessage(261));
workInProgressRoot = null;
workInProgressRootRenderLanes = 0;
@@ -9133,13 +9184,13 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
} catch (thrownValue$126) {
handleThrow(root, thrownValue$126);
} catch (thrownValue$125) {
handleThrow(root, thrownValue$125);
}
while (1);
resetContextDependencies();
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
executionContext = prevExecutionContext;
if (null !== workInProgress) return 0;
workInProgressRoot = null;
@@ -9155,7 +9206,7 @@ function performUnitOfWork(unitOfWork) {
var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
unitOfWork.memoizedProps = unitOfWork.pendingProps;
null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next);
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
}
function replaySuspendedUnitOfWork(unitOfWork) {
var current = unitOfWork.alternate;
@@ -9207,7 +9258,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
null === current
? completeUnitOfWork(unitOfWork)
: (workInProgress = current);
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
}
function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) {
resetContextDependencies();
@@ -9294,11 +9345,11 @@ function commitRoot(
didIncludeRenderPhaseUpdate,
spawnedLane
) {
var prevTransition = ReactSharedInternals.T,
previousUpdateLanePriority = currentUpdatePriority;
var previousUpdateLanePriority = currentUpdatePriority,
prevTransition = ReactCurrentBatchConfig.transition;
try {
(currentUpdatePriority = 2),
(ReactSharedInternals.T = null),
(ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = 2),
commitRootImpl(
root,
recoverableErrors,
@@ -9308,7 +9359,7 @@ function commitRoot(
spawnedLane
);
} finally {
(ReactSharedInternals.T = prevTransition),
(ReactCurrentBatchConfig.transition = prevTransition),
(currentUpdatePriority = previousUpdateLanePriority);
}
return null;
@@ -9352,13 +9403,13 @@ function commitRootImpl(
}));
transitions = 0 !== (finishedWork.flags & 15990);
if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) {
transitions = ReactSharedInternals.T;
ReactSharedInternals.T = null;
transitions = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = null;
spawnedLane = currentUpdatePriority;
currentUpdatePriority = 2;
var prevExecutionContext = executionContext;
executionContext |= 4;
ReactSharedInternals.owner = null;
ReactCurrentOwner.current = null;
commitBeforeMutationEffects(root, finishedWork);
commitMutationEffectsOnFiber(finishedWork, root);
root.current = finishedWork;
@@ -9366,7 +9417,7 @@ function commitRootImpl(
requestPaint();
executionContext = prevExecutionContext;
currentUpdatePriority = spawnedLane;
ReactSharedInternals.T = transitions;
ReactCurrentBatchConfig.transition = transitions;
} else root.current = finishedWork;
rootDoesHavePassiveEffects
? ((rootDoesHavePassiveEffects = !1),
@@ -9410,18 +9461,19 @@ function flushPassiveEffects() {
var root = rootWithPendingPassiveEffects,
remainingLanes = pendingPassiveEffectsRemainingLanes;
pendingPassiveEffectsRemainingLanes = 0;
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes),
prevTransition = ReactSharedInternals.T,
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
renderPriority = 32 > renderPriority ? 32 : renderPriority;
var prevTransition = ReactCurrentBatchConfig.transition,
previousPriority = currentUpdatePriority;
try {
return (
(currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority),
(ReactSharedInternals.T = null),
(ReactCurrentBatchConfig.transition = null),
(currentUpdatePriority = renderPriority),
flushPassiveEffectsImpl()
);
} finally {
(currentUpdatePriority = previousPriority),
(ReactSharedInternals.T = prevTransition),
(ReactCurrentBatchConfig.transition = prevTransition),
releaseRootPooledCache(root, remainingLanes);
}
}
@@ -9932,21 +9984,64 @@ function FiberRootNode(
)
containerInfo.push(null);
}
function updateContainerSync(element, container, parentComponent, callback) {
0 === container.tag && flushPassiveEffects();
function createContainer(
containerInfo,
tag,
hydrationCallbacks,
isStrictMode,
concurrentUpdatesByDefaultOverride,
identifierPrefix,
onUncaughtError,
onCaughtError,
onRecoverableError,
transitionCallbacks
) {
containerInfo = new FiberRootNode(
containerInfo,
tag,
!1,
identifierPrefix,
onUncaughtError,
onCaughtError,
onRecoverableError,
null
);
containerInfo.hydrationCallbacks = hydrationCallbacks;
enableTransitionTracing &&
(containerInfo.transitionCallbacks = transitionCallbacks);
hydrationCallbacks = 1;
!0 === isStrictMode && (hydrationCallbacks |= 24);
concurrentUpdatesByDefaultOverride && (hydrationCallbacks |= 32);
isStrictMode = createFiber(3, null, null, hydrationCallbacks);
containerInfo.current = isStrictMode;
isStrictMode.stateNode = containerInfo;
concurrentUpdatesByDefaultOverride = createCache();
concurrentUpdatesByDefaultOverride.refCount++;
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
concurrentUpdatesByDefaultOverride.refCount++;
isStrictMode.memoizedState = {
element: null,
isDehydrated: !1,
cache: concurrentUpdatesByDefaultOverride
};
initializeUpdateQueue(isStrictMode);
return containerInfo;
}
function updateContainer(element, container, parentComponent, callback) {
parentComponent = container.current;
var lane = requestUpdateLane();
null === container.context
? (container.context = emptyContextObject)
: (container.pendingContext = emptyContextObject);
container = createUpdate(2);
container = createUpdate(lane);
container.payload = { element: element };
callback = void 0 === callback ? null : callback;
null !== callback && (container.callback = callback);
element = enqueueUpdate(parentComponent, container, 2);
element = enqueueUpdate(parentComponent, container, lane);
null !== element &&
(scheduleUpdateOnFiber(element, parentComponent, 2),
entangleTransitions(element, parentComponent, 2));
return 2;
(scheduleUpdateOnFiber(element, parentComponent, lane),
entangleTransitions(element, parentComponent, lane));
return lane;
}
function emptyFindFiberByHostInstance() {
return null;
@@ -9987,52 +10082,41 @@ var slice = Array.prototype.slice,
_inheritsLoose(Surface, _React$Component);
var _proto4 = Surface.prototype;
_proto4.componentDidMount = function () {
var _this$props = this.props;
var $jscomp$this = this,
_this$props = this.props;
this._surface = Mode$1.Surface(
+_this$props.width,
+_this$props.height,
this._tagRef
);
_this$props = new FiberRootNode(
this._surface,
1,
!1,
"",
void 0,
void 0,
void 0,
null
);
_this$props.hydrationCallbacks = null;
enableTransitionTracing && (_this$props.transitionCallbacks = void 0);
var JSCompiler_inline_result = createFiber(3, null, null, 1);
_this$props.current = JSCompiler_inline_result;
JSCompiler_inline_result.stateNode = _this$props;
var initialCache = createCache();
initialCache.refCount++;
_this$props.pooledCache = initialCache;
initialCache.refCount++;
JSCompiler_inline_result.memoizedState = {
element: null,
isDehydrated: !1,
cache: initialCache
};
initializeUpdateQueue(JSCompiler_inline_result);
this._mountNode = _this$props;
updateContainerSync(this.props.children, this._mountNode, this);
flushSyncWork();
this._mountNode = createContainer(this._surface, 1, null, !1, !1, "");
flushSync(function () {
updateContainer(
$jscomp$this.props.children,
$jscomp$this._mountNode,
$jscomp$this
);
});
};
_proto4.componentDidUpdate = function (prevProps) {
var props = this.props;
var $jscomp$this = this,
props = this.props;
(props.height === prevProps.height && props.width === prevProps.width) ||
this._surface.resize(+props.width, +props.height);
updateContainerSync(this.props.children, this._mountNode, this);
flushSyncWork();
flushSync(function () {
updateContainer(
$jscomp$this.props.children,
$jscomp$this._mountNode,
$jscomp$this
);
});
this._surface.render && this._surface.render();
};
_proto4.componentWillUnmount = function () {
updateContainerSync(null, this._mountNode, this);
flushSyncWork();
var $jscomp$this = this;
flushSync(function () {
updateContainer(null, $jscomp$this._mountNode, $jscomp$this);
});
};
_proto4.render = function () {
var $jscomp$this = this,
@@ -10079,19 +10163,19 @@ var slice = Array.prototype.slice,
};
return Text;
})(React.Component),
devToolsConfig$jscomp$inline_1079 = {
devToolsConfig$jscomp$inline_1086 = {
findFiberByHostInstance: function () {
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-e590ea90",
version: "19.0.0-www-modern-292e1686",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1307 = {
bundleType: devToolsConfig$jscomp$inline_1079.bundleType,
version: devToolsConfig$jscomp$inline_1079.version,
rendererPackageName: devToolsConfig$jscomp$inline_1079.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1079.rendererConfig,
var internals$jscomp$inline_1298 = {
bundleType: devToolsConfig$jscomp$inline_1086.bundleType,
version: devToolsConfig$jscomp$inline_1086.version,
rendererPackageName: devToolsConfig$jscomp$inline_1086.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1086.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
@@ -10101,33 +10185,33 @@ var internals$jscomp$inline_1307 = {
setErrorHandler: null,
setSuspenseHandler: null,
scheduleUpdate: null,
currentDispatcherRef: ReactSharedInternals,
currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
findHostInstanceByFiber: function (fiber) {
fiber = findCurrentFiberUsingSlowPath(fiber);
fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null;
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1079.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1086.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-e590ea90"
reconcilerVersion: "19.0.0-www-modern-292e1686"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1308 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1299 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1308.isDisabled &&
hook$jscomp$inline_1308.supportsFiber
!hook$jscomp$inline_1299.isDisabled &&
hook$jscomp$inline_1299.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1308.inject(
internals$jscomp$inline_1307
(rendererID = hook$jscomp$inline_1299.inject(
internals$jscomp$inline_1298
)),
(injectedHook = hook$jscomp$inline_1308);
(injectedHook = hook$jscomp$inline_1299);
} catch (err) {}
}
var Path = Mode$1.Path;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "19.0.0-www-classic-bad327f1";
var ReactVersion = "19.0.0-www-classic-de6e54b3";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -63,10 +63,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -2349,10 +2351,7 @@ if (__DEV__) {
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// same object across all transitions.
@@ -2364,42 +2363,21 @@ if (__DEV__) {
};
var NotPending = Object.freeze(sharedNotPendingObject);
var previousDispatcher = ReactDOMSharedInternals.d;
/* ReactDOMCurrentDispatcher */
var ReactDOMSharedInternals =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
ReactDOMSharedInternals.d =
/* ReactDOMCurrentDispatcher */
{
f:
/* flushSyncWork */
previousDispatcher.f,
/* flushSyncWork */
r:
/* requestFormReset */
previousDispatcher.r,
/* requestFormReset */
D:
/* prefetchDNS */
prefetchDNS,
C:
/* preconnect */
preconnect,
L:
/* preload */
preload,
m:
/* preloadModule */
preloadModule,
X:
/* preinitScript */
preinitScript,
S:
/* preinitStyle */
preinitStyle,
M:
/* preinitModuleScript */
preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ReactDOMCurrentDispatcher =
ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
var previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ScriptStreamingFormat = 0;
var DataStreamingFormat = 1;
var NothingSent =
@@ -5025,7 +5003,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureOrNoScriptTagInScope
pictureTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
@@ -5036,7 +5014,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
@@ -5882,7 +5860,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
!!(formatContext.tagScope & PICTURE_SCOPE)
);
}
// Omitted close tags
@@ -7475,10 +7453,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.D(
/* prefetchDNS */
href
);
previousDispatcher.prefetchDNS(href);
return;
}
@@ -7537,11 +7512,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.C(
/* preconnect */
href,
crossOrigin
);
previousDispatcher.preconnect(href, crossOrigin);
return;
}
@@ -7606,12 +7577,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.L(
/* preload */
href,
as,
options
);
previousDispatcher.preload(href, as, options);
return;
}
@@ -7846,11 +7812,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.m(
/* preloadModule */
href,
options
);
previousDispatcher.preloadModule(href, options);
return;
}
@@ -7928,12 +7890,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.S(
/* preinitStyle */
href,
precedence,
options
);
previousDispatcher.preinitStyle(href, precedence, options);
return;
}
@@ -8015,11 +7972,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.X(
/* preinitScript */
src,
options
);
previousDispatcher.preinitScript(src, options);
return;
}
@@ -8085,11 +8038,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.M(
/* preinitModuleScript */
src,
options
);
previousDispatcher.preinitModuleScript(src, options);
return;
}
@@ -10880,8 +10829,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -10933,13 +10883,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternals.H = null;
ReactCurrentDispatcher$1.current = null;
disableLogs();
}
/**
@@ -11132,7 +11082,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternals.H = previousDispatcher;
ReactCurrentDispatcher$1.current = previousDispatcher;
reenableLogs();
}
@@ -11151,12 +11101,12 @@ if (__DEV__) {
return syntheticFrame;
}
function describeClassComponentFrame(ctor) {
function describeClassComponentFrame(ctor, ownerFn) {
{
return describeNativeComponentFrame(ctor, true);
}
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -11170,15 +11120,15 @@ if (__DEV__) {
do {
switch (node.tag) {
case 0:
info += describeBuiltInComponentFrame(node.type);
info += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
info += describeFunctionComponentFrame(node.type);
info += describeFunctionComponentFrame(node.type, null);
break;
case 2:
info += describeClassComponentFrame(node.type);
info += describeClassComponentFrame(node.type, null);
break;
} // $FlowFixMe[incompatible-type] we bail out when we get a null
@@ -11191,6 +11141,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; // Linked list representing the identity of a component given the component/tag name and key.
// The name might be minified but we assume that it's going to be the same generated name. Typically
// because it's just the same compiled output in practice.
// resume with segmentID at the index
@@ -12045,41 +11998,31 @@ if (__DEV__) {
}
function resolveClassComponentProps(Component, baseProps) {
var newProps = baseProps;
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in baseProps) {
newProps = {};
for (var propName in baseProps) {
if (propName !== "ref") {
newProps[propName] = baseProps[propName];
}
}
}
} // Resolve default props.
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
var defaultProps = Component.defaultProps;
if (
defaultProps && // If disableDefaultPropsExceptForClasses is true, we always resolve
// default props here, rather than in the JSX runtime.
disableDefaultPropsExceptForClasses
) {
// We may have already copied the props object above to remove ref. If so,
// we can modify that. Otherwise, copy the props object with Object.assign.
if (newProps === baseProps) {
newProps = assign({}, newProps, baseProps);
} // Taken from old JSX runtime, where this used to live.
if (defaultProps && disableDefaultPropsExceptForClasses) {
newProps = assign({}, newProps, baseProps);
for (var _propName in defaultProps) {
if (newProps[_propName] === undefined) {
newProps[_propName] = defaultProps[_propName];
for (var propName in defaultProps) {
if (newProps[propName] === undefined) {
newProps[propName] = defaultProps[propName];
}
}
}
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in newProps) {
if (newProps === baseProps) {
newProps = assign({}, newProps);
}
delete newProps.ref;
}
}
return newProps;
}
@@ -13999,22 +13942,22 @@ if (__DEV__) {
}
var prevContext = getActiveContext();
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = null;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher;
{
prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
}
var prevRequest = currentRequest;
currentRequest = request;
var prevGetCurrentStackImpl = null;
var prevGetCurrentStackImpl;
{
prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack;
ReactSharedInternals.getCurrentStack = getCurrentStackInDEV;
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
ReactDebugCurrentFrame.getCurrentStack = getCurrentStackInDEV;
}
var prevResumableState = currentResumableState;
@@ -14040,14 +13983,14 @@ if (__DEV__) {
fatalError(request, error);
} finally {
setCurrentResumableState(prevResumableState);
ReactSharedInternals.H = prevDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
{
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
}
{
ReactSharedInternals.getCurrentStack = prevGetCurrentStackImpl;
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
}
if (prevDispatcher === HooksDispatcher) {
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "19.0.0-www-modern-d8e2224b";
var ReactVersion = "19.0.0-www-modern-5712afa3";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -63,10 +63,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -2349,10 +2351,7 @@ if (__DEV__) {
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// same object across all transitions.
@@ -2364,42 +2363,21 @@ if (__DEV__) {
};
var NotPending = Object.freeze(sharedNotPendingObject);
var previousDispatcher = ReactDOMSharedInternals.d;
/* ReactDOMCurrentDispatcher */
var ReactDOMSharedInternals =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
ReactDOMSharedInternals.d =
/* ReactDOMCurrentDispatcher */
{
f:
/* flushSyncWork */
previousDispatcher.f,
/* flushSyncWork */
r:
/* requestFormReset */
previousDispatcher.r,
/* requestFormReset */
D:
/* prefetchDNS */
prefetchDNS,
C:
/* preconnect */
preconnect,
L:
/* preload */
preload,
m:
/* preloadModule */
preloadModule,
X:
/* preinitScript */
preinitScript,
S:
/* preinitStyle */
preinitStyle,
M:
/* preinitModuleScript */
preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ReactDOMCurrentDispatcher =
ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
var previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ScriptStreamingFormat = 0;
var DataStreamingFormat = 1;
var NothingSent =
@@ -5025,7 +5003,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureOrNoScriptTagInScope
pictureTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
@@ -5036,7 +5014,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
@@ -5882,7 +5860,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
!!(formatContext.tagScope & PICTURE_SCOPE)
);
}
// Omitted close tags
@@ -7475,10 +7453,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.D(
/* prefetchDNS */
href
);
previousDispatcher.prefetchDNS(href);
return;
}
@@ -7537,11 +7512,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.C(
/* preconnect */
href,
crossOrigin
);
previousDispatcher.preconnect(href, crossOrigin);
return;
}
@@ -7606,12 +7577,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.L(
/* preload */
href,
as,
options
);
previousDispatcher.preload(href, as, options);
return;
}
@@ -7846,11 +7812,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.m(
/* preloadModule */
href,
options
);
previousDispatcher.preloadModule(href, options);
return;
}
@@ -7928,12 +7890,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.S(
/* preinitStyle */
href,
precedence,
options
);
previousDispatcher.preinitStyle(href, precedence, options);
return;
}
@@ -8015,11 +7972,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.X(
/* preinitScript */
src,
options
);
previousDispatcher.preinitScript(src, options);
return;
}
@@ -8085,11 +8038,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.M(
/* preinitModuleScript */
src,
options
);
previousDispatcher.preinitModuleScript(src, options);
return;
}
@@ -10801,8 +10750,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -10854,13 +10804,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternals.H = null;
ReactCurrentDispatcher$1.current = null;
disableLogs();
}
/**
@@ -11053,7 +11003,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternals.H = previousDispatcher;
ReactCurrentDispatcher$1.current = previousDispatcher;
reenableLogs();
}
@@ -11072,12 +11022,12 @@ if (__DEV__) {
return syntheticFrame;
}
function describeClassComponentFrame(ctor) {
function describeClassComponentFrame(ctor, ownerFn) {
{
return describeNativeComponentFrame(ctor, true);
}
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -11091,15 +11041,15 @@ if (__DEV__) {
do {
switch (node.tag) {
case 0:
info += describeBuiltInComponentFrame(node.type);
info += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
info += describeFunctionComponentFrame(node.type);
info += describeFunctionComponentFrame(node.type, null);
break;
case 2:
info += describeClassComponentFrame(node.type);
info += describeClassComponentFrame(node.type, null);
break;
} // $FlowFixMe[incompatible-type] we bail out when we get a null
@@ -11112,6 +11062,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; // Linked list representing the identity of a component given the component/tag name and key.
// The name might be minified but we assume that it's going to be the same generated name. Typically
// because it's just the same compiled output in practice.
// resume with segmentID at the index
@@ -11948,41 +11901,31 @@ if (__DEV__) {
}
function resolveClassComponentProps(Component, baseProps) {
var newProps = baseProps;
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in baseProps) {
newProps = {};
for (var propName in baseProps) {
if (propName !== "ref") {
newProps[propName] = baseProps[propName];
}
}
}
} // Resolve default props.
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
var defaultProps = Component.defaultProps;
if (
defaultProps && // If disableDefaultPropsExceptForClasses is true, we always resolve
// default props here, rather than in the JSX runtime.
disableDefaultPropsExceptForClasses
) {
// We may have already copied the props object above to remove ref. If so,
// we can modify that. Otherwise, copy the props object with Object.assign.
if (newProps === baseProps) {
newProps = assign({}, newProps, baseProps);
} // Taken from old JSX runtime, where this used to live.
if (defaultProps && disableDefaultPropsExceptForClasses) {
newProps = assign({}, newProps, baseProps);
for (var _propName in defaultProps) {
if (newProps[_propName] === undefined) {
newProps[_propName] = defaultProps[_propName];
for (var propName in defaultProps) {
if (newProps[propName] === undefined) {
newProps[propName] = defaultProps[propName];
}
}
}
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in newProps) {
if (newProps === baseProps) {
newProps = assign({}, newProps);
}
delete newProps.ref;
}
}
return newProps;
}
@@ -13904,22 +13847,22 @@ if (__DEV__) {
}
var prevContext = getActiveContext();
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = null;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher;
{
prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
}
var prevRequest = currentRequest;
currentRequest = request;
var prevGetCurrentStackImpl = null;
var prevGetCurrentStackImpl;
{
prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack;
ReactSharedInternals.getCurrentStack = getCurrentStackInDEV;
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
ReactDebugCurrentFrame.getCurrentStack = getCurrentStackInDEV;
}
var prevResumableState = currentResumableState;
@@ -13945,14 +13888,14 @@ if (__DEV__) {
fatalError(request, error);
} finally {
setCurrentResumableState(prevResumableState);
ReactSharedInternals.H = prevDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
{
ReactSharedInternals.C = prevCacheDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
}
{
ReactSharedInternals.getCurrentStack = prevGetCurrentStackImpl;
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
}
if (prevDispatcher === HooksDispatcher) {
@@ -287,26 +287,25 @@ function sanitizeURL(url) {
: url;
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
sharedNotPendingObject = {
pending: !1,
data: null,
method: null,
action: null
},
previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
f: previousDispatcher.f,
r: previousDispatcher.r,
D: prefetchDNS,
C: preconnect,
L: preload,
m: preloadModule,
X: preinitScript,
S: preinitStyle,
M: preinitModuleScript
ReactDOMCurrentDispatcher =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactDOMCurrentDispatcher,
previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
};
var PRELOAD_NO_CREDS = [],
scriptRegex = /(<\/|<)(s)(cript)/gi;
@@ -1570,7 +1569,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 3) &&
!1 === !!(formatContext.tagScope & 2) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
@@ -2238,7 +2237,7 @@ function prefetchDNS(href) {
}
enqueueFlush(request);
}
} else previousDispatcher.D(href);
} else previousDispatcher.prefetchDNS(href);
}
function preconnect(href, crossOrigin) {
var request = currentRequest ? currentRequest : null;
@@ -2292,7 +2291,7 @@ function preconnect(href, crossOrigin) {
}
enqueueFlush(request);
}
} else previousDispatcher.C(href, crossOrigin);
} else previousDispatcher.preconnect(href, crossOrigin);
}
function preload(href, as, options) {
var request = currentRequest ? currentRequest : null;
@@ -2406,7 +2405,7 @@ function preload(href, as, options) {
}
enqueueFlush(request);
}
} else previousDispatcher.L(href, as, options);
} else previousDispatcher.preload(href, as, options);
}
function preloadModule(href, options) {
var request = currentRequest ? currentRequest : null;
@@ -2442,7 +2441,7 @@ function preloadModule(href, options) {
renderState.bulkPreloads.add(as);
enqueueFlush(request);
}
} else previousDispatcher.m(href, options);
} else previousDispatcher.preloadModule(href, options);
}
function preinitStyle(href, precedence, options) {
var request = currentRequest ? currentRequest : null;
@@ -2482,7 +2481,7 @@ function preinitStyle(href, precedence, options) {
styleQueue.sheets.set(href, precedence),
enqueueFlush(request));
}
} else previousDispatcher.S(href, precedence, options);
} else previousDispatcher.preinitStyle(href, precedence, options);
}
function preinitScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2506,7 +2505,7 @@ function preinitScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.X(src, options);
} else previousDispatcher.preinitScript(src, options);
}
function preinitModuleScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2532,7 +2531,7 @@ function preinitModuleScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.M(src, options);
} else previousDispatcher.preinitModuleScript(src, options);
}
function adoptPreloadCredentials(target, preloadState) {
null == target.crossOrigin && (target.crossOrigin = preloadState[0]);
@@ -3449,6 +3448,8 @@ function describeNativeComponentFrame(fn, construct) {
? describeBuiltInComponentFrame(previousPrepareStackTrace)
: "";
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
function defaultErrorHandler(error) {
console.error(error);
return null;
@@ -3670,7 +3671,7 @@ function getThrownInfo(request, node) {
do {
switch (node.tag) {
case 0:
request += describeBuiltInComponentFrame(node.type);
request += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
request += describeNativeComponentFrame(node.type, !1);
@@ -3806,20 +3807,19 @@ function renderElement(request, task, keyPath, type, props, ref) {
if (type.prototype && type.prototype.isReactComponent) {
var JSCompiler_inline_result,
newProps = props;
if (enableRefAsProp && "ref" in props) {
newProps = {};
for (var propName in props)
"ref" !== propName && (newProps[propName] = props[propName]);
}
if (
(JSCompiler_inline_result = type.defaultProps) &&
disableDefaultPropsExceptForClasses
) {
newProps === props && (newProps = assign({}, newProps, props));
for (var propName$31 in JSCompiler_inline_result)
void 0 === newProps[propName$31] &&
(newProps[propName$31] = JSCompiler_inline_result[propName$31]);
newProps = assign({}, newProps, props);
for (var propName in JSCompiler_inline_result)
void 0 === newProps[propName] &&
(newProps[propName] = JSCompiler_inline_result[propName]);
}
enableRefAsProp &&
"ref" in newProps &&
(newProps === props && (newProps = assign({}, newProps)),
delete newProps.ref);
JSCompiler_inline_result = newProps;
props = task.componentStack;
task.componentStack = { tag: 2, parent: task.componentStack, type: type };
@@ -3835,20 +3835,20 @@ function renderElement(request, task, keyPath, type, props, ref) {
newProps.updater = classComponentUpdater;
newProps.props = JSCompiler_inline_result;
newProps.state = initialState;
propName$31 = { queue: [], replace: !1 };
newProps._reactInternals = propName$31;
propName = type.contextType;
propName = { queue: [], replace: !1 };
newProps._reactInternals = propName;
var contextType = type.contextType;
newProps.context =
"object" === typeof propName && null !== propName
? propName._currentValue2
"object" === typeof contextType && null !== contextType
? contextType._currentValue2
: ref;
propName = type.getDerivedStateFromProps;
"function" === typeof propName &&
((propName = propName(JSCompiler_inline_result, initialState)),
contextType = type.getDerivedStateFromProps;
"function" === typeof contextType &&
((contextType = contextType(JSCompiler_inline_result, initialState)),
(initialState =
null === propName || void 0 === propName
null === contextType || void 0 === contextType
? initialState
: assign({}, initialState, propName)),
: assign({}, initialState, contextType)),
(newProps.state = initialState));
if (
"function" !== typeof type.getDerivedStateFromProps &&
@@ -3868,17 +3868,17 @@ function renderElement(request, task, keyPath, type, props, ref) {
newProps.state,
null
),
null !== propName$31.queue && 0 < propName$31.queue.length)
null !== propName.queue && 0 < propName.queue.length)
) {
initialState = propName$31.queue;
var oldReplace = propName$31.replace;
propName$31.queue = null;
propName$31.replace = !1;
initialState = propName.queue;
var oldReplace = propName.replace;
propName.queue = null;
propName.replace = !1;
if (oldReplace && 1 === initialState.length)
newProps.state = initialState[0];
else {
propName$31 = oldReplace ? initialState[0] : newProps.state;
propName = !0;
propName = oldReplace ? initialState[0] : newProps.state;
contextType = !0;
for (
oldReplace = oldReplace ? 1 : 0;
oldReplace < initialState.length;
@@ -3889,20 +3889,20 @@ function renderElement(request, task, keyPath, type, props, ref) {
"function" === typeof partial
? partial.call(
newProps,
propName$31,
propName,
JSCompiler_inline_result,
ref
)
: partial;
null != partial &&
(propName
? ((propName = !1),
(propName$31 = assign({}, propName$31, partial)))
: assign(propName$31, partial));
(contextType
? ((contextType = !1),
(propName = assign({}, propName, partial)))
: assign(propName, partial));
}
newProps.state = propName$31;
newProps.state = propName;
}
} else propName$31.queue = null;
} else propName.queue = null;
JSCompiler_inline_result = newProps.render();
ref = type.childContextTypes;
if (null !== ref && void 0 !== ref) {
@@ -3980,7 +3980,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
);
newProps.lastPushedText = !1;
JSCompiler_inline_result = task.formatContext;
propName$31 = task.keyPath;
propName = task.keyPath;
task.formatContext = getChildFormatContext(
JSCompiler_inline_result,
type,
@@ -3989,7 +3989,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
task.keyPath = keyPath;
renderNode(request, task, ref, -1);
task.formatContext = JSCompiler_inline_result;
task.keyPath = propName$31;
task.keyPath = propName;
a: {
keyPath = newProps.chunks;
request = request.resumableState;
@@ -4075,7 +4075,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
task.keyPath = type;
}
} else {
propName = task.componentStack;
contextType = task.componentStack;
type = task.componentStack = createBuiltInComponentStack(
task,
"Suspense"
@@ -4087,13 +4087,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
ref = props.fallback;
var content = props.children;
props = new Set();
propName$31 = createSuspenseBoundary(request, props);
propName = createSuspenseBoundary(request, props);
null !== request.trackedPostpones &&
(propName$31.trackedContentKeyPath = keyPath);
(propName.trackedContentKeyPath = keyPath);
initialState = createPendingSegment(
request,
parentSegment.chunks.length,
propName$31,
propName,
task.formatContext,
!1,
!1
@@ -4109,8 +4109,8 @@ function renderElement(request, task, keyPath, type, props, ref) {
!1
);
contentRootSegment.parentFlushed = !0;
task.blockedBoundary = propName$31;
task.hoistableState = propName$31.contentState;
task.blockedBoundary = propName;
task.hoistableState = propName.contentState;
task.blockedSegment = contentRootSegment;
task.keyPath = keyPath;
try {
@@ -4121,39 +4121,40 @@ function renderElement(request, task, keyPath, type, props, ref) {
contentRootSegment.textEmbedded &&
contentRootSegment.chunks.push("\x3c!-- --\x3e")),
(contentRootSegment.status = 1),
queueCompletedSegment(propName$31, contentRootSegment),
0 === propName$31.pendingTasks && 0 === propName$31.status)
queueCompletedSegment(propName, contentRootSegment),
0 === propName.pendingTasks && 0 === propName.status)
) {
propName$31.status = 1;
task.componentStack = propName;
propName.status = 1;
task.componentStack = contextType;
break a;
}
} catch (error) {
(contentRootSegment.status = 4),
(propName$31.status = 4),
(propName.status = 4),
(newProps = getThrownInfo(request, task.componentStack)),
(JSCompiler_inline_result = logRecoverableError(
request,
error,
newProps
)),
(propName$31.errorDigest = JSCompiler_inline_result),
untrackBoundary(request, propName$31);
(propName.errorDigest = JSCompiler_inline_result),
untrackBoundary(request, propName);
} finally {
(task.blockedBoundary = contextKey),
(task.hoistableState = partial),
(task.blockedSegment = parentSegment),
(task.keyPath = oldReplace),
(task.componentStack = propName);
(task.componentStack = contextType);
}
newProps = [keyPath[0], "Suspense Fallback", keyPath[2]];
JSCompiler_inline_result = request.trackedPostpones;
null !== JSCompiler_inline_result &&
((propName = [newProps[1], newProps[2], [], null]),
JSCompiler_inline_result.workingMap.set(newProps, propName),
5 === propName$31.status
? (JSCompiler_inline_result.workingMap.get(keyPath)[4] = propName)
: (propName$31.trackedFallbackNode = propName));
((contextType = [newProps[1], newProps[2], [], null]),
JSCompiler_inline_result.workingMap.set(newProps, contextType),
5 === propName.status
? (JSCompiler_inline_result.workingMap.get(keyPath)[4] =
contextType)
: (propName.trackedFallbackNode = contextType));
task = createRenderTask(
request,
null,
@@ -4161,7 +4162,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
-1,
contextKey,
initialState,
propName$31.fallbackState,
propName.fallbackState,
props,
newProps,
task.formatContext,
@@ -4679,15 +4680,15 @@ function renderNode(request, task, node, childIndex) {
chunkLength = segment.chunks.length;
try {
return renderNodeDestructive(request, task, node, childIndex);
} catch (thrownValue$43) {
} catch (thrownValue$42) {
if (
(resetHooksState(),
(segment.children.length = childrenLength),
(segment.chunks.length = chunkLength),
(node =
thrownValue$43 === SuspenseException
thrownValue$42 === SuspenseException
? getSuspendedThenable()
: thrownValue$43),
: thrownValue$42),
"object" === typeof node &&
null !== node &&
"function" === typeof node.then)
@@ -4960,10 +4961,10 @@ function finishedTask(request, boundary, segment) {
function performWork(request$jscomp$2) {
if (2 !== request$jscomp$2.status) {
var prevContext = currentActiveSnapshot,
prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
var prevRequest = currentRequest;
currentRequest = request$jscomp$2;
var prevResumableState = currentResumableState;
@@ -5116,8 +5117,8 @@ function performWork(request$jscomp$2) {
fatalError(request$jscomp$2, error);
} finally {
(currentResumableState = prevResumableState),
(ReactSharedInternals.H = prevDispatcher),
(ReactSharedInternals.C = prevCacheDispatcher),
(ReactCurrentDispatcher.current = prevDispatcher),
(ReactCurrentCache.current = prevCacheDispatcher),
prevDispatcher === HooksDispatcher && switchContext(prevContext),
(currentRequest = prevRequest);
}
@@ -5504,11 +5505,11 @@ function flushCompletedQueues(request, destination) {
completedBoundaries.splice(0, i);
var partialBoundaries = request.partialBoundaries;
for (i = 0; i < partialBoundaries.length; i++) {
var boundary$47 = partialBoundaries[i];
var boundary$46 = partialBoundaries[i];
a: {
clientRenderedBoundaries = request;
boundary = destination;
var completedSegments = boundary$47.completedSegments;
var completedSegments = boundary$46.completedSegments;
for (
JSCompiler_inline_result = 0;
JSCompiler_inline_result < completedSegments.length;
@@ -5518,7 +5519,7 @@ function flushCompletedQueues(request, destination) {
!flushPartiallyCompletedSegment(
clientRenderedBoundaries,
boundary,
boundary$47,
boundary$46,
completedSegments[JSCompiler_inline_result]
)
) {
@@ -5530,7 +5531,7 @@ function flushCompletedQueues(request, destination) {
completedSegments.splice(0, JSCompiler_inline_result);
JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
boundary,
boundary$47.contentState,
boundary$46.contentState,
clientRenderedBoundaries.renderState
);
}
@@ -5604,8 +5605,8 @@ function abort(request, reason) {
}
null !== request.destination &&
flushCompletedQueues(request, request.destination);
} catch (error$49) {
logRecoverableError(request, error$49, {}), fatalError(request, error$49);
} catch (error$48) {
logRecoverableError(request, error$48, {}), fatalError(request, error$48);
}
}
function onError() {}
@@ -5676,4 +5677,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-classic-b2292b3c";
exports.version = "19.0.0-www-classic-105227cc";
@@ -287,26 +287,25 @@ function sanitizeURL(url) {
: url;
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
sharedNotPendingObject = {
pending: !1,
data: null,
method: null,
action: null
},
previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
f: previousDispatcher.f,
r: previousDispatcher.r,
D: prefetchDNS,
C: preconnect,
L: preload,
m: preloadModule,
X: preinitScript,
S: preinitStyle,
M: preinitModuleScript
ReactDOMCurrentDispatcher =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactDOMCurrentDispatcher,
previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
};
var PRELOAD_NO_CREDS = [],
scriptRegex = /(<\/|<)(s)(cript)/gi;
@@ -1570,7 +1569,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 3) &&
!1 === !!(formatContext.tagScope & 2) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
@@ -2238,7 +2237,7 @@ function prefetchDNS(href) {
}
enqueueFlush(request);
}
} else previousDispatcher.D(href);
} else previousDispatcher.prefetchDNS(href);
}
function preconnect(href, crossOrigin) {
var request = currentRequest ? currentRequest : null;
@@ -2292,7 +2291,7 @@ function preconnect(href, crossOrigin) {
}
enqueueFlush(request);
}
} else previousDispatcher.C(href, crossOrigin);
} else previousDispatcher.preconnect(href, crossOrigin);
}
function preload(href, as, options) {
var request = currentRequest ? currentRequest : null;
@@ -2406,7 +2405,7 @@ function preload(href, as, options) {
}
enqueueFlush(request);
}
} else previousDispatcher.L(href, as, options);
} else previousDispatcher.preload(href, as, options);
}
function preloadModule(href, options) {
var request = currentRequest ? currentRequest : null;
@@ -2442,7 +2441,7 @@ function preloadModule(href, options) {
renderState.bulkPreloads.add(as);
enqueueFlush(request);
}
} else previousDispatcher.m(href, options);
} else previousDispatcher.preloadModule(href, options);
}
function preinitStyle(href, precedence, options) {
var request = currentRequest ? currentRequest : null;
@@ -2482,7 +2481,7 @@ function preinitStyle(href, precedence, options) {
styleQueue.sheets.set(href, precedence),
enqueueFlush(request));
}
} else previousDispatcher.S(href, precedence, options);
} else previousDispatcher.preinitStyle(href, precedence, options);
}
function preinitScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2506,7 +2505,7 @@ function preinitScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.X(src, options);
} else previousDispatcher.preinitScript(src, options);
}
function preinitModuleScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2532,7 +2531,7 @@ function preinitModuleScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.M(src, options);
} else previousDispatcher.preinitModuleScript(src, options);
}
function adoptPreloadCredentials(target, preloadState) {
null == target.crossOrigin && (target.crossOrigin = preloadState[0]);
@@ -3441,6 +3440,8 @@ function describeNativeComponentFrame(fn, construct) {
? describeBuiltInComponentFrame(previousPrepareStackTrace)
: "";
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
function defaultErrorHandler(error) {
console.error(error);
return null;
@@ -3662,7 +3663,7 @@ function getThrownInfo(request, node) {
do {
switch (node.tag) {
case 0:
request += describeBuiltInComponentFrame(node.type);
request += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
request += describeNativeComponentFrame(node.type, !1);
@@ -3797,24 +3798,18 @@ function renderElement(request, task, keyPath, type, props, ref) {
if ("function" === typeof type)
if (type.prototype && type.prototype.isReactComponent) {
var JSCompiler_inline_result = props;
if (enableRefAsProp && "ref" in props) {
JSCompiler_inline_result = {};
for (var propName in props)
"ref" !== propName &&
(JSCompiler_inline_result[propName] = props[propName]);
}
var defaultProps = type.defaultProps;
if (defaultProps && disableDefaultPropsExceptForClasses) {
JSCompiler_inline_result === props &&
(JSCompiler_inline_result = assign(
{},
JSCompiler_inline_result,
props
));
for (var propName$31 in defaultProps)
void 0 === JSCompiler_inline_result[propName$31] &&
(JSCompiler_inline_result[propName$31] = defaultProps[propName$31]);
JSCompiler_inline_result = assign({}, JSCompiler_inline_result, props);
for (var propName in defaultProps)
void 0 === JSCompiler_inline_result[propName] &&
(JSCompiler_inline_result[propName] = defaultProps[propName]);
}
enableRefAsProp &&
"ref" in JSCompiler_inline_result &&
(JSCompiler_inline_result === props &&
(JSCompiler_inline_result = assign({}, JSCompiler_inline_result)),
delete JSCompiler_inline_result.ref);
props = task.componentStack;
task.componentStack = { tag: 2, parent: task.componentStack, type: type };
defaultProps = emptyContextObject;
@@ -3823,10 +3818,10 @@ function renderElement(request, task, keyPath, type, props, ref) {
null !== ref &&
(defaultProps = ref._currentValue2);
defaultProps = new type(JSCompiler_inline_result, defaultProps);
propName$31 = void 0 !== defaultProps.state ? defaultProps.state : null;
propName = void 0 !== defaultProps.state ? defaultProps.state : null;
defaultProps.updater = classComponentUpdater;
defaultProps.props = JSCompiler_inline_result;
defaultProps.state = propName$31;
defaultProps.state = propName;
ref = { queue: [], replace: !1 };
defaultProps._reactInternals = ref;
var contextType = type.contextType;
@@ -3836,12 +3831,12 @@ function renderElement(request, task, keyPath, type, props, ref) {
: emptyContextObject;
contextType = type.getDerivedStateFromProps;
"function" === typeof contextType &&
((contextType = contextType(JSCompiler_inline_result, propName$31)),
(propName$31 =
((contextType = contextType(JSCompiler_inline_result, propName)),
(propName =
null === contextType || void 0 === contextType
? propName$31
: assign({}, propName$31, contextType)),
(defaultProps.state = propName$31));
? propName
: assign({}, propName, contextType)),
(defaultProps.state = propName));
if (
"function" !== typeof type.getDerivedStateFromProps &&
"function" !== typeof defaultProps.getSnapshotBeforeUpdate &&
@@ -3872,26 +3867,27 @@ function renderElement(request, task, keyPath, type, props, ref) {
defaultProps.state = type[0];
else {
ref = contextType ? type[0] : defaultProps.state;
propName$31 = !0;
propName = !0;
for (
contextType = contextType ? 1 : 0;
contextType < type.length;
contextType++
)
(propName = type[contextType]),
(propName =
"function" === typeof propName
? propName.call(
defaultProps,
ref,
JSCompiler_inline_result,
void 0
)
: propName),
null != propName &&
(propName$31
? ((propName$31 = !1), (ref = assign({}, ref, propName)))
: assign(ref, propName));
) {
var partial = type[contextType];
partial =
"function" === typeof partial
? partial.call(
defaultProps,
ref,
JSCompiler_inline_result,
void 0
)
: partial;
null != partial &&
(propName
? ((propName = !1), (ref = assign({}, ref, partial)))
: assign(ref, partial));
}
defaultProps.state = ref;
}
else ref.queue = null;
@@ -3926,14 +3922,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
if (null === defaultProps)
(defaultProps = props.children),
(ref = task.formatContext),
(propName$31 = task.keyPath),
(propName = task.keyPath),
(task.formatContext = getChildFormatContext(ref, type, props)),
(task.keyPath = keyPath),
renderNode(request, task, defaultProps, -1),
(task.formatContext = ref),
(task.keyPath = propName$31);
(task.keyPath = propName);
else {
propName$31 = pushStartInstance(
propName = pushStartInstance(
defaultProps.chunks,
type,
props,
@@ -3949,7 +3945,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
contextType = task.keyPath;
task.formatContext = getChildFormatContext(ref, type, props);
task.keyPath = keyPath;
renderNode(request, task, propName$31, -1);
renderNode(request, task, propName, -1);
task.formatContext = ref;
task.keyPath = contextType;
a: {
@@ -4046,13 +4042,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
ref = task.blockedBoundary;
var parentHoistableState = task.hoistableState,
parentSegment = task.blockedSegment;
propName$31 = props.fallback;
propName = props.fallback;
var content = props.children;
props = new Set();
contextType = createSuspenseBoundary(request, props);
null !== request.trackedPostpones &&
(contextType.trackedContentKeyPath = keyPath);
propName = createPendingSegment(
partial = createPendingSegment(
request,
parentSegment.chunks.length,
contextType,
@@ -4060,7 +4056,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
!1,
!1
);
parentSegment.children.push(propName);
parentSegment.children.push(partial);
parentSegment.lastPushedText = !1;
var contentRootSegment = createPendingSegment(
request,
@@ -4135,10 +4131,10 @@ function renderElement(request, task, keyPath, type, props, ref) {
task = createRenderTask(
request,
null,
propName$31,
propName,
-1,
ref,
propName,
partial,
contextType.fallbackState,
props,
JSCompiler_inline_result,
@@ -4657,15 +4653,15 @@ function renderNode(request, task, node, childIndex) {
chunkLength = segment.chunks.length;
try {
return renderNodeDestructive(request, task, node, childIndex);
} catch (thrownValue$43) {
} catch (thrownValue$42) {
if (
(resetHooksState(),
(segment.children.length = childrenLength),
(segment.chunks.length = chunkLength),
(node =
thrownValue$43 === SuspenseException
thrownValue$42 === SuspenseException
? getSuspendedThenable()
: thrownValue$43),
: thrownValue$42),
"object" === typeof node &&
null !== node &&
"function" === typeof node.then)
@@ -4938,10 +4934,10 @@ function finishedTask(request, boundary, segment) {
function performWork(request$jscomp$2) {
if (2 !== request$jscomp$2.status) {
var prevContext = currentActiveSnapshot,
prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
var prevRequest = currentRequest;
currentRequest = request$jscomp$2;
var prevResumableState = currentResumableState;
@@ -5094,8 +5090,8 @@ function performWork(request$jscomp$2) {
fatalError(request$jscomp$2, error);
} finally {
(currentResumableState = prevResumableState),
(ReactSharedInternals.H = prevDispatcher),
(ReactSharedInternals.C = prevCacheDispatcher),
(ReactCurrentDispatcher.current = prevDispatcher),
(ReactCurrentCache.current = prevCacheDispatcher),
prevDispatcher === HooksDispatcher && switchContext(prevContext),
(currentRequest = prevRequest);
}
@@ -5482,11 +5478,11 @@ function flushCompletedQueues(request, destination) {
completedBoundaries.splice(0, i);
var partialBoundaries = request.partialBoundaries;
for (i = 0; i < partialBoundaries.length; i++) {
var boundary$47 = partialBoundaries[i];
var boundary$46 = partialBoundaries[i];
a: {
clientRenderedBoundaries = request;
boundary = destination;
var completedSegments = boundary$47.completedSegments;
var completedSegments = boundary$46.completedSegments;
for (
JSCompiler_inline_result = 0;
JSCompiler_inline_result < completedSegments.length;
@@ -5496,7 +5492,7 @@ function flushCompletedQueues(request, destination) {
!flushPartiallyCompletedSegment(
clientRenderedBoundaries,
boundary,
boundary$47,
boundary$46,
completedSegments[JSCompiler_inline_result]
)
) {
@@ -5508,7 +5504,7 @@ function flushCompletedQueues(request, destination) {
completedSegments.splice(0, JSCompiler_inline_result);
JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
boundary,
boundary$47.contentState,
boundary$46.contentState,
clientRenderedBoundaries.renderState
);
}
@@ -5582,8 +5578,8 @@ function abort(request, reason) {
}
null !== request.destination &&
flushCompletedQueues(request, request.destination);
} catch (error$49) {
logRecoverableError(request, error$49, {}), fatalError(request, error$49);
} catch (error$48) {
logRecoverableError(request, error$48, {}), fatalError(request, error$48);
}
}
function onError() {}
@@ -5654,4 +5650,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.0.0-www-modern-eac2599d";
exports.version = "19.0.0-www-modern-09c7873c";
@@ -61,10 +61,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -2345,19 +2347,8 @@ if (__DEV__) {
: 'something with type "' + typeof thing + '"';
}
var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
if (!ReactSharedInternalsServer) {
throw new Error(
'The "react" package in this environment is not configured correctly. ' +
'The "react-server" condition must be enabled in any environment that ' +
"runs React Server Components."
);
}
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
var ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// same object across all transitions.
@@ -2369,42 +2360,21 @@ if (__DEV__) {
};
var NotPending = Object.freeze(sharedNotPendingObject);
var previousDispatcher = ReactDOMSharedInternals.d;
/* ReactDOMCurrentDispatcher */
var ReactDOMSharedInternals =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
ReactDOMSharedInternals.d =
/* ReactDOMCurrentDispatcher */
{
f:
/* flushSyncWork */
previousDispatcher.f,
/* flushSyncWork */
r:
/* requestFormReset */
previousDispatcher.r,
/* requestFormReset */
D:
/* prefetchDNS */
prefetchDNS,
C:
/* preconnect */
preconnect,
L:
/* preload */
preload,
m:
/* preloadModule */
preloadModule,
X:
/* preinitScript */
preinitScript,
S:
/* preinitStyle */
preinitStyle,
M:
/* preinitModuleScript */
preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ReactDOMCurrentDispatcher =
ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
var previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
}; // We make every property of the descriptor optional because it is not a contract that
var ScriptStreamingFormat = 0;
var DataStreamingFormat = 1;
var NothingSent =
@@ -5030,7 +5000,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
pictureOrNoScriptTagInScope
pictureTagInScope
) {
var src = props.src,
srcSet = props.srcSet;
@@ -5041,7 +5011,7 @@ if (__DEV__) {
(typeof src === "string" || src == null) &&
(typeof srcSet === "string" || srcSet == null) &&
props.fetchPriority !== "low" &&
pictureOrNoScriptTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
pictureTagInScope === false && // We exclude data URIs in src and srcSet since these should not be preloaded
!(
typeof src === "string" &&
src[4] === ":" &&
@@ -5889,7 +5859,7 @@ if (__DEV__) {
props,
resumableState,
renderState,
!!(formatContext.tagScope & (PICTURE_SCOPE | NOSCRIPT_SCOPE))
!!(formatContext.tagScope & PICTURE_SCOPE)
);
}
// Omitted close tags
@@ -7479,10 +7449,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.D(
/* prefetchDNS */
href
);
previousDispatcher.prefetchDNS(href);
return;
}
@@ -7541,11 +7508,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.C(
/* preconnect */
href,
crossOrigin
);
previousDispatcher.preconnect(href, crossOrigin);
return;
}
@@ -7610,12 +7573,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.L(
/* preload */
href,
as,
options
);
previousDispatcher.preload(href, as, options);
return;
}
@@ -7850,11 +7808,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.m(
/* preloadModule */
href,
options
);
previousDispatcher.preloadModule(href, options);
return;
}
@@ -7932,12 +7886,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.S(
/* preinitStyle */
href,
precedence,
options
);
previousDispatcher.preinitStyle(href, precedence, options);
return;
}
@@ -8019,11 +7968,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.X(
/* preinitScript */
src,
options
);
previousDispatcher.preinitScript(src, options);
return;
}
@@ -8089,11 +8034,7 @@ if (__DEV__) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.M(
/* preinitModuleScript */
src,
options
);
previousDispatcher.preinitModuleScript(src, options);
return;
}
@@ -10691,8 +10632,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -10744,13 +10686,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternalsServer.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternalsServer.H = null;
ReactCurrentDispatcher$1.current = null;
disableLogs();
}
/**
@@ -10943,7 +10885,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternalsServer.H = previousDispatcher;
ReactCurrentDispatcher$1.current = previousDispatcher;
reenableLogs();
}
@@ -10962,12 +10904,12 @@ if (__DEV__) {
return syntheticFrame;
}
function describeClassComponentFrame(ctor) {
function describeClassComponentFrame(ctor, ownerFn) {
{
return describeNativeComponentFrame(ctor, true);
}
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -10981,15 +10923,15 @@ if (__DEV__) {
do {
switch (node.tag) {
case 0:
info += describeBuiltInComponentFrame(node.type);
info += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
info += describeFunctionComponentFrame(node.type);
info += describeFunctionComponentFrame(node.type, null);
break;
case 2:
info += describeClassComponentFrame(node.type);
info += describeClassComponentFrame(node.type, null);
break;
} // $FlowFixMe[incompatible-type] we bail out when we get a null
@@ -11002,6 +10944,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; // Linked list representing the identity of a component given the component/tag name and key.
// The name might be minified but we assume that it's going to be the same generated name. Typically
// because it's just the same compiled output in practice.
// resume with segmentID at the index
@@ -11835,41 +11780,31 @@ if (__DEV__) {
}
function resolveClassComponentProps(Component, baseProps) {
var newProps = baseProps;
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in baseProps) {
newProps = {};
for (var propName in baseProps) {
if (propName !== "ref") {
newProps[propName] = baseProps[propName];
}
}
}
} // Resolve default props.
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
var defaultProps = Component.defaultProps;
if (
defaultProps && // If disableDefaultPropsExceptForClasses is true, we always resolve
// default props here, rather than in the JSX runtime.
disableDefaultPropsExceptForClasses
) {
// We may have already copied the props object above to remove ref. If so,
// we can modify that. Otherwise, copy the props object with Object.assign.
if (newProps === baseProps) {
newProps = assign({}, newProps, baseProps);
} // Taken from old JSX runtime, where this used to live.
if (defaultProps && disableDefaultPropsExceptForClasses) {
newProps = assign({}, newProps, baseProps);
for (var _propName in defaultProps) {
if (newProps[_propName] === undefined) {
newProps[_propName] = defaultProps[_propName];
for (var propName in defaultProps) {
if (newProps[propName] === undefined) {
newProps[propName] = defaultProps[propName];
}
}
}
if (enableRefAsProp) {
// Remove ref from the props object, if it exists.
if ("ref" in newProps) {
if (newProps === baseProps) {
newProps = assign({}, newProps);
}
delete newProps.ref;
}
}
return newProps;
}
@@ -13791,22 +13726,22 @@ if (__DEV__) {
}
var prevContext = getActiveContext();
var prevDispatcher = ReactSharedInternalsServer.H;
ReactSharedInternalsServer.H = HooksDispatcher;
var prevCacheDispatcher = null;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher;
{
prevCacheDispatcher = ReactSharedInternalsServer.C;
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
}
var prevRequest = currentRequest;
currentRequest = request;
var prevGetCurrentStackImpl = null;
var prevGetCurrentStackImpl;
{
prevGetCurrentStackImpl = ReactSharedInternalsServer.getCurrentStack;
ReactSharedInternalsServer.getCurrentStack = getCurrentStackInDEV;
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
ReactDebugCurrentFrame.getCurrentStack = getCurrentStackInDEV;
}
var prevResumableState = currentResumableState;
@@ -13832,14 +13767,14 @@ if (__DEV__) {
fatalError(request, error);
} finally {
setCurrentResumableState(prevResumableState);
ReactSharedInternalsServer.H = prevDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
{
ReactSharedInternalsServer.C = prevCacheDispatcher;
ReactCurrentCache.current = prevCacheDispatcher;
}
{
ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStackImpl;
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
}
if (prevDispatcher === HooksDispatcher) {
@@ -278,31 +278,26 @@ function sanitizeURL(url) {
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
: url;
}
var ReactSharedInternalsServer =
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
if (!ReactSharedInternalsServer)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
var ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
sharedNotPendingObject = {
pending: !1,
data: null,
method: null,
action: null
},
previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
f: previousDispatcher.f,
r: previousDispatcher.r,
D: prefetchDNS,
C: preconnect,
L: preload,
m: preloadModule,
X: preinitScript,
S: preinitStyle,
M: preinitModuleScript
ReactDOMCurrentDispatcher =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactDOMCurrentDispatcher,
previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitScript: preinitScript,
preinitStyle: preinitStyle,
preinitModuleScript: preinitModuleScript
};
var PRELOAD_NO_CREDS = [],
scriptRegex = /(<\/|<)(s)(cript)/gi;
@@ -1572,7 +1567,7 @@ function pushStartInstance(
("string" !== typeof srcSet && null != srcSet)
) &&
"low" !== props.fetchPriority &&
!1 === !!(formatContext.tagScope & 3) &&
!1 === !!(formatContext.tagScope & 2) &&
("string" !== typeof src ||
":" !== src[4] ||
("d" !== src[0] && "D" !== src[0]) ||
@@ -2259,7 +2254,7 @@ function prefetchDNS(href) {
}
enqueueFlush(request);
}
} else previousDispatcher.D(href);
} else previousDispatcher.prefetchDNS(href);
}
function preconnect(href, crossOrigin) {
var request = currentRequest ? currentRequest : null;
@@ -2313,7 +2308,7 @@ function preconnect(href, crossOrigin) {
}
enqueueFlush(request);
}
} else previousDispatcher.C(href, crossOrigin);
} else previousDispatcher.preconnect(href, crossOrigin);
}
function preload(href, as, options) {
var request = currentRequest ? currentRequest : null;
@@ -2427,7 +2422,7 @@ function preload(href, as, options) {
}
enqueueFlush(request);
}
} else previousDispatcher.L(href, as, options);
} else previousDispatcher.preload(href, as, options);
}
function preloadModule(href, options) {
var request = currentRequest ? currentRequest : null;
@@ -2463,7 +2458,7 @@ function preloadModule(href, options) {
renderState.bulkPreloads.add(as);
enqueueFlush(request);
}
} else previousDispatcher.m(href, options);
} else previousDispatcher.preloadModule(href, options);
}
function preinitStyle(href, precedence, options) {
var request = currentRequest ? currentRequest : null;
@@ -2503,7 +2498,7 @@ function preinitStyle(href, precedence, options) {
styleQueue.sheets.set(href, precedence),
enqueueFlush(request));
}
} else previousDispatcher.S(href, precedence, options);
} else previousDispatcher.preinitStyle(href, precedence, options);
}
function preinitScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2527,7 +2522,7 @@ function preinitScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.X(src, options);
} else previousDispatcher.preinitScript(src, options);
}
function preinitModuleScript(src, options) {
var request = currentRequest ? currentRequest : null;
@@ -2553,7 +2548,7 @@ function preinitModuleScript(src, options) {
pushScriptImpl(src, options),
enqueueFlush(request));
}
} else previousDispatcher.M(src, options);
} else previousDispatcher.preinitModuleScript(src, options);
}
function adoptPreloadCredentials(target, preloadState) {
null == target.crossOrigin && (target.crossOrigin = preloadState[0]);
@@ -3336,6 +3331,8 @@ function describeNativeComponentFrame(fn, construct) {
? describeBuiltInComponentFrame(previousPrepareStackTrace)
: "";
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
ReactCurrentCache = ReactSharedInternals.ReactCurrentCache;
function defaultErrorHandler(error) {
console.error(error);
return null;
@@ -3483,7 +3480,7 @@ function getThrownInfo(request, node) {
do {
switch (node.tag) {
case 0:
request += describeBuiltInComponentFrame(node.type);
request += describeBuiltInComponentFrame(node.type, null);
break;
case 1:
request += describeNativeComponentFrame(node.type, !1);
@@ -3625,24 +3622,18 @@ function renderElement(request, task, keyPath, type, props, ref) {
if ("function" === typeof type)
if (type.prototype && type.prototype.isReactComponent) {
var JSCompiler_inline_result = props;
if (enableRefAsProp && "ref" in props) {
JSCompiler_inline_result = {};
for (var propName in props)
"ref" !== propName &&
(JSCompiler_inline_result[propName] = props[propName]);
}
var defaultProps = type.defaultProps;
if (defaultProps && disableDefaultPropsExceptForClasses) {
JSCompiler_inline_result === props &&
(JSCompiler_inline_result = assign(
{},
JSCompiler_inline_result,
props
));
for (var propName$31 in defaultProps)
void 0 === JSCompiler_inline_result[propName$31] &&
(JSCompiler_inline_result[propName$31] = defaultProps[propName$31]);
JSCompiler_inline_result = assign({}, JSCompiler_inline_result, props);
for (var propName in defaultProps)
void 0 === JSCompiler_inline_result[propName] &&
(JSCompiler_inline_result[propName] = defaultProps[propName]);
}
enableRefAsProp &&
"ref" in JSCompiler_inline_result &&
(JSCompiler_inline_result === props &&
(JSCompiler_inline_result = assign({}, JSCompiler_inline_result)),
delete JSCompiler_inline_result.ref);
props = task.componentStack;
task.componentStack = { tag: 2, parent: task.componentStack, type: type };
defaultProps = emptyContextObject;
@@ -3651,10 +3642,10 @@ function renderElement(request, task, keyPath, type, props, ref) {
null !== ref &&
(defaultProps = ref._currentValue);
defaultProps = new type(JSCompiler_inline_result, defaultProps);
propName$31 = void 0 !== defaultProps.state ? defaultProps.state : null;
propName = void 0 !== defaultProps.state ? defaultProps.state : null;
defaultProps.updater = classComponentUpdater;
defaultProps.props = JSCompiler_inline_result;
defaultProps.state = propName$31;
defaultProps.state = propName;
ref = { queue: [], replace: !1 };
defaultProps._reactInternals = ref;
var contextType = type.contextType;
@@ -3664,12 +3655,12 @@ function renderElement(request, task, keyPath, type, props, ref) {
: emptyContextObject;
contextType = type.getDerivedStateFromProps;
"function" === typeof contextType &&
((contextType = contextType(JSCompiler_inline_result, propName$31)),
(propName$31 =
((contextType = contextType(JSCompiler_inline_result, propName)),
(propName =
null === contextType || void 0 === contextType
? propName$31
: assign({}, propName$31, contextType)),
(defaultProps.state = propName$31));
? propName
: assign({}, propName, contextType)),
(defaultProps.state = propName));
if (
"function" !== typeof type.getDerivedStateFromProps &&
"function" !== typeof defaultProps.getSnapshotBeforeUpdate &&
@@ -3700,26 +3691,27 @@ function renderElement(request, task, keyPath, type, props, ref) {
defaultProps.state = type[0];
else {
ref = contextType ? type[0] : defaultProps.state;
propName$31 = !0;
propName = !0;
for (
contextType = contextType ? 1 : 0;
contextType < type.length;
contextType++
)
(propName = type[contextType]),
(propName =
"function" === typeof propName
? propName.call(
defaultProps,
ref,
JSCompiler_inline_result,
void 0
)
: propName),
null != propName &&
(propName$31
? ((propName$31 = !1), (ref = assign({}, ref, propName)))
: assign(ref, propName));
) {
var partial = type[contextType];
partial =
"function" === typeof partial
? partial.call(
defaultProps,
ref,
JSCompiler_inline_result,
void 0
)
: partial;
null != partial &&
(propName
? ((propName = !1), (ref = assign({}, ref, partial)))
: assign(ref, partial));
}
defaultProps.state = ref;
}
else ref.queue = null;
@@ -3754,14 +3746,14 @@ function renderElement(request, task, keyPath, type, props, ref) {
if (null === defaultProps)
(defaultProps = props.children),
(ref = task.formatContext),
(propName$31 = task.keyPath),
(propName = task.keyPath),
(task.formatContext = getChildFormatContext(ref, type, props)),
(task.keyPath = keyPath),
renderNode(request, task, defaultProps, -1),
(task.formatContext = ref),
(task.keyPath = propName$31);
(task.keyPath = propName);
else {
propName$31 = pushStartInstance(
propName = pushStartInstance(
defaultProps.chunks,
type,
props,
@@ -3777,7 +3769,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
contextType = task.keyPath;
task.formatContext = getChildFormatContext(ref, type, props);
task.keyPath = keyPath;
renderNode(request, task, propName$31, -1);
renderNode(request, task, propName, -1);
task.formatContext = ref;
task.keyPath = contextType;
a: {
@@ -3874,13 +3866,13 @@ function renderElement(request, task, keyPath, type, props, ref) {
ref = task.blockedBoundary;
var parentHoistableState = task.hoistableState,
parentSegment = task.blockedSegment;
propName$31 = props.fallback;
propName = props.fallback;
var content = props.children;
props = new Set();
contextType = createSuspenseBoundary(request, props);
null !== request.trackedPostpones &&
(contextType.trackedContentKeyPath = keyPath);
propName = createPendingSegment(
partial = createPendingSegment(
request,
parentSegment.chunks.length,
contextType,
@@ -3888,7 +3880,7 @@ function renderElement(request, task, keyPath, type, props, ref) {
!1,
!1
);
parentSegment.children.push(propName);
parentSegment.children.push(partial);
parentSegment.lastPushedText = !1;
var contentRootSegment = createPendingSegment(
request,
@@ -3962,10 +3954,10 @@ function renderElement(request, task, keyPath, type, props, ref) {
task = createRenderTask(
request,
null,
propName$31,
propName,
-1,
ref,
propName,
partial,
contextType.fallbackState,
props,
JSCompiler_inline_result,
@@ -4496,15 +4488,15 @@ function renderNode(request, task, node, childIndex) {
chunkLength = segment.chunks.length;
try {
return renderNodeDestructive(request, task, node, childIndex);
} catch (thrownValue$43) {
} catch (thrownValue$42) {
if (
(resetHooksState(),
(segment.children.length = childrenLength),
(segment.chunks.length = chunkLength),
(node =
thrownValue$43 === SuspenseException
thrownValue$42 === SuspenseException
? getSuspendedThenable()
: thrownValue$43),
: thrownValue$42),
"object" === typeof node &&
null !== node &&
"function" === typeof node.then)
@@ -5159,11 +5151,11 @@ function flushCompletedQueues(request, destination) {
completedBoundaries.splice(0, i);
var partialBoundaries = request.partialBoundaries;
for (i = 0; i < partialBoundaries.length; i++) {
var boundary$47 = partialBoundaries[i];
var boundary$46 = partialBoundaries[i];
a: {
clientRenderedBoundaries = request;
boundary = destination;
var completedSegments = boundary$47.completedSegments;
var completedSegments = boundary$46.completedSegments;
for (
JSCompiler_inline_result = 0;
JSCompiler_inline_result < completedSegments.length;
@@ -5173,7 +5165,7 @@ function flushCompletedQueues(request, destination) {
!flushPartiallyCompletedSegment(
clientRenderedBoundaries,
boundary,
boundary$47,
boundary$46,
completedSegments[JSCompiler_inline_result]
)
) {
@@ -5185,7 +5177,7 @@ function flushCompletedQueues(request, destination) {
completedSegments.splice(0, JSCompiler_inline_result);
JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(
boundary,
boundary$47.contentState,
boundary$46.contentState,
clientRenderedBoundaries.renderState
);
}
@@ -5240,8 +5232,8 @@ function abort(request, reason) {
}
null !== request.destination &&
flushCompletedQueues(request, request.destination);
} catch (error$49) {
logRecoverableError(request, error$49, {}), fatalError(request, error$49);
} catch (error$48) {
logRecoverableError(request, error$48, {}), fatalError(request, error$48);
}
}
exports.abortStream = function (stream, reason) {
@@ -5266,10 +5258,10 @@ exports.renderNextChunk = function (stream) {
stream = stream.destination;
if (2 !== request.status) {
var prevContext = currentActiveSnapshot,
prevDispatcher = ReactSharedInternalsServer.H;
ReactSharedInternalsServer.H = HooksDispatcher;
var prevCacheDispatcher = ReactSharedInternalsServer.C;
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevCacheDispatcher = ReactCurrentCache.current;
ReactCurrentCache.current = DefaultCacheDispatcher;
var prevRequest = currentRequest;
currentRequest = request;
var prevResumableState = currentResumableState;
@@ -5423,8 +5415,8 @@ exports.renderNextChunk = function (stream) {
logRecoverableError(request, error, {}), fatalError(request, error);
} finally {
(currentResumableState = prevResumableState),
(ReactSharedInternalsServer.H = prevDispatcher),
(ReactSharedInternalsServer.C = prevCacheDispatcher),
(ReactCurrentDispatcher.current = prevDispatcher),
(ReactCurrentCache.current = prevCacheDispatcher),
prevDispatcher === HooksDispatcher && switchContext(prevContext),
(currentRequest = prevRequest);
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -78,21 +78,19 @@ if (__DEV__) {
}
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
// This client file is in the shared folder because it applies to both SSR and browser contexts.
var ReactDOMCurrentDispatcher =
ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
function dispatchHint(code, model) {
var dispatcher = ReactDOMSharedInternals.d;
/* ReactDOMCurrentDispatcher */
var dispatcher = ReactDOMCurrentDispatcher.current;
switch (code) {
case "D": {
var refined = refineModel(code, model);
var href = refined;
dispatcher.D(
/* prefetchDNS */
href
);
dispatcher.prefetchDNS(href);
return;
}
@@ -101,18 +99,11 @@ if (__DEV__) {
if (typeof _refined === "string") {
var _href = _refined;
dispatcher.C(
/* preconnect */
_href
);
dispatcher.preconnect(_href);
} else {
var _href2 = _refined[0];
var crossOrigin = _refined[1];
dispatcher.C(
/* preconnect */
_href2,
crossOrigin
);
dispatcher.preconnect(_href2, crossOrigin);
}
return;
@@ -126,18 +117,9 @@ if (__DEV__) {
if (_refined2.length === 3) {
var options = _refined2[2];
dispatcher.L(
/* preload */
_href3,
as,
options
);
dispatcher.preload(_href3, as, options);
} else {
dispatcher.L(
/* preload */
_href3,
as
);
dispatcher.preload(_href3, as);
}
return;
@@ -148,66 +130,44 @@ if (__DEV__) {
if (typeof _refined3 === "string") {
var _href4 = _refined3;
dispatcher.m(
/* preloadModule */
_href4
);
dispatcher.preloadModule(_href4);
} else {
var _href5 = _refined3[0];
var _options = _refined3[1];
dispatcher.m(
/* preloadModule */
_href5,
_options
);
}
return;
}
case "X": {
var _refined4 = refineModel(code, model);
if (typeof _refined4 === "string") {
var _href6 = _refined4;
dispatcher.X(
/* preinitScript */
_href6
);
} else {
var _href7 = _refined4[0];
var _options2 = _refined4[1];
dispatcher.X(
/* preinitScript */
_href7,
_options2
);
dispatcher.preloadModule(_href5, _options);
}
return;
}
case "S": {
var _refined4 = refineModel(code, model);
if (typeof _refined4 === "string") {
var _href6 = _refined4;
dispatcher.preinitStyle(_href6);
} else {
var _href7 = _refined4[0];
var precedence = _refined4[1] === 0 ? undefined : _refined4[1];
var _options2 = _refined4.length === 3 ? _refined4[2] : undefined;
dispatcher.preinitStyle(_href7, precedence, _options2);
}
return;
}
case "X": {
var _refined5 = refineModel(code, model);
if (typeof _refined5 === "string") {
var _href8 = _refined5;
dispatcher.S(
/* preinitStyle */
_href8
);
dispatcher.preinitScript(_href8);
} else {
var _href9 = _refined5[0];
var precedence = _refined5[1] === 0 ? undefined : _refined5[1];
var _options3 = _refined5.length === 3 ? _refined5[2] : undefined;
dispatcher.S(
/* preinitStyle */
_href9,
precedence,
_options3
);
var _options3 = _refined5[1];
dispatcher.preinitScript(_href9, _options3);
}
return;
@@ -218,18 +178,11 @@ if (__DEV__) {
if (typeof _refined6 === "string") {
var _href10 = _refined6;
dispatcher.M(
/* preinitModuleScript */
_href10
);
dispatcher.preinitModuleScript(_href10);
} else {
var _href11 = _refined6[0];
var _options4 = _refined6[1];
dispatcher.M(
/* preinitModuleScript */
_href11,
_options4
);
dispatcher.preinitModuleScript(_href11, _options4);
}
return;
@@ -623,8 +576,7 @@ if (__DEV__) {
}
}
function createElement(type, key, props, owner) {
// DEV-only
function createElement(type, key, props) {
var element;
if (enableRefAsProp) {
@@ -634,7 +586,7 @@ if (__DEV__) {
type: type,
key: key,
props: props,
_owner: owner
_owner: null
};
Object.defineProperty(element, "ref", {
enumerable: false,
@@ -649,7 +601,7 @@ if (__DEV__) {
ref: null,
props: props,
// Record the component responsible for creating this element.
_owner: owner
_owner: null
};
}
@@ -704,14 +656,7 @@ if (__DEV__) {
return chunk;
}
function createModelResolver(
chunk,
parentObject,
key,
cyclic,
response,
map
) {
function createModelResolver(chunk, parentObject, key, cyclic) {
var blocked;
if (initializingChunkBlockedModel) {
@@ -728,11 +673,11 @@ if (__DEV__) {
}
return function (value) {
parentObject[key] = map(response, value); // If this is the root object for a model reference, where `blocked.value`
parentObject[key] = value; // If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === "" && blocked.value === null) {
blocked.value = parentObject[key];
blocked.value = value;
}
blocked.deps--;
@@ -787,95 +732,26 @@ if (__DEV__) {
return proxy;
}
function getOutlinedModel(response, id, parentObject, key, map) {
function getOutlinedModel(response, id) {
var chunk = getChunk(response, id);
switch (chunk.status) {
case RESOLVED_MODEL:
initializeModelChunk(chunk);
break;
case RESOLVED_MODULE:
initializeModuleChunk(chunk);
break;
} // The status might have changed after initialization.
switch (chunk.status) {
case INITIALIZED:
var chunkValue = map(response, chunk.value);
if (chunk._debugInfo) {
// If we have a direct reference to an object that was rendered by a synchronous
// server component, it might have some debug info about how it was rendered.
// We forward this to the underlying object. This might be a React Element or
// an Array fragment.
// If this was a string / number return value we lose the debug info. We choose
// that tradeoff to allow sync server components to return plain values and not
// use them as React Nodes necessarily. We could otherwise wrap them in a Lazy.
if (
typeof chunkValue === "object" &&
chunkValue !== null &&
(Array.isArray(chunkValue) ||
chunkValue.$$typeof === REACT_ELEMENT_TYPE) &&
!chunkValue._debugInfo
) {
// We should maybe use a unique symbol for arrays but this is a React owned array.
// $FlowFixMe[prop-missing]: This should be added to elements.
Object.defineProperty(chunkValue, "_debugInfo", {
configurable: false,
enumerable: false,
writable: true,
value: chunk._debugInfo
});
}
}
return chunkValue;
case PENDING:
case BLOCKED:
case CYCLIC:
var parentChunk = initializingChunk;
chunk.then(
createModelResolver(
parentChunk,
parentObject,
key,
chunk.status === CYCLIC,
response,
map
),
createModelReject(parentChunk)
);
return null;
case INITIALIZED: {
return chunk.value;
}
// We always encode it first in the stream so it won't be pending.
default:
throw chunk.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function createFormData(response, model) {
var formData = new FormData();
for (var i = 0; i < model.length; i++) {
formData.append(model[i][0], model[i][1]);
}
return formData;
}
function createModel(response, model) {
return model;
}
function parseModelString(response, parentObject, key, value) {
if (value[0] === "$") {
if (value === "$") {
@@ -921,13 +797,8 @@ if (__DEV__) {
// Server Reference
var _id2 = parseInt(value.slice(2), 16);
return getOutlinedModel(
response,
_id2,
parentObject,
key,
createServerReferenceProxy
);
var metadata = getOutlinedModel(response, _id2);
return createServerReferenceProxy(response, metadata);
}
case "T": {
@@ -950,43 +821,17 @@ if (__DEV__) {
// Map
var _id4 = parseInt(value.slice(2), 16);
return getOutlinedModel(
response,
_id4,
parentObject,
key,
createMap
);
var data = getOutlinedModel(response, _id4);
return new Map(data);
}
case "W": {
// Set
var _id5 = parseInt(value.slice(2), 16);
return getOutlinedModel(
response,
_id5,
parentObject,
key,
createSet
);
}
var _data = getOutlinedModel(response, _id5);
case "B": {
return undefined;
}
case "K": {
// FormData
var _id7 = parseInt(value.slice(2), 16);
return getOutlinedModel(
response,
_id7,
parentObject,
key,
createFormData
);
return new Set(_data);
}
case "I": {
@@ -1041,15 +886,72 @@ if (__DEV__) {
default: {
// We assume that anything else is a reference ID.
var _id8 = parseInt(value.slice(1), 16);
var _id6 = parseInt(value.slice(1), 16);
return getOutlinedModel(
response,
_id8,
parentObject,
key,
createModel
);
var _chunk2 = getChunk(response, _id6);
switch (_chunk2.status) {
case RESOLVED_MODEL:
initializeModelChunk(_chunk2);
break;
case RESOLVED_MODULE:
initializeModuleChunk(_chunk2);
break;
} // The status might have changed after initialization.
switch (_chunk2.status) {
case INITIALIZED:
var chunkValue = _chunk2.value;
if (_chunk2._debugInfo) {
// If we have a direct reference to an object that was rendered by a synchronous
// server component, it might have some debug info about how it was rendered.
// We forward this to the underlying object. This might be a React Element or
// an Array fragment.
// If this was a string / number return value we lose the debug info. We choose
// that tradeoff to allow sync server components to return plain values and not
// use them as React Nodes necessarily. We could otherwise wrap them in a Lazy.
if (
typeof chunkValue === "object" &&
chunkValue !== null &&
(Array.isArray(chunkValue) ||
chunkValue.$$typeof === REACT_ELEMENT_TYPE) &&
!chunkValue._debugInfo
) {
// We should maybe use a unique symbol for arrays but this is a React owned array.
// $FlowFixMe[prop-missing]: This should be added to elements.
Object.defineProperty(chunkValue, "_debugInfo", {
configurable: false,
enumerable: false,
writable: true,
value: _chunk2._debugInfo
});
}
}
return chunkValue;
case PENDING:
case BLOCKED:
case CYCLIC:
var parentChunk = initializingChunk;
_chunk2.then(
createModelResolver(
parentChunk,
parentObject,
key,
_chunk2.status === CYCLIC
),
createModelReject(parentChunk)
);
return null;
default:
throw _chunk2.reason;
}
}
}
}
@@ -1063,7 +965,7 @@ if (__DEV__) {
if (tuple[0] === REACT_ELEMENT_TYPE) {
// TODO: Consider having React just directly accept these arrays as elements.
// Or even change the ReactElement type to be an array.
return createElement(tuple[1], tuple[2], tuple[3], tuple[4]);
return createElement(tuple[1], tuple[2], tuple[3]);
}
return value;
@@ -1204,10 +1106,9 @@ if (__DEV__) {
var payload = parseModel(response, value);
var methodName = payload[0]; // TODO: Restore the fake stack before logging.
// const stackTrace = payload[1];
// const owner = payload[2];
var env = payload[3];
var args = payload.slice(4);
var env = payload[2];
var args = payload.slice(3);
printToConsole(methodName, args, env);
}
@@ -1261,7 +1162,7 @@ if (__DEV__) {
case 68: /* "D" */
{
{
var debugInfo = parseModel(response, row);
var debugInfo = JSON.parse(row);
resolveDebugInfo(response, id, debugInfo);
return;
} // Fallthrough to share the error with Console entries.
@@ -14,8 +14,9 @@
var ReactDOM = require("react-dom");
require("ReactFeatureFlags");
var decoderOptions = { stream: !0 },
ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
ReactDOMCurrentDispatcher =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactDOMCurrentDispatcher;
function resolveClientReference(moduleMap, metadata) {
if ("function" === typeof moduleMap.resolveClientReference)
return moduleMap.resolveClientReference(metadata);
@@ -190,7 +191,7 @@ function getChunk(response, id) {
chunks.set(id, chunk));
return chunk;
}
function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
function createModelResolver(chunk, parentObject, key, cyclic) {
if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel;
cyclic || blocked.deps++;
@@ -200,8 +201,8 @@ function createModelResolver(chunk, parentObject, key, cyclic, response, map) {
value: null
};
return function (value) {
parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
parentObject[key] = value;
"" === key && null === blocked.value && (blocked.value = value);
blocked.deps--;
0 === blocked.deps &&
"blocked" === chunk.status &&
@@ -232,53 +233,19 @@ function createServerReferenceProxy(response, metaData) {
knownServerReferences.set(proxy, metaData);
return proxy;
}
function getOutlinedModel(response, id, parentObject, key, map) {
id = getChunk(response, id);
switch (id.status) {
function getOutlinedModel(response, id) {
response = getChunk(response, id);
switch (response.status) {
case "resolved_model":
initializeModelChunk(id);
break;
case "resolved_module":
initializeModuleChunk(id);
initializeModelChunk(response);
}
switch (id.status) {
switch (response.status) {
case "fulfilled":
return map(response, id.value);
case "pending":
case "blocked":
case "cyclic":
var parentChunk = initializingChunk;
id.then(
createModelResolver(
parentChunk,
parentObject,
key,
"cyclic" === id.status,
response,
map
),
createModelReject(parentChunk)
);
return null;
return response.value;
default:
throw id.reason;
throw response.reason;
}
}
function createMap(response, model) {
return new Map(model);
}
function createSet(response, model) {
return new Set(model);
}
function createFormData(response, model) {
response = new FormData();
for (var i = 0; i < model.length; i++)
response.append(model[i][0], model[i][1]);
return response;
}
function createModel(response, model) {
return model;
}
function parseModelString(response, parentObject, key, value) {
if ("$" === value[0]) {
if ("$" === value) return REACT_ELEMENT_TYPE;
@@ -299,14 +266,9 @@ function parseModelString(response, parentObject, key, value) {
return Symbol.for(value.slice(2));
case "F":
return (
(value = parseInt(value.slice(2), 16)),
getOutlinedModel(
response,
value,
parentObject,
key,
createServerReferenceProxy
)
(parentObject = parseInt(value.slice(2), 16)),
(parentObject = getOutlinedModel(response, parentObject)),
createServerReferenceProxy(response, parentObject)
);
case "T":
parentObject = parseInt(value.slice(2), 16);
@@ -322,20 +284,15 @@ function parseModelString(response, parentObject, key, value) {
return response[parentObject];
case "Q":
return (
(value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, value, parentObject, key, createMap)
(parentObject = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, parentObject)),
new Map(response)
);
case "W":
return (
(value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, value, parentObject, key, createSet)
);
case "B":
return;
case "K":
return (
(value = parseInt(value.slice(2), 16)),
getOutlinedModel(response, value, parentObject, key, createFormData)
(parentObject = parseInt(value.slice(2), 16)),
(response = getOutlinedModel(response, parentObject)),
new Set(response)
);
case "I":
return Infinity;
@@ -350,10 +307,37 @@ function parseModelString(response, parentObject, key, value) {
case "n":
return BigInt(value.slice(2));
default:
return (
(value = parseInt(value.slice(1), 16)),
getOutlinedModel(response, value, parentObject, key, createModel)
);
value = parseInt(value.slice(1), 16);
response = getChunk(response, value);
switch (response.status) {
case "resolved_model":
initializeModelChunk(response);
break;
case "resolved_module":
initializeModuleChunk(response);
}
switch (response.status) {
case "fulfilled":
return response.value;
case "pending":
case "blocked":
case "cyclic":
return (
(value = initializingChunk),
response.then(
createModelResolver(
value,
parentObject,
key,
"cyclic" === response.status
),
createModelReject(value)
),
null
);
default:
throw response.reason;
}
}
}
return value;
@@ -474,46 +458,46 @@ function startReadingFromStream(response, stream) {
rowID = rowTag[0];
rowTag = rowTag.slice(1);
rowLength = JSON.parse(rowTag, rowLength._fromJSON);
rowTag = ReactDOMSharedInternals.d;
rowTag = ReactDOMCurrentDispatcher.current;
switch (rowID) {
case "D":
rowTag.D(rowLength);
rowTag.prefetchDNS(rowLength);
break;
case "C":
"string" === typeof rowLength
? rowTag.C(rowLength)
: rowTag.C(rowLength[0], rowLength[1]);
? rowTag.preconnect(rowLength)
: rowTag.preconnect(rowLength[0], rowLength[1]);
break;
case "L":
rowID = rowLength[0];
i = rowLength[1];
3 === rowLength.length
? rowTag.L(rowID, i, rowLength[2])
: rowTag.L(rowID, i);
? rowTag.preload(rowID, i, rowLength[2])
: rowTag.preload(rowID, i);
break;
case "m":
"string" === typeof rowLength
? rowTag.m(rowLength)
: rowTag.m(rowLength[0], rowLength[1]);
break;
case "X":
"string" === typeof rowLength
? rowTag.X(rowLength)
: rowTag.X(rowLength[0], rowLength[1]);
? rowTag.preloadModule(rowLength)
: rowTag.preloadModule(rowLength[0], rowLength[1]);
break;
case "S":
"string" === typeof rowLength
? rowTag.S(rowLength)
: rowTag.S(
? rowTag.preinitStyle(rowLength)
: rowTag.preinitStyle(
rowLength[0],
0 === rowLength[1] ? void 0 : rowLength[1],
3 === rowLength.length ? rowLength[2] : void 0
);
break;
case "X":
"string" === typeof rowLength
? rowTag.preinitScript(rowLength)
: rowTag.preinitScript(rowLength[0], rowLength[1]);
break;
case "M":
"string" === typeof rowLength
? rowTag.M(rowLength)
: rowTag.M(rowLength[0], rowLength[1]);
? rowTag.preinitModuleScript(rowLength)
: rowTag.preinitModuleScript(rowLength[0], rowLength[1]);
}
break;
case 69:
@@ -86,10 +86,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -156,44 +158,20 @@ if (__DEV__) {
}
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var previousDispatcher = ReactDOMSharedInternals.d;
/* ReactDOMCurrentDispatcher */
ReactDOMSharedInternals.d =
/* ReactDOMCurrentDispatcher */
{
f:
/* flushSyncWork */
previousDispatcher.f,
/* flushSyncWork */
r:
/* requestFormReset */
previousDispatcher.r,
/* requestFormReset */
D:
/* prefetchDNS */
prefetchDNS,
C:
/* preconnect */
preconnect,
L:
/* preload */
preload,
m:
/* preloadModule */
preloadModule,
X:
/* preinitScript */
preinitScript,
S:
/* preinitStyle */
preinitStyle,
M:
/* preinitModuleScript */
preinitModuleScript
};
var ReactDOMCurrentDispatcher =
ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
var previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitStyle: preinitStyle,
preinitScript: preinitScript,
preinitModuleScript: preinitModuleScript
};
function prefetchDNS(href) {
if (typeof href === "string" && href) {
@@ -211,10 +189,7 @@ if (__DEV__) {
hints.add(key);
emitHint(request, "D", href);
} else {
previousDispatcher.D(
/* prefetchDNS */
href
);
previousDispatcher.prefetchDNS(href);
}
}
}
@@ -241,11 +216,7 @@ if (__DEV__) {
emitHint(request, "C", href);
}
} else {
previousDispatcher.C(
/* preconnect */
href,
crossOrigin
);
previousDispatcher.preconnect(href, crossOrigin);
}
}
}
@@ -282,12 +253,7 @@ if (__DEV__) {
emitHint(request, "L", [href, as]);
}
} else {
previousDispatcher.L(
/* preload */
href,
as,
options
);
previousDispatcher.preload(href, as, options);
}
}
}
@@ -314,11 +280,7 @@ if (__DEV__) {
return emitHint(request, "m", href);
}
} else {
previousDispatcher.m(
/* preloadModule */
href,
options
);
previousDispatcher.preloadModule(href, options);
}
}
}
@@ -351,12 +313,7 @@ if (__DEV__) {
return emitHint(request, "S", href);
}
} else {
previousDispatcher.S(
/* preinitStyle */
href,
precedence,
options
);
previousDispatcher.preinitStyle(href, precedence, options);
}
}
}
@@ -383,11 +340,7 @@ if (__DEV__) {
return emitHint(request, "X", src);
}
} else {
previousDispatcher.X(
/* preinitScript */
src,
options
);
previousDispatcher.preinitScript(src, options);
}
}
}
@@ -414,11 +367,7 @@ if (__DEV__) {
return emitHint(request, "M", src);
}
} else {
previousDispatcher.M(
/* preinitModuleScript */
src,
options
);
previousDispatcher.preinitModuleScript(src, options);
}
}
} // Flight normally encodes undefined as a special character however for directive option
@@ -636,37 +585,21 @@ if (__DEV__) {
var currentRequest$1 = null;
var thenableIndexCounter = 0;
var thenableState = null;
var currentComponentDebugInfo = null;
function prepareToUseHooksForRequest(request) {
currentRequest$1 = request;
}
function resetHooksForRequest() {
currentRequest$1 = null;
}
function prepareToUseHooksForComponent(
prevThenableState,
componentDebugInfo
) {
function prepareToUseHooksForComponent(prevThenableState) {
thenableIndexCounter = 0;
thenableState = prevThenableState;
{
currentComponentDebugInfo = componentDebugInfo;
}
}
function getThenableStateAfterSuspending() {
// If you use() to Suspend this should always exist but if you throw a Promise instead,
// which is not really supported anymore, it will be empty. We use the empty set as a
// marker to know if this was a replay of the same component or first attempt.
var state = thenableState || createThenableState();
{
// This is a hack but we stash the debug info here so that we don't need a completely
// different data structure just for this in DEV. Not too happy about it.
state._componentDebugInfo = currentComponentDebugInfo;
currentComponentDebugInfo = null;
}
thenableState = null;
return state;
}
@@ -1150,10 +1083,13 @@ if (__DEV__) {
return "\n " + str;
}
var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
var ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
if (!ReactSharedInternalsServer) {
var ReactSharedServerInternals = // $FlowFixMe: It's defined in the one we resolve to.
React.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
if (!ReactSharedServerInternals) {
throw new Error(
'The "react" package in this environment is not configured correctly. ' +
'The "react-server" condition must be enabled in any environment that ' +
@@ -1161,8 +1097,6 @@ if (__DEV__) {
);
}
var ReactSharedInternals = ReactSharedInternalsServer;
function patchConsole(consoleInst, methodName) {
var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName);
@@ -1205,8 +1139,7 @@ if (__DEV__) {
// refer to previous logs in debug info to associate them with a component.
var id = request.nextChunkId++;
var owner = ReactSharedInternals.owner;
emitConsoleChunk(request, id, methodName, owner, stack, arguments);
emitConsoleChunk(request, id, methodName, stack, arguments);
} // $FlowFixMe[prop-missing]
return originalMethod.apply(this, arguments);
@@ -1254,6 +1187,8 @@ if (__DEV__) {
var SEEN_BUT_NOT_YET_OUTLINED = -1;
var NEVER_OUTLINED = -2;
var ReactCurrentCache = ReactSharedServerInternals.ReactCurrentCache;
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
function defaultErrorHandler(error) {
console["error"](error); // Don't transform to our wrapper
@@ -1275,15 +1210,15 @@ if (__DEV__) {
environmentName
) {
if (
ReactSharedInternals.C !== null &&
ReactSharedInternals.C !== DefaultCacheDispatcher
ReactCurrentCache.current !== null &&
ReactCurrentCache.current !== DefaultCacheDispatcher
) {
throw new Error(
"Currently React only supports one RSC renderer at a time."
);
}
ReactSharedInternals.C = DefaultCacheDispatcher;
ReactCurrentCache.current = DefaultCacheDispatcher;
var abortSet = new Set();
var pingedTasks = [];
var cleanupQueue = [];
@@ -1499,63 +1434,34 @@ if (__DEV__) {
return lazyType;
}
function renderFunctionComponent(
request,
task,
key,
Component,
props,
owner
) {
function renderFunctionComponent(request, task, key, Component, props) {
// Reset the task's thenable state before continuing, so that if a later
// component suspends we can reuse the same task object. If the same
// component suspends again, the thenable state will be restored.
var prevThenableState = task.thenableState;
task.thenableState = null;
var componentDebugInfo = null;
{
if (debugID === null) {
// We don't have a chunk to assign debug info. We need to outline this
// component to assign it an ID.
return outlineTask(request, task);
} else if (prevThenableState !== null) {
// This is a replay and we've already emitted the debug info of this component
// in the first pass. We skip emitting a duplicate line.
// As a hack we stashed the previous component debug info on this object in DEV.
componentDebugInfo = prevThenableState._componentDebugInfo;
} else {
} else if (prevThenableState !== null);
else {
// This is a new component in the same task so we can emit more debug info.
var componentName = Component.displayName || Component.name || "";
request.pendingChunks++;
var componentDebugID = debugID;
componentDebugInfo = {
emitDebugChunk(request, debugID, {
name: componentName,
env: request.environmentName,
owner: owner
}; // We outline this model eagerly so that we can refer to by reference as an owner.
// If we had a smarter way to dedupe we might not have to do this if there ends up
// being no references to this as an owner.
outlineModel(request, componentDebugInfo);
emitDebugChunk(request, componentDebugID, componentDebugInfo);
env: request.environmentName
});
}
}
prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); // The secondArg is always undefined in Server Components since refs error early.
prepareToUseHooksForComponent(prevThenableState); // The secondArg is always undefined in Server Components since refs error early.
var secondArg = undefined;
var result;
{
ReactSharedInternals.owner = componentDebugInfo;
try {
result = Component(props, secondArg);
} finally {
ReactSharedInternals.owner = null;
}
}
var result = Component(props, secondArg);
if (
typeof result === "object" &&
@@ -1651,8 +1557,7 @@ if (__DEV__) {
return children;
}
function renderClientElement(task, type, key, props, owner) {
// DEV-only
function renderClientElement(task, type, key, props) {
// the keys of any Server Components which are not serialized.
var keyPath = task.keyPath;
@@ -1663,7 +1568,7 @@ if (__DEV__) {
key = keyPath + "," + key;
}
var element = [REACT_ELEMENT_TYPE, type, key, props, owner];
var element = [REACT_ELEMENT_TYPE, type, key, props];
if (task.implicitSlot && key !== null) {
// The root Server Component had no key so it was in an implicit slot.
@@ -1702,8 +1607,7 @@ if (__DEV__) {
return serializeLazyID(newTask.id);
}
function renderElement(request, task, type, key, ref, props, owner) {
// DEV only
function renderElement(request, task, type, key, ref, props) {
if (ref !== null && ref !== undefined) {
// When the ref moves to the regular props object this will implicitly
// throw for functions. We could probably relax it to a DEV warning for other
@@ -1726,13 +1630,13 @@ if (__DEV__) {
if (typeof type === "function") {
if (isClientReference(type) || isTemporaryReference(type)) {
// This is a reference to a Client Component.
return renderClientElement(task, type, key, props, owner);
return renderClientElement(task, type, key, props);
} // This is a Server Component.
return renderFunctionComponent(request, task, key, type, props, owner);
return renderFunctionComponent(request, task, key, type, props);
} else if (typeof type === "string") {
// This is a host element. E.g. HTML.
return renderClientElement(task, type, key, props, owner);
return renderClientElement(task, type, key, props);
} else if (typeof type === "symbol") {
if (type === REACT_FRAGMENT_TYPE && key === null) {
// For key-less fragments, we add a small optimization to avoid serializing
@@ -1755,11 +1659,11 @@ if (__DEV__) {
} // This might be a built-in React component. We'll let the client decide.
// Any built-in works as long as its props are serializable.
return renderClientElement(task, type, key, props, owner);
return renderClientElement(task, type, key, props);
} else if (type != null && typeof type === "object") {
if (isClientReference(type)) {
// This is a reference to a Client Component.
return renderClientElement(task, type, key, props, owner);
return renderClientElement(task, type, key, props);
}
switch (type.$$typeof) {
@@ -1767,15 +1671,7 @@ if (__DEV__) {
var payload = type._payload;
var init = type._init;
var wrappedType = init(payload);
return renderElement(
request,
task,
wrappedType,
key,
ref,
props,
owner
);
return renderElement(request, task, wrappedType, key, ref, props);
}
case REACT_FORWARD_REF_TYPE: {
@@ -1784,21 +1680,12 @@ if (__DEV__) {
task,
key,
type.render,
props,
owner
props
);
}
case REACT_MEMO_TYPE: {
return renderElement(
request,
task,
type.type,
key,
ref,
props,
owner
);
return renderElement(request, task, type.type, key, ref, props);
}
}
}
@@ -2079,12 +1966,6 @@ if (__DEV__) {
return "$Q" + id.toString(16);
}
function serializeFormData(request, formData) {
var entries = Array.from(formData.entries());
var id = outlineModel(request, entries);
return "$K" + id.toString(16);
}
function serializeSet(request, set) {
var entries = Array.from(set);
@@ -2282,8 +2163,7 @@ if (__DEV__) {
element.type, // $FlowFixMe[incompatible-call] the key of an element is null | string
element.key,
ref,
props,
element._owner
props
);
}
@@ -2391,10 +2271,6 @@ if (__DEV__) {
if (value instanceof Set) {
return serializeSet(request, value);
} // TODO: FormData is not available in old Node. Remove the typeof later.
if (typeof FormData === "function" && value instanceof FormData) {
return serializeFormData(request, value);
}
var iteratorFn = getIteratorFn(value);
@@ -2671,23 +2547,7 @@ if (__DEV__) {
}
function emitDebugChunk(request, id, debugInfo) {
// use the full serialization that requires a task.
var counter = {
objectCount: 0
};
function replacer(parentPropertyName, value) {
return renderConsoleValue(
request,
counter,
this,
parentPropertyName,
value
);
} // $FlowFixMe[incompatible-type] stringify can return null
var json = stringify(debugInfo, replacer);
var json = stringify(debugInfo);
var row = serializeRowHeader("D", id) + json + "\n";
var processedChunk = stringToChunk(row);
request.completedRegularChunks.push(processedChunk);
@@ -2787,10 +2647,6 @@ if (__DEV__) {
if (value instanceof Set) {
return serializeSet(request, value);
} // TODO: FormData is not available in old Node. Remove the typeof later.
if (typeof FormData === "function" && value instanceof FormData) {
return serializeFormData(request, value);
}
var iteratorFn = getIteratorFn(value);
@@ -2900,14 +2756,7 @@ if (__DEV__) {
return id;
}
function emitConsoleChunk(
request,
id,
methodName,
owner,
stackTrace,
args
) {
function emitConsoleChunk(request, id, methodName, stackTrace, args) {
var counter = {
objectCount: 0
};
@@ -2927,7 +2776,7 @@ if (__DEV__) {
} // TODO: Don't double badge if this log came from another Flight Client.
var env = request.environmentName;
var payload = [methodName, stackTrace, owner, env]; // $FlowFixMe[method-unbinding]
var payload = [methodName, stackTrace, env]; // $FlowFixMe[method-unbinding]
payload.push.apply(payload, args); // $FlowFixMe[incompatible-type] stringify can return null
@@ -3034,8 +2883,8 @@ if (__DEV__) {
}
function performWork(request) {
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevRequest = currentRequest;
currentRequest = request;
prepareToUseHooksForRequest(request);
@@ -3056,7 +2905,7 @@ if (__DEV__) {
logRecoverableError(request, error);
fatalError(request, error);
} finally {
ReactSharedInternals.H = prevDispatcher;
ReactCurrentDispatcher.current = prevDispatcher;
resetHooksForRequest();
currentRequest = prevRequest;
}
@@ -26,19 +26,18 @@ function writeChunkAndReturn(destination, chunk) {
destination.write(chunk);
return !0;
}
var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
previousDispatcher = ReactDOMSharedInternals.d;
ReactDOMSharedInternals.d = {
f: previousDispatcher.f,
r: previousDispatcher.r,
D: prefetchDNS,
C: preconnect,
L: preload,
m: preloadModule,
X: preinitScript,
S: preinitStyle,
M: preinitModuleScript
var ReactDOMCurrentDispatcher =
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactDOMCurrentDispatcher,
previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preloadModule: preloadModule,
preinitStyle: preinitStyle,
preinitScript: preinitScript,
preinitModuleScript: preinitModuleScript
};
function prefetchDNS(href) {
if ("string" === typeof href && href) {
@@ -47,7 +46,7 @@ function prefetchDNS(href) {
var hints = request.hints,
key = "D|" + href;
hints.has(key) || (hints.add(key), emitHint(request, "D", href));
} else previousDispatcher.D(href);
} else previousDispatcher.prefetchDNS(href);
}
}
function preconnect(href, crossOrigin) {
@@ -61,7 +60,7 @@ function preconnect(href, crossOrigin) {
"string" === typeof crossOrigin
? emitHint(request, "C", [href, crossOrigin])
: emitHint(request, "C", href));
} else previousDispatcher.C(href, crossOrigin);
} else previousDispatcher.preconnect(href, crossOrigin);
}
}
function preload(href, as, options) {
@@ -86,7 +85,7 @@ function preload(href, as, options) {
(options = trimOptions(options))
? emitHint(request, "L", [href, as, options])
: emitHint(request, "L", [href, as]));
} else previousDispatcher.L(href, as, options);
} else previousDispatcher.preload(href, as, options);
}
}
function preloadModule(href, options) {
@@ -101,7 +100,7 @@ function preloadModule(href, options) {
? emitHint(request, "m", [href, options])
: emitHint(request, "m", href);
}
previousDispatcher.m(href, options);
previousDispatcher.preloadModule(href, options);
}
}
function preinitStyle(href, precedence, options) {
@@ -122,7 +121,7 @@ function preinitStyle(href, precedence, options) {
? emitHint(request, "S", [href, precedence])
: emitHint(request, "S", href);
}
previousDispatcher.S(href, precedence, options);
previousDispatcher.preinitStyle(href, precedence, options);
}
}
function preinitScript(src, options) {
@@ -137,7 +136,7 @@ function preinitScript(src, options) {
? emitHint(request, "X", [src, options])
: emitHint(request, "X", src);
}
previousDispatcher.X(src, options);
previousDispatcher.preinitScript(src, options);
}
}
function preinitModuleScript(src, options) {
@@ -152,7 +151,7 @@ function preinitModuleScript(src, options) {
? emitHint(request, "M", [src, options])
: emitHint(request, "M", src);
}
previousDispatcher.M(src, options);
previousDispatcher.preinitModuleScript(src, options);
}
}
function trimOptions(options) {
@@ -431,14 +430,18 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
"\n " + str + "\n " + objectOrArray)
: "\n " + str;
}
var ReactSharedInternalsServer =
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
if (!ReactSharedInternalsServer)
var ReactSharedInternals =
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
ReactSharedServerInternals =
React.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
if (!ReactSharedServerInternals)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
var ObjectPrototype = Object.prototype,
stringify = JSON.stringify;
stringify = JSON.stringify,
ReactCurrentCache = ReactSharedServerInternals.ReactCurrentCache,
ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
function defaultErrorHandler(error) {
console.error(error);
}
@@ -859,11 +862,6 @@ function renderModelDestructive(
parentPropertyName.set(parent, -1));
return "$W" + outlineModel(request, value).toString(16);
}
if ("function" === typeof FormData && value instanceof FormData)
return (
(value = Array.from(value.entries())),
"$K" + outlineModel(request, value).toString(16)
);
null === value || "object" !== typeof value
? (parent = null)
: ((parent =
@@ -1023,8 +1021,8 @@ function retryTask(request, task) {
}
}
function performWork(request) {
var prevDispatcher = ReactSharedInternalsServer.H;
ReactSharedInternalsServer.H = HooksDispatcher;
var prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = HooksDispatcher;
var prevRequest = currentRequest;
currentRequest$1 = currentRequest = request;
try {
@@ -1037,7 +1035,7 @@ function performWork(request) {
} catch (error) {
logRecoverableError(request, error), fatalError(request, error);
} finally {
(ReactSharedInternalsServer.H = prevDispatcher),
(ReactCurrentDispatcher.current = prevDispatcher),
(currentRequest$1 = null),
(currentRequest = prevRequest);
}
@@ -1090,11 +1088,11 @@ exports.renderToDestination = function (destination, model, options) {
);
var onError = options ? options.onError : void 0;
if (
null !== ReactSharedInternalsServer.C &&
ReactSharedInternalsServer.C !== DefaultCacheDispatcher
null !== ReactCurrentCache.current &&
ReactCurrentCache.current !== DefaultCacheDispatcher
)
throw Error("Currently React only supports one RSC renderer at a time.");
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
ReactCurrentCache.current = DefaultCacheDispatcher;
var abortSet = new Set();
options = [];
var hints = new Set();
+135 -414
View File
@@ -58,10 +58,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -86,36 +88,55 @@ if (__DEV__) {
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses; // On WWW, true is used for a new modern build.
// because JSX is an extremely hot path.
var disableStringRefs = false;
var ReactSharedInternals = {
H: null,
C: null
/**
* Keeps track of the current Cache dispatcher.
*/
var ReactCurrentCache = {
current: null
};
{
ReactSharedInternals.owner = null;
}
/**
* Keeps track of the current dispatcher.
*/
var ReactCurrentDispatcher$1 = {
current: null
};
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*/
var ReactCurrentOwner$1 = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
var ReactDebugCurrentFrame$1 = {};
var currentExtraStackFrame = null;
{
var currentExtraStackFrame = null;
ReactSharedInternals.setExtraStackFrame = function (stack) {
currentExtraStackFrame = stack;
ReactDebugCurrentFrame$1.setExtraStackFrame = function (stack) {
{
currentExtraStackFrame = stack;
}
}; // Stack implementation injected by the current renderer.
ReactSharedInternals.getCurrentStack = null;
ReactDebugCurrentFrame$1.getCurrentStack = null;
ReactSharedInternals.getStackAddendum = function () {
ReactDebugCurrentFrame$1.getStackAddendum = function () {
var stack = ""; // Add an extra top frame while an element is being validated
if (currentExtraStackFrame) {
stack += currentExtraStackFrame;
} // Delegate to the injected renderer-specific implementation
var impl = ReactSharedInternals.getCurrentStack;
var impl = ReactDebugCurrentFrame$1.getCurrentStack;
if (impl) {
stack += impl() || "";
@@ -125,6 +146,19 @@ if (__DEV__) {
};
}
var ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher$1,
ReactCurrentOwner: ReactCurrentOwner$1
};
{
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame$1;
}
var ReactServerSharedInternals = {
ReactCurrentCache: ReactCurrentCache
};
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
function isArray(a) {
@@ -245,22 +279,8 @@ if (__DEV__) {
}
}
}
function checkPropStringCoercion(value, propName) {
{
if (willCoercionThrow(value)) {
error(
"The provided `%s` prop is an unsupported type %s." +
" This value must be coerced to a string before using it here.",
propName,
typeName(value)
);
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
}
}
}
function getWrappedName$1(outerType, innerType, wrapperName) {
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
@@ -273,7 +293,7 @@ if (__DEV__) {
: wrapperName;
} // Keep in sync with react-reconciler/getComponentNameFromFiber
function getContextName$1(type) {
function getContextName(type) {
return type.displayName || "Context";
}
@@ -340,28 +360,28 @@ if (__DEV__) {
return null;
} else {
var provider = type;
return getContextName$1(provider._context) + ".Provider";
return getContextName(provider._context) + ".Provider";
}
case REACT_CONTEXT_TYPE:
var context = type;
if (enableRenderableContext) {
return getContextName$1(context) + ".Provider";
return getContextName(context) + ".Provider";
} else {
return getContextName$1(context) + ".Consumer";
return getContextName(context) + ".Consumer";
}
case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName$1(consumer._context) + ".Consumer";
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_FORWARD_REF_TYPE:
return getWrappedName$1(type, type.render, "ForwardRef");
return getWrappedName(type, type.render, "ForwardRef");
case REACT_MEMO_TYPE:
var outerName = type.displayName || null;
@@ -531,8 +551,9 @@ if (__DEV__) {
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
@@ -584,13 +605,13 @@ if (__DEV__) {
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher = null;
var previousDispatcher;
{
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactSharedInternals.H = null;
ReactCurrentDispatcher.current = null;
disableLogs();
}
/**
@@ -783,7 +804,7 @@ if (__DEV__) {
reentry = false;
{
ReactSharedInternals.H = previousDispatcher;
ReactCurrentDispatcher.current = previousDispatcher;
reenableLogs();
}
@@ -801,7 +822,7 @@ if (__DEV__) {
return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
@@ -812,7 +833,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}
function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
@@ -842,7 +863,7 @@ if (__DEV__) {
case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
case REACT_LAZY_TYPE: {
var lazyComponent = type;
@@ -851,7 +872,10 @@ if (__DEV__) {
try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
@@ -860,165 +884,13 @@ if (__DEV__) {
return "";
}
var FunctionComponent = 0;
var ClassComponent = 1;
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedFragment = 18;
var SuspenseListComponent = 19;
var ScopeComponent = 21;
var OffscreenComponent = 22;
var LegacyHiddenComponent = 23;
var CacheComponent = 24;
var TracingMarkerComponent = 25;
var HostHoistable = 26;
var HostSingleton = 27;
var IncompleteFunctionComponent = 28;
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || "";
return (
outerType.displayName ||
(functionName !== ""
? wrapperName + "(" + functionName + ")"
: wrapperName)
);
} // Keep in sync with shared/getComponentNameFromType
function getContextName(type) {
return type.displayName || "Context";
}
function getComponentNameFromFiber(fiber) {
var tag = fiber.tag,
type = fiber.type;
switch (tag) {
case CacheComponent:
return "Cache";
case ContextConsumer:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
var context = type;
return getContextName(context) + ".Consumer";
}
case ContextProvider:
if (enableRenderableContext) {
var _context = type;
return getContextName(_context) + ".Provider";
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case DehydratedFragment:
return "DehydratedFragment";
case ForwardRef:
return getWrappedName(type, type.render, "ForwardRef");
case Fragment:
return "Fragment";
case HostHoistable:
case HostSingleton:
case HostComponent:
// Host component type is the display name (e.g. "div", "View")
return type;
case HostPortal:
return "Portal";
case HostRoot:
return "Root";
case HostText:
return "Text";
case LazyComponent:
// Name comes from the type in this case; we don't have a tag.
return getComponentNameFromType(type);
case Mode:
if (type === REACT_STRICT_MODE_TYPE) {
// Don't be less specific than shared/getComponentNameFromType
return "StrictMode";
}
return "Mode";
case OffscreenComponent:
return "Offscreen";
case Profiler:
return "Profiler";
case ScopeComponent:
return "Scope";
case SuspenseComponent:
return "Suspense";
case SuspenseListComponent:
return "SuspenseList";
case TracingMarkerComponent:
return "TracingMarker";
// The display name for these tags come from the user-provided type:
case IncompleteClassComponent:
case IncompleteFunctionComponent: {
break;
}
// Fallthrough
case ClassComponent:
case FunctionComponent:
case MemoComponent:
case SimpleMemoComponent:
if (typeof type === "function") {
return type.displayName || type.name || null;
}
if (typeof type === "string") {
return type;
}
break;
case LegacyHiddenComponent: {
return "LegacyHidden";
}
}
return null;
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
var didWarnAboutStringRefs;
var didWarnAboutElementRef;
var didWarnAboutOldJSXRuntime;
{
didWarnAboutStringRefs = {};
@@ -1057,12 +929,12 @@ if (__DEV__) {
{
if (
typeof config.ref === "string" &&
ReactSharedInternals.owner &&
ReactCurrentOwner.current &&
self &&
ReactSharedInternals.owner.stateNode !== self
ReactCurrentOwner.current.stateNode !== self
) {
var componentName = getComponentNameFromType(
ReactSharedInternals.owner.type
ReactCurrentOwner.current.type
);
if (!didWarnAboutStringRefs[componentName]) {
@@ -1073,7 +945,7 @@ if (__DEV__) {
"We ask you to manually fix this case by using useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
getComponentNameFromType(ReactSharedInternals.owner.type),
getComponentNameFromType(ReactCurrentOwner.current.type),
config.ref
);
@@ -1433,6 +1305,9 @@ if (__DEV__) {
}
}
var propName; // Reserved names are extracted
var props = {};
var key = null;
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
@@ -1460,49 +1335,20 @@ if (__DEV__) {
if (hasValidRef(config)) {
if (!enableRefAsProp) {
ref = config.ref;
{
ref = coerceStringRef(ref, ReactSharedInternals.owner, type);
}
}
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
}
} // Remaining properties are added to a new props object
var props;
if (enableRefAsProp && disableStringRefs && !("key" in config)) {
// If key was not spread in, we can reuse the original props object. This
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
// target and the compiler always passes a new object. For `createElement`,
// we can't assume a new object is passed every time because it can be
// called manually.
//
// Spreading key is a warning in dev. In a future release, we will not
// remove a spread key from the props object. (But we'll still warn.) We'll
// always pass the object straight through.
props = config;
} else {
// We need to remove reserved props (key, prop, ref). Create a fresh props
// object and copy over all the non-reserved props. We don't use `delete`
// because in V8 it will deopt the object to dictionary mode.
props = {};
for (var propName in config) {
// Skip over reserved prop names
if (propName !== "key" && (enableRefAsProp || propName !== "ref")) {
if (enableRefAsProp && !disableStringRefs && propName === "ref") {
props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
);
} else {
props[propName] = config[propName];
}
}
for (propName in config) {
if (
hasOwnProperty.call(config, propName) && // Skip over reserved prop names
propName !== "key" &&
(enableRefAsProp || propName !== "ref")
) {
props[propName] = config[propName];
}
}
@@ -1511,9 +1357,9 @@ if (__DEV__) {
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (var _propName2 in defaultProps) {
if (props[_propName2] === undefined) {
props[_propName2] = defaultProps[_propName2];
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
@@ -1540,7 +1386,7 @@ if (__DEV__) {
ref,
self,
source,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
@@ -1621,34 +1467,9 @@ if (__DEV__) {
var ref = null;
if (config != null) {
{
if (
!didWarnAboutOldJSXRuntime &&
"__self" in config && // Do not assume this is the result of an oudated JSX transform if key
// is present, because the modern JSX transform sometimes outputs
// createElement to preserve precedence between a static key and a
// spread key. To avoid false positive warnings, we never warn if
// there's a key.
!("key" in config)
) {
didWarnAboutOldJSXRuntime = true;
warn(
"Your app (or one of its dependencies) is using an outdated JSX " +
"transform. Update to the modern JSX transform for " +
"faster performance: " + // TODO: Create a short link for this
"https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html"
);
}
}
if (hasValidRef(config)) {
if (!enableRefAsProp) {
ref = config.ref;
{
ref = coerceStringRef(ref, ReactSharedInternals.owner, type);
}
}
{
@@ -1675,15 +1496,7 @@ if (__DEV__) {
propName !== "__self" &&
propName !== "__source"
) {
if (enableRefAsProp && !disableStringRefs && propName === "ref") {
props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
);
} else {
props[propName] = config[propName];
}
props[propName] = config[propName];
}
}
} // Children can be more than one argument, and those are transferred onto
@@ -1742,7 +1555,7 @@ if (__DEV__) {
ref,
undefined,
undefined,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
@@ -1789,16 +1602,12 @@ if (__DEV__) {
if (config != null) {
if (hasValidRef(config)) {
owner = ReactSharedInternals.owner;
if (!enableRefAsProp) {
// Silently steal the ref from the parent.
ref = config.ref;
{
ref = coerceStringRef(ref, owner, element.type);
}
}
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config)) {
@@ -1843,15 +1652,7 @@ if (__DEV__) {
// Resolve default props
props[propName] = defaultProps[propName];
} else {
if (enableRefAsProp && !disableStringRefs && propName === "ref") {
props.ref = coerceStringRef(
config[propName],
owner,
element.type
);
} else {
props[propName] = config[propName];
}
props[propName] = config[propName];
}
}
}
@@ -1891,8 +1692,8 @@ if (__DEV__) {
function getDeclarationErrorAddendum() {
{
if (ReactSharedInternals.owner) {
var name = getComponentNameFromType(ReactSharedInternals.owner.type);
if (ReactCurrentOwner.current) {
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
if (name) {
return "\n\nCheck the render method of `" + name + "`.";
@@ -2006,18 +1807,14 @@ if (__DEV__) {
if (
element &&
element._owner != null &&
element._owner !== ReactSharedInternals.owner
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;
if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.
childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}
setCurrentlyValidatingElement(element);
@@ -2036,10 +1833,14 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
ReactSharedInternals.setExtraStackFrame(stack);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactSharedInternals.setExtraStackFrame(null);
ReactDebugCurrentFrame.setExtraStackFrame(null);
}
}
}
@@ -2097,96 +1898,6 @@ if (__DEV__) {
}
}
function coerceStringRef(mixedRef, owner, type) {
var stringRef;
if (typeof mixedRef === "string") {
stringRef = mixedRef;
} else {
if (typeof mixedRef === "number" || typeof mixedRef === "boolean") {
{
checkPropStringCoercion(mixedRef, "ref");
}
stringRef = "" + mixedRef;
} else {
return mixedRef;
}
}
return stringRefAsCallbackRef.bind(null, stringRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner) {
throw new Error(
"Element ref was specified as a string (" +
stringRef +
") but no owner was set. This could happen for one of" +
" the following reasons:\n" +
"1. You may be adding a ref to a function component\n" +
"2. You may be adding a ref to a component that was not created inside a component's render method\n" +
"3. You have multiple copies of React loaded\n" +
"See https://react.dev/link/refs-must-have-owner for more information."
);
}
if (owner.tag !== ClassComponent) {
throw new Error(
"Function components cannot have string refs. " +
"We recommend using useRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref"
);
}
{
if (
// Will already warn with "Function components cannot be given refs"
!(typeof type === "function" && !isReactClass(type))
) {
var componentName = getComponentNameFromFiber(owner) || "Component";
if (!didWarnAboutStringRefs[componentName]) {
error(
'Component "%s" contains the string ref "%s". Support for string refs ' +
"will be removed in a future major release. We recommend using " +
"useRef() or createRef() instead. " +
"Learn more about using refs safely here: " +
"https://react.dev/link/strict-mode-string-ref",
componentName,
stringRef
);
didWarnAboutStringRefs[componentName] = true;
}
}
}
var inst = owner.stateNode;
if (!inst) {
throw new Error(
"Missing owner for string ref " +
stringRef +
". This error is likely caused by a " +
"bug in React. Please file an issue."
);
}
var refs = inst.refs;
if (value === null) {
delete refs[stringRef];
} else {
refs[stringRef] = value;
}
}
function isReactClass(type) {
return type.prototype && type.prototype.isReactComponent;
}
var SEPARATOR = ".";
var SUBSEPARATOR = ":";
/**
@@ -2600,7 +2311,7 @@ if (__DEV__) {
}
function resolveDispatcher() {
var dispatcher = ReactSharedInternals.H;
var dispatcher = ReactCurrentDispatcher$1.current;
{
if (dispatcher === null) {
@@ -2911,7 +2622,7 @@ if (__DEV__) {
function cache(fn) {
return function () {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
if (!dispatcher) {
// If there is no dispatcher, then we treat this as not being cached.
@@ -2996,6 +2707,14 @@ if (__DEV__) {
};
}
/**
* Keeps track of the current batch's configuration such as how long an update
* should suspend for if it needs to.
*/
var ReactCurrentBatchConfig = {
transition: null
};
var reportGlobalError =
typeof reportError === "function" // In modern browsers, reportError will dispatch an error event,
? // emulating an uncaught JavaScript error.
@@ -3036,26 +2755,26 @@ if (__DEV__) {
};
function startTransition(scope, options) {
var prevTransition = ReactSharedInternals.T; // Each renderer registers a callback to receive the return value of
var prevTransition = ReactCurrentBatchConfig.transition; // Each renderer registers a callback to receive the return value of
// the scope function. This is used to implement async actions.
var callbacks = new Set();
var transition = {
_callbacks: callbacks
};
ReactSharedInternals.T = transition;
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = transition;
var currentTransition = ReactCurrentBatchConfig.transition;
{
ReactSharedInternals.T._updatedFibers = new Set();
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
}
if (enableTransitionTracing) {
if (options !== undefined && options.name !== undefined) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
ReactSharedInternals.T.name = options.name; // $FlowFixMe[incompatible-use] found when upgrading Flow
ReactCurrentBatchConfig.transition.name = options.name; // $FlowFixMe[incompatible-use] found when upgrading Flow
ReactSharedInternals.T.startTime = -1;
ReactCurrentBatchConfig.transition.startTime = -1;
}
}
@@ -3077,7 +2796,7 @@ if (__DEV__) {
reportGlobalError(error);
} finally {
warnAboutTransitionSubscriptions(prevTransition, currentTransition);
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
}
}
@@ -3105,7 +2824,7 @@ if (__DEV__) {
function noop() {}
var ReactVersion = "19.0.0-www-modern-6d726a4f";
var ReactVersion = "19.0.0-www-modern-1ec419e8";
// Patch fetch
var Children = {
@@ -3127,8 +2846,10 @@ if (__DEV__) {
exports.Profiler = REACT_PROFILER_TYPE;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactServerSharedInternals;
exports.cache = cache;
exports.cloneElement = cloneElement;
exports.createElement = createElement;
+84 -109
View File
@@ -17,7 +17,13 @@ var assign = Object.assign,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp,
disableDefaultPropsExceptForClasses =
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
ReactSharedInternals = { H: null, C: null, owner: null };
ReactCurrentCache = { current: null },
ReactCurrentDispatcher = { current: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentOwner: { current: null }
},
ReactServerSharedInternals = { ReactCurrentCache: ReactCurrentCache };
function formatProdErrorMessage(code) {
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
@@ -51,7 +57,8 @@ function getIteratorFn(maybeIterable) {
maybeIterable["@@iterator"];
return "function" === typeof maybeIterable ? maybeIterable : null;
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
var hasOwnProperty = Object.prototype.hasOwnProperty,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
function ReactElement(type, key, _ref, self, source, owner, props) {
enableRefAsProp &&
((_ref = props.ref), (_ref = void 0 !== _ref ? _ref : null));
@@ -65,39 +72,29 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
};
}
function jsxProd(type, config, maybeKey) {
var key = null,
var propName,
props = {},
key = null,
ref = null;
void 0 !== maybeKey && (key = "" + maybeKey);
void 0 !== config.key && (key = "" + config.key);
void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type)));
maybeKey = {};
for (var propName in config)
"key" === propName ||
(!enableRefAsProp && "ref" === propName) ||
(enableRefAsProp && "ref" === propName
? (maybeKey.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (maybeKey[propName] = config[propName]));
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) {
config = type.defaultProps;
for (var propName$0 in config)
void 0 === maybeKey[propName$0] &&
(maybeKey[propName$0] = config[propName$0]);
}
void 0 === config.ref || enableRefAsProp || (ref = config.ref);
for (propName in config)
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
(enableRefAsProp || "ref" !== propName) &&
(props[propName] = config[propName]);
if (!disableDefaultPropsExceptForClasses && type && type.defaultProps)
for (propName in ((config = type.defaultProps), config))
void 0 === props[propName] && (props[propName] = config[propName]);
return ReactElement(
type,
key,
ref,
void 0,
void 0,
ReactSharedInternals.owner,
maybeKey
ReactCurrentOwner.current,
props
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -118,21 +115,6 @@ function isValidElement(object) {
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function coerceStringRef(mixedRef, owner, type) {
if ("string" !== typeof mixedRef)
if ("number" === typeof mixedRef || "boolean" === typeof mixedRef)
mixedRef = "" + mixedRef;
else return mixedRef;
return stringRefAsCallbackRef.bind(null, mixedRef, type, owner);
}
function stringRefAsCallbackRef(stringRef, type, owner, value) {
if (!owner) throw Error(formatProdErrorMessage(290, stringRef));
if (1 !== owner.tag) throw Error(formatProdErrorMessage(309));
type = owner.stateNode;
if (!type) throw Error(formatProdErrorMessage(147, stringRef));
type = type.refs;
null === value ? delete type[stringRef] : (type[stringRef] = value);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
@@ -324,35 +306,36 @@ function createCacheRoot() {
function createCacheNode() {
return { s: 0, v: void 0, o: null, p: null };
}
var reportGlobalError =
"function" === typeof reportError
? reportError
: function (error) {
if (
"object" === typeof window &&
"function" === typeof window.ErrorEvent
) {
var event = new window.ErrorEvent("error", {
bubbles: !0,
cancelable: !0,
message:
"object" === typeof error &&
null !== error &&
"string" === typeof error.message
? String(error.message)
: String(error),
error: error
});
if (!window.dispatchEvent(event)) return;
} else if (
"object" === typeof process &&
"function" === typeof process.emit
) {
process.emit("uncaughtException", error);
return;
}
console.error(error);
};
var ReactCurrentBatchConfig = { transition: null },
reportGlobalError =
"function" === typeof reportError
? reportError
: function (error) {
if (
"object" === typeof window &&
"function" === typeof window.ErrorEvent
) {
var event = new window.ErrorEvent("error", {
bubbles: !0,
cancelable: !0,
message:
"object" === typeof error &&
null !== error &&
"string" === typeof error.message
? String(error.message)
: String(error),
error: error
});
if (!window.dispatchEvent(event)) return;
} else if (
"object" === typeof process &&
"function" === typeof process.emit
) {
process.emit("uncaughtException", error);
return;
}
console.error(error);
};
function noop() {}
exports.Children = {
map: mapChildren,
@@ -388,11 +371,13 @@ exports.Fragment = REACT_FRAGMENT_TYPE;
exports.Profiler = REACT_PROFILER_TYPE;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactSharedInternals;
exports.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
ReactServerSharedInternals;
exports.cache = function (fn) {
return function () {
var dispatcher = ReactSharedInternals.C;
var dispatcher = ReactCurrentCache.current;
if (!dispatcher) return fn.apply(null, arguments);
var fnMap = dispatcher.getCacheForType(createCacheRoot);
dispatcher = fnMap.get(fn);
@@ -439,10 +424,8 @@ exports.cloneElement = function (element, config, children) {
owner = element._owner;
if (null != config) {
void 0 !== config.ref &&
((owner = ReactSharedInternals.owner),
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, owner, element.type))));
(enableRefAsProp || (ref = config.ref),
(owner = ReactCurrentOwner.current));
void 0 !== config.key && (key = "" + config.key);
if (
!disableDefaultPropsExceptForClasses &&
@@ -457,17 +440,12 @@ exports.cloneElement = function (element, config, children) {
"__self" === propName ||
"__source" === propName ||
(enableRefAsProp && "ref" === propName && void 0 === config.ref) ||
(disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
owner,
element.type
))
: (props[propName] = config[propName])
: (props[propName] = defaultProps[propName]));
(props[propName] =
disableDefaultPropsExceptForClasses ||
void 0 !== config[propName] ||
void 0 === defaultProps
? config[propName]
: defaultProps[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
@@ -486,8 +464,7 @@ exports.createElement = function (type, config, children) {
if (null != config)
for (propName in (void 0 === config.ref ||
enableRefAsProp ||
((ref = config.ref),
(ref = coerceStringRef(ref, ReactSharedInternals.owner, type))),
(ref = config.ref),
void 0 !== config.key && (key = "" + config.key),
config))
hasOwnProperty.call(config, propName) &&
@@ -495,13 +472,7 @@ exports.createElement = function (type, config, children) {
(enableRefAsProp || "ref" !== propName) &&
"__self" !== propName &&
"__source" !== propName &&
(enableRefAsProp && "ref" === propName
? (props.ref = coerceStringRef(
config[propName],
ReactSharedInternals.owner,
type
))
: (props[propName] = config[propName]));
(props[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) props.children = children;
else if (1 < childrenLength) {
@@ -519,7 +490,7 @@ exports.createElement = function (type, config, children) {
ref,
void 0,
void 0,
ReactSharedInternals.owner,
ReactCurrentOwner.current,
props
);
};
@@ -548,15 +519,15 @@ exports.memo = function (type, compare) {
};
};
exports.startTransition = function (scope, options) {
var prevTransition = ReactSharedInternals.T,
var prevTransition = ReactCurrentBatchConfig.transition,
callbacks = new Set();
ReactSharedInternals.T = { _callbacks: callbacks };
var currentTransition = ReactSharedInternals.T;
ReactCurrentBatchConfig.transition = { _callbacks: callbacks };
var currentTransition = ReactCurrentBatchConfig.transition;
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactSharedInternals.T.name = options.name),
(ReactSharedInternals.T.startTime = -1));
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
var returnValue = scope();
"object" === typeof returnValue &&
@@ -569,23 +540,27 @@ exports.startTransition = function (scope, options) {
} catch (error) {
reportGlobalError(error);
} finally {
ReactSharedInternals.T = prevTransition;
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
return ReactCurrentDispatcher.current.use(usable);
};
exports.useActionState = function (action, initialState, permalink) {
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
return ReactCurrentDispatcher.current.useActionState(
action,
initialState,
permalink
);
};
exports.useCallback = function (callback, deps) {
return ReactSharedInternals.H.useCallback(callback, deps);
return ReactCurrentDispatcher.current.useCallback(callback, deps);
};
exports.useDebugValue = function () {};
exports.useId = function () {
return ReactSharedInternals.H.useId();
return ReactCurrentDispatcher.current.useId();
};
exports.useMemo = function (create, deps) {
return ReactSharedInternals.H.useMemo(create, deps);
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.version = "19.0.0-www-modern-3ff8d311";
exports.version = "19.0.0-www-modern-53e0c063";
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -61,10 +61,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -912,7 +914,7 @@ if (__DEV__) {
}
var SecretInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var EventInternals = SecretInternals.Events;
var getInstanceFromNode = EventInternals[0];
var getNodeFromInstance = EventInternals[1];
@@ -1674,9 +1676,6 @@ if (__DEV__) {
"stalled",
"suspend",
"timeUpdate",
"transitionRun",
"transitionStart",
"transitionCancel",
"transitionEnd",
"waiting",
"mouseEnter",
@@ -61,10 +61,12 @@ if (__DEV__) {
var React = require("react");
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; // Defensive in case this is fired before React is initialized.
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Defensive in case this is fired before React is initialized.
if (ReactSharedInternals != null) {
var stack = ReactSharedInternals.getStackAddendum();
var ReactDebugCurrentFrame =
ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== "") {
format += "%s";
@@ -912,7 +914,7 @@ if (__DEV__) {
}
var SecretInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var EventInternals = SecretInternals.Events;
var getInstanceFromNode = EventInternals[0];
var getNodeFromInstance = EventInternals[1];
@@ -1674,9 +1676,6 @@ if (__DEV__) {
"stalled",
"suspend",
"timeUpdate",
"transitionRun",
"transitionStart",
"transitionCancel",
"transitionEnd",
"waiting",
"mouseEnter",
@@ -247,7 +247,7 @@ export default [
"ReactDOM.render was removed in React 19. Use createRoot instead.",
"ReactDOM.unstable_renderSubtreeIntoContainer() has not been supported since React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://react.dev/link/switch-to-createroot",
"ReactDOM.unstable_renderSubtreeIntoContainer() was removed in React 19. Consider using a portal instead.",
"ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
"ReactDOM.useFormState has been deprecated and replaced by React.useActionState. Please update %s to use React.useActionState.",
"ReactTestUtils.mockComponent() is deprecated. Use shallow rendering or jest.mock() instead.\n\nSee https://react.dev/link/test-utils-mock-component for more information.",
"Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",
"Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.",
@@ -301,7 +301,6 @@ export default [
"Touch with identifier %s does not exist. Cannot record touch end without a touch start.",
"Touch with identifier %s does not exist. Cannot record touch move without a touch start.",
"Unexpected Fiber popped.",
"Unexpected host component type. Expected a form. This is a bug in React.",
"Unexpected pop.",
"Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",
"Unexpected return value from a callback ref in %s. A callback ref should not return a function.",
@@ -346,7 +345,6 @@ export default [
"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`.",
"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.",
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ",
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html",
"`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
"`Infinity` is an invalid value for the `%s` css style property.",
"`NaN` is an invalid value for the `%s` css style property.",
@@ -385,7 +383,6 @@ export default [
"precomputed chunks must be smaller than the view size configured for this host. This is a bug in React.",
"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",
"react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer",
"requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.",
"root.finishedLanes should not be empty during a commit. This is a bug in React.",
"sendAccessibilityEvent was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component",
"unmountComponentAtNode was removed in React 19. Use root.unmount() instead.",
@@ -8,8 +8,8 @@
'use strict';
const {
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
} = require('ReactDOM');
module.exports =
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.ReactBrowserEventEmitter;
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactBrowserEventEmitter;