react 0.0.0-experimental-aae83a4b9 → 0.0.0-experimental-d7382b6c4

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "branch": "master",
3
- "buildNumber": "105612",
4
- "checksum": "b755e17",
5
- "commit": "aae83a4b9",
3
+ "buildNumber": "113424",
4
+ "checksum": "cf19f4a",
5
+ "commit": "d7382b6c4",
6
6
  "environment": "ci",
7
- "reactVersion": "16.13.0-experimental-aae83a4b9"
7
+ "reactVersion": "16.13.1-experimental-d7382b6c4"
8
8
  }
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-dev-runtime.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -34,6 +34,7 @@ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0
34
34
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
35
35
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
36
36
  var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
37
+ var REACT_SERVER_BLOCK_TYPE = hasSymbol ? Symbol.for('react.server.block') : 0xeada;
37
38
  var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
38
39
  var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
39
40
  var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
@@ -106,14 +107,7 @@ function printWarning(level, format, args) {
106
107
 
107
108
  function isValidElementType(type) {
108
109
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
109
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
110
- }
111
-
112
- // TODO: Move this to "react" once we can import from externals.
113
- var Resolved = 1;
114
-
115
- function refineResolvedLazyComponent(lazyComponent) {
116
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
110
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE);
117
111
  }
118
112
 
119
113
  function getWrappedName(outerType, innerType, wrapperName) {
@@ -182,18 +176,19 @@ function getComponentName(type) {
182
176
  return getComponentName(type.type);
183
177
 
184
178
  case REACT_BLOCK_TYPE:
185
- return getComponentName(type.render);
179
+ return getComponentName(type._render);
186
180
 
187
181
  case REACT_LAZY_TYPE:
188
182
  {
189
- var thenable = type;
190
- var resolvedThenable = refineResolvedLazyComponent(thenable);
191
-
192
- if (resolvedThenable) {
193
- return getComponentName(resolvedThenable);
183
+ var lazyComponent = type;
184
+ var payload = lazyComponent._payload;
185
+ var init = lazyComponent._init;
186
+
187
+ try {
188
+ return getComponentName(init(payload));
189
+ } catch (x) {
190
+ return null;
194
191
  }
195
-
196
- break;
197
192
  }
198
193
  }
199
194
  }
@@ -287,9 +282,9 @@ function hasValidKey(config) {
287
282
  return config.key !== undefined;
288
283
  }
289
284
 
290
- function warnIfStringRefCannotBeAutoConverted(config) {
285
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
291
286
  {
292
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
287
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
293
288
  var componentName = getComponentName(ReactCurrentOwner.current.type);
294
289
 
295
290
  if (!didWarnAboutStringRefs[componentName]) {
@@ -441,7 +436,7 @@ function jsxDEV(type, config, maybeKey, source, self) {
441
436
 
442
437
  if (hasValidRef(config)) {
443
438
  ref = config.ref;
444
- warnIfStringRefCannotBeAutoConverted(config);
439
+ warnIfStringRefCannotBeAutoConverted(config, self);
445
440
  } // Remaining properties are added to a new props object
446
441
 
447
442
 
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-dev-runtime.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-dev-runtime.profiling.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-runtime.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -34,6 +34,7 @@ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0
34
34
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
35
35
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
36
36
  var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
37
+ var REACT_SERVER_BLOCK_TYPE = hasSymbol ? Symbol.for('react.server.block') : 0xeada;
37
38
  var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
38
39
  var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
39
40
  var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
@@ -106,14 +107,7 @@ function printWarning(level, format, args) {
106
107
 
107
108
  function isValidElementType(type) {
108
109
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
109
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
110
- }
111
-
112
- // TODO: Move this to "react" once we can import from externals.
113
- var Resolved = 1;
114
-
115
- function refineResolvedLazyComponent(lazyComponent) {
116
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
110
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE);
117
111
  }
118
112
 
119
113
  function getWrappedName(outerType, innerType, wrapperName) {
@@ -182,18 +176,19 @@ function getComponentName(type) {
182
176
  return getComponentName(type.type);
183
177
 
184
178
  case REACT_BLOCK_TYPE:
185
- return getComponentName(type.render);
179
+ return getComponentName(type._render);
186
180
 
187
181
  case REACT_LAZY_TYPE:
188
182
  {
189
- var thenable = type;
190
- var resolvedThenable = refineResolvedLazyComponent(thenable);
191
-
192
- if (resolvedThenable) {
193
- return getComponentName(resolvedThenable);
183
+ var lazyComponent = type;
184
+ var payload = lazyComponent._payload;
185
+ var init = lazyComponent._init;
186
+
187
+ try {
188
+ return getComponentName(init(payload));
189
+ } catch (x) {
190
+ return null;
194
191
  }
195
-
196
- break;
197
192
  }
198
193
  }
199
194
  }
@@ -287,9 +282,9 @@ function hasValidKey(config) {
287
282
  return config.key !== undefined;
288
283
  }
289
284
 
290
- function warnIfStringRefCannotBeAutoConverted(config) {
285
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
291
286
  {
292
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
287
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
293
288
  var componentName = getComponentName(ReactCurrentOwner.current.type);
294
289
 
295
290
  if (!didWarnAboutStringRefs[componentName]) {
@@ -441,7 +436,7 @@ function jsxDEV(type, config, maybeKey, source, self) {
441
436
 
442
437
  if (hasValidRef(config)) {
443
438
  ref = config.ref;
444
- warnIfStringRefCannotBeAutoConverted(config);
439
+ warnIfStringRefCannotBeAutoConverted(config, self);
445
440
  } // Remaining properties are added to a new props object
446
441
 
447
442
 
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-runtime.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react-jsx-runtime.profiling.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.0.0-experimental-aae83a4b9
1
+ /** @license React v0.0.0-experimental-d7382b6c4
2
2
  * react.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -18,7 +18,7 @@ if (process.env.NODE_ENV !== "production") {
18
18
  var _assign = require('object-assign');
19
19
 
20
20
  // TODO: this is special because it gets imported during build.
21
- var ReactVersion = '16.13.0-experimental-aae83a4b9';
21
+ var ReactVersion = '16.13.1-experimental-d7382b6c4';
22
22
 
23
23
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
24
24
  // nor polyfill, then a plain number is used for performance.
@@ -37,6 +37,7 @@ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0
37
37
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
38
38
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
39
39
  var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
40
+ var REACT_SERVER_BLOCK_TYPE = hasSymbol ? Symbol.for('react.server.block') : 0xeada;
40
41
  var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
41
42
  var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
42
43
  var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
@@ -122,13 +123,6 @@ function describeComponentFrame (name, source, ownerName) {
122
123
  return '\n in ' + (name || 'Unknown') + sourceInfo;
123
124
  }
124
125
 
125
- // TODO: Move this to "react" once we can import from externals.
126
- var Resolved = 1;
127
-
128
- function refineResolvedLazyComponent(lazyComponent) {
129
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
130
- }
131
-
132
126
  function getWrappedName(outerType, innerType, wrapperName) {
133
127
  var functionName = innerType.displayName || innerType.name || '';
134
128
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
@@ -195,18 +189,19 @@ function getComponentName(type) {
195
189
  return getComponentName(type.type);
196
190
 
197
191
  case REACT_BLOCK_TYPE:
198
- return getComponentName(type.render);
192
+ return getComponentName(type._render);
199
193
 
200
194
  case REACT_LAZY_TYPE:
201
195
  {
202
- var thenable = type;
203
- var resolvedThenable = refineResolvedLazyComponent(thenable);
204
-
205
- if (resolvedThenable) {
206
- return getComponentName(resolvedThenable);
196
+ var lazyComponent = type;
197
+ var payload = lazyComponent._payload;
198
+ var init = lazyComponent._init;
199
+
200
+ try {
201
+ return getComponentName(init(payload));
202
+ } catch (x) {
203
+ return null;
207
204
  }
208
-
209
- break;
210
205
  }
211
206
  }
212
207
  }
@@ -926,7 +921,7 @@ function escape(key) {
926
921
  '=': '=0',
927
922
  ':': '=2'
928
923
  };
929
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
924
+ var escapedString = key.replace(escapeRegex, function (match) {
930
925
  return escaperLookup[match];
931
926
  });
932
927
  return '$' + escapedString;
@@ -941,54 +936,30 @@ var didWarnAboutMaps = false;
941
936
  var userProvidedKeyEscapeRegex = /\/+/g;
942
937
 
943
938
  function escapeUserProvidedKey(text) {
944
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
939
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
945
940
  }
941
+ /**
942
+ * Generate a key string that identifies a element within a set.
943
+ *
944
+ * @param {*} element A element that could contain a manual key.
945
+ * @param {number} index Index that is used if a manual key is not provided.
946
+ * @return {string}
947
+ */
946
948
 
947
- var POOL_SIZE = 10;
948
- var traverseContextPool = [];
949
949
 
950
- function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
951
- if (traverseContextPool.length) {
952
- var traverseContext = traverseContextPool.pop();
953
- traverseContext.result = mapResult;
954
- traverseContext.keyPrefix = keyPrefix;
955
- traverseContext.func = mapFunction;
956
- traverseContext.context = mapContext;
957
- traverseContext.count = 0;
958
- return traverseContext;
959
- } else {
960
- return {
961
- result: mapResult,
962
- keyPrefix: keyPrefix,
963
- func: mapFunction,
964
- context: mapContext,
965
- count: 0
966
- };
967
- }
968
- }
950
+ function getElementKey(element, index) {
951
+ // Do some typechecking here since we call this blindly. We want to ensure
952
+ // that we don't block potential future ES APIs.
953
+ if (typeof element === 'object' && element !== null && element.key != null) {
954
+ // Explicit key
955
+ return escape('' + element.key);
956
+ } // Implicit key determined by the index in the set
969
957
 
970
- function releaseTraverseContext(traverseContext) {
971
- traverseContext.result = null;
972
- traverseContext.keyPrefix = null;
973
- traverseContext.func = null;
974
- traverseContext.context = null;
975
- traverseContext.count = 0;
976
958
 
977
- if (traverseContextPool.length < POOL_SIZE) {
978
- traverseContextPool.push(traverseContext);
979
- }
959
+ return index.toString(36);
980
960
  }
981
- /**
982
- * @param {?*} children Children tree container.
983
- * @param {!string} nameSoFar Name of the key path so far.
984
- * @param {!function} callback Callback to invoke with each child found.
985
- * @param {?*} traverseContext Used to pass information throughout the traversal
986
- * process.
987
- * @return {!number} The number of children in this subtree.
988
- */
989
961
 
990
-
991
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
962
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
992
963
  var type = typeof children;
993
964
 
994
965
  if (type === 'undefined' || type === 'boolean') {
@@ -1018,9 +989,34 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1018
989
  }
1019
990
 
1020
991
  if (invokeCallback) {
1021
- callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
1022
- // so that it's consistent if the number of children grows.
1023
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
992
+ var _child = children;
993
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
994
+ // so that it's consistent if the number of children grows:
995
+
996
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
997
+
998
+ if (Array.isArray(mappedChild)) {
999
+ var escapedChildKey = '';
1000
+
1001
+ if (childKey != null) {
1002
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1003
+ }
1004
+
1005
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1006
+ return c;
1007
+ });
1008
+ } else if (mappedChild != null) {
1009
+ if (isValidElement(mappedChild)) {
1010
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1011
+ // traverseAllChildren used to do for objects as children
1012
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1013
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1014
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1015
+ }
1016
+
1017
+ array.push(mappedChild);
1018
+ }
1019
+
1024
1020
  return 1;
1025
1021
  }
1026
1022
 
@@ -1033,17 +1029,18 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1033
1029
  if (Array.isArray(children)) {
1034
1030
  for (var i = 0; i < children.length; i++) {
1035
1031
  child = children[i];
1036
- nextName = nextNamePrefix + getComponentKey(child, i);
1037
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1032
+ nextName = nextNamePrefix + getElementKey(child, i);
1033
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1038
1034
  }
1039
1035
  } else {
1040
1036
  var iteratorFn = getIteratorFn(children);
1041
1037
 
1042
1038
  if (typeof iteratorFn === 'function') {
1039
+ var iterableChildren = children;
1043
1040
 
1044
1041
  {
1045
1042
  // Warn about using Maps as children
1046
- if (iteratorFn === children.entries) {
1043
+ if (iteratorFn === iterableChildren.entries) {
1047
1044
  if (!didWarnAboutMaps) {
1048
1045
  warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
1049
1046
  }
@@ -1052,14 +1049,14 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1052
1049
  }
1053
1050
  }
1054
1051
 
1055
- var iterator = iteratorFn.call(children);
1052
+ var iterator = iteratorFn.call(iterableChildren);
1056
1053
  var step;
1057
1054
  var ii = 0;
1058
1055
 
1059
1056
  while (!(step = iterator.next()).done) {
1060
1057
  child = step.value;
1061
- nextName = nextNamePrefix + getComponentKey(child, ii++);
1062
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1058
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1059
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1063
1060
  }
1064
1061
  } else if (type === 'object') {
1065
1062
  var addendum = '';
@@ -1080,114 +1077,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1080
1077
 
1081
1078
  return subtreeCount;
1082
1079
  }
1083
- /**
1084
- * Traverses children that are typically specified as `props.children`, but
1085
- * might also be specified through attributes:
1086
- *
1087
- * - `traverseAllChildren(this.props.children, ...)`
1088
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1089
- *
1090
- * The `traverseContext` is an optional argument that is passed through the
1091
- * entire traversal. It can be used to store accumulations or anything else that
1092
- * the callback might find relevant.
1093
- *
1094
- * @param {?*} children Children tree object.
1095
- * @param {!function} callback To invoke upon traversing each child.
1096
- * @param {?*} traverseContext Context for traversal.
1097
- * @return {!number} The number of children in this subtree.
1098
- */
1099
-
1100
-
1101
- function traverseAllChildren(children, callback, traverseContext) {
1102
- if (children == null) {
1103
- return 0;
1104
- }
1105
1080
 
1106
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
1107
- }
1108
- /**
1109
- * Generate a key string that identifies a component within a set.
1110
- *
1111
- * @param {*} component A component that could contain a manual key.
1112
- * @param {number} index Index that is used if a manual key is not provided.
1113
- * @return {string}
1114
- */
1115
-
1116
-
1117
- function getComponentKey(component, index) {
1118
- // Do some typechecking here since we call this blindly. We want to ensure
1119
- // that we don't block potential future ES APIs.
1120
- if (typeof component === 'object' && component !== null && component.key != null) {
1121
- // Explicit key
1122
- return escape(component.key);
1123
- } // Implicit key determined by the index in the set
1124
-
1125
-
1126
- return index.toString(36);
1127
- }
1128
-
1129
- function forEachSingleChild(bookKeeping, child, name) {
1130
- var func = bookKeeping.func,
1131
- context = bookKeeping.context;
1132
- func.call(context, child, bookKeeping.count++);
1133
- }
1134
- /**
1135
- * Iterates through children that are typically specified as `props.children`.
1136
- *
1137
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1138
- *
1139
- * The provided forEachFunc(child, index) will be called for each
1140
- * leaf child.
1141
- *
1142
- * @param {?*} children Children tree container.
1143
- * @param {function(*, int)} forEachFunc
1144
- * @param {*} forEachContext Context for forEachContext.
1145
- */
1146
-
1147
-
1148
- function forEachChildren(children, forEachFunc, forEachContext) {
1149
- if (children == null) {
1150
- return children;
1151
- }
1152
-
1153
- var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
1154
- traverseAllChildren(children, forEachSingleChild, traverseContext);
1155
- releaseTraverseContext(traverseContext);
1156
- }
1157
-
1158
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1159
- var result = bookKeeping.result,
1160
- keyPrefix = bookKeeping.keyPrefix,
1161
- func = bookKeeping.func,
1162
- context = bookKeeping.context;
1163
- var mappedChild = func.call(context, child, bookKeeping.count++);
1164
-
1165
- if (Array.isArray(mappedChild)) {
1166
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
1167
- return c;
1168
- });
1169
- } else if (mappedChild != null) {
1170
- if (isValidElement(mappedChild)) {
1171
- mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1172
- // traverseAllChildren used to do for objects as children
1173
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1174
- }
1175
-
1176
- result.push(mappedChild);
1177
- }
1178
- }
1179
-
1180
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1181
- var escapedPrefix = '';
1182
-
1183
- if (prefix != null) {
1184
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1185
- }
1186
-
1187
- var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
1188
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
1189
- releaseTraverseContext(traverseContext);
1190
- }
1191
1081
  /**
1192
1082
  * Maps children that are typically specified as `props.children`.
1193
1083
  *
@@ -1201,15 +1091,16 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1201
1091
  * @param {*} context Context for mapFunction.
1202
1092
  * @return {object} Object containing the ordered map of results.
1203
1093
  */
1204
-
1205
-
1206
1094
  function mapChildren(children, func, context) {
1207
1095
  if (children == null) {
1208
1096
  return children;
1209
1097
  }
1210
1098
 
1211
1099
  var result = [];
1212
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1100
+ var count = 0;
1101
+ mapIntoArray(children, result, '', '', function (child) {
1102
+ return func.call(context, child, count++);
1103
+ });
1213
1104
  return result;
1214
1105
  }
1215
1106
  /**
@@ -1224,9 +1115,29 @@ function mapChildren(children, func, context) {
1224
1115
 
1225
1116
 
1226
1117
  function countChildren(children) {
1227
- return traverseAllChildren(children, function () {
1228
- return null;
1229
- }, null);
1118
+ var n = 0;
1119
+ mapChildren(children, function () {
1120
+ n++; // Don't return anything
1121
+ });
1122
+ return n;
1123
+ }
1124
+
1125
+ /**
1126
+ * Iterates through children that are typically specified as `props.children`.
1127
+ *
1128
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1129
+ *
1130
+ * The provided forEachFunc(child, index) will be called for each
1131
+ * leaf child.
1132
+ *
1133
+ * @param {?*} children Children tree container.
1134
+ * @param {function(*, int)} forEachFunc
1135
+ * @param {*} forEachContext Context for forEachContext.
1136
+ */
1137
+ function forEachChildren(children, forEachFunc, forEachContext) {
1138
+ mapChildren(children, function () {
1139
+ forEachFunc.apply(this, arguments); // Don't return anything.
1140
+ }, forEachContext);
1230
1141
  }
1231
1142
  /**
1232
1143
  * Flatten a children object (typically specified as `props.children`) and
@@ -1237,11 +1148,9 @@ function countChildren(children) {
1237
1148
 
1238
1149
 
1239
1150
  function toArray(children) {
1240
- var result = [];
1241
- mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
1151
+ return mapChildren(children, function (child) {
1242
1152
  return child;
1243
- });
1244
- return result;
1153
+ }) || [];
1245
1154
  }
1246
1155
  /**
1247
1156
  * Returns the first child in a collection of children and verifies that there
@@ -1390,13 +1299,63 @@ function createContext(defaultValue, calculateChangedBits) {
1390
1299
  return context;
1391
1300
  }
1392
1301
 
1302
+ var Uninitialized = -1;
1303
+ var Pending = 0;
1304
+ var Resolved = 1;
1305
+ var Rejected = 2;
1306
+
1307
+ function lazyInitializer(payload) {
1308
+ if (payload._status === Uninitialized) {
1309
+ var ctor = payload._result;
1310
+ var thenable = ctor(); // Transition to the next state.
1311
+
1312
+ var pending = payload;
1313
+ pending._status = Pending;
1314
+ pending._result = thenable;
1315
+ thenable.then(function (moduleObject) {
1316
+ if (payload._status === Pending) {
1317
+ var defaultExport = moduleObject.default;
1318
+
1319
+ {
1320
+ if (defaultExport === undefined) {
1321
+ error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1322
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1323
+ }
1324
+ } // Transition to the next state.
1325
+
1326
+
1327
+ var resolved = payload;
1328
+ resolved._status = Resolved;
1329
+ resolved._result = defaultExport;
1330
+ }
1331
+ }, function (error) {
1332
+ if (payload._status === Pending) {
1333
+ // Transition to the next state.
1334
+ var rejected = payload;
1335
+ rejected._status = Rejected;
1336
+ rejected._result = error;
1337
+ }
1338
+ });
1339
+ }
1340
+
1341
+ if (payload._status === Resolved) {
1342
+ return payload._result;
1343
+ } else {
1344
+ throw payload._result;
1345
+ }
1346
+ }
1347
+
1393
1348
  function lazy(ctor) {
1394
- var lazyType = {
1395
- $$typeof: REACT_LAZY_TYPE,
1396
- // React uses these fields to store the result.
1349
+ var payload = {
1350
+ // We use these fields to store the result.
1397
1351
  _status: -1,
1398
1352
  _result: ctor
1399
1353
  };
1354
+ var lazyType = {
1355
+ $$typeof: REACT_LAZY_TYPE,
1356
+ _payload: payload,
1357
+ _init: lazyInitializer
1358
+ };
1400
1359
 
1401
1360
  {
1402
1361
  // In production, this would just set it on the object.
@@ -1469,7 +1428,7 @@ function forwardRef(render) {
1469
1428
 
1470
1429
  function isValidElementType(type) {
1471
1430
  return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1472
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
1431
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE);
1473
1432
  }
1474
1433
 
1475
1434
  function memo(type, compare) {
@@ -1486,10 +1445,18 @@ function memo(type, compare) {
1486
1445
  };
1487
1446
  }
1488
1447
 
1489
- function block(query, render) {
1448
+ function lazyInitializer$1(payload) {
1449
+ return {
1450
+ $$typeof: REACT_BLOCK_TYPE,
1451
+ _data: payload.load.apply(null, payload.args),
1452
+ _render: payload.render
1453
+ };
1454
+ }
1455
+
1456
+ function block(render, load) {
1490
1457
  {
1491
- if (typeof query !== 'function') {
1492
- error('Blocks require a query function but was given %s.', query === null ? 'null' : typeof query);
1458
+ if (load !== undefined && typeof load !== 'function') {
1459
+ error('Blocks require a load function, if provided, but was given %s.', load === null ? 'null' : typeof load);
1493
1460
  }
1494
1461
 
1495
1462
  if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
@@ -1500,7 +1467,7 @@ function block(query, render) {
1500
1467
  error('Blocks require a render function but was given %s.', render === null ? 'null' : typeof render);
1501
1468
  } else if (render.length !== 0 && render.length !== 2) {
1502
1469
  // Warn if it's not accepting two args.
1503
- // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
1470
+ // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object.
1504
1471
  error('Block render functions accept exactly two parameters: props and data. %s', render.length === 1 ? 'Did you forget to use the data parameter?' : 'Any additional parameter will be undefined.');
1505
1472
  }
1506
1473
 
@@ -1509,21 +1476,35 @@ function block(query, render) {
1509
1476
  }
1510
1477
  }
1511
1478
 
1512
- function initializer(args) {
1513
- var data = query.apply(null, args);
1514
- return [data, render];
1515
- }
1479
+ if (load === undefined) {
1480
+ return function () {
1481
+ var blockComponent = {
1482
+ $$typeof: REACT_BLOCK_TYPE,
1483
+ _data: undefined,
1484
+ // $FlowFixMe: Data must be void in this scenario.
1485
+ _render: render
1486
+ }; // $FlowFixMe: Upstream BlockComponent to Flow as a valid Node.
1516
1487
 
1488
+ return blockComponent;
1489
+ };
1490
+ } // Trick to let Flow refine this.
1491
+
1492
+
1493
+ var loadFn = load;
1517
1494
  return function () {
1518
1495
  var args = arguments;
1519
- var blockComponent = {
1520
- $$typeof: REACT_BLOCK_TYPE,
1521
- _status: -1,
1522
- _data: args,
1523
- _fn: initializer
1524
- }; // $FlowFixMe
1525
-
1526
- return blockComponent;
1496
+ var payload = {
1497
+ load: loadFn,
1498
+ args: args,
1499
+ render: render
1500
+ };
1501
+ var lazyType = {
1502
+ $$typeof: REACT_LAZY_TYPE,
1503
+ _payload: payload,
1504
+ _init: lazyInitializer$1
1505
+ }; // $FlowFixMe: Upstream BlockComponent to Flow as a valid Node.
1506
+
1507
+ return lazyType;
1527
1508
  };
1528
1509
  }
1529
1510
 
@@ -2009,13 +1990,11 @@ function createMutableSource(source, getVersion) {
2009
1990
 
2010
1991
  try {
2011
1992
  var frozenObject = Object.freeze({});
2012
- var testMap = new Map([[frozenObject, null]]);
2013
- var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
2014
- // https://github.com/rollup/rollup/issues/1771
2015
- // TODO: we can remove these if Rollup fixes the bug.
1993
+ /* eslint-disable no-new */
2016
1994
 
2017
- testMap.set(0, 0);
2018
- testSet.add(0);
1995
+ new Map([[frozenObject, null]]);
1996
+ new Set([frozenObject]);
1997
+ /* eslint-enable no-new */
2019
1998
  } catch (e) {
2020
1999
  }
2021
2000
  }