react 0.0.0-experimental-d7382b6c4 → 0.0.0-experimental-4c8c98ab9
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/build-info.json +4 -4
- package/cjs/react-jsx-dev-runtime.development.js +461 -57
- package/cjs/react-jsx-dev-runtime.production.min.js +2 -3
- package/cjs/react-jsx-dev-runtime.profiling.min.js +2 -3
- package/cjs/react-jsx-runtime.development.js +461 -57
- package/cjs/react-jsx-runtime.production.min.js +3 -4
- package/cjs/react-jsx-runtime.profiling.min.js +3 -4
- package/cjs/react-unstable-cache.development.js +52 -0
- package/cjs/react-unstable-cache.production.min.js +10 -0
- package/cjs/react-unstable-cache.profiling.min.js +10 -0
- package/cjs/react.development.js +609 -213
- package/cjs/react.production.min.js +20 -19
- package/package.json +3 -2
- package/umd/react.development.js +629 -240
- package/umd/react.production.min.js +26 -26
- package/umd/react.profiling.min.js +33 -32
- package/unstable-cache.js +7 -0
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "181514",
|
|
4
|
+
"checksum": "1b37e19",
|
|
5
|
+
"commit": "4c8c98ab9",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "
|
|
7
|
+
"reactVersion": "17.0.0-alpha.0-experimental-4c8c98ab9"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-4c8c98ab9
|
|
2
2
|
* react-jsx-dev-runtime.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,35 +9,65 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
12
|
if (process.env.NODE_ENV !== "production") {
|
|
15
13
|
(function() {
|
|
16
14
|
'use strict';
|
|
17
15
|
|
|
18
16
|
var React = require('react');
|
|
17
|
+
var _assign = require('object-assign');
|
|
19
18
|
|
|
19
|
+
// ATTENTION
|
|
20
|
+
// When adding new symbols to this file,
|
|
21
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
20
22
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
21
23
|
// nor polyfill, then a plain number is used for performance.
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
24
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
25
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
26
|
+
exports.Fragment = 0xeacb;
|
|
27
|
+
var REACT_STRICT_MODE_TYPE = 0xeacc;
|
|
28
|
+
var REACT_PROFILER_TYPE = 0xead2;
|
|
29
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
30
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
31
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
32
|
+
var REACT_SUSPENSE_TYPE = 0xead1;
|
|
33
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
34
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
35
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
36
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
37
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
38
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
39
|
+
var REACT_RESPONDER_TYPE = 0xead6;
|
|
40
|
+
var REACT_SCOPE_TYPE = 0xead7;
|
|
41
|
+
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
42
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
43
|
+
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
44
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
45
|
+
|
|
46
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
47
|
+
var symbolFor = Symbol.for;
|
|
48
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
49
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
50
|
+
exports.Fragment = symbolFor('react.fragment');
|
|
51
|
+
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
52
|
+
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
53
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
54
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
55
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
56
|
+
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
57
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
58
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
59
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
60
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
61
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
62
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
63
|
+
REACT_RESPONDER_TYPE = symbolFor('react.responder');
|
|
64
|
+
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
65
|
+
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
66
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
67
|
+
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
68
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
69
|
+
}
|
|
70
|
+
|
|
41
71
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
42
72
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
43
73
|
function getIteratorFn(maybeIterable) {
|
|
@@ -70,16 +100,12 @@ function printWarning(level, format, args) {
|
|
|
70
100
|
// When changing this logic, you might want to also
|
|
71
101
|
// update consoleWithStackDev.www.js as well.
|
|
72
102
|
{
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
if (!hasExistingStack) {
|
|
76
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
77
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
103
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
104
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
78
105
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
106
|
+
if (stack !== '') {
|
|
107
|
+
format += '%s';
|
|
108
|
+
args = args.concat([stack]);
|
|
83
109
|
}
|
|
84
110
|
|
|
85
111
|
var argsWithFormat = args.map(function (item) {
|
|
@@ -91,23 +117,30 @@ function printWarning(level, format, args) {
|
|
|
91
117
|
// eslint-disable-next-line react-internal/no-production-logging
|
|
92
118
|
|
|
93
119
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
94
|
-
|
|
95
|
-
try {
|
|
96
|
-
// --- Welcome to debugging React ---
|
|
97
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
98
|
-
// to find the callsite that caused this warning to fire.
|
|
99
|
-
var argIndex = 0;
|
|
100
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
101
|
-
return args[argIndex++];
|
|
102
|
-
});
|
|
103
|
-
throw new Error(message);
|
|
104
|
-
} catch (x) {}
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
|
|
123
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
124
|
+
|
|
125
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
126
|
+
|
|
108
127
|
function isValidElementType(type) {
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
129
|
+
return true;
|
|
130
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (typeof type === 'object' && type !== null) {
|
|
138
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return false;
|
|
111
144
|
}
|
|
112
145
|
|
|
113
146
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
@@ -140,7 +173,7 @@ function getComponentName(type) {
|
|
|
140
173
|
}
|
|
141
174
|
|
|
142
175
|
switch (type) {
|
|
143
|
-
case
|
|
176
|
+
case exports.Fragment:
|
|
144
177
|
return 'Fragment';
|
|
145
178
|
|
|
146
179
|
case REACT_PORTAL_TYPE:
|
|
@@ -196,8 +229,358 @@ function getComponentName(type) {
|
|
|
196
229
|
return null;
|
|
197
230
|
}
|
|
198
231
|
|
|
232
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
233
|
+
// replaying on render function. This currently only patches the object
|
|
234
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
235
|
+
// We could also eagerly patch the method.
|
|
236
|
+
var disabledDepth = 0;
|
|
237
|
+
var prevLog;
|
|
238
|
+
var prevInfo;
|
|
239
|
+
var prevWarn;
|
|
240
|
+
var prevError;
|
|
241
|
+
var prevGroup;
|
|
242
|
+
var prevGroupCollapsed;
|
|
243
|
+
var prevGroupEnd;
|
|
244
|
+
|
|
245
|
+
function disabledLog() {}
|
|
246
|
+
|
|
247
|
+
disabledLog.__reactDisabledLog = true;
|
|
248
|
+
function disableLogs() {
|
|
249
|
+
{
|
|
250
|
+
if (disabledDepth === 0) {
|
|
251
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
252
|
+
prevLog = console.log;
|
|
253
|
+
prevInfo = console.info;
|
|
254
|
+
prevWarn = console.warn;
|
|
255
|
+
prevError = console.error;
|
|
256
|
+
prevGroup = console.group;
|
|
257
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
258
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
259
|
+
|
|
260
|
+
var props = {
|
|
261
|
+
configurable: true,
|
|
262
|
+
enumerable: true,
|
|
263
|
+
value: disabledLog,
|
|
264
|
+
writable: true
|
|
265
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
266
|
+
|
|
267
|
+
Object.defineProperties(console, {
|
|
268
|
+
info: props,
|
|
269
|
+
log: props,
|
|
270
|
+
warn: props,
|
|
271
|
+
error: props,
|
|
272
|
+
group: props,
|
|
273
|
+
groupCollapsed: props,
|
|
274
|
+
groupEnd: props
|
|
275
|
+
});
|
|
276
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
disabledDepth++;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
function reenableLogs() {
|
|
283
|
+
{
|
|
284
|
+
disabledDepth--;
|
|
285
|
+
|
|
286
|
+
if (disabledDepth === 0) {
|
|
287
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
288
|
+
var props = {
|
|
289
|
+
configurable: true,
|
|
290
|
+
enumerable: true,
|
|
291
|
+
writable: true
|
|
292
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
293
|
+
|
|
294
|
+
Object.defineProperties(console, {
|
|
295
|
+
log: _assign({}, props, {
|
|
296
|
+
value: prevLog
|
|
297
|
+
}),
|
|
298
|
+
info: _assign({}, props, {
|
|
299
|
+
value: prevInfo
|
|
300
|
+
}),
|
|
301
|
+
warn: _assign({}, props, {
|
|
302
|
+
value: prevWarn
|
|
303
|
+
}),
|
|
304
|
+
error: _assign({}, props, {
|
|
305
|
+
value: prevError
|
|
306
|
+
}),
|
|
307
|
+
group: _assign({}, props, {
|
|
308
|
+
value: prevGroup
|
|
309
|
+
}),
|
|
310
|
+
groupCollapsed: _assign({}, props, {
|
|
311
|
+
value: prevGroupCollapsed
|
|
312
|
+
}),
|
|
313
|
+
groupEnd: _assign({}, props, {
|
|
314
|
+
value: prevGroupEnd
|
|
315
|
+
})
|
|
316
|
+
});
|
|
317
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (disabledDepth < 0) {
|
|
321
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
327
|
+
var prefix;
|
|
328
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
329
|
+
{
|
|
330
|
+
if (prefix === undefined) {
|
|
331
|
+
// Extract the VM specific prefix used by each line.
|
|
332
|
+
try {
|
|
333
|
+
throw Error();
|
|
334
|
+
} catch (x) {
|
|
335
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
336
|
+
prefix = match && match[1] || '';
|
|
337
|
+
}
|
|
338
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
return '\n' + prefix + name;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var reentry = false;
|
|
345
|
+
var componentFrameCache;
|
|
346
|
+
|
|
347
|
+
{
|
|
348
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
349
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
353
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
354
|
+
if (!fn || reentry) {
|
|
355
|
+
return '';
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
{
|
|
359
|
+
var frame = componentFrameCache.get(fn);
|
|
360
|
+
|
|
361
|
+
if (frame !== undefined) {
|
|
362
|
+
return frame;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
var control;
|
|
367
|
+
reentry = true;
|
|
368
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
369
|
+
|
|
370
|
+
Error.prepareStackTrace = undefined;
|
|
371
|
+
var previousDispatcher;
|
|
372
|
+
|
|
373
|
+
{
|
|
374
|
+
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
375
|
+
// for warnings.
|
|
376
|
+
|
|
377
|
+
ReactCurrentDispatcher.current = null;
|
|
378
|
+
disableLogs();
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
try {
|
|
382
|
+
// This should throw.
|
|
383
|
+
if (construct) {
|
|
384
|
+
// Something should be setting the props in the constructor.
|
|
385
|
+
var Fake = function () {
|
|
386
|
+
throw Error();
|
|
387
|
+
}; // $FlowFixMe
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
391
|
+
set: function () {
|
|
392
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
393
|
+
// because that won't throw in a non-strict mode function.
|
|
394
|
+
throw Error();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
399
|
+
// We construct a different control for this case to include any extra
|
|
400
|
+
// frames added by the construct call.
|
|
401
|
+
try {
|
|
402
|
+
Reflect.construct(Fake, []);
|
|
403
|
+
} catch (x) {
|
|
404
|
+
control = x;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
Reflect.construct(fn, [], Fake);
|
|
408
|
+
} else {
|
|
409
|
+
try {
|
|
410
|
+
Fake.call();
|
|
411
|
+
} catch (x) {
|
|
412
|
+
control = x;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
fn.call(Fake.prototype);
|
|
416
|
+
}
|
|
417
|
+
} else {
|
|
418
|
+
try {
|
|
419
|
+
throw Error();
|
|
420
|
+
} catch (x) {
|
|
421
|
+
control = x;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
fn();
|
|
425
|
+
}
|
|
426
|
+
} catch (sample) {
|
|
427
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
428
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
429
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
430
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
431
|
+
var sampleLines = sample.stack.split('\n');
|
|
432
|
+
var controlLines = control.stack.split('\n');
|
|
433
|
+
var s = sampleLines.length - 1;
|
|
434
|
+
var c = controlLines.length - 1;
|
|
435
|
+
|
|
436
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
437
|
+
// We expect at least one stack frame to be shared.
|
|
438
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
439
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
440
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
441
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
442
|
+
// the sample somewhere in the control.
|
|
443
|
+
c--;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
447
|
+
// Next we find the first one that isn't the same which should be the
|
|
448
|
+
// frame that called our sample function and the control.
|
|
449
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
450
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
451
|
+
// If we're about to return the first line, and the control is also on the same
|
|
452
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
453
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
454
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
455
|
+
if (s !== 1 || c !== 1) {
|
|
456
|
+
do {
|
|
457
|
+
s--;
|
|
458
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
459
|
+
// The next one that isn't the same should be our match though.
|
|
460
|
+
|
|
461
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
462
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
463
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
464
|
+
|
|
465
|
+
{
|
|
466
|
+
if (typeof fn === 'function') {
|
|
467
|
+
componentFrameCache.set(fn, _frame);
|
|
468
|
+
}
|
|
469
|
+
} // Return the line we found.
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
return _frame;
|
|
473
|
+
}
|
|
474
|
+
} while (s >= 1 && c >= 0);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
} finally {
|
|
482
|
+
reentry = false;
|
|
483
|
+
|
|
484
|
+
{
|
|
485
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
486
|
+
reenableLogs();
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
490
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
494
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
495
|
+
|
|
496
|
+
{
|
|
497
|
+
if (typeof fn === 'function') {
|
|
498
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return syntheticFrame;
|
|
503
|
+
}
|
|
504
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
505
|
+
{
|
|
506
|
+
return describeNativeComponentFrame(fn, false);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function shouldConstruct(Component) {
|
|
511
|
+
var prototype = Component.prototype;
|
|
512
|
+
return !!(prototype && prototype.isReactComponent);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
516
|
+
|
|
517
|
+
if (type == null) {
|
|
518
|
+
return '';
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (typeof type === 'function') {
|
|
522
|
+
{
|
|
523
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
if (typeof type === 'string') {
|
|
528
|
+
return describeBuiltInComponentFrame(type);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
switch (type) {
|
|
532
|
+
case REACT_SUSPENSE_TYPE:
|
|
533
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
534
|
+
|
|
535
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
536
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (typeof type === 'object') {
|
|
540
|
+
switch (type.$$typeof) {
|
|
541
|
+
case REACT_FORWARD_REF_TYPE:
|
|
542
|
+
return describeFunctionComponentFrame(type.render);
|
|
543
|
+
|
|
544
|
+
case REACT_MEMO_TYPE:
|
|
545
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
546
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
547
|
+
|
|
548
|
+
case REACT_BLOCK_TYPE:
|
|
549
|
+
return describeFunctionComponentFrame(type._render);
|
|
550
|
+
|
|
551
|
+
case REACT_LAZY_TYPE:
|
|
552
|
+
{
|
|
553
|
+
var lazyComponent = type;
|
|
554
|
+
var payload = lazyComponent._payload;
|
|
555
|
+
var init = lazyComponent._init;
|
|
556
|
+
|
|
557
|
+
try {
|
|
558
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
559
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
560
|
+
} catch (x) {}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
return '';
|
|
566
|
+
}
|
|
567
|
+
|
|
199
568
|
var loggedTypeFailures = {};
|
|
200
|
-
|
|
569
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
570
|
+
|
|
571
|
+
function setCurrentlyValidatingElement(element) {
|
|
572
|
+
{
|
|
573
|
+
if (element) {
|
|
574
|
+
var owner = element._owner;
|
|
575
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
576
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
577
|
+
} else {
|
|
578
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
201
584
|
{
|
|
202
585
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
203
586
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
@@ -223,15 +606,22 @@ function checkPropTypes(typeSpecs, values, location, componentName) {
|
|
|
223
606
|
}
|
|
224
607
|
|
|
225
608
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
609
|
+
setCurrentlyValidatingElement(element);
|
|
610
|
+
|
|
226
611
|
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
612
|
+
|
|
613
|
+
setCurrentlyValidatingElement(null);
|
|
227
614
|
}
|
|
228
615
|
|
|
229
616
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
230
617
|
// Only monitor this failure once because there tends to be a lot of the
|
|
231
618
|
// same error.
|
|
232
619
|
loggedTypeFailures[error$1.message] = true;
|
|
620
|
+
setCurrentlyValidatingElement(element);
|
|
233
621
|
|
|
234
622
|
error('Failed %s type: %s', location, error$1.message);
|
|
623
|
+
|
|
624
|
+
setCurrentlyValidatingElement(null);
|
|
235
625
|
}
|
|
236
626
|
}
|
|
237
627
|
}
|
|
@@ -474,7 +864,20 @@ function jsxDEV(type, config, maybeKey, source, self) {
|
|
|
474
864
|
}
|
|
475
865
|
|
|
476
866
|
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
477
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
867
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
868
|
+
|
|
869
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
870
|
+
{
|
|
871
|
+
if (element) {
|
|
872
|
+
var owner = element._owner;
|
|
873
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
874
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
875
|
+
} else {
|
|
876
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
478
881
|
var propTypesMisspellWarningShown;
|
|
479
882
|
|
|
480
883
|
{
|
|
@@ -580,11 +983,11 @@ function validateExplicitKey(element, parentType) {
|
|
|
580
983
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
581
984
|
}
|
|
582
985
|
|
|
583
|
-
|
|
986
|
+
setCurrentlyValidatingElement$1(element);
|
|
584
987
|
|
|
585
988
|
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
586
989
|
|
|
587
|
-
|
|
990
|
+
setCurrentlyValidatingElement$1(null);
|
|
588
991
|
}
|
|
589
992
|
}
|
|
590
993
|
/**
|
|
@@ -667,9 +1070,7 @@ function validatePropTypes(element) {
|
|
|
667
1070
|
}
|
|
668
1071
|
|
|
669
1072
|
if (propTypes) {
|
|
670
|
-
|
|
671
|
-
checkPropTypes(propTypes, element.props, 'prop', name);
|
|
672
|
-
ReactDebugCurrentFrame.setCurrentlyValidatingElement(null);
|
|
1073
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
673
1074
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
674
1075
|
propTypesMisspellWarningShown = true;
|
|
675
1076
|
|
|
@@ -689,24 +1090,28 @@ function validatePropTypes(element) {
|
|
|
689
1090
|
|
|
690
1091
|
function validateFragmentProps(fragment) {
|
|
691
1092
|
{
|
|
692
|
-
ReactDebugCurrentFrame.setCurrentlyValidatingElement(fragment);
|
|
693
1093
|
var keys = Object.keys(fragment.props);
|
|
694
1094
|
|
|
695
1095
|
for (var i = 0; i < keys.length; i++) {
|
|
696
1096
|
var key = keys[i];
|
|
697
1097
|
|
|
698
1098
|
if (key !== 'children' && key !== 'key') {
|
|
1099
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1100
|
+
|
|
699
1101
|
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
700
1102
|
|
|
1103
|
+
setCurrentlyValidatingElement$1(null);
|
|
701
1104
|
break;
|
|
702
1105
|
}
|
|
703
1106
|
}
|
|
704
1107
|
|
|
705
1108
|
if (fragment.ref !== null) {
|
|
1109
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1110
|
+
|
|
706
1111
|
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
707
|
-
}
|
|
708
1112
|
|
|
709
|
-
|
|
1113
|
+
setCurrentlyValidatingElement$1(null);
|
|
1114
|
+
}
|
|
710
1115
|
}
|
|
711
1116
|
}
|
|
712
1117
|
|
|
@@ -780,7 +1185,7 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
|
780
1185
|
}
|
|
781
1186
|
}
|
|
782
1187
|
|
|
783
|
-
if (type ===
|
|
1188
|
+
if (type === exports.Fragment) {
|
|
784
1189
|
validateFragmentProps(element);
|
|
785
1190
|
} else {
|
|
786
1191
|
validatePropTypes(element);
|
|
@@ -792,7 +1197,6 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
|
792
1197
|
|
|
793
1198
|
var jsxDEV$1 = jsxWithValidation ;
|
|
794
1199
|
|
|
795
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
796
1200
|
exports.jsxDEV = jsxDEV$1;
|
|
797
1201
|
})();
|
|
798
1202
|
}
|