react 19.0.0-canary-cb151849e1-20240424 → 19.0.0-rc-915b914b3a-20240515

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.
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @license React
3
+ * react-compiler-runtime.development.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ if (process.env.NODE_ENV !== "production") {
14
+ (function() {
15
+ 'use strict';
16
+
17
+ var React = require('react');
18
+
19
+ var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
20
+
21
+ function error(format) {
22
+ {
23
+ {
24
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
25
+ args[_key2 - 1] = arguments[_key2];
26
+ }
27
+
28
+ printWarning('error', format, args);
29
+ }
30
+ }
31
+ }
32
+
33
+ function printWarning(level, format, args) {
34
+ // When changing this logic, you might want to also
35
+ // update consoleWithStackDev.www.js as well.
36
+ {
37
+ var stack = ReactSharedInternals.getStackAddendum();
38
+
39
+ if (stack !== '') {
40
+ format += '%s';
41
+ args = args.concat([stack]);
42
+ } // eslint-disable-next-line react-internal/safe-string-coercion
43
+
44
+
45
+ var argsWithFormat = args.map(function (item) {
46
+ return String(item);
47
+ }); // Careful: RN currently depends on this prefix
48
+
49
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
50
+ // breaks IE9: https://github.com/facebook/react/issues/13610
51
+ // eslint-disable-next-line react-internal/no-production-logging
52
+
53
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
54
+ }
55
+ }
56
+
57
+ function resolveDispatcher() {
58
+ var dispatcher = ReactSharedInternals.H;
59
+
60
+ {
61
+ if (dispatcher === null) {
62
+ error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.');
63
+ }
64
+ } // Will result in a null access error if accessed outside render phase. We
65
+ // intentionally don't throw our own error because this is in a hot path.
66
+ // Also helps ensure this is inlined.
67
+
68
+
69
+ return dispatcher;
70
+ }
71
+ function useMemoCache(size) {
72
+ var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
73
+
74
+ return dispatcher.useMemoCache(size);
75
+ }
76
+
77
+ exports.c = useMemoCache;
78
+ })();
79
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license React
3
+ * react-compiler-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ "use strict";
12
+ var ReactSharedInternals =
13
+ require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
14
+ exports.c = function (size) {
15
+ return ReactSharedInternals.H.useMemoCache(size);
16
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license React
3
+ * react-compiler-runtime.profiling.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ "use strict";
12
+ var ReactSharedInternals =
13
+ require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
14
+ exports.c = function (size) {
15
+ return ReactSharedInternals.H.useMemoCache(size);
16
+ };
@@ -741,6 +741,19 @@ function describeUnknownElementTypeFrameInDEV(type) {
741
741
  }
742
742
 
743
743
  var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
744
+
745
+ function getOwner() {
746
+ {
747
+ var dispatcher = ReactSharedInternals.A;
748
+
749
+ if (dispatcher === null) {
750
+ return null;
751
+ }
752
+
753
+ return dispatcher.getOwner();
754
+ }
755
+ }
756
+
744
757
  var specialPropKeyWarningShown;
745
758
  var didWarnAboutElementRef;
746
759
 
@@ -832,7 +845,7 @@ function elementRefGetterWithDeprecationWarning() {
832
845
  */
833
846
 
834
847
 
835
- function ReactElement(type, key, _ref, self, source, owner, props) {
848
+ function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
836
849
  var ref;
837
850
 
838
851
  {
@@ -1067,7 +1080,7 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
1067
1080
  }
1068
1081
  }
1069
1082
 
1070
- var element = ReactElement(type, key, ref, self, source, ReactSharedInternals.owner, props);
1083
+ var element = ReactElement(type, key, ref, self, source, getOwner(), props);
1071
1084
 
1072
1085
  if (type === REACT_FRAGMENT_TYPE) {
1073
1086
  validateFragmentProps(element);
@@ -1079,8 +1092,10 @@ function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
1079
1092
 
1080
1093
  function getDeclarationErrorAddendum() {
1081
1094
  {
1082
- if (ReactSharedInternals.owner) {
1083
- var name = getComponentNameFromType(ReactSharedInternals.owner.type);
1095
+ var owner = getOwner();
1096
+
1097
+ if (owner) {
1098
+ var name = getComponentNameFromType(owner.type);
1084
1099
 
1085
1100
  if (name) {
1086
1101
  return '\n\nCheck the render method of `' + name + '`.';
@@ -1187,7 +1202,7 @@ function validateExplicitKey(element, parentType) {
1187
1202
 
1188
1203
  var childOwner = '';
1189
1204
 
1190
- if (element && element._owner != null && element._owner !== ReactSharedInternals.owner) {
1205
+ if (element && element._owner != null && element._owner !== getOwner()) {
1191
1206
  var ownerName = null;
1192
1207
 
1193
1208
  if (typeof element._owner.tag === 'number') {