react 19.0.0-canary-e3ebcd54b-20240405 → 19.0.0-canary-adb717393-20240411
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-jsx-dev-runtime.development.js +53 -34
- package/cjs/react-jsx-runtime.development.js +53 -34
- package/cjs/react-jsx-runtime.production.js +27 -16
- package/cjs/react-jsx-runtime.production.min.js +1 -1
- package/cjs/react-jsx-runtime.production.min.js.map +1 -1
- package/cjs/react-jsx-runtime.profiling.js +27 -16
- package/cjs/react-jsx-runtime.profiling.min.js +1 -1
- package/cjs/react-jsx-runtime.profiling.min.js.map +1 -1
- package/cjs/react-jsx-runtime.react-server.development.js +58 -34
- package/cjs/react-jsx-runtime.react-server.production.js +31 -15
- package/cjs/react-jsx-runtime.react-server.production.min.js +2 -1
- package/cjs/react-jsx-runtime.react-server.production.min.js.map +1 -1
- package/cjs/react.development.js +118 -150
- package/cjs/react.production.js +13 -53
- package/cjs/react.production.min.js +17 -18
- package/cjs/react.production.min.js.map +1 -1
- package/cjs/react.react-server.development.js +83 -110
- package/cjs/react.react-server.production.js +14 -58
- package/cjs/react.react-server.production.min.js +17 -18
- package/cjs/react.react-server.production.min.js.map +1 -1
- package/package.json +1 -1
- package/umd/react.development.js +158 -159
- package/umd/react.production.min.js +23 -24
- package/umd/react.profiling.min.js +23 -24
@@ -51,7 +51,12 @@ function getIteratorFn(maybeIterable) {
|
|
51
51
|
return null;
|
52
52
|
}
|
53
53
|
|
54
|
-
var
|
54
|
+
var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
|
55
|
+
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
56
|
+
|
57
|
+
if (!ReactSharedInternalsServer) {
|
58
|
+
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.');
|
59
|
+
}
|
55
60
|
|
56
61
|
function error(format) {
|
57
62
|
{
|
@@ -69,8 +74,7 @@ function printWarning(level, format, args) {
|
|
69
74
|
// When changing this logic, you might want to also
|
70
75
|
// update consoleWithStackDev.www.js as well.
|
71
76
|
{
|
72
|
-
var
|
73
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
77
|
+
var stack = ReactSharedInternalsServer.getStackAddendum();
|
74
78
|
|
75
79
|
if (stack !== '') {
|
76
80
|
format += '%s';
|
@@ -419,9 +423,8 @@ function reenableLogs() {
|
|
419
423
|
}
|
420
424
|
}
|
421
425
|
|
422
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
423
426
|
var prefix;
|
424
|
-
function describeBuiltInComponentFrame(name
|
427
|
+
function describeBuiltInComponentFrame(name) {
|
425
428
|
{
|
426
429
|
if (prefix === undefined) {
|
427
430
|
// Extract the VM specific prefix used by each line.
|
@@ -475,13 +478,13 @@ function describeNativeComponentFrame(fn, construct) {
|
|
475
478
|
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
|
476
479
|
|
477
480
|
Error.prepareStackTrace = undefined;
|
478
|
-
var previousDispatcher;
|
481
|
+
var previousDispatcher = null;
|
479
482
|
|
480
483
|
{
|
481
|
-
previousDispatcher =
|
484
|
+
previousDispatcher = ReactSharedInternalsServer.H; // Set the dispatcher in DEV because this might be call in the render function
|
482
485
|
// for warnings.
|
483
486
|
|
484
|
-
|
487
|
+
ReactSharedInternalsServer.H = null;
|
485
488
|
disableLogs();
|
486
489
|
}
|
487
490
|
/**
|
@@ -666,7 +669,7 @@ function describeNativeComponentFrame(fn, construct) {
|
|
666
669
|
reentry = false;
|
667
670
|
|
668
671
|
{
|
669
|
-
|
672
|
+
ReactSharedInternalsServer.H = previousDispatcher;
|
670
673
|
reenableLogs();
|
671
674
|
}
|
672
675
|
|
@@ -685,7 +688,7 @@ function describeNativeComponentFrame(fn, construct) {
|
|
685
688
|
|
686
689
|
return syntheticFrame;
|
687
690
|
}
|
688
|
-
function describeFunctionComponentFrame(fn
|
691
|
+
function describeFunctionComponentFrame(fn) {
|
689
692
|
{
|
690
693
|
return describeNativeComponentFrame(fn, false);
|
691
694
|
}
|
@@ -696,7 +699,7 @@ function shouldConstruct(Component) {
|
|
696
699
|
return !!(prototype && prototype.isReactComponent);
|
697
700
|
}
|
698
701
|
|
699
|
-
function describeUnknownElementTypeFrameInDEV(type
|
702
|
+
function describeUnknownElementTypeFrameInDEV(type) {
|
700
703
|
|
701
704
|
if (type == null) {
|
702
705
|
return '';
|
@@ -727,7 +730,7 @@ function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
|
|
727
730
|
|
728
731
|
case REACT_MEMO_TYPE:
|
729
732
|
// Memo may contain any component type so we recursively resolve it.
|
730
|
-
return describeUnknownElementTypeFrameInDEV(type.type
|
733
|
+
return describeUnknownElementTypeFrameInDEV(type.type);
|
731
734
|
|
732
735
|
case REACT_LAZY_TYPE:
|
733
736
|
{
|
@@ -737,7 +740,7 @@ function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
|
|
737
740
|
|
738
741
|
try {
|
739
742
|
// Lazy may contain any component type so we recursively resolve it.
|
740
|
-
return describeUnknownElementTypeFrameInDEV(init(payload)
|
743
|
+
return describeUnknownElementTypeFrameInDEV(init(payload));
|
741
744
|
} catch (x) {}
|
742
745
|
}
|
743
746
|
}
|
@@ -746,8 +749,6 @@ function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
|
|
746
749
|
return '';
|
747
750
|
}
|
748
751
|
|
749
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
750
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
751
752
|
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
752
753
|
var specialPropKeyWarningShown;
|
753
754
|
var didWarnAboutElementRef;
|
@@ -1036,9 +1037,6 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
|
1036
1037
|
}
|
1037
1038
|
}
|
1038
1039
|
|
1039
|
-
var propName; // Reserved names are extracted
|
1040
|
-
|
1041
|
-
var props = {};
|
1042
1040
|
var key = null;
|
1043
1041
|
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
1044
1042
|
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
@@ -1063,14 +1061,33 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
|
1063
1061
|
key = '' + config.key;
|
1064
1062
|
}
|
1065
1063
|
|
1066
|
-
if (hasValidRef(config)) ;
|
1064
|
+
if (hasValidRef(config)) ;
|
1067
1065
|
|
1066
|
+
var props;
|
1068
1067
|
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1068
|
+
if (!('key' in config)) {
|
1069
|
+
// If key was not spread in, we can reuse the original props object. This
|
1070
|
+
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
|
1071
|
+
// target and the compiler always passes a new object. For `createElement`,
|
1072
|
+
// we can't assume a new object is passed every time because it can be
|
1073
|
+
// called manually.
|
1074
|
+
//
|
1075
|
+
// Spreading key is a warning in dev. In a future release, we will not
|
1076
|
+
// remove a spread key from the props object. (But we'll still warn.) We'll
|
1077
|
+
// always pass the object straight through.
|
1078
|
+
props = config;
|
1079
|
+
} else {
|
1080
|
+
// We need to remove reserved props (key, prop, ref). Create a fresh props
|
1081
|
+
// object and copy over all the non-reserved props. We don't use `delete`
|
1082
|
+
// because in V8 it will deopt the object to dictionary mode.
|
1083
|
+
props = {};
|
1084
|
+
|
1085
|
+
for (var propName in config) {
|
1086
|
+
// Skip over reserved prop names
|
1087
|
+
if (propName !== 'key' && (enableRefAsProp )) {
|
1088
|
+
{
|
1089
|
+
props[propName] = config[propName];
|
1090
|
+
}
|
1074
1091
|
}
|
1075
1092
|
}
|
1076
1093
|
}
|
@@ -1083,7 +1100,7 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
|
1083
1100
|
}
|
1084
1101
|
}
|
1085
1102
|
|
1086
|
-
var element = ReactElement(type, key, ref, self, source,
|
1103
|
+
var element = ReactElement(type, key, ref, self, source, ReactSharedInternalsServer.owner, props);
|
1087
1104
|
|
1088
1105
|
if (type === REACT_FRAGMENT_TYPE) {
|
1089
1106
|
validateFragmentProps(element);
|
@@ -1095,8 +1112,8 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
|
1095
1112
|
|
1096
1113
|
function getDeclarationErrorAddendum() {
|
1097
1114
|
{
|
1098
|
-
if (
|
1099
|
-
var name = getComponentNameFromType(
|
1115
|
+
if (ReactSharedInternalsServer.owner) {
|
1116
|
+
var name = getComponentNameFromType(ReactSharedInternalsServer.owner.type);
|
1100
1117
|
|
1101
1118
|
if (name) {
|
1102
1119
|
return '\n\nCheck the render method of `' + name + '`.';
|
@@ -1200,9 +1217,17 @@ function validateExplicitKey(element, parentType) {
|
|
1200
1217
|
|
1201
1218
|
var childOwner = '';
|
1202
1219
|
|
1203
|
-
if (element && element._owner && element._owner !==
|
1204
|
-
|
1205
|
-
|
1220
|
+
if (element && element._owner != null && element._owner !== ReactSharedInternalsServer.owner) {
|
1221
|
+
var ownerName = null;
|
1222
|
+
|
1223
|
+
if (typeof element._owner.tag === 'number') {
|
1224
|
+
ownerName = getComponentNameFromType(element._owner.type);
|
1225
|
+
} else if (typeof element._owner.name === 'string') {
|
1226
|
+
ownerName = element._owner.name;
|
1227
|
+
} // Give the component that originally created this child.
|
1228
|
+
|
1229
|
+
|
1230
|
+
childOwner = " It was passed a child from " + ownerName + ".";
|
1206
1231
|
}
|
1207
1232
|
|
1208
1233
|
setCurrentlyValidatingElement(element);
|
@@ -1216,11 +1241,10 @@ function validateExplicitKey(element, parentType) {
|
|
1216
1241
|
function setCurrentlyValidatingElement(element) {
|
1217
1242
|
{
|
1218
1243
|
if (element) {
|
1219
|
-
var
|
1220
|
-
|
1221
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
1244
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
1245
|
+
ReactSharedInternalsServer.setExtraStackFrame(stack);
|
1222
1246
|
} else {
|
1223
|
-
|
1247
|
+
ReactSharedInternalsServer.setExtraStackFrame(null);
|
1224
1248
|
}
|
1225
1249
|
}
|
1226
1250
|
}
|
@@ -26,12 +26,12 @@ const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
26
26
|
|
27
27
|
const enableRefAsProp = true;
|
28
28
|
|
29
|
-
const
|
29
|
+
const ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
|
30
|
+
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
32
|
+
if (!ReactSharedInternalsServer) {
|
33
|
+
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.');
|
34
|
+
}
|
35
35
|
|
36
36
|
function hasValidKey(config) {
|
37
37
|
|
@@ -100,9 +100,6 @@ function ReactElement(type, key, _ref, self, source, owner, props) {
|
|
100
100
|
|
101
101
|
|
102
102
|
function jsxProd(type, config, maybeKey) {
|
103
|
-
let propName; // Reserved names are extracted
|
104
|
-
|
105
|
-
const props = {};
|
106
103
|
let key = null;
|
107
104
|
let ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
108
105
|
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
@@ -121,17 +118,36 @@ function jsxProd(type, config, maybeKey) {
|
|
121
118
|
key = '' + config.key;
|
122
119
|
}
|
123
120
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
121
|
+
let props;
|
122
|
+
|
123
|
+
if (!('key' in config)) {
|
124
|
+
// If key was not spread in, we can reuse the original props object. This
|
125
|
+
// only works for `jsx`, not `createElement`, because `jsx` is a compiler
|
126
|
+
// target and the compiler always passes a new object. For `createElement`,
|
127
|
+
// we can't assume a new object is passed every time because it can be
|
128
|
+
// called manually.
|
129
|
+
//
|
130
|
+
// Spreading key is a warning in dev. In a future release, we will not
|
131
|
+
// remove a spread key from the props object. (But we'll still warn.) We'll
|
132
|
+
// always pass the object straight through.
|
133
|
+
props = config;
|
134
|
+
} else {
|
135
|
+
// We need to remove reserved props (key, prop, ref). Create a fresh props
|
136
|
+
// object and copy over all the non-reserved props. We don't use `delete`
|
137
|
+
// because in V8 it will deopt the object to dictionary mode.
|
138
|
+
props = {};
|
139
|
+
|
140
|
+
for (const propName in config) {
|
141
|
+
// Skip over reserved prop names
|
142
|
+
if (propName !== 'key' && (enableRefAsProp )) {
|
143
|
+
{
|
144
|
+
props[propName] = config[propName];
|
145
|
+
}
|
130
146
|
}
|
131
147
|
}
|
132
148
|
}
|
133
149
|
|
134
|
-
return ReactElement(type, key, ref, undefined, undefined,
|
150
|
+
return ReactElement(type, key, ref, undefined, undefined, ReactSharedInternalsServer.owner, props);
|
135
151
|
} // While `jsxDEV` should never be called when running in production, we do
|
136
152
|
|
137
153
|
const jsx = jsxProd; // we may want to special case jsxs internally to take advantage of static children.
|
@@ -7,6 +7,7 @@
|
|
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';require("react")
|
10
|
+
'use strict';var e=require("react"),f=Symbol.for("react.element"),g=Symbol.for("react.fragment");if(!e.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)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.');
|
11
|
+
function h(k,a,b){var c=null;void 0!==b&&(c=""+b);void 0!==a.key&&(c=""+a.key);if("key"in a){b={};for(var d in a)"key"!==d&&(b[d]=a[d])}else b=a;a=b.ref;return{$$typeof:f,type:k,key:c,ref:void 0!==a?a:null,props:b}}exports.Fragment=g;exports.jsx=h;exports.jsxDEV=void 0;exports.jsxs=h;
|
11
12
|
|
12
13
|
//# sourceMappingURL=react-jsx-runtime.react-server.production.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"react-jsx-runtime.react-server.production.min.js","lineCount":
|
1
|
+
{"version":3,"file":"react-jsx-runtime.react-server.production.min.js","lineCount":11,"mappings":"A;;;;;;;;;aAYA,IAAIA,EAAQC,OAAA,CAAQ,OAAR,CAAZ,CAMMC,EAAqBC,MAAOC,CAAAA,GAAP,CAAW,eAAX,CAN3B,CAOMC,EAAsBF,MAAOC,CAAAA,GAAP,CAAW,gBAAX,CAY5B,IAAI,CAFJJ,CAAMM,CAAAA,+DAEN,CACE,KAAUC,MAAJ,CAAU,yKAAV,CAAN;AAqEFC,QAASA,EAAO,CAACC,CAAD,CAAOC,CAAP,CAAeC,CAAf,CAAyB,CACvC,IAAIC,EAAM,IAQOC,KAAAA,EAAjB,GAAIF,CAAJ,GAEEC,CAFF,CAEQ,EAFR,CAEaD,CAFb,CAzEsBE,KAAAA,EA8EtB,GAAgBH,CA9EFE,CAAAA,GA8Ed,GAEEA,CAFF,CAEQ,EAFR,CAEaF,CAAOE,CAAAA,GAFpB,CAOA,IAAM,KAAN,EAAeF,EAAf,CAWO,CAILI,CAAA,CAAQ,EAER,KAAKC,IAAMA,CAAX,GAAuBL,EAAvB,CAEmB,KAAjB,GAAIK,CAAJ,GAEID,CAAA,CAAMC,CAAN,CAFJ,CAEsBL,CAAA,CAAOK,CAAP,CAFtB,CARG,CAXP,IAUED,EAAA,CAAQJ,CA9DFM,EAAAA,CA+EoFF,CA/EpEG,CAAAA,GA+ExB,OArEYC,CAERC,SAAUjB,CAFFgB,CAIRT,KAiEgBA,CArERS,CAKRN,IAgEsBA,CArEdM,CAMRD,IAbgBJ,IAAAA,EAAZI,GAAAD,CAAAC,CAAwBD,CAAxBC,CAAkC,IAO9BC,CAORJ,MA8DwFA,CArEhFI,CAqB2B,CAyDzCE,OAAQC,CAAAA,QAAR,CAAmBhB,CACnBe,QAAQE,CAAAA,GAAR,CAAcA,CACdF,QAAQG,CAAAA,MAAR,CAJeV,IAAAA,EAKfO,QAAQI,CAAAA,IAAR,CAAeA;","sources":["react-jsx-runtime.react-server.production.js"],"names":["React","require","REACT_ELEMENT_TYPE","Symbol","for","REACT_FRAGMENT_TYPE","__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","Error","jsxProd","type","config","maybeKey","key","undefined","props","propName","refProp","ref","element","$$typeof","exports","Fragment","jsx","jsxDEV","jsxs"],"ignoreList":[0]}
|