react 0.0.0-experimental-e5d06e34b → 0.0.0-experimental-ede917064
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 +418 -35
- 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 +418 -35
- package/cjs/react-jsx-runtime.production.min.js +2 -3
- package/cjs/react-jsx-runtime.profiling.min.js +2 -3
- 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 +436 -186
- package/cjs/react.production.min.js +14 -13
- package/package.json +3 -2
- package/umd/react.development.js +480 -236
- package/umd/react.production.min.js +26 -25
- package/umd/react.profiling.min.js +33 -32
- package/unstable-cache.js +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
2
|
* react.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
'use strict';var l=require("object-assign"),m=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;exports.unstable_SuspenseList=60120;var u=60115,v=60116,w=60121;exports.unstable_DebugTracingMode=60129;exports.unstable_LegacyHidden=60131;
|
|
10
|
+
if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;m=x("react.element");p=x("react.portal");exports.Fragment=x("react.fragment");exports.StrictMode=x("react.strict_mode");exports.Profiler=x("react.profiler");q=x("react.provider");r=x("react.context");t=x("react.forward_ref");exports.Suspense=x("react.suspense");exports.unstable_SuspenseList=x("react.suspense_list");u=x("react.memo");v=x("react.lazy");w=x("react.block");exports.unstable_DebugTracingMode=x("react.debug_trace_mode");exports.unstable_LegacyHidden=
|
|
11
|
+
x("react.legacy_hidden")}var y="function"===typeof Symbol&&Symbol.iterator;function z(a){if(null===a||"object"!==typeof a)return null;a=y&&a[y]||a["@@iterator"];return"function"===typeof a?a:null}
|
|
12
|
+
function A(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C={};
|
|
13
|
+
function D(a,b,c){this.props=a;this.context=b;this.refs=C;this.updater=c||B}D.prototype.isReactComponent={};D.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(A(85));this.updater.enqueueSetState(this,a,b,"setState")};D.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function E(){}E.prototype=D.prototype;function F(a,b,c){this.props=a;this.context=b;this.refs=C;this.updater=c||B}var G=F.prototype=new E;
|
|
14
|
+
G.constructor=F;l(G,D.prototype);G.isPureReactComponent=!0;var H={current:null},I=Object.prototype.hasOwnProperty,J={key:!0,ref:!0,__self:!0,__source:!0};
|
|
15
15
|
function K(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)I.call(b,e)&&!J.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),n=0;n<g;n++)f[n]=arguments[n+2];d.children=f}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return{$$typeof:m,type:a,key:k,ref:h,props:d,_owner:H.current}}
|
|
16
16
|
function L(a,b){return{$$typeof:m,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===m}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var N=/\/+/g;function O(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
17
17
|
function P(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case m:case p:h=!0}}if(h)return h=a,d=d(h),a=""===e?"."+O(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(N,"$&/")+"/"),P(d,b,c,"",function(a){return a})):null!=d&&(M(d)&&(d=L(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(N,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
|
|
18
|
-
0;g<a.length;g++){k=a[g];var f=e+O(k,g);h+=P(k,b,c,f,d)}else if(f=z(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+O(k,g++),h+=P(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(A(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b
|
|
18
|
+
0;g<a.length;g++){k=a[g];var f=e+O(k,g);h+=P(k,b,c,f,d)}else if(f=z(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+O(k,g++),h+=P(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(A(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function Q(a,b,c){if(null==a)return a;var e=[],d=0;P(a,e,"","",function(a){return b.call(c,a,d++)});return e}
|
|
19
19
|
function R(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}if(1===a._status)return a._result;throw a._result;}function S(a){return{$$typeof:w,_data:a.load.apply(null,a.args),_render:a.render}}var T={current:null};function U(){var a=T.current;if(null===a)throw Error(A(321));return a}
|
|
20
20
|
var V={suspense:null},W={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:V,ReactCurrentOwner:H,IsSomeRendererActing:{current:!1},assign:l};exports.Children={map:Q,forEach:function(a,b,c){Q(a,function(){b.apply(this,arguments)},c)},count:function(a){var b=0;Q(a,function(){b++});return b},toArray:function(a){return Q(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error(A(143));return a}};exports.Component=D;exports.PureComponent=F;
|
|
21
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
|
|
21
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
|
|
22
22
|
exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(A(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=H.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)I.call(b,f)&&!J.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var n=0;n<f;n++)g[n]=arguments[n+2];e.children=g}return{$$typeof:m,type:a.type,
|
|
23
|
-
key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=K;exports.createFactory=function(a){var b=K.bind(null,a);b.type=a;return b};exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
23
|
+
key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=K;exports.createFactory=function(a){var b=K.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:t,render:a}};exports.isValidElement=M;
|
|
24
|
+
exports.lazy=function(a){return{$$typeof:v,_payload:{_status:-1,_result:a},_init:R}};exports.memo=function(a,b){return{$$typeof:u,type:a,compare:void 0===b?null:b}};exports.unstable_block=function(a,b){return void 0===b?function(){return{$$typeof:w,_data:void 0,_render:a}}:function(){return{$$typeof:v,_payload:{load:b,args:arguments,render:a},_init:S}}};exports.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};
|
|
25
|
+
exports.unstable_useDeferredValue=function(a,b){return U().useDeferredValue(a,b)};exports.unstable_useMutableSource=function(a,b,c){return U().useMutableSource(a,b,c)};exports.unstable_useOpaqueIdentifier=function(){return U().useOpaqueIdentifier()};exports.unstable_useTransition=function(a){return U().useTransition(a)};exports.unstable_withSuspenseConfig=function(a,b){var c=V.suspense;V.suspense=void 0===b?null:b;try{a()}finally{V.suspense=c}};
|
|
26
|
+
exports.useCallback=function(a,b){return U().useCallback(a,b)};exports.useContext=function(a,b){return U().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return U().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return U().useImperativeHandle(a,b,c)};exports.useLayoutEffect=function(a,b){return U().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U().useMemo(a,b)};exports.useReducer=function(a,b,c){return U().useReducer(a,b,c)};
|
|
27
|
+
exports.useRef=function(a){return U().useRef(a)};exports.useState=function(a){return U().useState(a)};exports.version="17.0.0-alpha.0-experimental-ede917064";
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.0.0-experimental-
|
|
7
|
+
"version": "0.0.0-experimental-ede917064",
|
|
8
8
|
"homepage": "https://reactjs.org/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "MIT",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"cjs/",
|
|
17
17
|
"umd/",
|
|
18
18
|
"jsx-runtime.js",
|
|
19
|
-
"jsx-dev-runtime.js"
|
|
19
|
+
"jsx-dev-runtime.js",
|
|
20
|
+
"unstable-cache.js"
|
|
20
21
|
],
|
|
21
22
|
"main": "index.js",
|
|
22
23
|
"repository": {
|
package/umd/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
}(this, (function (exports) { 'use strict';
|
|
17
17
|
|
|
18
18
|
// TODO: this is special because it gets imported during build.
|
|
19
|
-
var ReactVersion = '
|
|
19
|
+
var ReactVersion = '17.0.0-alpha.0-experimental-ede917064';
|
|
20
20
|
|
|
21
|
+
// ATTENTION
|
|
22
|
+
// When adding new symbols to this file,
|
|
23
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
21
24
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
22
25
|
// nor polyfill, then a plain number is used for performance.
|
|
23
26
|
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
var REACT_CONTEXT_TYPE = 0xeace;
|
|
30
33
|
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
31
34
|
exports.Suspense = 0xead1;
|
|
32
|
-
exports.
|
|
35
|
+
exports.unstable_SuspenseList = 0xead8;
|
|
33
36
|
var REACT_MEMO_TYPE = 0xead3;
|
|
34
37
|
var REACT_LAZY_TYPE = 0xead4;
|
|
35
38
|
var REACT_BLOCK_TYPE = 0xead9;
|
|
@@ -38,6 +41,9 @@
|
|
|
38
41
|
var REACT_RESPONDER_TYPE = 0xead6;
|
|
39
42
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
40
43
|
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
44
|
+
exports.unstable_DebugTracingMode = 0xeae1;
|
|
45
|
+
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
46
|
+
exports.unstable_LegacyHidden = 0xeae3;
|
|
41
47
|
|
|
42
48
|
if (typeof Symbol === 'function' && Symbol.for) {
|
|
43
49
|
var symbolFor = Symbol.for;
|
|
@@ -50,7 +56,7 @@
|
|
|
50
56
|
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
51
57
|
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
52
58
|
exports.Suspense = symbolFor('react.suspense');
|
|
53
|
-
exports.
|
|
59
|
+
exports.unstable_SuspenseList = symbolFor('react.suspense_list');
|
|
54
60
|
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
55
61
|
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
56
62
|
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
@@ -59,6 +65,9 @@
|
|
|
59
65
|
REACT_RESPONDER_TYPE = symbolFor('react.responder');
|
|
60
66
|
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
61
67
|
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
68
|
+
exports.unstable_DebugTracingMode = symbolFor('react.debug_trace_mode');
|
|
69
|
+
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
70
|
+
exports.unstable_LegacyHidden = symbolFor('react.legacy_hidden');
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
@@ -87,7 +96,7 @@
|
|
|
87
96
|
}
|
|
88
97
|
};
|
|
89
98
|
|
|
90
|
-
var
|
|
99
|
+
var assign = Object.assign || function (target, sources) {
|
|
91
100
|
if (target == null) {
|
|
92
101
|
throw new TypeError('Object.assign target cannot be null or undefined');
|
|
93
102
|
}
|
|
@@ -138,136 +147,18 @@
|
|
|
138
147
|
current: null
|
|
139
148
|
};
|
|
140
149
|
|
|
141
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
142
|
-
|
|
143
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
144
|
-
var sourceInfo = '';
|
|
145
|
-
|
|
146
|
-
if ( source) {
|
|
147
|
-
var path = source.fileName;
|
|
148
|
-
var fileName = path.replace(BEFORE_SLASH_RE, ''); // In DEV, include code for a common special case:
|
|
149
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
150
|
-
|
|
151
|
-
if (/^index\./.test(fileName)) {
|
|
152
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
153
|
-
|
|
154
|
-
if (match) {
|
|
155
|
-
var pathBeforeSlash = match[1];
|
|
156
|
-
|
|
157
|
-
if (pathBeforeSlash) {
|
|
158
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
159
|
-
fileName = folderName + '/' + fileName;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
165
|
-
} else if (ownerName) {
|
|
166
|
-
sourceInfo = ' (created by ' + ownerName + ')';
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
173
|
-
var ownerName = null;
|
|
174
|
-
|
|
175
|
-
if ( ownerFn) {
|
|
176
|
-
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return describeComponentFrame(name, source, ownerName);
|
|
180
|
-
}
|
|
181
|
-
function describeClassComponentFrame(ctor, source, ownerFn) {
|
|
182
|
-
return describeFunctionComponentFrame(ctor, source, ownerFn);
|
|
183
|
-
}
|
|
184
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
185
|
-
if (!fn) {
|
|
186
|
-
return '';
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
var name = fn.displayName || fn.name || null;
|
|
190
|
-
var ownerName = null;
|
|
191
|
-
|
|
192
|
-
if ( ownerFn) {
|
|
193
|
-
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return describeComponentFrame(name, source, ownerName);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function shouldConstruct(Component) {
|
|
200
|
-
var prototype = Component.prototype;
|
|
201
|
-
return !!(prototype && prototype.isReactComponent);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
205
|
-
|
|
206
|
-
if (type == null) {
|
|
207
|
-
return '';
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (typeof type === 'function') {
|
|
211
|
-
if (shouldConstruct(type)) {
|
|
212
|
-
return describeClassComponentFrame(type, source, ownerFn);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return describeFunctionComponentFrame(type, source, ownerFn);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (typeof type === 'string') {
|
|
219
|
-
return describeBuiltInComponentFrame(type, source, ownerFn);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
switch (type) {
|
|
223
|
-
case exports.Suspense:
|
|
224
|
-
return describeBuiltInComponentFrame('Suspense', source, ownerFn);
|
|
225
|
-
|
|
226
|
-
case exports.SuspenseList:
|
|
227
|
-
return describeBuiltInComponentFrame('SuspenseList', source, ownerFn);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (typeof type === 'object') {
|
|
231
|
-
switch (type.$$typeof) {
|
|
232
|
-
case REACT_FORWARD_REF_TYPE:
|
|
233
|
-
return describeFunctionComponentFrame(type.render, source, ownerFn);
|
|
234
|
-
|
|
235
|
-
case REACT_MEMO_TYPE:
|
|
236
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
237
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
238
|
-
|
|
239
|
-
case REACT_BLOCK_TYPE:
|
|
240
|
-
return describeFunctionComponentFrame(type._render, source, ownerFn);
|
|
241
|
-
|
|
242
|
-
case REACT_LAZY_TYPE:
|
|
243
|
-
{
|
|
244
|
-
var lazyComponent = type;
|
|
245
|
-
var payload = lazyComponent._payload;
|
|
246
|
-
var init = lazyComponent._init;
|
|
247
|
-
|
|
248
|
-
try {
|
|
249
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
250
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
251
|
-
} catch (x) {}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return '';
|
|
257
|
-
}
|
|
258
|
-
|
|
259
150
|
var ReactDebugCurrentFrame = {};
|
|
260
|
-
var
|
|
261
|
-
function
|
|
151
|
+
var currentExtraStackFrame = null;
|
|
152
|
+
function setExtraStackFrame(stack) {
|
|
262
153
|
{
|
|
263
|
-
|
|
154
|
+
currentExtraStackFrame = stack;
|
|
264
155
|
}
|
|
265
156
|
}
|
|
266
157
|
|
|
267
158
|
{
|
|
268
|
-
ReactDebugCurrentFrame.
|
|
159
|
+
ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
|
269
160
|
{
|
|
270
|
-
|
|
161
|
+
currentExtraStackFrame = stack;
|
|
271
162
|
}
|
|
272
163
|
}; // Stack implementation injected by the current renderer.
|
|
273
164
|
|
|
@@ -277,9 +168,8 @@
|
|
|
277
168
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
278
169
|
var stack = ''; // Add an extra top frame while an element is being validated
|
|
279
170
|
|
|
280
|
-
if (
|
|
281
|
-
|
|
282
|
-
stack += describeUnknownElementTypeFrameInDEV(currentlyValidatingElement.type, currentlyValidatingElement._source, owner ? owner.type : null);
|
|
171
|
+
if (currentExtraStackFrame) {
|
|
172
|
+
stack += currentExtraStackFrame;
|
|
283
173
|
} // Delegate to the injected renderer-specific implementation
|
|
284
174
|
|
|
285
175
|
|
|
@@ -306,17 +196,11 @@
|
|
|
306
196
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
307
197
|
IsSomeRendererActing: IsSomeRendererActing,
|
|
308
198
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
309
|
-
assign:
|
|
199
|
+
assign: assign
|
|
310
200
|
};
|
|
311
201
|
|
|
312
202
|
{
|
|
313
|
-
|
|
314
|
-
// These should not be included in production.
|
|
315
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
316
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
317
|
-
// TODO: remove in React 17.0.
|
|
318
|
-
ReactComponentTreeHook: {}
|
|
319
|
-
});
|
|
203
|
+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
320
204
|
}
|
|
321
205
|
|
|
322
206
|
// by calls to these methods by a Babel plugin.
|
|
@@ -347,16 +231,12 @@
|
|
|
347
231
|
// When changing this logic, you might want to also
|
|
348
232
|
// update consoleWithStackDev.www.js as well.
|
|
349
233
|
{
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
if (!hasExistingStack) {
|
|
353
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
354
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
234
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
235
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
355
236
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
237
|
+
if (stack !== '') {
|
|
238
|
+
format += '%s';
|
|
239
|
+
args = args.concat([stack]);
|
|
360
240
|
}
|
|
361
241
|
|
|
362
242
|
var argsWithFormat = args.map(function (item) {
|
|
@@ -368,17 +248,6 @@
|
|
|
368
248
|
// eslint-disable-next-line react-internal/no-production-logging
|
|
369
249
|
|
|
370
250
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
371
|
-
|
|
372
|
-
try {
|
|
373
|
-
// --- Welcome to debugging React ---
|
|
374
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
375
|
-
// to find the callsite that caused this warning to fire.
|
|
376
|
-
var argIndex = 0;
|
|
377
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
378
|
-
return args[argIndex++];
|
|
379
|
-
});
|
|
380
|
-
throw new Error(message);
|
|
381
|
-
} catch (x) {}
|
|
382
251
|
}
|
|
383
252
|
}
|
|
384
253
|
|
|
@@ -592,7 +461,7 @@
|
|
|
592
461
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
593
462
|
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
594
463
|
|
|
595
|
-
|
|
464
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
596
465
|
|
|
597
466
|
pureComponentPrototype.isPureReactComponent = true;
|
|
598
467
|
|
|
@@ -654,7 +523,7 @@
|
|
|
654
523
|
case exports.Suspense:
|
|
655
524
|
return 'Suspense';
|
|
656
525
|
|
|
657
|
-
case exports.
|
|
526
|
+
case exports.unstable_SuspenseList:
|
|
658
527
|
return 'SuspenseList';
|
|
659
528
|
}
|
|
660
529
|
|
|
@@ -964,7 +833,7 @@
|
|
|
964
833
|
|
|
965
834
|
var propName; // Original props are copied
|
|
966
835
|
|
|
967
|
-
var props =
|
|
836
|
+
var props = assign({}, element.props); // Reserved names are extracted
|
|
968
837
|
|
|
969
838
|
|
|
970
839
|
var key = element.key;
|
|
@@ -1191,17 +1060,11 @@
|
|
|
1191
1060
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1192
1061
|
}
|
|
1193
1062
|
} else if (type === 'object') {
|
|
1194
|
-
var addendum = '';
|
|
1195
|
-
|
|
1196
|
-
{
|
|
1197
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
1063
|
var childrenString = '' + children;
|
|
1201
1064
|
|
|
1202
1065
|
{
|
|
1203
1066
|
{
|
|
1204
|
-
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ").
|
|
1067
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
|
|
1205
1068
|
}
|
|
1206
1069
|
}
|
|
1207
1070
|
}
|
|
@@ -1215,7 +1078,7 @@
|
|
|
1215
1078
|
*
|
|
1216
1079
|
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1217
1080
|
*
|
|
1218
|
-
* The provided mapFunction(child,
|
|
1081
|
+
* The provided mapFunction(child, index) will be called for each
|
|
1219
1082
|
* leaf child.
|
|
1220
1083
|
*
|
|
1221
1084
|
* @param {?*} children Children tree container.
|
|
@@ -1578,9 +1441,27 @@
|
|
|
1578
1441
|
return elementType;
|
|
1579
1442
|
}
|
|
1580
1443
|
|
|
1444
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1445
|
+
|
|
1446
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1447
|
+
|
|
1581
1448
|
function isValidElementType(type) {
|
|
1582
|
-
|
|
1583
|
-
|
|
1449
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1450
|
+
return true;
|
|
1451
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
if (type === exports.Fragment || type === exports.Profiler || type === exports.unstable_DebugTracingMode || type === exports.StrictMode || type === exports.Suspense || type === exports.unstable_SuspenseList || type === exports.unstable_LegacyHidden || enableScopeAPI ) {
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
if (typeof type === 'object' && type !== null) {
|
|
1459
|
+
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) {
|
|
1460
|
+
return true;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return false;
|
|
1584
1465
|
}
|
|
1585
1466
|
|
|
1586
1467
|
function memo(type, compare) {
|
|
@@ -1781,8 +1662,358 @@
|
|
|
1781
1662
|
}
|
|
1782
1663
|
}
|
|
1783
1664
|
|
|
1665
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1666
|
+
// replaying on render function. This currently only patches the object
|
|
1667
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
1668
|
+
// We could also eagerly patch the method.
|
|
1669
|
+
var disabledDepth = 0;
|
|
1670
|
+
var prevLog;
|
|
1671
|
+
var prevInfo;
|
|
1672
|
+
var prevWarn;
|
|
1673
|
+
var prevError;
|
|
1674
|
+
var prevGroup;
|
|
1675
|
+
var prevGroupCollapsed;
|
|
1676
|
+
var prevGroupEnd;
|
|
1677
|
+
|
|
1678
|
+
function disabledLog() {}
|
|
1679
|
+
|
|
1680
|
+
disabledLog.__reactDisabledLog = true;
|
|
1681
|
+
function disableLogs() {
|
|
1682
|
+
{
|
|
1683
|
+
if (disabledDepth === 0) {
|
|
1684
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1685
|
+
prevLog = console.log;
|
|
1686
|
+
prevInfo = console.info;
|
|
1687
|
+
prevWarn = console.warn;
|
|
1688
|
+
prevError = console.error;
|
|
1689
|
+
prevGroup = console.group;
|
|
1690
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
1691
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
1692
|
+
|
|
1693
|
+
var props = {
|
|
1694
|
+
configurable: true,
|
|
1695
|
+
enumerable: true,
|
|
1696
|
+
value: disabledLog,
|
|
1697
|
+
writable: true
|
|
1698
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1699
|
+
|
|
1700
|
+
Object.defineProperties(console, {
|
|
1701
|
+
info: props,
|
|
1702
|
+
log: props,
|
|
1703
|
+
warn: props,
|
|
1704
|
+
error: props,
|
|
1705
|
+
group: props,
|
|
1706
|
+
groupCollapsed: props,
|
|
1707
|
+
groupEnd: props
|
|
1708
|
+
});
|
|
1709
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
disabledDepth++;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
function reenableLogs() {
|
|
1716
|
+
{
|
|
1717
|
+
disabledDepth--;
|
|
1718
|
+
|
|
1719
|
+
if (disabledDepth === 0) {
|
|
1720
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1721
|
+
var props = {
|
|
1722
|
+
configurable: true,
|
|
1723
|
+
enumerable: true,
|
|
1724
|
+
writable: true
|
|
1725
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1726
|
+
|
|
1727
|
+
Object.defineProperties(console, {
|
|
1728
|
+
log: assign({}, props, {
|
|
1729
|
+
value: prevLog
|
|
1730
|
+
}),
|
|
1731
|
+
info: assign({}, props, {
|
|
1732
|
+
value: prevInfo
|
|
1733
|
+
}),
|
|
1734
|
+
warn: assign({}, props, {
|
|
1735
|
+
value: prevWarn
|
|
1736
|
+
}),
|
|
1737
|
+
error: assign({}, props, {
|
|
1738
|
+
value: prevError
|
|
1739
|
+
}),
|
|
1740
|
+
group: assign({}, props, {
|
|
1741
|
+
value: prevGroup
|
|
1742
|
+
}),
|
|
1743
|
+
groupCollapsed: assign({}, props, {
|
|
1744
|
+
value: prevGroupCollapsed
|
|
1745
|
+
}),
|
|
1746
|
+
groupEnd: assign({}, props, {
|
|
1747
|
+
value: prevGroupEnd
|
|
1748
|
+
})
|
|
1749
|
+
});
|
|
1750
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
if (disabledDepth < 0) {
|
|
1754
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1760
|
+
var prefix;
|
|
1761
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1762
|
+
{
|
|
1763
|
+
if (prefix === undefined) {
|
|
1764
|
+
// Extract the VM specific prefix used by each line.
|
|
1765
|
+
try {
|
|
1766
|
+
throw Error();
|
|
1767
|
+
} catch (x) {
|
|
1768
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1769
|
+
prefix = match && match[1] || '';
|
|
1770
|
+
}
|
|
1771
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
return '\n' + prefix + name;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
var reentry = false;
|
|
1778
|
+
var componentFrameCache;
|
|
1779
|
+
|
|
1780
|
+
{
|
|
1781
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1782
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
1786
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1787
|
+
if (!fn || reentry) {
|
|
1788
|
+
return '';
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
{
|
|
1792
|
+
var frame = componentFrameCache.get(fn);
|
|
1793
|
+
|
|
1794
|
+
if (frame !== undefined) {
|
|
1795
|
+
return frame;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
var control;
|
|
1800
|
+
reentry = true;
|
|
1801
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
1802
|
+
|
|
1803
|
+
Error.prepareStackTrace = undefined;
|
|
1804
|
+
var previousDispatcher;
|
|
1805
|
+
|
|
1806
|
+
{
|
|
1807
|
+
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
1808
|
+
// for warnings.
|
|
1809
|
+
|
|
1810
|
+
ReactCurrentDispatcher$1.current = null;
|
|
1811
|
+
disableLogs();
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
try {
|
|
1815
|
+
// This should throw.
|
|
1816
|
+
if (construct) {
|
|
1817
|
+
// Something should be setting the props in the constructor.
|
|
1818
|
+
var Fake = function () {
|
|
1819
|
+
throw Error();
|
|
1820
|
+
}; // $FlowFixMe
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
1824
|
+
set: function () {
|
|
1825
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
1826
|
+
// because that won't throw in a non-strict mode function.
|
|
1827
|
+
throw Error();
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
|
|
1831
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1832
|
+
// We construct a different control for this case to include any extra
|
|
1833
|
+
// frames added by the construct call.
|
|
1834
|
+
try {
|
|
1835
|
+
Reflect.construct(Fake, []);
|
|
1836
|
+
} catch (x) {
|
|
1837
|
+
control = x;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
Reflect.construct(fn, [], Fake);
|
|
1841
|
+
} else {
|
|
1842
|
+
try {
|
|
1843
|
+
Fake.call();
|
|
1844
|
+
} catch (x) {
|
|
1845
|
+
control = x;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
fn.call(Fake.prototype);
|
|
1849
|
+
}
|
|
1850
|
+
} else {
|
|
1851
|
+
try {
|
|
1852
|
+
throw Error();
|
|
1853
|
+
} catch (x) {
|
|
1854
|
+
control = x;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
fn();
|
|
1858
|
+
}
|
|
1859
|
+
} catch (sample) {
|
|
1860
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
1861
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
1862
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
1863
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
1864
|
+
var sampleLines = sample.stack.split('\n');
|
|
1865
|
+
var controlLines = control.stack.split('\n');
|
|
1866
|
+
var s = sampleLines.length - 1;
|
|
1867
|
+
var c = controlLines.length - 1;
|
|
1868
|
+
|
|
1869
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1870
|
+
// We expect at least one stack frame to be shared.
|
|
1871
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
1872
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
1873
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
1874
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
1875
|
+
// the sample somewhere in the control.
|
|
1876
|
+
c--;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1880
|
+
// Next we find the first one that isn't the same which should be the
|
|
1881
|
+
// frame that called our sample function and the control.
|
|
1882
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
1883
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
1884
|
+
// If we're about to return the first line, and the control is also on the same
|
|
1885
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
1886
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
1887
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
1888
|
+
if (s !== 1 || c !== 1) {
|
|
1889
|
+
do {
|
|
1890
|
+
s--;
|
|
1891
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
1892
|
+
// The next one that isn't the same should be our match though.
|
|
1893
|
+
|
|
1894
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1895
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1896
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1897
|
+
|
|
1898
|
+
{
|
|
1899
|
+
if (typeof fn === 'function') {
|
|
1900
|
+
componentFrameCache.set(fn, _frame);
|
|
1901
|
+
}
|
|
1902
|
+
} // Return the line we found.
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
return _frame;
|
|
1906
|
+
}
|
|
1907
|
+
} while (s >= 1 && c >= 0);
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
break;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
} finally {
|
|
1915
|
+
reentry = false;
|
|
1916
|
+
|
|
1917
|
+
{
|
|
1918
|
+
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1919
|
+
reenableLogs();
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1923
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
1927
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
1928
|
+
|
|
1929
|
+
{
|
|
1930
|
+
if (typeof fn === 'function') {
|
|
1931
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
return syntheticFrame;
|
|
1936
|
+
}
|
|
1937
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1938
|
+
{
|
|
1939
|
+
return describeNativeComponentFrame(fn, false);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
function shouldConstruct(Component) {
|
|
1944
|
+
var prototype = Component.prototype;
|
|
1945
|
+
return !!(prototype && prototype.isReactComponent);
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1949
|
+
|
|
1950
|
+
if (type == null) {
|
|
1951
|
+
return '';
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
if (typeof type === 'function') {
|
|
1955
|
+
{
|
|
1956
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
if (typeof type === 'string') {
|
|
1961
|
+
return describeBuiltInComponentFrame(type);
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
switch (type) {
|
|
1965
|
+
case exports.Suspense:
|
|
1966
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
1967
|
+
|
|
1968
|
+
case exports.unstable_SuspenseList:
|
|
1969
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
if (typeof type === 'object') {
|
|
1973
|
+
switch (type.$$typeof) {
|
|
1974
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1975
|
+
return describeFunctionComponentFrame(type.render);
|
|
1976
|
+
|
|
1977
|
+
case REACT_MEMO_TYPE:
|
|
1978
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
1979
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1980
|
+
|
|
1981
|
+
case REACT_BLOCK_TYPE:
|
|
1982
|
+
return describeFunctionComponentFrame(type._render);
|
|
1983
|
+
|
|
1984
|
+
case REACT_LAZY_TYPE:
|
|
1985
|
+
{
|
|
1986
|
+
var lazyComponent = type;
|
|
1987
|
+
var payload = lazyComponent._payload;
|
|
1988
|
+
var init = lazyComponent._init;
|
|
1989
|
+
|
|
1990
|
+
try {
|
|
1991
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
1992
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1993
|
+
} catch (x) {}
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
return '';
|
|
1999
|
+
}
|
|
2000
|
+
|
|
1784
2001
|
var loggedTypeFailures = {};
|
|
1785
|
-
|
|
2002
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2003
|
+
|
|
2004
|
+
function setCurrentlyValidatingElement(element) {
|
|
2005
|
+
{
|
|
2006
|
+
if (element) {
|
|
2007
|
+
var owner = element._owner;
|
|
2008
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2009
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2010
|
+
} else {
|
|
2011
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1786
2017
|
{
|
|
1787
2018
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1788
2019
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
@@ -1808,21 +2039,40 @@
|
|
|
1808
2039
|
}
|
|
1809
2040
|
|
|
1810
2041
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
2042
|
+
setCurrentlyValidatingElement(element);
|
|
2043
|
+
|
|
1811
2044
|
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);
|
|
2045
|
+
|
|
2046
|
+
setCurrentlyValidatingElement(null);
|
|
1812
2047
|
}
|
|
1813
2048
|
|
|
1814
2049
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1815
2050
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1816
2051
|
// same error.
|
|
1817
2052
|
loggedTypeFailures[error$1.message] = true;
|
|
2053
|
+
setCurrentlyValidatingElement(element);
|
|
1818
2054
|
|
|
1819
2055
|
error('Failed %s type: %s', location, error$1.message);
|
|
2056
|
+
|
|
2057
|
+
setCurrentlyValidatingElement(null);
|
|
1820
2058
|
}
|
|
1821
2059
|
}
|
|
1822
2060
|
}
|
|
1823
2061
|
}
|
|
1824
2062
|
}
|
|
1825
2063
|
|
|
2064
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
2065
|
+
{
|
|
2066
|
+
if (element) {
|
|
2067
|
+
var owner = element._owner;
|
|
2068
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2069
|
+
setExtraStackFrame(stack);
|
|
2070
|
+
} else {
|
|
2071
|
+
setExtraStackFrame(null);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
|
|
1826
2076
|
var propTypesMisspellWarningShown;
|
|
1827
2077
|
|
|
1828
2078
|
{
|
|
@@ -1916,13 +2166,13 @@
|
|
|
1916
2166
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1917
2167
|
}
|
|
1918
2168
|
|
|
1919
|
-
setCurrentlyValidatingElement(element);
|
|
1920
|
-
|
|
1921
2169
|
{
|
|
2170
|
+
setCurrentlyValidatingElement$1(element);
|
|
2171
|
+
|
|
1922
2172
|
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);
|
|
1923
|
-
}
|
|
1924
2173
|
|
|
1925
|
-
|
|
2174
|
+
setCurrentlyValidatingElement$1(null);
|
|
2175
|
+
}
|
|
1926
2176
|
}
|
|
1927
2177
|
/**
|
|
1928
2178
|
* Ensure that every element either is passed in a static location, in an
|
|
@@ -2002,9 +2252,7 @@
|
|
|
2002
2252
|
}
|
|
2003
2253
|
|
|
2004
2254
|
if (propTypes) {
|
|
2005
|
-
|
|
2006
|
-
checkPropTypes(propTypes, element.props, 'prop', name);
|
|
2007
|
-
setCurrentlyValidatingElement(null);
|
|
2255
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2008
2256
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2009
2257
|
propTypesMisspellWarningShown = true;
|
|
2010
2258
|
|
|
@@ -2024,24 +2272,28 @@
|
|
|
2024
2272
|
|
|
2025
2273
|
function validateFragmentProps(fragment) {
|
|
2026
2274
|
{
|
|
2027
|
-
setCurrentlyValidatingElement(fragment);
|
|
2028
2275
|
var keys = Object.keys(fragment.props);
|
|
2029
2276
|
|
|
2030
2277
|
for (var i = 0; i < keys.length; i++) {
|
|
2031
2278
|
var key = keys[i];
|
|
2032
2279
|
|
|
2033
2280
|
if (key !== 'children' && key !== 'key') {
|
|
2281
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2282
|
+
|
|
2034
2283
|
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2035
2284
|
|
|
2285
|
+
setCurrentlyValidatingElement$1(null);
|
|
2036
2286
|
break;
|
|
2037
2287
|
}
|
|
2038
2288
|
}
|
|
2039
2289
|
|
|
2040
2290
|
if (fragment.ref !== null) {
|
|
2291
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2292
|
+
|
|
2041
2293
|
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2042
|
-
}
|
|
2043
2294
|
|
|
2044
|
-
|
|
2295
|
+
setCurrentlyValidatingElement$1(null);
|
|
2296
|
+
}
|
|
2045
2297
|
}
|
|
2046
2298
|
}
|
|
2047
2299
|
function createElementWithValidation(type, props, children) {
|
|
@@ -2288,7 +2540,7 @@
|
|
|
2288
2540
|
forceFrameRate = function (fps) {
|
|
2289
2541
|
if (fps < 0 || fps > 125) {
|
|
2290
2542
|
// Using console['error'] to evade Babel and ESLint
|
|
2291
|
-
console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing
|
|
2543
|
+
console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
|
|
2292
2544
|
return;
|
|
2293
2545
|
}
|
|
2294
2546
|
|
|
@@ -2616,11 +2868,11 @@
|
|
|
2616
2868
|
|
|
2617
2869
|
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
|
|
2618
2870
|
|
|
2619
|
-
var
|
|
2871
|
+
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
|
2620
2872
|
var NORMAL_PRIORITY_TIMEOUT = 5000;
|
|
2621
2873
|
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
|
|
2622
2874
|
|
|
2623
|
-
var
|
|
2875
|
+
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
|
|
2624
2876
|
|
|
2625
2877
|
var taskQueue = [];
|
|
2626
2878
|
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
|
|
@@ -2709,7 +2961,7 @@
|
|
|
2709
2961
|
throw error;
|
|
2710
2962
|
}
|
|
2711
2963
|
} else {
|
|
2712
|
-
// No catch in prod
|
|
2964
|
+
// No catch in prod code path.
|
|
2713
2965
|
return workLoop(hasTimeRemaining, initialTime);
|
|
2714
2966
|
}
|
|
2715
2967
|
} finally {
|
|
@@ -2738,7 +2990,7 @@
|
|
|
2738
2990
|
|
|
2739
2991
|
var callback = currentTask.callback;
|
|
2740
2992
|
|
|
2741
|
-
if (callback
|
|
2993
|
+
if (typeof callback === 'function') {
|
|
2742
2994
|
currentTask.callback = null;
|
|
2743
2995
|
currentPriorityLevel = currentTask.priorityLevel;
|
|
2744
2996
|
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
|
@@ -2847,30 +3099,9 @@
|
|
|
2847
3099
|
};
|
|
2848
3100
|
}
|
|
2849
3101
|
|
|
2850
|
-
function timeoutForPriorityLevel(priorityLevel) {
|
|
2851
|
-
switch (priorityLevel) {
|
|
2852
|
-
case ImmediatePriority:
|
|
2853
|
-
return IMMEDIATE_PRIORITY_TIMEOUT;
|
|
2854
|
-
|
|
2855
|
-
case UserBlockingPriority:
|
|
2856
|
-
return USER_BLOCKING_PRIORITY;
|
|
2857
|
-
|
|
2858
|
-
case IdlePriority:
|
|
2859
|
-
return IDLE_PRIORITY;
|
|
2860
|
-
|
|
2861
|
-
case LowPriority:
|
|
2862
|
-
return LOW_PRIORITY_TIMEOUT;
|
|
2863
|
-
|
|
2864
|
-
case NormalPriority:
|
|
2865
|
-
default:
|
|
2866
|
-
return NORMAL_PRIORITY_TIMEOUT;
|
|
2867
|
-
}
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
3102
|
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
2871
3103
|
var currentTime = getCurrentTime();
|
|
2872
3104
|
var startTime;
|
|
2873
|
-
var timeout;
|
|
2874
3105
|
|
|
2875
3106
|
if (typeof options === 'object' && options !== null) {
|
|
2876
3107
|
var delay = options.delay;
|
|
@@ -2880,13 +3111,35 @@
|
|
|
2880
3111
|
} else {
|
|
2881
3112
|
startTime = currentTime;
|
|
2882
3113
|
}
|
|
2883
|
-
|
|
2884
|
-
timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
|
|
2885
3114
|
} else {
|
|
2886
|
-
timeout = timeoutForPriorityLevel(priorityLevel);
|
|
2887
3115
|
startTime = currentTime;
|
|
2888
3116
|
}
|
|
2889
3117
|
|
|
3118
|
+
var timeout;
|
|
3119
|
+
|
|
3120
|
+
switch (priorityLevel) {
|
|
3121
|
+
case ImmediatePriority:
|
|
3122
|
+
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
|
|
3123
|
+
break;
|
|
3124
|
+
|
|
3125
|
+
case UserBlockingPriority:
|
|
3126
|
+
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
|
|
3127
|
+
break;
|
|
3128
|
+
|
|
3129
|
+
case IdlePriority:
|
|
3130
|
+
timeout = IDLE_PRIORITY_TIMEOUT;
|
|
3131
|
+
break;
|
|
3132
|
+
|
|
3133
|
+
case LowPriority:
|
|
3134
|
+
timeout = LOW_PRIORITY_TIMEOUT;
|
|
3135
|
+
break;
|
|
3136
|
+
|
|
3137
|
+
case NormalPriority:
|
|
3138
|
+
default:
|
|
3139
|
+
timeout = NORMAL_PRIORITY_TIMEOUT;
|
|
3140
|
+
break;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
2890
3143
|
var expirationTime = startTime + timeout;
|
|
2891
3144
|
var newTask = {
|
|
2892
3145
|
id: taskIdCounter++,
|
|
@@ -3355,28 +3608,19 @@
|
|
|
3355
3608
|
IsSomeRendererActing: IsSomeRendererActing,
|
|
3356
3609
|
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
3357
3610
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
3358
|
-
assign:
|
|
3611
|
+
assign: assign,
|
|
3612
|
+
// Re-export the schedule API(s) for UMD bundles.
|
|
3613
|
+
// This avoids introducing a dependency on a new UMD global in a minor update,
|
|
3614
|
+
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
|
|
3615
|
+
// This re-export is only required for UMD bundles;
|
|
3616
|
+
// CJS bundles use the shared NPM package.
|
|
3617
|
+
Scheduler: Scheduler,
|
|
3618
|
+
SchedulerTracing: SchedulerTracing
|
|
3359
3619
|
};
|
|
3360
3620
|
|
|
3361
3621
|
{
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
3365
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
3366
|
-
// TODO: remove in React 17.0.
|
|
3367
|
-
ReactComponentTreeHook: {}
|
|
3368
|
-
});
|
|
3369
|
-
} // Re-export the schedule API(s) for UMD bundles.
|
|
3370
|
-
// This avoids introducing a dependency on a new UMD global in a minor update,
|
|
3371
|
-
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
|
|
3372
|
-
// This re-export is only required for UMD bundles;
|
|
3373
|
-
// CJS bundles use the shared NPM package.
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
_assign$1(ReactSharedInternals$1, {
|
|
3377
|
-
Scheduler: Scheduler,
|
|
3378
|
-
SchedulerTracing: SchedulerTracing
|
|
3379
|
-
});
|
|
3622
|
+
ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
3623
|
+
}
|
|
3380
3624
|
|
|
3381
3625
|
{
|
|
3382
3626
|
|
|
@@ -3406,32 +3650,32 @@
|
|
|
3406
3650
|
exports.Component = Component;
|
|
3407
3651
|
exports.PureComponent = PureComponent;
|
|
3408
3652
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1;
|
|
3409
|
-
exports.block = block;
|
|
3410
3653
|
exports.cloneElement = cloneElement$1;
|
|
3411
3654
|
exports.createContext = createContext;
|
|
3412
3655
|
exports.createElement = createElement$1;
|
|
3413
3656
|
exports.createFactory = createFactory;
|
|
3414
|
-
exports.createMutableSource = createMutableSource;
|
|
3415
3657
|
exports.createRef = createRef;
|
|
3416
3658
|
exports.forwardRef = forwardRef;
|
|
3417
3659
|
exports.isValidElement = isValidElement;
|
|
3418
3660
|
exports.lazy = lazy;
|
|
3419
3661
|
exports.memo = memo;
|
|
3662
|
+
exports.unstable_block = block;
|
|
3663
|
+
exports.unstable_createMutableSource = createMutableSource;
|
|
3664
|
+
exports.unstable_useDeferredValue = useDeferredValue;
|
|
3665
|
+
exports.unstable_useMutableSource = useMutableSource;
|
|
3420
3666
|
exports.unstable_useOpaqueIdentifier = useOpaqueIdentifier;
|
|
3667
|
+
exports.unstable_useTransition = useTransition;
|
|
3421
3668
|
exports.unstable_withSuspenseConfig = withSuspenseConfig;
|
|
3422
3669
|
exports.useCallback = useCallback;
|
|
3423
3670
|
exports.useContext = useContext;
|
|
3424
3671
|
exports.useDebugValue = useDebugValue;
|
|
3425
|
-
exports.useDeferredValue = useDeferredValue;
|
|
3426
3672
|
exports.useEffect = useEffect;
|
|
3427
3673
|
exports.useImperativeHandle = useImperativeHandle;
|
|
3428
3674
|
exports.useLayoutEffect = useLayoutEffect;
|
|
3429
3675
|
exports.useMemo = useMemo;
|
|
3430
|
-
exports.useMutableSource = useMutableSource;
|
|
3431
3676
|
exports.useReducer = useReducer;
|
|
3432
3677
|
exports.useRef = useRef;
|
|
3433
3678
|
exports.useState = useState;
|
|
3434
|
-
exports.useTransition = useTransition;
|
|
3435
3679
|
exports.version = ReactVersion;
|
|
3436
3680
|
|
|
3437
3681
|
})));
|