@expo/cli 1.0.0-canary-20250404-3c3b5fd → 1.0.0-canary-20250701-6a945c5
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/README.md +33 -24
- package/build/bin/cli +1 -1
- package/build/metro-require/require.js +6 -4
- package/build/src/api/user/actions.js +25 -11
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/customize/templates.js +15 -1
- package/build/src/customize/templates.js.map +1 -1
- package/build/src/export/exportApp.js +26 -14
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAsync.js +6 -0
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportHermes.js +2 -2
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/install/checkPackages.js +22 -4
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/index.js +3 -1
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/resolveOptions.js +7 -2
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/install/utils/checkPackagesCompatibility.js +1 -1
- package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
- package/build/src/lint/ESlintPrerequisite.js +32 -48
- package/build/src/lint/ESlintPrerequisite.js.map +1 -1
- package/build/src/lint/index.js +45 -47
- package/build/src/lint/index.js.map +1 -1
- package/build/src/lint/lintAsync.js +150 -4
- package/build/src/lint/lintAsync.js.map +1 -1
- package/build/src/lint/resolveOptions.js +115 -0
- package/build/src/lint/resolveOptions.js.map +1 -0
- package/build/src/prebuild/renameTemplateAppName.js +4 -1
- package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
- package/build/src/prebuild/resolveTemplate.js +4 -4
- package/build/src/prebuild/resolveTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +19 -9
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/run/android/resolveOptions.js +13 -1
- package/build/src/run/android/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +39 -17
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +3 -3
- package/build/src/run/ios/XcodeBuild.js.map +1 -1
- package/build/src/run/ios/options/resolveOptions.js +13 -1
- package/build/src/run/ios/options/resolveOptions.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +38 -7
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/start/doctor/SecurityBinPrerequisite.js +1 -1
- package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/index.js +1 -1
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js +1 -1
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/getDevices.js +1 -1
- package/build/src/start/platforms/android/getDevices.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/xcrun.js +1 -1
- package/build/src/start/platforms/ios/xcrun.js.map +1 -1
- package/build/src/start/project/dotExpo.js +5 -0
- package/build/src/start/project/dotExpo.js.map +1 -1
- package/build/src/start/resolveOptions.js +3 -0
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +38 -26
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +29 -2
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/createExpoFallbackResolver.js +6 -4
- package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +2 -2
- package/build/src/start/server/metro/createJResolver.js.map +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +16 -5
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +19 -19
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/externals.js +1 -1
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +13 -8
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +21 -2
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js +15 -12
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +19 -8
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +1 -1
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +7 -12
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/CorsMiddleware.js +1 -1
- package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +4 -8
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +2 -25
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +2 -26
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/utils/build-cache-providers/helpers.js +61 -0
- package/build/src/utils/build-cache-providers/helpers.js.map +1 -0
- package/build/src/utils/build-cache-providers/index.js +283 -0
- package/build/src/utils/build-cache-providers/index.js.map +1 -0
- package/build/src/utils/codesigning.js +14 -2
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/exit.js +0 -1
- package/build/src/utils/exit.js.map +1 -1
- package/build/src/utils/ip.js +7 -104
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/modifyConfigAsync.js +1 -1
- package/build/src/utils/modifyConfigAsync.js.map +1 -1
- package/build/src/utils/resolveArgs.js +8 -0
- package/build/src/utils/resolveArgs.js.map +1 -1
- package/build/src/utils/scheme.js +1 -1
- package/build/src/utils/scheme.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +2 -2
- package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/build/src/utils/tsconfig/evaluateTsConfig.js +7 -2
- package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
- package/build/src/utils/variadic.js +63 -6
- package/build/src/utils/variadic.js.map +1 -1
- package/package.json +20 -20
- package/static/canary/react-is/cjs/react-is.development.js +118 -185
- package/static/canary/react-is/cjs/react-is.production.js +2 -2
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +16582 -26565
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +3495 -3357
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js +3929 -3801
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16869 -27032
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3535 -3428
- package/static/canary/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4198 -4095
- package/static/canary/scheduler/cjs/scheduler-unstable_mock.development.js +387 -684
- package/static/canary/scheduler/cjs/scheduler-unstable_mock.production.js +0 -9
- package/static/canary/scheduler/cjs/scheduler-unstable_post_task.development.js +137 -195
- package/static/canary/scheduler/cjs/scheduler-unstable_post_task.production.js +0 -5
- package/static/canary/scheduler/cjs/scheduler.development.js +339 -600
- package/static/canary/scheduler/cjs/scheduler.native.development.js +324 -512
- package/static/canary/scheduler/cjs/scheduler.native.production.js +6 -5
- package/static/canary/scheduler/cjs/scheduler.production.js +16 -17
- package/static/canary-full/react/cjs/react-compiler-runtime.development.js +13 -68
- package/static/canary-full/react/cjs/react-jsx-dev-runtime.development.js +317 -1251
- package/static/canary-full/react/cjs/react-jsx-dev-runtime.react-server.development.js +353 -1286
- package/static/canary-full/react/cjs/react-jsx-runtime.development.js +326 -1279
- package/static/canary-full/react/cjs/react-jsx-runtime.react-server.development.js +353 -1286
- package/static/canary-full/react/cjs/react.development.js +1204 -2771
- package/static/canary-full/react/cjs/react.production.js +25 -20
- package/static/canary-full/react/cjs/react.react-server.development.js +783 -2162
- package/static/canary-full/react/cjs/react.react-server.production.js +13 -63
- package/static/canary-full/react/package.json +1 -1
- package/static/canary-full/react-dom/cjs/react-dom-client.development.js +24847 -37099
- package/static/canary-full/react-dom/cjs/react-dom-client.production.js +8261 -7475
- package/static/canary-full/react-dom/cjs/react-dom-profiling.development.js +25252 -37571
- package/static/canary-full/react-dom/cjs/react-dom-profiling.profiling.js +9442 -8662
- package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.development.js +8944 -11568
- package/static/canary-full/react-dom/cjs/react-dom-server-legacy.browser.production.js +1378 -944
- package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.development.js +8944 -11568
- package/static/canary-full/react-dom/cjs/react-dom-server-legacy.node.production.js +1386 -954
- package/static/canary-full/react-dom/cjs/react-dom-server.browser.development.js +9344 -11600
- package/static/canary-full/react-dom/cjs/react-dom-server.browser.production.js +1545 -954
- package/static/canary-full/react-dom/cjs/react-dom-server.bun.development.js +8286 -11064
- package/static/canary-full/react-dom/cjs/react-dom-server.bun.production.js +1437 -976
- package/static/canary-full/react-dom/cjs/react-dom-server.edge.development.js +9356 -11609
- package/static/canary-full/react-dom/cjs/react-dom-server.edge.production.js +1542 -970
- package/static/canary-full/react-dom/cjs/react-dom-server.node.development.js +9227 -11571
- package/static/canary-full/react-dom/cjs/react-dom-server.node.production.js +1787 -1183
- package/static/canary-full/react-dom/cjs/react-dom-test-utils.development.js +13 -59
- package/static/canary-full/react-dom/cjs/react-dom.development.js +402 -604
- package/static/canary-full/react-dom/cjs/react-dom.production.js +4 -3
- package/static/canary-full/react-dom/cjs/react-dom.react-server.development.js +322 -382
- package/static/canary-full/react-dom/cjs/react-dom.react-server.production.js +6 -7
- package/static/canary-full/react-dom/package.json +5 -5
- package/static/canary-full/react-dom/static.browser.js +1 -0
- package/static/canary-full/react-dom/static.edge.js +1 -0
- package/static/canary-full/react-dom/static.node.js +1 -0
- package/static/template/eslint.config.js +10 -0
|
@@ -8,1276 +8,342 @@
|
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var enableDebugTracing = false;
|
|
36
|
-
|
|
37
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
|
38
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
39
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
40
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
41
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
42
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
|
43
|
-
|
|
44
|
-
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
|
45
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
46
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
47
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
48
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
49
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
50
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
51
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
52
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
53
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
54
|
-
function getIteratorFn(maybeIterable) {
|
|
55
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
60
|
-
|
|
61
|
-
if (typeof maybeIterator === 'function') {
|
|
62
|
-
return maybeIterator;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
69
|
-
|
|
70
|
-
function error(format) {
|
|
71
|
-
{
|
|
72
|
-
{
|
|
73
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
74
|
-
args[_key2 - 1] = arguments[_key2];
|
|
11
|
+
"use strict";
|
|
12
|
+
"production" !== process.env.NODE_ENV &&
|
|
13
|
+
(function () {
|
|
14
|
+
function getComponentNameFromType(type) {
|
|
15
|
+
if (null == type) return null;
|
|
16
|
+
if ("function" === typeof type)
|
|
17
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
18
|
+
? null
|
|
19
|
+
: type.displayName || type.name || null;
|
|
20
|
+
if ("string" === typeof type) return type;
|
|
21
|
+
switch (type) {
|
|
22
|
+
case REACT_FRAGMENT_TYPE:
|
|
23
|
+
return "Fragment";
|
|
24
|
+
case REACT_PROFILER_TYPE:
|
|
25
|
+
return "Profiler";
|
|
26
|
+
case REACT_STRICT_MODE_TYPE:
|
|
27
|
+
return "StrictMode";
|
|
28
|
+
case REACT_SUSPENSE_TYPE:
|
|
29
|
+
return "Suspense";
|
|
30
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
31
|
+
return "SuspenseList";
|
|
32
|
+
case REACT_ACTIVITY_TYPE:
|
|
33
|
+
return "Activity";
|
|
75
34
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return displayName;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
114
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
115
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
function getContextName(type) {
|
|
119
|
-
return type.displayName || 'Context';
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
123
|
-
|
|
124
|
-
function getComponentNameFromType(type) {
|
|
125
|
-
if (type == null) {
|
|
126
|
-
// Host root, text node or just invalid type.
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (typeof type === 'function') {
|
|
131
|
-
if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
|
|
132
|
-
// TODO: Create a convention for naming client references with debug info.
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return type.displayName || type.name || null;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (typeof type === 'string') {
|
|
140
|
-
return type;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
switch (type) {
|
|
144
|
-
case REACT_FRAGMENT_TYPE:
|
|
145
|
-
return 'Fragment';
|
|
146
|
-
|
|
147
|
-
case REACT_PORTAL_TYPE:
|
|
148
|
-
return 'Portal';
|
|
149
|
-
|
|
150
|
-
case REACT_PROFILER_TYPE:
|
|
151
|
-
return 'Profiler';
|
|
152
|
-
|
|
153
|
-
case REACT_STRICT_MODE_TYPE:
|
|
154
|
-
return 'StrictMode';
|
|
155
|
-
|
|
156
|
-
case REACT_SUSPENSE_TYPE:
|
|
157
|
-
return 'Suspense';
|
|
158
|
-
|
|
159
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
160
|
-
return 'SuspenseList';
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (typeof type === 'object') {
|
|
165
|
-
{
|
|
166
|
-
if (typeof type.tag === 'number') {
|
|
167
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
switch (type.$$typeof) {
|
|
172
|
-
case REACT_PROVIDER_TYPE:
|
|
173
|
-
{
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
case REACT_CONTEXT_TYPE:
|
|
178
|
-
var context = type;
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
return getContextName(context) + '.Provider';
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
case REACT_CONSUMER_TYPE:
|
|
185
|
-
{
|
|
186
|
-
var consumer = type;
|
|
187
|
-
return getContextName(consumer._context) + '.Consumer';
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
case REACT_FORWARD_REF_TYPE:
|
|
191
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
192
|
-
|
|
193
|
-
case REACT_MEMO_TYPE:
|
|
194
|
-
var outerName = type.displayName || null;
|
|
195
|
-
|
|
196
|
-
if (outerName !== null) {
|
|
197
|
-
return outerName;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
201
|
-
|
|
202
|
-
case REACT_LAZY_TYPE:
|
|
203
|
-
{
|
|
204
|
-
var lazyComponent = type;
|
|
205
|
-
var payload = lazyComponent._payload;
|
|
206
|
-
var init = lazyComponent._init;
|
|
207
|
-
|
|
208
|
-
try {
|
|
209
|
-
return getComponentNameFromType(init(payload));
|
|
210
|
-
} catch (x) {
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
35
|
+
if ("object" === typeof type)
|
|
36
|
+
switch (
|
|
37
|
+
("number" === typeof type.tag &&
|
|
38
|
+
console.error(
|
|
39
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
40
|
+
),
|
|
41
|
+
type.$$typeof)
|
|
42
|
+
) {
|
|
43
|
+
case REACT_PORTAL_TYPE:
|
|
44
|
+
return "Portal";
|
|
45
|
+
case REACT_CONTEXT_TYPE:
|
|
46
|
+
return (type.displayName || "Context") + ".Provider";
|
|
47
|
+
case REACT_CONSUMER_TYPE:
|
|
48
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
49
|
+
case REACT_FORWARD_REF_TYPE:
|
|
50
|
+
var innerType = type.render;
|
|
51
|
+
type = type.displayName;
|
|
52
|
+
type ||
|
|
53
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
54
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
55
|
+
return type;
|
|
56
|
+
case REACT_MEMO_TYPE:
|
|
57
|
+
return (
|
|
58
|
+
(innerType = type.displayName || null),
|
|
59
|
+
null !== innerType
|
|
60
|
+
? innerType
|
|
61
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
62
|
+
);
|
|
63
|
+
case REACT_LAZY_TYPE:
|
|
64
|
+
innerType = type._payload;
|
|
65
|
+
type = type._init;
|
|
66
|
+
try {
|
|
67
|
+
return getComponentNameFromType(type(innerType));
|
|
68
|
+
} catch (x) {}
|
|
213
69
|
}
|
|
70
|
+
return null;
|
|
214
71
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// $FlowFixMe[method-unbinding]
|
|
221
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
222
|
-
|
|
223
|
-
var assign = Object.assign;
|
|
224
|
-
|
|
225
|
-
/*
|
|
226
|
-
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
|
227
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
228
|
-
*
|
|
229
|
-
* The functions in this module will throw an easier-to-understand,
|
|
230
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
231
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
232
|
-
* of the `value` object).
|
|
233
|
-
*/
|
|
234
|
-
// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
|
235
|
-
function typeName(value) {
|
|
236
|
-
{
|
|
237
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
238
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
239
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
|
|
240
|
-
|
|
241
|
-
return type;
|
|
242
|
-
}
|
|
243
|
-
} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
function willCoercionThrow(value) {
|
|
247
|
-
{
|
|
248
|
-
try {
|
|
249
|
-
testStringCoercion(value);
|
|
250
|
-
return false;
|
|
251
|
-
} catch (e) {
|
|
252
|
-
return true;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function testStringCoercion(value) {
|
|
258
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
259
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
260
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
261
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
262
|
-
//
|
|
263
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
264
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
265
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
266
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
267
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
268
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
269
|
-
//
|
|
270
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
271
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
272
|
-
//
|
|
273
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
274
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
275
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
276
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
277
|
-
// In most cases, this console output also shows the component and its
|
|
278
|
-
// ancestor components where the exception happened.
|
|
279
|
-
//
|
|
280
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
281
|
-
return '' + value;
|
|
282
|
-
}
|
|
283
|
-
function checkKeyStringCoercion(value) {
|
|
284
|
-
{
|
|
285
|
-
if (willCoercionThrow(value)) {
|
|
286
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
|
|
287
|
-
|
|
288
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference');
|
|
294
|
-
function isValidElementType(type) {
|
|
295
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
296
|
-
return true;
|
|
297
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
|
|
301
|
-
return true;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (typeof type === 'object' && type !== null) {
|
|
305
|
-
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
|
|
306
|
-
// types supported by any Flight configuration anywhere since
|
|
307
|
-
// we don't know which Flight build this will end up being used
|
|
308
|
-
// with.
|
|
309
|
-
type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
|
|
310
|
-
return true;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return false;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
318
|
-
|
|
319
|
-
function isArray(a) {
|
|
320
|
-
return isArrayImpl(a);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
324
|
-
// replaying on render function. This currently only patches the object
|
|
325
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
326
|
-
// We could also eagerly patch the method.
|
|
327
|
-
var disabledDepth = 0;
|
|
328
|
-
var prevLog;
|
|
329
|
-
var prevInfo;
|
|
330
|
-
var prevWarn;
|
|
331
|
-
var prevError;
|
|
332
|
-
var prevGroup;
|
|
333
|
-
var prevGroupCollapsed;
|
|
334
|
-
var prevGroupEnd;
|
|
335
|
-
|
|
336
|
-
function disabledLog() {}
|
|
337
|
-
|
|
338
|
-
disabledLog.__reactDisabledLog = true;
|
|
339
|
-
function disableLogs() {
|
|
340
|
-
{
|
|
341
|
-
if (disabledDepth === 0) {
|
|
342
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
343
|
-
prevLog = console.log;
|
|
344
|
-
prevInfo = console.info;
|
|
345
|
-
prevWarn = console.warn;
|
|
346
|
-
prevError = console.error;
|
|
347
|
-
prevGroup = console.group;
|
|
348
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
349
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
350
|
-
|
|
351
|
-
var props = {
|
|
352
|
-
configurable: true,
|
|
353
|
-
enumerable: true,
|
|
354
|
-
value: disabledLog,
|
|
355
|
-
writable: true
|
|
356
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
|
357
|
-
|
|
358
|
-
Object.defineProperties(console, {
|
|
359
|
-
info: props,
|
|
360
|
-
log: props,
|
|
361
|
-
warn: props,
|
|
362
|
-
error: props,
|
|
363
|
-
group: props,
|
|
364
|
-
groupCollapsed: props,
|
|
365
|
-
groupEnd: props
|
|
366
|
-
});
|
|
367
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
disabledDepth++;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
function reenableLogs() {
|
|
374
|
-
{
|
|
375
|
-
disabledDepth--;
|
|
376
|
-
|
|
377
|
-
if (disabledDepth === 0) {
|
|
378
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
379
|
-
var props = {
|
|
380
|
-
configurable: true,
|
|
381
|
-
enumerable: true,
|
|
382
|
-
writable: true
|
|
383
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
|
384
|
-
|
|
385
|
-
Object.defineProperties(console, {
|
|
386
|
-
log: assign({}, props, {
|
|
387
|
-
value: prevLog
|
|
388
|
-
}),
|
|
389
|
-
info: assign({}, props, {
|
|
390
|
-
value: prevInfo
|
|
391
|
-
}),
|
|
392
|
-
warn: assign({}, props, {
|
|
393
|
-
value: prevWarn
|
|
394
|
-
}),
|
|
395
|
-
error: assign({}, props, {
|
|
396
|
-
value: prevError
|
|
397
|
-
}),
|
|
398
|
-
group: assign({}, props, {
|
|
399
|
-
value: prevGroup
|
|
400
|
-
}),
|
|
401
|
-
groupCollapsed: assign({}, props, {
|
|
402
|
-
value: prevGroupCollapsed
|
|
403
|
-
}),
|
|
404
|
-
groupEnd: assign({}, props, {
|
|
405
|
-
value: prevGroupEnd
|
|
406
|
-
})
|
|
407
|
-
});
|
|
408
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
if (disabledDepth < 0) {
|
|
412
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
72
|
+
function testStringCoercion(value) {
|
|
73
|
+
return "" + value;
|
|
413
74
|
}
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
var prefix;
|
|
418
|
-
function describeBuiltInComponentFrame(name) {
|
|
419
|
-
{
|
|
420
|
-
if (prefix === undefined) {
|
|
421
|
-
// Extract the VM specific prefix used by each line.
|
|
75
|
+
function checkKeyStringCoercion(value) {
|
|
422
76
|
try {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
77
|
+
testStringCoercion(value);
|
|
78
|
+
var JSCompiler_inline_result = !1;
|
|
79
|
+
} catch (e) {
|
|
80
|
+
JSCompiler_inline_result = !0;
|
|
427
81
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
* filename, line + col number) for a single component in a component stack. We
|
|
444
|
-
* do this by:
|
|
445
|
-
* (1) throwing and catching an error in the function - this will be our
|
|
446
|
-
* control error.
|
|
447
|
-
* (2) calling the component which will eventually throw an error that we'll
|
|
448
|
-
* catch - this will be our sample error.
|
|
449
|
-
* (3) diffing the control and sample error stacks to find the stack frame
|
|
450
|
-
* which represents our component.
|
|
451
|
-
*/
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
455
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
456
|
-
if (!fn || reentry) {
|
|
457
|
-
return '';
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
{
|
|
461
|
-
var frame = componentFrameCache.get(fn);
|
|
462
|
-
|
|
463
|
-
if (frame !== undefined) {
|
|
464
|
-
return frame;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
reentry = true;
|
|
469
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
|
|
470
|
-
|
|
471
|
-
Error.prepareStackTrace = undefined;
|
|
472
|
-
var previousDispatcher = null;
|
|
473
|
-
|
|
474
|
-
{
|
|
475
|
-
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
|
|
476
|
-
// for warnings.
|
|
477
|
-
|
|
478
|
-
ReactSharedInternals.H = null;
|
|
479
|
-
disableLogs();
|
|
480
|
-
}
|
|
481
|
-
/**
|
|
482
|
-
* Finding a common stack frame between sample and control errors can be
|
|
483
|
-
* tricky given the different types and levels of stack trace truncation from
|
|
484
|
-
* different JS VMs. So instead we'll attempt to control what that common
|
|
485
|
-
* frame should be through this object method:
|
|
486
|
-
* Having both the sample and control errors be in the function under the
|
|
487
|
-
* `DescribeNativeComponentFrameRoot` property, + setting the `name` and
|
|
488
|
-
* `displayName` properties of the function ensures that a stack
|
|
489
|
-
* frame exists that has the method name `DescribeNativeComponentFrameRoot` in
|
|
490
|
-
* it for both control and sample stacks.
|
|
491
|
-
*/
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var RunInRootFrame = {
|
|
495
|
-
DetermineComponentFrameRoot: function () {
|
|
496
|
-
var control;
|
|
497
|
-
|
|
498
|
-
try {
|
|
499
|
-
// This should throw.
|
|
500
|
-
if (construct) {
|
|
501
|
-
// Something should be setting the props in the constructor.
|
|
502
|
-
var Fake = function () {
|
|
503
|
-
throw Error();
|
|
504
|
-
}; // $FlowFixMe[prop-missing]
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
508
|
-
set: function () {
|
|
509
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
510
|
-
// because that won't throw in a non-strict mode function.
|
|
511
|
-
throw Error();
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
516
|
-
// We construct a different control for this case to include any extra
|
|
517
|
-
// frames added by the construct call.
|
|
518
|
-
try {
|
|
519
|
-
Reflect.construct(Fake, []);
|
|
520
|
-
} catch (x) {
|
|
521
|
-
control = x;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
Reflect.construct(fn, [], Fake);
|
|
525
|
-
} else {
|
|
526
|
-
try {
|
|
527
|
-
Fake.call();
|
|
528
|
-
} catch (x) {
|
|
529
|
-
control = x;
|
|
530
|
-
} // $FlowFixMe[prop-missing] found when upgrading Flow
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
fn.call(Fake.prototype);
|
|
534
|
-
}
|
|
535
|
-
} else {
|
|
536
|
-
try {
|
|
537
|
-
throw Error();
|
|
538
|
-
} catch (x) {
|
|
539
|
-
control = x;
|
|
540
|
-
} // TODO(luna): This will currently only throw if the function component
|
|
541
|
-
// tries to access React/ReactDOM/props. We should probably make this throw
|
|
542
|
-
// in simple components too
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
var maybePromise = fn(); // If the function component returns a promise, it's likely an async
|
|
546
|
-
// component, which we don't yet support. Attach a noop catch handler to
|
|
547
|
-
// silence the error.
|
|
548
|
-
// TODO: Implement component stacks for async client components?
|
|
549
|
-
|
|
550
|
-
if (maybePromise && typeof maybePromise.catch === 'function') {
|
|
551
|
-
maybePromise.catch(function () {});
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
} catch (sample) {
|
|
555
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
556
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
557
|
-
return [sample.stack, control.stack];
|
|
558
|
-
}
|
|
82
|
+
if (JSCompiler_inline_result) {
|
|
83
|
+
JSCompiler_inline_result = console;
|
|
84
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
85
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
86
|
+
("function" === typeof Symbol &&
|
|
87
|
+
Symbol.toStringTag &&
|
|
88
|
+
value[Symbol.toStringTag]) ||
|
|
89
|
+
value.constructor.name ||
|
|
90
|
+
"Object";
|
|
91
|
+
JSCompiler_temp_const.call(
|
|
92
|
+
JSCompiler_inline_result,
|
|
93
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
+
JSCompiler_inline_result$jscomp$0
|
|
95
|
+
);
|
|
96
|
+
return testStringCoercion(value);
|
|
559
97
|
}
|
|
560
|
-
|
|
561
|
-
return [null, null];
|
|
562
98
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
try {
|
|
579
|
-
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
|
|
580
|
-
sampleStack = _RunInRootFrame$Deter[0],
|
|
581
|
-
controlStack = _RunInRootFrame$Deter[1];
|
|
582
|
-
|
|
583
|
-
if (sampleStack && controlStack) {
|
|
584
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
585
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
586
|
-
var sampleLines = sampleStack.split('\n');
|
|
587
|
-
var controlLines = controlStack.split('\n');
|
|
588
|
-
var s = 0;
|
|
589
|
-
var c = 0;
|
|
590
|
-
|
|
591
|
-
while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
|
|
592
|
-
s++;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
|
|
596
|
-
c++;
|
|
597
|
-
} // We couldn't find our intentionally injected common root frame, attempt
|
|
598
|
-
// to find another common root frame by search from the bottom of the
|
|
599
|
-
// control stack...
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (s === sampleLines.length || c === controlLines.length) {
|
|
603
|
-
s = sampleLines.length - 1;
|
|
604
|
-
c = controlLines.length - 1;
|
|
605
|
-
|
|
606
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
607
|
-
// We expect at least one stack frame to be shared.
|
|
608
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
609
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
610
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
611
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
612
|
-
// the sample somewhere in the control.
|
|
613
|
-
c--;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
618
|
-
// Next we find the first one that isn't the same which should be the
|
|
619
|
-
// frame that called our sample function and the control.
|
|
620
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
621
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
622
|
-
// If we're about to return the first line, and the control is also on the same
|
|
623
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
624
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
625
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
626
|
-
if (s !== 1 || c !== 1) {
|
|
627
|
-
do {
|
|
628
|
-
s--;
|
|
629
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
630
|
-
// The next one that isn't the same should be our match though.
|
|
631
|
-
|
|
632
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
633
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
634
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
635
|
-
// but we have a user-provided "displayName"
|
|
636
|
-
// splice it in to make the stack more readable.
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
640
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
if (true) {
|
|
644
|
-
if (typeof fn === 'function') {
|
|
645
|
-
componentFrameCache.set(fn, _frame);
|
|
646
|
-
}
|
|
647
|
-
} // Return the line we found.
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
return _frame;
|
|
651
|
-
}
|
|
652
|
-
} while (s >= 1 && c >= 0);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
99
|
+
function getTaskName(type) {
|
|
100
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
101
|
+
if (
|
|
102
|
+
"object" === typeof type &&
|
|
103
|
+
null !== type &&
|
|
104
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
105
|
+
)
|
|
106
|
+
return "<...>";
|
|
107
|
+
try {
|
|
108
|
+
var name = getComponentNameFromType(type);
|
|
109
|
+
return name ? "<" + name + ">" : "<...>";
|
|
110
|
+
} catch (x) {
|
|
111
|
+
return "<...>";
|
|
657
112
|
}
|
|
658
113
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
{
|
|
663
|
-
ReactSharedInternals.H = previousDispatcher;
|
|
664
|
-
reenableLogs();
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
668
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
672
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
673
|
-
|
|
674
|
-
{
|
|
675
|
-
if (typeof fn === 'function') {
|
|
676
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
114
|
+
function getOwner() {
|
|
115
|
+
var dispatcher = ReactSharedInternals.A;
|
|
116
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
677
117
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return syntheticFrame;
|
|
681
|
-
}
|
|
682
|
-
function describeFunctionComponentFrame(fn) {
|
|
683
|
-
{
|
|
684
|
-
return describeNativeComponentFrame(fn, false);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function shouldConstruct(Component) {
|
|
689
|
-
var prototype = Component.prototype;
|
|
690
|
-
return !!(prototype && prototype.isReactComponent);
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
function describeUnknownElementTypeFrameInDEV(type) {
|
|
694
|
-
|
|
695
|
-
if (type == null) {
|
|
696
|
-
return '';
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
if (typeof type === 'function') {
|
|
700
|
-
{
|
|
701
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
118
|
+
function UnknownOwner() {
|
|
119
|
+
return Error("react-stack-top-frame");
|
|
702
120
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
switch (type) {
|
|
710
|
-
case REACT_SUSPENSE_TYPE:
|
|
711
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
712
|
-
|
|
713
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
714
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if (typeof type === 'object') {
|
|
718
|
-
switch (type.$$typeof) {
|
|
719
|
-
case REACT_FORWARD_REF_TYPE:
|
|
720
|
-
return describeFunctionComponentFrame(type.render);
|
|
721
|
-
|
|
722
|
-
case REACT_MEMO_TYPE:
|
|
723
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
724
|
-
return describeUnknownElementTypeFrameInDEV(type.type);
|
|
725
|
-
|
|
726
|
-
case REACT_LAZY_TYPE:
|
|
727
|
-
{
|
|
728
|
-
var lazyComponent = type;
|
|
729
|
-
var payload = lazyComponent._payload;
|
|
730
|
-
var init = lazyComponent._init;
|
|
731
|
-
|
|
732
|
-
try {
|
|
733
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
734
|
-
return describeUnknownElementTypeFrameInDEV(init(payload));
|
|
735
|
-
} catch (x) {}
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
return '';
|
|
741
|
-
}
|
|
742
|
-
|
|
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
|
-
|
|
757
|
-
var specialPropKeyWarningShown;
|
|
758
|
-
var didWarnAboutElementRef;
|
|
759
|
-
|
|
760
|
-
{
|
|
761
|
-
didWarnAboutElementRef = {};
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
function hasValidRef(config) {
|
|
765
|
-
{
|
|
766
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
767
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
768
|
-
|
|
769
|
-
if (getter && getter.isReactWarning) {
|
|
770
|
-
return false;
|
|
121
|
+
function hasValidKey(config) {
|
|
122
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
123
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
124
|
+
if (getter && getter.isReactWarning) return !1;
|
|
771
125
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
if (getter && getter.isReactWarning) {
|
|
784
|
-
return false;
|
|
126
|
+
return void 0 !== config.key;
|
|
127
|
+
}
|
|
128
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
129
|
+
function warnAboutAccessingKey() {
|
|
130
|
+
specialPropKeyWarningShown ||
|
|
131
|
+
((specialPropKeyWarningShown = !0),
|
|
132
|
+
console.error(
|
|
133
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
134
|
+
displayName
|
|
135
|
+
));
|
|
785
136
|
}
|
|
137
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
|
138
|
+
Object.defineProperty(props, "key", {
|
|
139
|
+
get: warnAboutAccessingKey,
|
|
140
|
+
configurable: !0
|
|
141
|
+
});
|
|
786
142
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
828
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
829
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
|
|
830
|
-
* if something is a React Element.
|
|
831
|
-
*
|
|
832
|
-
* @param {*} type
|
|
833
|
-
* @param {*} props
|
|
834
|
-
* @param {*} key
|
|
835
|
-
* @param {string|object} ref
|
|
836
|
-
* @param {*} owner
|
|
837
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
838
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
839
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
840
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
841
|
-
* change in behavior.
|
|
842
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
843
|
-
* indicating filename, line number, and/or other information.
|
|
844
|
-
* @internal
|
|
845
|
-
*/
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
function ReactElement(type, key, _ref, self, source, owner, props) {
|
|
849
|
-
var ref;
|
|
850
|
-
|
|
851
|
-
{
|
|
852
|
-
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
|
853
|
-
// argument and treat `props.ref` as the source of truth. The only thing we
|
|
854
|
-
// use this for is `element.ref`, which will log a deprecation warning on
|
|
855
|
-
// access. In the next release, we can remove `element.ref` as well as the
|
|
856
|
-
// `ref` argument.
|
|
857
|
-
var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
|
858
|
-
// backwards compatibility.
|
|
859
|
-
|
|
860
|
-
ref = refProp !== undefined ? refProp : null;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
var element;
|
|
864
|
-
|
|
865
|
-
{
|
|
866
|
-
// In dev, make `ref` a non-enumerable property with a warning. It's non-
|
|
867
|
-
// enumerable so that test matchers and serializers don't access it and
|
|
868
|
-
// trigger the warning.
|
|
869
|
-
//
|
|
870
|
-
// `ref` will be removed from the element completely in a future release.
|
|
871
|
-
element = {
|
|
872
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
873
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
874
|
-
// Built-in properties that belong on the element
|
|
875
|
-
type: type,
|
|
876
|
-
key: key,
|
|
877
|
-
props: props,
|
|
878
|
-
// Record the component responsible for creating this element.
|
|
879
|
-
_owner: owner
|
|
880
|
-
};
|
|
881
|
-
|
|
882
|
-
if (ref !== null) {
|
|
883
|
-
Object.defineProperty(element, 'ref', {
|
|
884
|
-
enumerable: false,
|
|
885
|
-
get: elementRefGetterWithDeprecationWarning
|
|
143
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
144
|
+
var componentName = getComponentNameFromType(this.type);
|
|
145
|
+
didWarnAboutElementRef[componentName] ||
|
|
146
|
+
((didWarnAboutElementRef[componentName] = !0),
|
|
147
|
+
console.error(
|
|
148
|
+
"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."
|
|
149
|
+
));
|
|
150
|
+
componentName = this.props.ref;
|
|
151
|
+
return void 0 !== componentName ? componentName : null;
|
|
152
|
+
}
|
|
153
|
+
function ReactElement(
|
|
154
|
+
type,
|
|
155
|
+
key,
|
|
156
|
+
self,
|
|
157
|
+
source,
|
|
158
|
+
owner,
|
|
159
|
+
props,
|
|
160
|
+
debugStack,
|
|
161
|
+
debugTask
|
|
162
|
+
) {
|
|
163
|
+
self = props.ref;
|
|
164
|
+
type = {
|
|
165
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
166
|
+
type: type,
|
|
167
|
+
key: key,
|
|
168
|
+
props: props,
|
|
169
|
+
_owner: owner
|
|
170
|
+
};
|
|
171
|
+
null !== (void 0 !== self ? self : null)
|
|
172
|
+
? Object.defineProperty(type, "ref", {
|
|
173
|
+
enumerable: !1,
|
|
174
|
+
get: elementRefGetterWithDeprecationWarning
|
|
175
|
+
})
|
|
176
|
+
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
|
|
177
|
+
type._store = {};
|
|
178
|
+
Object.defineProperty(type._store, "validated", {
|
|
179
|
+
configurable: !1,
|
|
180
|
+
enumerable: !1,
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: 0
|
|
886
183
|
});
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
// a problem because it bypasses non-enumerability.
|
|
892
|
-
//
|
|
893
|
-
// So unfortunately this will trigger a false positive warning in Jest
|
|
894
|
-
// when the diff is printed:
|
|
895
|
-
//
|
|
896
|
-
// expect(<div ref={ref} />).toEqual(<span ref={ref} />);
|
|
897
|
-
//
|
|
898
|
-
// A bit sketchy, but this is what we've done for the `props.key` and
|
|
899
|
-
// `props.ref` accessors for years, which implies it will be good enough
|
|
900
|
-
// for `element.ref`, too. Let's see if anyone complains.
|
|
901
|
-
Object.defineProperty(element, 'ref', {
|
|
902
|
-
enumerable: false,
|
|
184
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
185
|
+
configurable: !1,
|
|
186
|
+
enumerable: !1,
|
|
187
|
+
writable: !0,
|
|
903
188
|
value: null
|
|
904
189
|
});
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
// an external backing store so that we can freeze the whole object.
|
|
911
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
912
|
-
// commonly used development environments.
|
|
913
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
914
|
-
// the validation flag non-enumerable (where possible, which should
|
|
915
|
-
// include every environment we run tests in), so the test framework
|
|
916
|
-
// ignores it.
|
|
917
|
-
|
|
918
|
-
Object.defineProperty(element._store, 'validated', {
|
|
919
|
-
configurable: false,
|
|
920
|
-
enumerable: false,
|
|
921
|
-
writable: true,
|
|
922
|
-
value: false
|
|
923
|
-
}); // debugInfo contains Server Component debug information.
|
|
924
|
-
|
|
925
|
-
Object.defineProperty(element, '_debugInfo', {
|
|
926
|
-
configurable: false,
|
|
927
|
-
enumerable: false,
|
|
928
|
-
writable: true,
|
|
929
|
-
value: null
|
|
930
|
-
});
|
|
931
|
-
|
|
932
|
-
if (Object.freeze) {
|
|
933
|
-
Object.freeze(element.props);
|
|
934
|
-
Object.freeze(element);
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
return element;
|
|
939
|
-
}
|
|
940
|
-
var didWarnAboutKeySpread = {};
|
|
941
|
-
/**
|
|
942
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
943
|
-
* @param {*} type
|
|
944
|
-
* @param {object} props
|
|
945
|
-
* @param {string} key
|
|
946
|
-
*/
|
|
947
|
-
|
|
948
|
-
function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
|
|
949
|
-
{
|
|
950
|
-
if (!isValidElementType(type)) {
|
|
951
|
-
// This is an invalid element type.
|
|
952
|
-
//
|
|
953
|
-
// We warn in this case but don't throw. We expect the element creation to
|
|
954
|
-
// succeed and there will likely be errors in render.
|
|
955
|
-
var info = '';
|
|
956
|
-
|
|
957
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
958
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
var typeString;
|
|
962
|
-
|
|
963
|
-
if (type === null) {
|
|
964
|
-
typeString = 'null';
|
|
965
|
-
} else if (isArray(type)) {
|
|
966
|
-
typeString = 'array';
|
|
967
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
968
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
969
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
970
|
-
} else {
|
|
971
|
-
typeString = typeof type;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
975
|
-
} else {
|
|
976
|
-
// This is a valid element type.
|
|
977
|
-
// Skip key warning if the type isn't valid since our key validation logic
|
|
978
|
-
// doesn't expect a non-string/function type and can throw confusing
|
|
979
|
-
// errors. We don't want exception behavior to differ between dev and
|
|
980
|
-
// prod. (Rendering will throw with a helpful message and as soon as the
|
|
981
|
-
// type is fixed, the key warnings will appear.)
|
|
982
|
-
var children = config.children;
|
|
983
|
-
|
|
984
|
-
if (children !== undefined) {
|
|
985
|
-
if (isStaticChildren) {
|
|
986
|
-
if (isArray(children)) {
|
|
987
|
-
for (var i = 0; i < children.length; i++) {
|
|
988
|
-
validateChildKeys(children[i], type);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
if (Object.freeze) {
|
|
992
|
-
Object.freeze(children);
|
|
993
|
-
}
|
|
994
|
-
} else {
|
|
995
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
996
|
-
}
|
|
997
|
-
} else {
|
|
998
|
-
validateChildKeys(children, type);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
} // Warn about key spread regardless of whether the type is valid.
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
1005
|
-
var componentName = getComponentNameFromType(type);
|
|
1006
|
-
var keys = Object.keys(config).filter(function (k) {
|
|
1007
|
-
return k !== 'key';
|
|
190
|
+
Object.defineProperty(type, "_debugStack", {
|
|
191
|
+
configurable: !1,
|
|
192
|
+
enumerable: !1,
|
|
193
|
+
writable: !0,
|
|
194
|
+
value: debugStack
|
|
1008
195
|
});
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
for (var propName in config) {
|
|
1066
|
-
// Skip over reserved prop names
|
|
1067
|
-
if (propName !== 'key' && (enableRefAsProp )) {
|
|
1068
|
-
{
|
|
1069
|
-
props[propName] = config[propName];
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (key || !enableRefAsProp ) {
|
|
1076
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
1077
|
-
|
|
1078
|
-
if (key) {
|
|
1079
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
var element = ReactElement(type, key, ref, self, source, getOwner(), props);
|
|
1084
|
-
|
|
1085
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1086
|
-
validateFragmentProps(element);
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
return element;
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
function getDeclarationErrorAddendum() {
|
|
1094
|
-
{
|
|
1095
|
-
var owner = getOwner();
|
|
1096
|
-
|
|
1097
|
-
if (owner) {
|
|
1098
|
-
var name = getComponentNameFromType(owner.type);
|
|
1099
|
-
|
|
1100
|
-
if (name) {
|
|
1101
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
return '';
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
/**
|
|
1109
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1110
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1111
|
-
* with valid key property.
|
|
1112
|
-
*
|
|
1113
|
-
* @internal
|
|
1114
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1115
|
-
* @param {*} parentType node's parent's type.
|
|
1116
|
-
*/
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
function validateChildKeys(node, parentType) {
|
|
1120
|
-
{
|
|
1121
|
-
if (typeof node !== 'object' || !node) {
|
|
1122
|
-
return;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
|
|
1126
|
-
for (var i = 0; i < node.length; i++) {
|
|
1127
|
-
var child = node[i];
|
|
1128
|
-
|
|
1129
|
-
if (isValidElement(child)) {
|
|
1130
|
-
validateExplicitKey(child, parentType);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
} else if (isValidElement(node)) {
|
|
1134
|
-
// This element was passed in a valid location.
|
|
1135
|
-
if (node._store) {
|
|
1136
|
-
node._store.validated = true;
|
|
1137
|
-
}
|
|
1138
|
-
} else {
|
|
1139
|
-
var iteratorFn = getIteratorFn(node);
|
|
1140
|
-
|
|
1141
|
-
if (typeof iteratorFn === 'function') {
|
|
1142
|
-
// Entry iterators used to provide implicit keys,
|
|
1143
|
-
// but now we print a separate warning for them later.
|
|
1144
|
-
if (iteratorFn !== node.entries) {
|
|
1145
|
-
var iterator = iteratorFn.call(node);
|
|
1146
|
-
|
|
1147
|
-
if (iterator !== node) {
|
|
1148
|
-
var step;
|
|
1149
|
-
|
|
1150
|
-
while (!(step = iterator.next()).done) {
|
|
1151
|
-
if (isValidElement(step.value)) {
|
|
1152
|
-
validateExplicitKey(step.value, parentType);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
/**
|
|
1162
|
-
* Verifies the object is a ReactElement.
|
|
1163
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1164
|
-
* @param {?object} object
|
|
1165
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
1166
|
-
* @final
|
|
1167
|
-
*/
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
function isValidElement(object) {
|
|
1171
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1172
|
-
}
|
|
1173
|
-
var ownerHasKeyUseWarning = {};
|
|
1174
|
-
/**
|
|
1175
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1176
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1177
|
-
* reordered. All children that haven't already been validated are required to
|
|
1178
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1179
|
-
* will only be shown once.
|
|
1180
|
-
*
|
|
1181
|
-
* @internal
|
|
1182
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1183
|
-
* @param {*} parentType element's parent's type.
|
|
1184
|
-
*/
|
|
1185
|
-
|
|
1186
|
-
function validateExplicitKey(element, parentType) {
|
|
1187
|
-
{
|
|
1188
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
element._store.validated = true;
|
|
1193
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1194
|
-
|
|
1195
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1196
|
-
return;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1200
|
-
// property, it may be the creator of the child that's responsible for
|
|
1201
|
-
// assigning it a key.
|
|
1202
|
-
|
|
1203
|
-
var childOwner = '';
|
|
1204
|
-
|
|
1205
|
-
if (element && element._owner != null && element._owner !== getOwner()) {
|
|
1206
|
-
var ownerName = null;
|
|
1207
|
-
|
|
1208
|
-
if (typeof element._owner.tag === 'number') {
|
|
1209
|
-
ownerName = getComponentNameFromType(element._owner.type);
|
|
1210
|
-
} else if (typeof element._owner.name === 'string') {
|
|
1211
|
-
ownerName = element._owner.name;
|
|
1212
|
-
} // Give the component that originally created this child.
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
childOwner = " It was passed a child from " + ownerName + ".";
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
setCurrentlyValidatingElement(element);
|
|
1219
|
-
|
|
1220
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1221
|
-
|
|
1222
|
-
setCurrentlyValidatingElement(null);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
function setCurrentlyValidatingElement(element) {
|
|
1227
|
-
{
|
|
1228
|
-
if (element) {
|
|
1229
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
|
1230
|
-
ReactSharedInternals.setExtraStackFrame(stack);
|
|
1231
|
-
} else {
|
|
1232
|
-
ReactSharedInternals.setExtraStackFrame(null);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1238
|
-
{
|
|
1239
|
-
var info = getDeclarationErrorAddendum();
|
|
1240
|
-
|
|
1241
|
-
if (!info) {
|
|
1242
|
-
var parentName = getComponentNameFromType(parentType);
|
|
1243
|
-
|
|
1244
|
-
if (parentName) {
|
|
1245
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
196
|
+
Object.defineProperty(type, "_debugTask", {
|
|
197
|
+
configurable: !1,
|
|
198
|
+
enumerable: !1,
|
|
199
|
+
writable: !0,
|
|
200
|
+
value: debugTask
|
|
201
|
+
});
|
|
202
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
203
|
+
return type;
|
|
204
|
+
}
|
|
205
|
+
function jsxDEVImpl(
|
|
206
|
+
type,
|
|
207
|
+
config,
|
|
208
|
+
maybeKey,
|
|
209
|
+
isStaticChildren,
|
|
210
|
+
source,
|
|
211
|
+
self,
|
|
212
|
+
debugStack,
|
|
213
|
+
debugTask
|
|
214
|
+
) {
|
|
215
|
+
var children = config.children;
|
|
216
|
+
if (void 0 !== children)
|
|
217
|
+
if (isStaticChildren)
|
|
218
|
+
if (isArrayImpl(children)) {
|
|
219
|
+
for (
|
|
220
|
+
isStaticChildren = 0;
|
|
221
|
+
isStaticChildren < children.length;
|
|
222
|
+
isStaticChildren++
|
|
223
|
+
)
|
|
224
|
+
validateChildKeys(children[isStaticChildren]);
|
|
225
|
+
Object.freeze && Object.freeze(children);
|
|
226
|
+
} else
|
|
227
|
+
console.error(
|
|
228
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
229
|
+
);
|
|
230
|
+
else validateChildKeys(children);
|
|
231
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
232
|
+
children = getComponentNameFromType(type);
|
|
233
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
234
|
+
return "key" !== k;
|
|
235
|
+
});
|
|
236
|
+
isStaticChildren =
|
|
237
|
+
0 < keys.length
|
|
238
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
239
|
+
: "{key: someKey}";
|
|
240
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
241
|
+
((keys =
|
|
242
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
243
|
+
console.error(
|
|
244
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
245
|
+
isStaticChildren,
|
|
246
|
+
children,
|
|
247
|
+
keys,
|
|
248
|
+
children
|
|
249
|
+
),
|
|
250
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = !0));
|
|
1246
251
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
252
|
+
children = null;
|
|
253
|
+
void 0 !== maybeKey &&
|
|
254
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
255
|
+
hasValidKey(config) &&
|
|
256
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
257
|
+
if ("key" in config) {
|
|
258
|
+
maybeKey = {};
|
|
259
|
+
for (var propName in config)
|
|
260
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
261
|
+
} else maybeKey = config;
|
|
262
|
+
children &&
|
|
263
|
+
defineKeyPropWarningGetter(
|
|
264
|
+
maybeKey,
|
|
265
|
+
"function" === typeof type
|
|
266
|
+
? type.displayName || type.name || "Unknown"
|
|
267
|
+
: type
|
|
268
|
+
);
|
|
269
|
+
return ReactElement(
|
|
270
|
+
type,
|
|
271
|
+
children,
|
|
272
|
+
self,
|
|
273
|
+
source,
|
|
274
|
+
getOwner(),
|
|
275
|
+
maybeKey,
|
|
276
|
+
debugStack,
|
|
277
|
+
debugTask
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
function validateChildKeys(node) {
|
|
281
|
+
"object" === typeof node &&
|
|
282
|
+
null !== node &&
|
|
283
|
+
node.$$typeof === REACT_ELEMENT_TYPE &&
|
|
284
|
+
node._store &&
|
|
285
|
+
(node._store.validated = 1);
|
|
286
|
+
}
|
|
287
|
+
var React = require("react"),
|
|
288
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
289
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
290
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
291
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
292
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
293
|
+
Symbol.for("react.provider");
|
|
294
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
295
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
296
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
297
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
298
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
299
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
300
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
301
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
302
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
303
|
+
ReactSharedInternals =
|
|
304
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
305
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
306
|
+
isArrayImpl = Array.isArray,
|
|
307
|
+
createTask = console.createTask
|
|
308
|
+
? console.createTask
|
|
309
|
+
: function () {
|
|
310
|
+
return null;
|
|
311
|
+
};
|
|
312
|
+
React = {
|
|
313
|
+
"react-stack-bottom-frame": function (callStackForError) {
|
|
314
|
+
return callStackForError();
|
|
1273
315
|
}
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
316
|
+
};
|
|
317
|
+
var specialPropKeyWarningShown;
|
|
318
|
+
var didWarnAboutElementRef = {};
|
|
319
|
+
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
|
320
|
+
React,
|
|
321
|
+
UnknownOwner
|
|
322
|
+
)();
|
|
323
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
324
|
+
var didWarnAboutKeySpread = {};
|
|
325
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
326
|
+
exports.jsxDEV = function (
|
|
327
|
+
type,
|
|
328
|
+
config,
|
|
329
|
+
maybeKey,
|
|
330
|
+
isStaticChildren,
|
|
331
|
+
source,
|
|
332
|
+
self
|
|
333
|
+
) {
|
|
334
|
+
var trackActualOwner =
|
|
335
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
336
|
+
return jsxDEVImpl(
|
|
337
|
+
type,
|
|
338
|
+
config,
|
|
339
|
+
maybeKey,
|
|
340
|
+
isStaticChildren,
|
|
341
|
+
source,
|
|
342
|
+
self,
|
|
343
|
+
trackActualOwner
|
|
344
|
+
? Error("react-stack-top-frame")
|
|
345
|
+
: unknownOwnerDebugStack,
|
|
346
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
347
|
+
);
|
|
348
|
+
};
|
|
1282
349
|
})();
|
|
1283
|
-
}
|