react 19.0.0-canary-33a32441e9-20240418 → 19.0.0-canary-cb151849e1-20240424
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 +27 -28
- package/cjs/react-jsx-dev-runtime.production.js +4 -9
- package/cjs/react-jsx-dev-runtime.profiling.js +4 -9
- package/cjs/react-jsx-runtime.development.js +27 -28
- package/cjs/react-jsx-runtime.production.js +24 -144
- package/cjs/react-jsx-runtime.profiling.js +24 -144
- package/cjs/react-jsx-runtime.react-server.development.js +27 -28
- package/cjs/react-jsx-runtime.react-server.production.js +29 -151
- package/cjs/react.development.js +33 -35
- package/cjs/react.production.js +467 -1028
- package/cjs/react.react-server.development.js +13 -139
- package/cjs/react.react-server.production.js +424 -998
- package/index.js +1 -1
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.react-server.js +1 -1
- package/package.json +1 -1
- package/react.react-server.js +1 -1
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-dev-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.production.min.js +0 -12
- package/cjs/react-jsx-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.react-server.production.min.js +0 -13
- package/cjs/react-jsx-runtime.react-server.production.min.js.map +0 -1
- package/cjs/react.production.min.js +0 -30
- package/cjs/react.production.min.js.map +0 -1
- package/cjs/react.react-server.production.min.js +0 -29
- package/cjs/react.react-server.production.min.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license React
|
3
|
-
* react-jsx-runtime.react-server.production.
|
3
|
+
* react-jsx-runtime.react-server.production.js
|
4
4
|
*
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
6
|
*
|
@@ -8,155 +8,33 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
const REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
20
|
-
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
21
|
-
|
22
|
-
// -----------------------------------------------------------------------------
|
23
|
-
// as a normal prop instead of stripping it from the props object.
|
24
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
25
|
-
// during element creation.
|
26
|
-
|
27
|
-
const enableRefAsProp = true;
|
28
|
-
|
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;
|
31
|
-
|
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
|
-
|
36
|
-
function hasValidKey(config) {
|
37
|
-
|
38
|
-
return config.key !== undefined;
|
39
|
-
}
|
40
|
-
/**
|
41
|
-
* Factory method to create a new React element. This no longer adheres to
|
42
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
43
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
44
|
-
* if something is a React Element.
|
45
|
-
*
|
46
|
-
* @param {*} type
|
47
|
-
* @param {*} props
|
48
|
-
* @param {*} key
|
49
|
-
* @param {string|object} ref
|
50
|
-
* @param {*} owner
|
51
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
52
|
-
* different from the `owner` when React.createElement is called, so that we
|
53
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
54
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
55
|
-
* change in behavior.
|
56
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
57
|
-
* indicating filename, line number, and/or other information.
|
58
|
-
* @internal
|
59
|
-
*/
|
60
|
-
|
61
|
-
|
62
|
-
function ReactElement(type, key, _ref, self, source, owner, props) {
|
63
|
-
let ref;
|
64
|
-
|
65
|
-
{
|
66
|
-
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
67
|
-
// argument and treat `props.ref` as the source of truth. The only thing we
|
68
|
-
// use this for is `element.ref`, which will log a deprecation warning on
|
69
|
-
// access. In the next release, we can remove `element.ref` as well as the
|
70
|
-
// `ref` argument.
|
71
|
-
const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
72
|
-
// backwards compatibility.
|
73
|
-
|
74
|
-
ref = refProp !== undefined ? refProp : null;
|
75
|
-
}
|
76
|
-
|
77
|
-
let element;
|
78
|
-
|
79
|
-
{
|
80
|
-
// In prod, `ref` is a regular property and _owner doesn't exist.
|
81
|
-
element = {
|
82
|
-
// This tag allows us to uniquely identify this as a React Element
|
83
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
84
|
-
// Built-in properties that belong on the element
|
85
|
-
type,
|
86
|
-
key,
|
87
|
-
ref,
|
88
|
-
props
|
89
|
-
};
|
90
|
-
}
|
91
|
-
|
92
|
-
return element;
|
93
|
-
}
|
94
|
-
/**
|
95
|
-
* https://github.com/reactjs/rfcs/pull/107
|
96
|
-
* @param {*} type
|
97
|
-
* @param {object} props
|
98
|
-
* @param {string} key
|
99
|
-
*/
|
100
|
-
|
101
|
-
|
11
|
+
"use strict";
|
12
|
+
var React = require("react"),
|
13
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
14
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
15
|
+
if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
|
16
|
+
throw Error(
|
17
|
+
'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.'
|
18
|
+
);
|
102
19
|
function jsxProd(type, config, maybeKey) {
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
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
|
-
}
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
return ReactElement(type, key, ref, undefined, undefined, ReactSharedInternalsServer.owner, props);
|
151
|
-
} // While `jsxDEV` should never be called when running in production, we do
|
152
|
-
|
153
|
-
const jsx = jsxProd; // we may want to special case jsxs internally to take advantage of static children.
|
154
|
-
// for now we can ship identical prod functions
|
155
|
-
|
156
|
-
const jsxs = jsxProd;
|
157
|
-
const jsxDEV = undefined;
|
158
|
-
|
20
|
+
var key = null;
|
21
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
22
|
+
void 0 !== config.key && (key = "" + config.key);
|
23
|
+
if ("key" in config) {
|
24
|
+
maybeKey = {};
|
25
|
+
for (var propName in config)
|
26
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
27
|
+
} else maybeKey = config;
|
28
|
+
config = maybeKey.ref;
|
29
|
+
return {
|
30
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
31
|
+
type: type,
|
32
|
+
key: key,
|
33
|
+
ref: void 0 !== config ? config : null,
|
34
|
+
props: maybeKey
|
35
|
+
};
|
36
|
+
}
|
159
37
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
160
|
-
exports.jsx =
|
161
|
-
exports.jsxDEV =
|
162
|
-
exports.jsxs =
|
38
|
+
exports.jsx = jsxProd;
|
39
|
+
exports.jsxDEV = void 0;
|
40
|
+
exports.jsxs = jsxProd;
|
package/cjs/react.development.js
CHANGED
@@ -23,13 +23,31 @@ if (
|
|
23
23
|
) {
|
24
24
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
25
25
|
}
|
26
|
-
var ReactVersion = '19.0.0-canary-
|
26
|
+
var ReactVersion = '19.0.0-canary-cb151849e1-20240424';
|
27
27
|
|
28
|
-
//
|
29
|
-
|
30
|
-
//
|
31
|
-
//
|
32
|
-
|
28
|
+
// -----------------------------------------------------------------------------
|
29
|
+
|
30
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
31
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
32
|
+
|
33
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
34
|
+
// as a normal prop instead of stripping it from the props object.
|
35
|
+
// Passes `ref` as a normal prop instead of stripping it from the props object
|
36
|
+
// during element creation.
|
37
|
+
|
38
|
+
var enableRefAsProp = true;
|
39
|
+
// This allows us to land breaking changes to remove legacy mode APIs in experimental builds
|
40
|
+
// before removing them in stable in the next Major
|
41
|
+
|
42
|
+
var disableLegacyMode = true;
|
43
|
+
|
44
|
+
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
45
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
46
|
+
// issues in DEV builds.
|
47
|
+
|
48
|
+
var enableDebugTracing = false;
|
49
|
+
|
50
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
33
51
|
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
34
52
|
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
35
53
|
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
@@ -60,28 +78,6 @@ function getIteratorFn(maybeIterable) {
|
|
60
78
|
return null;
|
61
79
|
}
|
62
80
|
|
63
|
-
// -----------------------------------------------------------------------------
|
64
|
-
|
65
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
66
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
67
|
-
|
68
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
69
|
-
// as a normal prop instead of stripping it from the props object.
|
70
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
71
|
-
// during element creation.
|
72
|
-
|
73
|
-
var enableRefAsProp = true;
|
74
|
-
// This allows us to land breaking changes to remove legacy mode APIs in experimental builds
|
75
|
-
// before removing them in stable in the next Major
|
76
|
-
|
77
|
-
var disableLegacyMode = true;
|
78
|
-
|
79
|
-
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
80
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
81
|
-
// issues in DEV builds.
|
82
|
-
|
83
|
-
var enableDebugTracing = false;
|
84
|
-
|
85
81
|
var ReactSharedInternals = {
|
86
82
|
H: null,
|
87
83
|
C: null,
|
@@ -1105,7 +1101,7 @@ function elementRefGetterWithDeprecationWarning() {
|
|
1105
1101
|
/**
|
1106
1102
|
* Factory method to create a new React element. This no longer adheres to
|
1107
1103
|
* the class pattern, so do not use new to call it. Also, instanceof check
|
1108
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
1104
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
|
1109
1105
|
* if something is a React Element.
|
1110
1106
|
*
|
1111
1107
|
* @param {*} type
|
@@ -1278,8 +1274,7 @@ function createElement(type, config, children) {
|
|
1278
1274
|
!('key' in config)) {
|
1279
1275
|
didWarnAboutOldJSXRuntime = true;
|
1280
1276
|
|
1281
|
-
warn('Your app (or one of its dependencies) is using an outdated JSX ' + 'transform. Update to the modern JSX transform for ' + 'faster performance: '
|
1282
|
-
'https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html');
|
1277
|
+
warn('Your app (or one of its dependencies) is using an outdated JSX ' + 'transform. Update to the modern JSX transform for ' + 'faster performance: https://react.dev/link/new-jsx-transform');
|
1283
1278
|
}
|
1284
1279
|
}
|
1285
1280
|
|
@@ -1493,11 +1488,14 @@ function validateChildKeys(node, parentType) {
|
|
1493
1488
|
// but now we print a separate warning for them later.
|
1494
1489
|
if (iteratorFn !== node.entries) {
|
1495
1490
|
var iterator = iteratorFn.call(node);
|
1496
|
-
var step;
|
1497
1491
|
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1492
|
+
if (iterator !== node) {
|
1493
|
+
var step;
|
1494
|
+
|
1495
|
+
while (!(step = iterator.next()).done) {
|
1496
|
+
if (isValidElement(step.value)) {
|
1497
|
+
validateExplicitKey(step.value, parentType);
|
1498
|
+
}
|
1501
1499
|
}
|
1502
1500
|
}
|
1503
1501
|
}
|