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.
Files changed (32) hide show
  1. package/cjs/react-jsx-dev-runtime.development.js +27 -28
  2. package/cjs/react-jsx-dev-runtime.production.js +4 -9
  3. package/cjs/react-jsx-dev-runtime.profiling.js +4 -9
  4. package/cjs/react-jsx-runtime.development.js +27 -28
  5. package/cjs/react-jsx-runtime.production.js +24 -144
  6. package/cjs/react-jsx-runtime.profiling.js +24 -144
  7. package/cjs/react-jsx-runtime.react-server.development.js +27 -28
  8. package/cjs/react-jsx-runtime.react-server.production.js +29 -151
  9. package/cjs/react.development.js +33 -35
  10. package/cjs/react.production.js +467 -1028
  11. package/cjs/react.react-server.development.js +13 -139
  12. package/cjs/react.react-server.production.js +424 -998
  13. package/index.js +1 -1
  14. package/jsx-dev-runtime.js +1 -1
  15. package/jsx-runtime.js +1 -1
  16. package/jsx-runtime.react-server.js +1 -1
  17. package/package.json +1 -1
  18. package/react.react-server.js +1 -1
  19. package/cjs/react-jsx-dev-runtime.production.min.js +0 -12
  20. package/cjs/react-jsx-dev-runtime.production.min.js.map +0 -1
  21. package/cjs/react-jsx-dev-runtime.profiling.min.js +0 -12
  22. package/cjs/react-jsx-dev-runtime.profiling.min.js.map +0 -1
  23. package/cjs/react-jsx-runtime.production.min.js +0 -12
  24. package/cjs/react-jsx-runtime.production.min.js.map +0 -1
  25. package/cjs/react-jsx-runtime.profiling.min.js +0 -12
  26. package/cjs/react-jsx-runtime.profiling.min.js.map +0 -1
  27. package/cjs/react-jsx-runtime.react-server.production.min.js +0 -13
  28. package/cjs/react-jsx-runtime.react-server.production.min.js.map +0 -1
  29. package/cjs/react.production.min.js +0 -30
  30. package/cjs/react.production.min.js.map +0 -1
  31. package/cjs/react.react-server.production.min.js +0 -29
  32. package/cjs/react.react-server.production.min.js.map +0 -1
@@ -121,142 +121,13 @@ function printWarning(level, format, args) {
121
121
  }
122
122
  }
123
123
 
124
- var assign = Object.assign;
125
-
126
- function createFetchCache() {
127
- return new Map();
128
- }
129
-
130
- var simpleCacheKey = '["GET",[],null,"follow",null,null,null,null]'; // generateCacheKey(new Request('https://blank'));
131
-
132
- function generateCacheKey(request) {
133
- // We pick the fields that goes into the key used to dedupe requests.
134
- // We don't include the `cache` field, because we end up using whatever
135
- // caching resulted from the first request.
136
- // Notably we currently don't consider non-standard (or future) options.
137
- // This might not be safe. TODO: warn for non-standard extensions differing.
138
- // IF YOU CHANGE THIS UPDATE THE simpleCacheKey ABOVE.
139
- return JSON.stringify([request.method, Array.from(request.headers.entries()), request.mode, request.redirect, request.credentials, request.referrer, request.referrerPolicy, request.integrity]);
140
- }
141
-
142
- {
143
- if (typeof fetch === 'function') {
144
- var originalFetch = fetch;
145
-
146
- var cachedFetch = function fetch(resource, options) {
147
- var dispatcher = ReactSharedInternals.C;
148
-
149
- if (!dispatcher) {
150
- // We're outside a cached scope.
151
- return originalFetch(resource, options);
152
- }
153
-
154
- if (options && options.signal) {
155
- // If we're passed a signal, then we assume that
156
- // someone else controls the lifetime of this object and opts out of
157
- // caching. It's effectively the opt-out mechanism.
158
- // Ideally we should be able to check this on the Request but
159
- // it always gets initialized with its own signal so we don't
160
- // know if it's supposed to override - unless we also override the
161
- // Request constructor.
162
- return originalFetch(resource, options);
163
- } // Normalize the Request
164
-
165
-
166
- var url;
167
- var cacheKey;
168
-
169
- if (typeof resource === 'string' && !options) {
170
- // Fast path.
171
- cacheKey = simpleCacheKey;
172
- url = resource;
173
- } else {
174
- // Normalize the request.
175
- // if resource is not a string or a URL (its an instance of Request)
176
- // then do not instantiate a new Request but instead
177
- // reuse the request as to not disturb the body in the event it's a ReadableStream.
178
- var request = typeof resource === 'string' || resource instanceof URL ? new Request(resource, options) : resource;
179
-
180
- if (request.method !== 'GET' && request.method !== 'HEAD' || // $FlowFixMe[prop-missing]: keepalive is real
181
- request.keepalive) {
182
- // We currently don't dedupe requests that might have side-effects. Those
183
- // have to be explicitly cached. We assume that the request doesn't have a
184
- // body if it's GET or HEAD.
185
- // keepalive gets treated the same as if you passed a custom cache signal.
186
- return originalFetch(resource, options);
187
- }
188
-
189
- cacheKey = generateCacheKey(request);
190
- url = request.url;
191
- }
192
-
193
- var cache = dispatcher.getCacheForType(createFetchCache);
194
- var cacheEntries = cache.get(url);
195
- var match;
196
-
197
- if (cacheEntries === undefined) {
198
- // We pass the original arguments here in case normalizing the Request
199
- // doesn't include all the options in this environment.
200
- match = originalFetch(resource, options);
201
- cache.set(url, [cacheKey, match]);
202
- } else {
203
- // We use an array as the inner data structure since it's lighter and
204
- // we typically only expect to see one or two entries here.
205
- for (var i = 0, l = cacheEntries.length; i < l; i += 2) {
206
- var key = cacheEntries[i];
207
- var value = cacheEntries[i + 1];
208
-
209
- if (key === cacheKey) {
210
- match = value; // I would've preferred a labelled break but lint says no.
211
-
212
- return match.then(function (response) {
213
- return response.clone();
214
- });
215
- }
216
- }
217
-
218
- match = originalFetch(resource, options);
219
- cacheEntries.push(cacheKey, match);
220
- } // We clone the response so that each time you call this you get a new read
221
- // of the body so that it can be read multiple times.
222
-
223
-
224
- return match.then(function (response) {
225
- return response.clone();
226
- });
227
- }; // We don't expect to see any extra properties on fetch but if there are any,
228
- // copy them over. Useful for extended fetch environments or mocks.
229
-
230
-
231
- assign(cachedFetch, originalFetch);
232
-
233
- try {
234
- // eslint-disable-next-line no-native-reassign
235
- fetch = cachedFetch;
236
- } catch (error1) {
237
- try {
238
- // In case assigning it globally fails, try globalThis instead just in case it exists.
239
- globalThis.fetch = cachedFetch;
240
- } catch (error2) {
241
- // Log even in production just to make sure this is seen if only prod is frozen.
242
- // eslint-disable-next-line react-internal/no-production-logging
243
- warn('React was unable to patch the fetch() function in this environment. ' + 'Suspensey APIs might not work correctly as a result.');
244
- }
245
- }
246
- }
247
- }
248
-
249
124
  var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
250
125
 
251
126
  function isArray(a) {
252
127
  return isArrayImpl(a);
253
128
  }
254
129
 
255
- // ATTENTION
256
- // When adding new symbols to this file,
257
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
258
- // The Symbol used to tag the ReactElement-like types.
259
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
130
+ var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
260
131
  var REACT_PORTAL_TYPE = Symbol.for('react.portal');
261
132
  var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
262
133
  var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
@@ -472,6 +343,8 @@ function getComponentNameFromType(type) {
472
343
  // $FlowFixMe[method-unbinding]
473
344
  var hasOwnProperty = Object.prototype.hasOwnProperty;
474
345
 
346
+ var assign = Object.assign;
347
+
475
348
  var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference');
476
349
  function isValidElementType(type) {
477
350
  if (typeof type === 'string' || typeof type === 'function') {
@@ -990,7 +863,7 @@ function elementRefGetterWithDeprecationWarning() {
990
863
  /**
991
864
  * Factory method to create a new React element. This no longer adheres to
992
865
  * the class pattern, so do not use new to call it. Also, instanceof check
993
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
866
+ * will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
994
867
  * if something is a React Element.
995
868
  *
996
869
  * @param {*} type
@@ -1163,8 +1036,7 @@ function createElement(type, config, children) {
1163
1036
  !('key' in config)) {
1164
1037
  didWarnAboutOldJSXRuntime = true;
1165
1038
 
1166
- 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
1167
- 'https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html');
1039
+ 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');
1168
1040
  }
1169
1041
  }
1170
1042
 
@@ -1378,11 +1250,14 @@ function validateChildKeys(node, parentType) {
1378
1250
  // but now we print a separate warning for them later.
1379
1251
  if (iteratorFn !== node.entries) {
1380
1252
  var iterator = iteratorFn.call(node);
1381
- var step;
1382
1253
 
1383
- while (!(step = iterator.next()).done) {
1384
- if (isValidElement(step.value)) {
1385
- validateExplicitKey(step.value, parentType);
1254
+ if (iterator !== node) {
1255
+ var step;
1256
+
1257
+ while (!(step = iterator.next()).done) {
1258
+ if (isValidElement(step.value)) {
1259
+ validateExplicitKey(step.value, parentType);
1260
+ }
1386
1261
  }
1387
1262
  }
1388
1263
  }
@@ -2272,9 +2147,8 @@ function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
2272
2147
 
2273
2148
  function noop() {}
2274
2149
 
2275
- var ReactVersion = '19.0.0-canary-33a32441e9-20240418';
2150
+ var ReactVersion = '19.0.0-canary-cb151849e1-20240424';
2276
2151
 
2277
- // Patch fetch
2278
2152
  var Children = {
2279
2153
  map: mapChildren,
2280
2154
  forEach: forEachChildren,