react 19.0.0-canary-48ec17b86-20240402 → 19.0.0-canary-fd0da3eef-20240404
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/react-jsx-dev-runtime.development.js +65 -80
- package/cjs/react-jsx-runtime.development.js +65 -80
- package/cjs/react-jsx-runtime.production.js +19 -29
- package/cjs/react-jsx-runtime.production.min.js +1 -2
- package/cjs/react-jsx-runtime.production.min.js.map +1 -1
- package/cjs/react-jsx-runtime.profiling.js +19 -29
- package/cjs/react-jsx-runtime.profiling.min.js +1 -2
- package/cjs/react-jsx-runtime.profiling.min.js.map +1 -1
- package/cjs/react-jsx-runtime.react-server.development.js +65 -80
- package/cjs/react-jsx-runtime.react-server.production.js +19 -29
- package/cjs/react-jsx-runtime.react-server.production.min.js +1 -2
- package/cjs/react-jsx-runtime.react-server.production.min.js.map +1 -1
- package/cjs/react.development.js +97 -220
- package/cjs/react.production.js +25 -53
- package/cjs/react.production.min.js +21 -21
- package/cjs/react.production.min.js.map +1 -1
- package/cjs/react.react-server.development.js +70 -142
- package/cjs/react.react-server.production.js +22 -48
- package/cjs/react.react-server.production.min.js +18 -19
- package/cjs/react.react-server.production.min.js.map +1 -1
- package/package.json +1 -1
- package/umd/react.development.js +97 -220
- package/umd/react.production.min.js +24 -25
- package/umd/react.profiling.min.js +24 -25
@@ -136,19 +136,13 @@ var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
136
136
|
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
137
137
|
|
138
138
|
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
139
|
-
// Ready for next major.
|
140
|
-
//
|
141
|
-
// Alias __NEXT_MAJOR__ to false for easier skimming.
|
142
|
-
// -----------------------------------------------------------------------------
|
143
|
-
|
144
|
-
var __NEXT_MAJOR__ = false; // Removes legacy style context
|
145
139
|
// as a normal prop instead of stripping it from the props object.
|
146
140
|
// Passes `ref` as a normal prop instead of stripping it from the props object
|
147
141
|
// during element creation.
|
148
142
|
|
149
|
-
var enableRefAsProp =
|
143
|
+
var enableRefAsProp = true;
|
150
144
|
|
151
|
-
var enableRenderableContext =
|
145
|
+
var enableRenderableContext = true; // -----------------------------------------------------------------------------
|
152
146
|
// stuff. Intended to enable React core members to more easily debug scheduling
|
153
147
|
// issues in DEV builds.
|
154
148
|
|
@@ -189,8 +183,8 @@ function generateCacheKey(request) {
|
|
189
183
|
return originalFetch(resource, options);
|
190
184
|
}
|
191
185
|
|
192
|
-
if (options && options.signal
|
193
|
-
// If we're passed a signal
|
186
|
+
if (options && options.signal) {
|
187
|
+
// If we're passed a signal, then we assume that
|
194
188
|
// someone else controls the lifetime of this object and opts out of
|
195
189
|
// caching. It's effectively the opt-out mechanism.
|
196
190
|
// Ideally we should be able to check this on the Request but
|
@@ -465,20 +459,20 @@ function getComponentNameFromType(type) {
|
|
465
459
|
switch (type.$$typeof) {
|
466
460
|
case REACT_PROVIDER_TYPE:
|
467
461
|
{
|
468
|
-
|
469
|
-
return getContextName(provider._context) + '.Provider';
|
462
|
+
return null;
|
470
463
|
}
|
471
464
|
|
472
465
|
case REACT_CONTEXT_TYPE:
|
473
466
|
var context = type;
|
474
467
|
|
475
468
|
{
|
476
|
-
return getContextName(context) + '.
|
469
|
+
return getContextName(context) + '.Provider';
|
477
470
|
}
|
478
471
|
|
479
472
|
case REACT_CONSUMER_TYPE:
|
480
473
|
{
|
481
|
-
|
474
|
+
var consumer = type;
|
475
|
+
return getContextName(consumer._context) + '.Consumer';
|
482
476
|
}
|
483
477
|
|
484
478
|
case REACT_FORWARD_REF_TYPE:
|
@@ -526,7 +520,7 @@ function isValidElementType(type) {
|
|
526
520
|
}
|
527
521
|
|
528
522
|
if (typeof type === 'object' && type !== null) {
|
529
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof ===
|
523
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
530
524
|
// types supported by any Flight configuration anywhere since
|
531
525
|
// we don't know which Flight build this will end up being used
|
532
526
|
// with.
|
@@ -963,11 +957,10 @@ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
963
957
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
964
958
|
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
965
959
|
var specialPropKeyWarningShown;
|
966
|
-
var
|
967
|
-
var didWarnAboutStringRefs;
|
960
|
+
var didWarnAboutElementRef;
|
968
961
|
|
969
962
|
{
|
970
|
-
|
963
|
+
didWarnAboutElementRef = {};
|
971
964
|
}
|
972
965
|
|
973
966
|
function hasValidRef(config) {
|
@@ -998,20 +991,6 @@ function hasValidKey(config) {
|
|
998
991
|
return config.key !== undefined;
|
999
992
|
}
|
1000
993
|
|
1001
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
1002
|
-
{
|
1003
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
1004
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
1005
|
-
|
1006
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
1007
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + '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(ReactCurrentOwner.current.type), config.ref);
|
1008
|
-
|
1009
|
-
didWarnAboutStringRefs[componentName] = true;
|
1010
|
-
}
|
1011
|
-
}
|
1012
|
-
}
|
1013
|
-
}
|
1014
|
-
|
1015
994
|
function defineKeyPropWarningGetter(props, displayName) {
|
1016
995
|
{
|
1017
996
|
var warnAboutAccessingKey = function () {
|
@@ -1030,23 +1009,20 @@ function defineKeyPropWarningGetter(props, displayName) {
|
|
1030
1009
|
}
|
1031
1010
|
}
|
1032
1011
|
|
1033
|
-
function
|
1012
|
+
function elementRefGetterWithDeprecationWarning() {
|
1034
1013
|
{
|
1035
|
-
|
1036
|
-
var warnAboutAccessingRef = function () {
|
1037
|
-
if (!specialPropRefWarningShown) {
|
1038
|
-
specialPropRefWarningShown = true;
|
1014
|
+
var componentName = getComponentNameFromType(this.type);
|
1039
1015
|
|
1040
|
-
|
1041
|
-
|
1042
|
-
};
|
1016
|
+
if (!didWarnAboutElementRef[componentName]) {
|
1017
|
+
didWarnAboutElementRef[componentName] = true;
|
1043
1018
|
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1019
|
+
error('Accessing element.ref was removed in React 19. ref is now a ' + 'regular prop. It will be removed from the JSX Element ' + 'type in a future release.');
|
1020
|
+
} // An undefined `element.ref` is coerced to `null` for
|
1021
|
+
// backwards compatibility.
|
1022
|
+
|
1023
|
+
|
1024
|
+
var refProp = this.props.ref;
|
1025
|
+
return refProp !== undefined ? refProp : null;
|
1050
1026
|
}
|
1051
1027
|
}
|
1052
1028
|
/**
|
@@ -1075,25 +1051,60 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
|
|
1075
1051
|
var ref;
|
1076
1052
|
|
1077
1053
|
{
|
1078
|
-
|
1054
|
+
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
1055
|
+
// argument and treat `props.ref` as the source of truth. The only thing we
|
1056
|
+
// use this for is `element.ref`, which will log a deprecation warning on
|
1057
|
+
// access. In the next release, we can remove `element.ref` as well as the
|
1058
|
+
// `ref` argument.
|
1059
|
+
var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
1060
|
+
// backwards compatibility.
|
1061
|
+
|
1062
|
+
ref = refProp !== undefined ? refProp : null;
|
1079
1063
|
}
|
1080
1064
|
|
1081
1065
|
var element;
|
1082
1066
|
|
1083
1067
|
{
|
1084
|
-
// In
|
1085
|
-
//
|
1068
|
+
// In dev, make `ref` a non-enumerable property with a warning. It's non-
|
1069
|
+
// enumerable so that test matchers and serializers don't access it and
|
1070
|
+
// trigger the warning.
|
1071
|
+
//
|
1072
|
+
// `ref` will be removed from the element completely in a future release.
|
1086
1073
|
element = {
|
1087
1074
|
// This tag allows us to uniquely identify this as a React Element
|
1088
1075
|
$$typeof: REACT_ELEMENT_TYPE,
|
1089
1076
|
// Built-in properties that belong on the element
|
1090
1077
|
type: type,
|
1091
1078
|
key: key,
|
1092
|
-
ref: ref,
|
1093
1079
|
props: props,
|
1094
1080
|
// Record the component responsible for creating this element.
|
1095
1081
|
_owner: owner
|
1096
1082
|
};
|
1083
|
+
|
1084
|
+
if (ref !== null) {
|
1085
|
+
Object.defineProperty(element, 'ref', {
|
1086
|
+
enumerable: false,
|
1087
|
+
get: elementRefGetterWithDeprecationWarning
|
1088
|
+
});
|
1089
|
+
} else {
|
1090
|
+
// Don't warn on access if a ref is not given. This reduces false
|
1091
|
+
// positives in cases where a test serializer uses
|
1092
|
+
// getOwnPropertyDescriptors to compare objects, like Jest does, which is
|
1093
|
+
// a problem because it bypasses non-enumerability.
|
1094
|
+
//
|
1095
|
+
// So unfortunately this will trigger a false positive warning in Jest
|
1096
|
+
// when the diff is printed:
|
1097
|
+
//
|
1098
|
+
// expect(<div ref={ref} />).toEqual(<span ref={ref} />);
|
1099
|
+
//
|
1100
|
+
// A bit sketchy, but this is what we've done for the `props.key` and
|
1101
|
+
// `props.ref` accessors for years, which implies it will be good enough
|
1102
|
+
// for `element.ref`, too. Let's see if anyone complains.
|
1103
|
+
Object.defineProperty(element, 'ref', {
|
1104
|
+
enumerable: false,
|
1105
|
+
value: null
|
1106
|
+
});
|
1107
|
+
}
|
1097
1108
|
}
|
1098
1109
|
|
1099
1110
|
{
|
@@ -1181,15 +1192,7 @@ function createElement(type, config, children) {
|
|
1181
1192
|
var ref = null;
|
1182
1193
|
|
1183
1194
|
if (config != null) {
|
1184
|
-
if (hasValidRef(config))
|
1185
|
-
{
|
1186
|
-
ref = config.ref;
|
1187
|
-
}
|
1188
|
-
|
1189
|
-
{
|
1190
|
-
warnIfStringRefCannotBeAutoConverted(config, config.__self);
|
1191
|
-
}
|
1192
|
-
}
|
1195
|
+
if (hasValidRef(config)) ;
|
1193
1196
|
|
1194
1197
|
if (hasValidKey(config)) {
|
1195
1198
|
{
|
@@ -1202,7 +1205,7 @@ function createElement(type, config, children) {
|
|
1202
1205
|
|
1203
1206
|
for (propName in config) {
|
1204
1207
|
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1205
|
-
propName !== 'key' && (
|
1208
|
+
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
1206
1209
|
// them to appear as props, so in createElement we filter them out.
|
1207
1210
|
// We don't have to do this in the jsx() runtime because the jsx()
|
1208
1211
|
// transform never passed these as props; it used separate arguments.
|
@@ -1246,16 +1249,12 @@ function createElement(type, config, children) {
|
|
1246
1249
|
}
|
1247
1250
|
|
1248
1251
|
{
|
1249
|
-
if (key ||
|
1252
|
+
if (key || !enableRefAsProp ) {
|
1250
1253
|
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
1251
1254
|
|
1252
1255
|
if (key) {
|
1253
1256
|
defineKeyPropWarningGetter(props, displayName);
|
1254
1257
|
}
|
1255
|
-
|
1256
|
-
if (ref) {
|
1257
|
-
defineRefPropWarningGetter(props, displayName);
|
1258
|
-
}
|
1259
1258
|
}
|
1260
1259
|
}
|
1261
1260
|
|
@@ -1270,7 +1269,7 @@ function createElement(type, config, children) {
|
|
1270
1269
|
function cloneAndReplaceKey(oldElement, newKey) {
|
1271
1270
|
return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
|
1272
1271
|
// exists to avoid the `ref` access warning.
|
1273
|
-
|
1272
|
+
null , undefined, undefined, oldElement._owner, oldElement.props);
|
1274
1273
|
}
|
1275
1274
|
/**
|
1276
1275
|
* Clone and return a new ReactElement using element as the starting point.
|
@@ -1287,16 +1286,12 @@ function cloneElement(element, config, children) {
|
|
1287
1286
|
var props = assign({}, element.props); // Reserved names are extracted
|
1288
1287
|
|
1289
1288
|
var key = element.key;
|
1290
|
-
var ref =
|
1289
|
+
var ref = null ; // Owner will be preserved, unless ref is overridden
|
1291
1290
|
|
1292
1291
|
var owner = element._owner;
|
1293
1292
|
|
1294
1293
|
if (config != null) {
|
1295
1294
|
if (hasValidRef(config)) {
|
1296
|
-
{
|
1297
|
-
// Silently steal the ref from the parent.
|
1298
|
-
ref = config.ref;
|
1299
|
-
}
|
1300
1295
|
|
1301
1296
|
owner = ReactCurrentOwner.current;
|
1302
1297
|
}
|
@@ -1309,16 +1304,9 @@ function cloneElement(element, config, children) {
|
|
1309
1304
|
key = '' + config.key;
|
1310
1305
|
} // Remaining properties override existing props
|
1311
1306
|
|
1312
|
-
|
1313
|
-
var defaultProps;
|
1314
|
-
|
1315
|
-
if (element.type && element.type.defaultProps) {
|
1316
|
-
defaultProps = element.type.defaultProps;
|
1317
|
-
}
|
1318
|
-
|
1319
1307
|
for (propName in config) {
|
1320
1308
|
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1321
|
-
propName !== 'key' && (
|
1309
|
+
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
1322
1310
|
// warnings and debug information in dev. Need to decide if we're OK
|
1323
1311
|
// with dropping them. In the jsx() runtime it's not an issue because
|
1324
1312
|
// the data gets passed as separate arguments instead of props, but
|
@@ -1327,11 +1315,8 @@ function cloneElement(element, config, children) {
|
|
1327
1315
|
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
1328
1316
|
// if the property were missing. This is mostly for
|
1329
1317
|
// backwards compatibility.
|
1330
|
-
!(
|
1331
|
-
|
1332
|
-
// Resolve default props
|
1333
|
-
props[propName] = defaultProps[propName];
|
1334
|
-
} else {
|
1318
|
+
!(propName === 'ref' && config.ref === undefined)) {
|
1319
|
+
{
|
1335
1320
|
props[propName] = config[propName];
|
1336
1321
|
}
|
1337
1322
|
}
|
@@ -1533,14 +1518,6 @@ function validateFragmentProps(fragment) {
|
|
1533
1518
|
break;
|
1534
1519
|
}
|
1535
1520
|
}
|
1536
|
-
|
1537
|
-
if (fragment.ref !== null) {
|
1538
|
-
setCurrentlyValidatingElement(fragment);
|
1539
|
-
|
1540
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
1541
|
-
|
1542
|
-
setCurrentlyValidatingElement(null);
|
1543
|
-
}
|
1544
1521
|
}
|
1545
1522
|
}
|
1546
1523
|
|
@@ -1682,12 +1659,6 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
1682
1659
|
} else {
|
1683
1660
|
switch (type) {
|
1684
1661
|
case 'bigint':
|
1685
|
-
{
|
1686
|
-
break;
|
1687
|
-
}
|
1688
|
-
|
1689
|
-
// fallthrough for enabled BigInt support
|
1690
|
-
|
1691
1662
|
case 'string':
|
1692
1663
|
case 'number':
|
1693
1664
|
invokeCallback = true;
|
@@ -2087,49 +2058,6 @@ function lazy(ctor) {
|
|
2087
2058
|
_init: lazyInitializer
|
2088
2059
|
};
|
2089
2060
|
|
2090
|
-
{
|
2091
|
-
// In production, this would just set it on the object.
|
2092
|
-
var defaultProps;
|
2093
|
-
var propTypes; // $FlowFixMe[prop-missing]
|
2094
|
-
|
2095
|
-
Object.defineProperties(lazyType, {
|
2096
|
-
defaultProps: {
|
2097
|
-
configurable: true,
|
2098
|
-
get: function () {
|
2099
|
-
return defaultProps;
|
2100
|
-
},
|
2101
|
-
// $FlowFixMe[missing-local-annot]
|
2102
|
-
set: function (newDefaultProps) {
|
2103
|
-
error('It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
2104
|
-
|
2105
|
-
defaultProps = newDefaultProps; // Match production behavior more closely:
|
2106
|
-
// $FlowFixMe[prop-missing]
|
2107
|
-
|
2108
|
-
Object.defineProperty(lazyType, 'defaultProps', {
|
2109
|
-
enumerable: true
|
2110
|
-
});
|
2111
|
-
}
|
2112
|
-
},
|
2113
|
-
propTypes: {
|
2114
|
-
configurable: true,
|
2115
|
-
get: function () {
|
2116
|
-
return propTypes;
|
2117
|
-
},
|
2118
|
-
// $FlowFixMe[missing-local-annot]
|
2119
|
-
set: function (newPropTypes) {
|
2120
|
-
error('It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
2121
|
-
|
2122
|
-
propTypes = newPropTypes; // Match production behavior more closely:
|
2123
|
-
// $FlowFixMe[prop-missing]
|
2124
|
-
|
2125
|
-
Object.defineProperty(lazyType, 'propTypes', {
|
2126
|
-
enumerable: true
|
2127
|
-
});
|
2128
|
-
}
|
2129
|
-
}
|
2130
|
-
});
|
2131
|
-
}
|
2132
|
-
|
2133
2061
|
return lazyType;
|
2134
2062
|
}
|
2135
2063
|
|
@@ -2366,7 +2294,7 @@ function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
|
|
2366
2294
|
|
2367
2295
|
function noop() {}
|
2368
2296
|
|
2369
|
-
var ReactVersion = '19.0.0-canary-
|
2297
|
+
var ReactVersion = '19.0.0-canary-fd0da3eef-20240404';
|
2370
2298
|
|
2371
2299
|
// Patch fetch
|
2372
2300
|
var Children = {
|
@@ -13,17 +13,11 @@
|
|
13
13
|
const assign = Object.assign;
|
14
14
|
|
15
15
|
// -----------------------------------------------------------------------------
|
16
|
-
// Ready for next major.
|
17
|
-
//
|
18
|
-
// Alias __NEXT_MAJOR__ to false for easier skimming.
|
19
|
-
// -----------------------------------------------------------------------------
|
20
|
-
|
21
|
-
const __NEXT_MAJOR__ = false; // Removes legacy style context
|
22
16
|
// as a normal prop instead of stripping it from the props object.
|
23
17
|
// Passes `ref` as a normal prop instead of stripping it from the props object
|
24
18
|
// during element creation.
|
25
19
|
|
26
|
-
const enableRefAsProp =
|
20
|
+
const enableRefAsProp = true;
|
27
21
|
|
28
22
|
/**
|
29
23
|
* Keeps track of the current Cache dispatcher.
|
@@ -60,8 +54,8 @@ function generateCacheKey(request) {
|
|
60
54
|
return originalFetch(resource, options);
|
61
55
|
}
|
62
56
|
|
63
|
-
if (options && options.signal
|
64
|
-
// If we're passed a signal
|
57
|
+
if (options && options.signal) {
|
58
|
+
// If we're passed a signal, then we assume that
|
65
59
|
// someone else controls the lifetime of this object and opts out of
|
66
60
|
// caching. It's effectively the opt-out mechanism.
|
67
61
|
// Ideally we should be able to check this on the Request but
|
@@ -273,14 +267,21 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
|
|
273
267
|
let ref;
|
274
268
|
|
275
269
|
{
|
276
|
-
|
270
|
+
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
271
|
+
// argument and treat `props.ref` as the source of truth. The only thing we
|
272
|
+
// use this for is `element.ref`, which will log a deprecation warning on
|
273
|
+
// access. In the next release, we can remove `element.ref` as well as the
|
274
|
+
// `ref` argument.
|
275
|
+
const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
276
|
+
// backwards compatibility.
|
277
|
+
|
278
|
+
ref = refProp !== undefined ? refProp : null;
|
277
279
|
}
|
278
280
|
|
279
281
|
let element;
|
280
282
|
|
281
283
|
{
|
282
|
-
// In prod, `ref` is a regular property
|
283
|
-
// future release.
|
284
|
+
// In prod, `ref` is a regular property and _owner doesn't exist.
|
284
285
|
element = {
|
285
286
|
// This tag allows us to uniquely identify this as a React Element
|
286
287
|
$$typeof: REACT_ELEMENT_TYPE,
|
@@ -288,9 +289,7 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
|
|
288
289
|
type,
|
289
290
|
key,
|
290
291
|
ref,
|
291
|
-
props
|
292
|
-
// Record the component responsible for creating this element.
|
293
|
-
_owner: owner
|
292
|
+
props
|
294
293
|
};
|
295
294
|
}
|
296
295
|
|
@@ -310,11 +309,6 @@ function createElement(type, config, children) {
|
|
310
309
|
let ref = null;
|
311
310
|
|
312
311
|
if (config != null) {
|
313
|
-
if (hasValidRef(config)) {
|
314
|
-
{
|
315
|
-
ref = config.ref;
|
316
|
-
}
|
317
|
-
}
|
318
312
|
|
319
313
|
if (hasValidKey(config)) {
|
320
314
|
|
@@ -324,7 +318,7 @@ function createElement(type, config, children) {
|
|
324
318
|
|
325
319
|
for (propName in config) {
|
326
320
|
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
327
|
-
propName !== 'key' && (
|
321
|
+
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
328
322
|
// them to appear as props, so in createElement we filter them out.
|
329
323
|
// We don't have to do this in the jsx() runtime because the jsx()
|
330
324
|
// transform never passed these as props; it used separate arguments.
|
@@ -368,7 +362,7 @@ function createElement(type, config, children) {
|
|
368
362
|
function cloneAndReplaceKey(oldElement, newKey) {
|
369
363
|
return ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
|
370
364
|
// exists to avoid the `ref` access warning.
|
371
|
-
|
365
|
+
null , undefined, undefined, undefined , oldElement.props);
|
372
366
|
}
|
373
367
|
/**
|
374
368
|
* Clone and return a new ReactElement using element as the starting point.
|
@@ -385,16 +379,12 @@ function cloneElement(element, config, children) {
|
|
385
379
|
const props = assign({}, element.props); // Reserved names are extracted
|
386
380
|
|
387
381
|
let key = element.key;
|
388
|
-
let ref =
|
382
|
+
let ref = null ; // Owner will be preserved, unless ref is overridden
|
389
383
|
|
390
|
-
let owner =
|
384
|
+
let owner = undefined ;
|
391
385
|
|
392
386
|
if (config != null) {
|
393
387
|
if (hasValidRef(config)) {
|
394
|
-
{
|
395
|
-
// Silently steal the ref from the parent.
|
396
|
-
ref = config.ref;
|
397
|
-
}
|
398
388
|
|
399
389
|
owner = ReactCurrentOwner.current;
|
400
390
|
}
|
@@ -404,16 +394,9 @@ function cloneElement(element, config, children) {
|
|
404
394
|
key = '' + config.key;
|
405
395
|
} // Remaining properties override existing props
|
406
396
|
|
407
|
-
|
408
|
-
let defaultProps;
|
409
|
-
|
410
|
-
if (element.type && element.type.defaultProps) {
|
411
|
-
defaultProps = element.type.defaultProps;
|
412
|
-
}
|
413
|
-
|
414
397
|
for (propName in config) {
|
415
398
|
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
416
|
-
propName !== 'key' && (
|
399
|
+
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
417
400
|
// warnings and debug information in dev. Need to decide if we're OK
|
418
401
|
// with dropping them. In the jsx() runtime it's not an issue because
|
419
402
|
// the data gets passed as separate arguments instead of props, but
|
@@ -422,11 +405,8 @@ function cloneElement(element, config, children) {
|
|
422
405
|
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
423
406
|
// if the property were missing. This is mostly for
|
424
407
|
// backwards compatibility.
|
425
|
-
!(
|
426
|
-
|
427
|
-
// Resolve default props
|
428
|
-
props[propName] = defaultProps[propName];
|
429
|
-
} else {
|
408
|
+
!(propName === 'ref' && config.ref === undefined)) {
|
409
|
+
{
|
430
410
|
props[propName] = config[propName];
|
431
411
|
}
|
432
412
|
}
|
@@ -593,12 +573,6 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
593
573
|
} else {
|
594
574
|
switch (type) {
|
595
575
|
case 'bigint':
|
596
|
-
{
|
597
|
-
break;
|
598
|
-
}
|
599
|
-
|
600
|
-
// fallthrough for enabled BigInt support
|
601
|
-
|
602
576
|
case 'string':
|
603
577
|
case 'number':
|
604
578
|
invokeCallback = true;
|
@@ -1092,7 +1066,7 @@ function startTransition(scope, options) {
|
|
1092
1066
|
|
1093
1067
|
function noop() {}
|
1094
1068
|
|
1095
|
-
var ReactVersion = '19.0.0-canary-
|
1069
|
+
var ReactVersion = '19.0.0-canary-fd0da3eef-20240404';
|
1096
1070
|
|
1097
1071
|
// Patch fetch
|
1098
1072
|
const Children = {
|
@@ -7,25 +7,24 @@
|
|
7
7
|
This source code is licensed under the MIT license found in the
|
8
8
|
LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
|
-
'use strict';var
|
11
|
-
if("function"===typeof fetch){var
|
12
|
-
|
13
|
-
|
14
|
-
var
|
15
|
-
function
|
10
|
+
'use strict';var l=Object.assign,m={current:null};function n(){return new Map}
|
11
|
+
if("function"===typeof fetch){var p=fetch,q=function(a,b){var d=m.current;if(!d||b&&b.signal)return p(a,b);if("string"!==typeof a||b){var c="string"===typeof a||a instanceof URL?new Request(a,b):a;if("GET"!==c.method&&"HEAD"!==c.method||c.keepalive)return p(a,b);var e=JSON.stringify([c.method,Array.from(c.headers.entries()),c.mode,c.redirect,c.credentials,c.referrer,c.referrerPolicy,c.integrity]);c=c.url}else e='["GET",[],null,"follow",null,null,null,null]',c=a;var g=d.getCacheForType(n);d=g.get(c);
|
12
|
+
if(void 0===d)a=p(a,b),g.set(c,[e,a]);else{c=0;for(g=d.length;c<g;c+=2){var f=d[c+1];if(d[c]===e)return a=f,a.then(function(k){return k.clone()})}a=p(a,b);d.push(e,a)}return a.then(function(k){return k.clone()})};l(q,p);try{fetch=q}catch(a){try{globalThis.fetch=q}catch(b){console.warn("React was unable to patch the fetch() function in this environment. Suspensey APIs might not work correctly as a result.")}}}var r={current:null},t={ReactCurrentDispatcher:r,ReactCurrentOwner:{current:null}},u={ReactCurrentCache:m};
|
13
|
+
function v(a){var b="https://react.dev/errors/"+a;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)b+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
14
|
+
var w=Array.isArray,x=Symbol.for("react.element"),y=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),C=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),E=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),G=Symbol.iterator;function H(a){if(null===a||"object"!==typeof a)return null;a=G&&a[G]||a["@@iterator"];return"function"===typeof a?a:null}var I=Object.prototype.hasOwnProperty,J=t.ReactCurrentOwner;
|
15
|
+
function K(a,b,d,c,e,g,f){d=f.ref;return{$$typeof:x,type:a,key:b,ref:void 0!==d?d:null,props:f}}function L(a,b){return K(a.type,b,null,void 0,void 0,void 0,a.props)}function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===x}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(d){return b[d]})}var N=/\/+/g;function O(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}function P(){}
|
16
16
|
function Q(a){switch(a.status){case "fulfilled":return a.value;case "rejected":throw a.reason;default:switch("string"===typeof a.status?a.then(P,P):(a.status="pending",a.then(function(b){"pending"===a.status&&(a.status="fulfilled",a.value=b)},function(b){"pending"===a.status&&(a.status="rejected",a.reason=b)})),a.status){case "fulfilled":return a.value;case "rejected":throw a.reason;}}throw a;}
|
17
|
-
function R(a,b,d,c,e){var
|
18
|
-
""===c?".":c+":";if(
|
19
|
-
function S(a,b,d){if(null==a)return a;var c=[],e=0;R(a,c,"","",function(
|
20
|
-
var
|
21
|
-
exports.Children={map:S,forEach:function(a,b,d){S(a,function(){b.apply(this,arguments)},d)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(b){return b})||[]},only:function(a){if(!M(a))throw Error(
|
22
|
-
exports.cache=function(a){return function(){var b=
|
23
|
-
arguments);d=b;d.s=1;return d.v=
|
24
|
-
exports.cloneElement=function(a,b,d){if(null===a||void 0===a)throw Error(
|
25
|
-
|
26
|
-
exports.
|
27
|
-
exports.
|
28
|
-
exports.
|
29
|
-
exports.useId=function(){return t.current.useId()};exports.useMemo=function(a,b){return t.current.useMemo(a,b)};exports.version="19.0.0-canary-48ec17b86-20240402";
|
17
|
+
function R(a,b,d,c,e){var g=typeof a;if("undefined"===g||"boolean"===g)a=null;var f=!1;if(null===a)f=!0;else switch(g){case "bigint":case "string":case "number":f=!0;break;case "object":switch(a.$$typeof){case x:case y:f=!0;break;case F:return f=a._init,R(f(a._payload),b,d,c,e)}}if(f)return e=e(a),f=""===c?"."+O(a,0):c,w(e)?(d="",null!=f&&(d=f.replace(N,"$&/")+"/"),R(e,b,d,"",function(W){return W})):null!=e&&(M(e)&&(e=L(e,d+(!e.key||a&&a.key===e.key?"":(""+e.key).replace(N,"$&/")+"/")+f)),b.push(e)),
|
18
|
+
1;f=0;var k=""===c?".":c+":";if(w(a))for(var h=0;h<a.length;h++)c=a[h],g=k+O(c,h),f+=R(c,b,d,g,e);else if(h=H(a),"function"===typeof h)for(a=h.call(a),h=0;!(c=a.next()).done;)c=c.value,g=k+O(c,h++),f+=R(c,b,d,g,e);else if("object"===g){if("function"===typeof a.then)return R(Q(a),b,d,c,e);b=String(a);throw Error(v(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));}return f}
|
19
|
+
function S(a,b,d){if(null==a)return a;var c=[],e=0;R(a,c,"","",function(g){return b.call(d,g,e++)});return c}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(d){if(0===a._status||-1===a._status)a._status=1,a._result=d},function(d){if(0===a._status||-1===a._status)a._status=2,a._result=d});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}function U(){return new WeakMap}function V(){return{s:0,v:void 0,o:null,p:null}}
|
20
|
+
var X={transition:null},Y="function"===typeof reportError?reportError:function(a){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var b=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof a&&null!==a&&"string"===typeof a.message?String(a.message):String(a),error:a});if(!window.dispatchEvent(b))return}else if("object"===typeof process&&"function"===typeof process.emit){process.emit("uncaughtException",a);return}console.error(a)};function Z(){}
|
21
|
+
exports.Children={map:S,forEach:function(a,b,d){S(a,function(){b.apply(this,arguments)},d)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(b){return b})||[]},only:function(a){if(!M(a))throw Error(v(143));return a}};exports.Fragment=z;exports.Profiler=B;exports.StrictMode=A;exports.Suspense=D;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t;exports.__SECRET_SERVER_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u;
|
22
|
+
exports.cache=function(a){return function(){var b=m.current;if(!b)return a.apply(null,arguments);var d=b.getCacheForType(U);b=d.get(a);void 0===b&&(b=V(),d.set(a,b));d=0;for(var c=arguments.length;d<c;d++){var e=arguments[d];if("function"===typeof e||"object"===typeof e&&null!==e){var g=b.o;null===g&&(b.o=g=new WeakMap);b=g.get(e);void 0===b&&(b=V(),g.set(e,b))}else g=b.p,null===g&&(b.p=g=new Map),b=g.get(e),void 0===b&&(b=V(),g.set(e,b))}if(1===b.s)return b.v;if(2===b.s)throw b.v;try{var f=a.apply(null,
|
23
|
+
arguments);d=b;d.s=1;return d.v=f}catch(k){throw f=b,f.s=2,f.v=k,k;}}};
|
24
|
+
exports.cloneElement=function(a,b,d){if(null===a||void 0===a)throw Error(v(267,a));var c=l({},a.props),e=a.key,g=void 0;if(null!=b)for(f in void 0!==b.ref&&(g=J.current),void 0!==b.key&&(e=""+b.key),b)!I.call(b,f)||"key"===f||"__self"===f||"__source"===f||"ref"===f&&void 0===b.ref||(c[f]=b[f]);var f=arguments.length-2;if(1===f)c.children=d;else if(1<f){for(var k=Array(f),h=0;h<f;h++)k[h]=arguments[h+2];c.children=k}return K(a.type,e,null,void 0,void 0,g,c)};
|
25
|
+
exports.createElement=function(a,b,d){var c,e={},g=null;if(null!=b)for(c in void 0!==b.key&&(g=""+b.key),b)I.call(b,c)&&"key"!==c&&"__self"!==c&&"__source"!==c&&(e[c]=b[c]);var f=arguments.length-2;if(1===f)e.children=d;else if(1<f){for(var k=Array(f),h=0;h<f;h++)k[h]=arguments[h+2];e.children=k}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===e[c]&&(e[c]=f[c]);return K(a,g,null,void 0,void 0,J.current,e)};exports.createRef=function(){return{current:null}};
|
26
|
+
exports.forwardRef=function(a){return{$$typeof:C,render:a}};exports.isValidElement=M;exports.lazy=function(a){return{$$typeof:F,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:E,type:a,compare:void 0===b?null:b}};
|
27
|
+
exports.startTransition=function(a){var b=X.transition,d=new Set;X.transition={_callbacks:d};var c=X.transition;try{var e=a();"object"===typeof e&&null!==e&&"function"===typeof e.then&&(d.forEach(function(g){return g(c,e)}),e.then(Z,Y))}catch(g){Y(g)}finally{X.transition=b}};exports.use=function(a){return r.current.use(a)};exports.useActionState=function(a,b,d){return r.current.useActionState(a,b,d)};exports.useCallback=function(a,b){return r.current.useCallback(a,b)};exports.useDebugValue=function(){};
|
28
|
+
exports.useId=function(){return r.current.useId()};exports.useMemo=function(a,b){return r.current.useMemo(a,b)};exports.version="19.0.0-canary-fd0da3eef-20240404";
|
30
29
|
|
31
30
|
//# sourceMappingURL=react.react-server.production.min.js.map
|