react-reconciler 0.3.0-beta.1 → 0.7.0

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.
@@ -1,4 +1,4 @@
1
- /** @license React v16.1.0-beta.1
1
+ /** @license React v16.2.0
2
2
  * react-reconciler.development.js
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
@@ -7,14 +7,15 @@
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
 
10
-
11
10
  'use strict';
12
11
 
13
-
14
12
  if (process.env.NODE_ENV !== "production") {
15
- var $$$reconciler;
16
- module.exports = function(config) {
17
-
13
+ // This is a hacky way to ensure third party renderers don't share
14
+ // top-level module state inside the reconciler. Ideally we should
15
+ // remove this hack by putting all top-level state into the closures
16
+ // and then forbidding adding more of it in the reconciler.
17
+ var $$$reconciler;
18
+ module.exports = function(config) {
18
19
  'use strict';
19
20
 
20
21
  var _assign = require('object-assign');
@@ -25,15 +26,6 @@ var emptyObject = require('fbjs/lib/emptyObject');
25
26
  var checkPropTypes = require('prop-types/checkPropTypes');
26
27
  var shallowEqual = require('fbjs/lib/shallowEqual');
27
28
 
28
- /**
29
- * Copyright (c) 2013-present, Facebook, Inc.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- *
34
- *
35
- */
36
-
37
29
  /**
38
30
  * WARNING: DO NOT manually require this module.
39
31
  * This is a replacement for `invariant(...)` used by the error code system
@@ -41,19 +33,8 @@ var shallowEqual = require('fbjs/lib/shallowEqual');
41
33
  * It always throws.
42
34
  */
43
35
 
44
- /**
45
- * Copyright (c) 2013-present, Facebook, Inc.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- *
50
- *
51
- */
52
-
53
36
  var enableAsyncSubtreeAPI = true;
54
37
 
55
- // Exports React.Fragment
56
- var enableReactFragment = false;
57
38
  // Exports ReactDOM.createRoot
58
39
 
59
40
  var enableUserTimingAPI = true;
@@ -65,14 +46,10 @@ var enableNoopReconciler = false;
65
46
  // Experimental persistent mode (CS):
66
47
  var enablePersistentReconciler = false;
67
48
 
68
- // Only used in www builds.
49
+ // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
50
+ var debugRenderPhaseSideEffects = false;
69
51
 
70
- /**
71
- * Copyright (c) 2013-present, Facebook, Inc.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */
52
+ // Only used in www builds.
76
53
 
77
54
  /**
78
55
  * `ReactInstanceMap` maintains a mapping from a public facing stateful
@@ -85,10 +62,10 @@ var enablePersistentReconciler = false;
85
62
  */
86
63
 
87
64
  /**
88
- * This API should be called `delete` but we'd have to make sure to always
89
- * transform these to strings for IE support. When this transform is fully
90
- * supported we can rename it.
91
- */
65
+ * This API should be called `delete` but we'd have to make sure to always
66
+ * transform these to strings for IE support. When this transform is fully
67
+ * supported we can rename it.
68
+ */
92
69
 
93
70
 
94
71
  function get(key) {
@@ -101,13 +78,6 @@ function set(key, value) {
101
78
  key._reactInternalFiber = value;
102
79
  }
103
80
 
104
- /**
105
- * Copyright (c) 2013-present, Facebook, Inc.
106
- *
107
- * This source code is licensed under the MIT license found in the
108
- * LICENSE file in the root directory of this source tree.
109
- */
110
-
111
81
  var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
112
82
 
113
83
  var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
@@ -123,25 +93,9 @@ function getComponentName(fiber) {
123
93
  return type.displayName || type.name;
124
94
  }
125
95
  return null;
126
- } /**
127
- * Copyright (c) 2013-present, Facebook, Inc.
128
- *
129
- * This source code is licensed under the MIT license found in the
130
- * LICENSE file in the root directory of this source tree.
131
- *
132
- *
133
- */
96
+ }
134
97
 
135
98
  var IndeterminateComponent = 0; // Before we know whether it is functional or class
136
- /**
137
- * Copyright (c) 2013-present, Facebook, Inc.
138
- *
139
- * This source code is licensed under the MIT license found in the
140
- * LICENSE file in the root directory of this source tree.
141
- *
142
- *
143
- */
144
-
145
99
  var FunctionalComponent = 1;
146
100
  var ClassComponent = 2;
147
101
  var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
@@ -155,15 +109,6 @@ var Fragment = 10;
155
109
 
156
110
  // Don't change these two values:
157
111
  var NoEffect = 0; // 0b00000000
158
- /**
159
- * Copyright (c) 2013-present, Facebook, Inc.
160
- *
161
- * This source code is licensed under the MIT license found in the
162
- * LICENSE file in the root directory of this source tree.
163
- *
164
- *
165
- */
166
-
167
112
  var PerformedWork = 1; // 0b00000001
168
113
 
169
114
  // You can change the rest (and add more).
@@ -478,15 +423,6 @@ function reset() {
478
423
  }
479
424
  }
480
425
 
481
- /**
482
- * Copyright (c) 2016-present, Facebook, Inc.
483
- *
484
- * This source code is licensed under the MIT license found in the
485
- * LICENSE file in the root directory of this source tree.
486
- *
487
- *
488
- */
489
-
490
426
  var describeComponentFrame = function (name, source, ownerName) {
491
427
  return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
492
428
  };
@@ -524,15 +460,6 @@ function getStackAddendumByWorkInProgressFiber(workInProgress) {
524
460
  return info;
525
461
  }
526
462
 
527
- /**
528
- * Copyright (c) 2013-present, Facebook, Inc.
529
- *
530
- * This source code is licensed under the MIT license found in the
531
- * LICENSE file in the root directory of this source tree.
532
- *
533
- *
534
- */
535
-
536
463
  function getCurrentFiberOwnerName() {
537
464
  {
538
465
  var fiber = ReactDebugCurrentFiber.current;
@@ -609,6 +536,7 @@ var hasScheduledUpdateInCurrentCommit = false;
609
536
  var hasScheduledUpdateInCurrentPhase = false;
610
537
  var commitCountInCurrentWorkLoop = 0;
611
538
  var effectCountInCurrentCommit = 0;
539
+ var isWaitingForCallback = false;
612
540
  // During commits, we only show a measurement once per method name
613
541
  // to avoid stretch the commit phase with measurement overhead.
614
542
  var labelsInCurrentCommit = new Set();
@@ -767,6 +695,25 @@ function recordScheduleUpdate() {
767
695
  }
768
696
  }
769
697
 
698
+ function startRequestCallbackTimer() {
699
+ if (enableUserTimingAPI) {
700
+ if (supportsUserTiming && !isWaitingForCallback) {
701
+ isWaitingForCallback = true;
702
+ beginMark('(Waiting for async callback...)');
703
+ }
704
+ }
705
+ }
706
+
707
+ function stopRequestCallbackTimer(didExpire) {
708
+ if (enableUserTimingAPI) {
709
+ if (supportsUserTiming) {
710
+ isWaitingForCallback = false;
711
+ var warning$$1 = didExpire ? 'React was blocked by main thread' : null;
712
+ endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning$$1);
713
+ }
714
+ }
715
+ }
716
+
770
717
  function startWorkTimer(fiber) {
771
718
  if (enableUserTimingAPI) {
772
719
  if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
@@ -852,8 +799,9 @@ function stopPhaseTimer() {
852
799
  }
853
800
  }
854
801
 
855
- function startWorkLoopTimer() {
802
+ function startWorkLoopTimer(nextUnitOfWork) {
856
803
  if (enableUserTimingAPI) {
804
+ currentFiber = nextUnitOfWork;
857
805
  if (!supportsUserTiming) {
858
806
  return;
859
807
  }
@@ -866,12 +814,22 @@ function startWorkLoopTimer() {
866
814
  }
867
815
  }
868
816
 
869
- function stopWorkLoopTimer() {
817
+ function stopWorkLoopTimer(interruptedBy) {
870
818
  if (enableUserTimingAPI) {
871
819
  if (!supportsUserTiming) {
872
820
  return;
873
821
  }
874
- var warning$$1 = commitCountInCurrentWorkLoop > 1 ? 'There were cascading updates' : null;
822
+ var warning$$1 = null;
823
+ if (interruptedBy !== null) {
824
+ if (interruptedBy.tag === HostRoot) {
825
+ warning$$1 = 'A top-level update interrupted the previous render';
826
+ } else {
827
+ var componentName = getComponentName(interruptedBy) || 'Unknown';
828
+ warning$$1 = 'An update to ' + componentName + ' interrupted the previous render';
829
+ }
830
+ } else if (commitCountInCurrentWorkLoop > 1) {
831
+ warning$$1 = 'There were cascading updates';
832
+ }
875
833
  commitCountInCurrentWorkLoop = 0;
876
834
  // Pause any measurements until the next loop.
877
835
  pauseTimers();
@@ -954,15 +912,6 @@ function stopCommitLifeCyclesTimer() {
954
912
  }
955
913
  }
956
914
 
957
- /**
958
- * Copyright (c) 2013-present, Facebook, Inc.
959
- *
960
- * This source code is licensed under the MIT license found in the
961
- * LICENSE file in the root directory of this source tree.
962
- *
963
- *
964
- */
965
-
966
915
  {
967
916
  var warnedAboutMissingGetChildContext = {};
968
917
  }
@@ -1173,16 +1122,7 @@ function findCurrentUnmaskedContext(fiber) {
1173
1122
  return node.stateNode.context;
1174
1123
  }
1175
1124
 
1176
- var NoWork = 0; /**
1177
- * Copyright (c) 2013-present, Facebook, Inc.
1178
- *
1179
- * This source code is licensed under the MIT license found in the
1180
- * LICENSE file in the root directory of this source tree.
1181
- *
1182
- *
1183
- */
1184
-
1185
- // TODO: Use an opaque type once ESLint et al support the syntax
1125
+ var NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax
1186
1126
 
1187
1127
  var Sync = 1;
1188
1128
  var Never = 2147483647; // Max int32: Math.pow(2, 31) - 1
@@ -1196,6 +1136,10 @@ function msToExpirationTime(ms) {
1196
1136
  return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET;
1197
1137
  }
1198
1138
 
1139
+ function expirationTimeToMs(expirationTime) {
1140
+ return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE;
1141
+ }
1142
+
1199
1143
  function ceiling(num, precision) {
1200
1144
  return ((num / precision | 0) + 1) * precision;
1201
1145
  }
@@ -1204,15 +1148,7 @@ function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
1204
1148
  return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
1205
1149
  }
1206
1150
 
1207
- var NoContext = 0; /**
1208
- * Copyright (c) 2013-present, Facebook, Inc.
1209
- *
1210
- * This source code is licensed under the MIT license found in the
1211
- * LICENSE file in the root directory of this source tree.
1212
- *
1213
- *
1214
- */
1215
-
1151
+ var NoContext = 0;
1216
1152
  var AsyncUpdates = 1;
1217
1153
 
1218
1154
  {
@@ -1220,8 +1156,7 @@ var AsyncUpdates = 1;
1220
1156
  try {
1221
1157
  var nonExtensibleObject = Object.preventExtensions({});
1222
1158
  /* eslint-disable no-new */
1223
- new Map([[nonExtensibleObject, null]]);
1224
- new Set([nonExtensibleObject]);
1159
+
1225
1160
  /* eslint-enable no-new */
1226
1161
  } catch (e) {
1227
1162
  // TODO: Consider warning about bad polyfills
@@ -1388,7 +1323,7 @@ function createFiberFromElement(element, internalContextTag, expirationTime) {
1388
1323
  var info = '';
1389
1324
  {
1390
1325
  if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1391
- info += ' You likely forgot to export your component from the file ' + "it's defined in.";
1326
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1392
1327
  }
1393
1328
  var ownerName = owner ? getComponentName(owner) : null;
1394
1329
  if (ownerName) {
@@ -1454,15 +1389,6 @@ function createFiberFromPortal(portal, internalContextTag, expirationTime) {
1454
1389
  return fiber;
1455
1390
  }
1456
1391
 
1457
- /**
1458
- * Copyright (c) 2013-present, Facebook, Inc.
1459
- *
1460
- * This source code is licensed under the MIT license found in the
1461
- * LICENSE file in the root directory of this source tree.
1462
- *
1463
- *
1464
- */
1465
-
1466
1392
  function createFiberRoot(containerInfo, hydrate) {
1467
1393
  // Cyclic construction. This cheats the type system right now because
1468
1394
  // stateNode is any.
@@ -1483,15 +1409,6 @@ function createFiberRoot(containerInfo, hydrate) {
1483
1409
  return root;
1484
1410
  }
1485
1411
 
1486
- /**
1487
- * Copyright (c) 2013-present, Facebook, Inc.
1488
- *
1489
- * This source code is licensed under the MIT license found in the
1490
- * LICENSE file in the root directory of this source tree.
1491
- *
1492
- *
1493
- */
1494
-
1495
1412
  var onCommitFiberRoot = null;
1496
1413
  var onCommitFiberUnmount = null;
1497
1414
  var hasLoggedError = false;
@@ -1559,15 +1476,6 @@ function onCommitUnmount(fiber) {
1559
1476
  }
1560
1477
  }
1561
1478
 
1562
- /**
1563
- * Copyright (c) 2013-present, Facebook, Inc.
1564
- *
1565
- * This source code is licensed under the MIT license found in the
1566
- * LICENSE file in the root directory of this source tree.
1567
- *
1568
- *
1569
- */
1570
-
1571
1479
  var ReactErrorUtils = {
1572
1480
  // Used by Fiber to simulate a try-catch.
1573
1481
  _caughtError: null,
@@ -1774,15 +1682,6 @@ var rethrowCaughtError = function () {
1774
1682
  }
1775
1683
  };
1776
1684
 
1777
- /**
1778
- * Copyright (c) 2013-present, Facebook, Inc.
1779
- *
1780
- * This source code is licensed under the MIT license found in the
1781
- * LICENSE file in the root directory of this source tree.
1782
- *
1783
- *
1784
- */
1785
-
1786
1685
  {
1787
1686
  var didWarnUpdateInsideUpdate = false;
1788
1687
  }
@@ -1900,6 +1799,12 @@ function getStateFromUpdate(update, instance, prevState, props) {
1900
1799
  var partialState = update.partialState;
1901
1800
  if (typeof partialState === 'function') {
1902
1801
  var updateFn = partialState;
1802
+
1803
+ // Invoke setState callback an extra time to help detect side-effects.
1804
+ if (debugRenderPhaseSideEffects) {
1805
+ updateFn.call(instance, prevState, props);
1806
+ }
1807
+
1903
1808
  return updateFn.call(instance, prevState, props);
1904
1809
  } else {
1905
1810
  return partialState;
@@ -2045,15 +1950,6 @@ function commitCallbacks(queue, context) {
2045
1950
  }
2046
1951
  }
2047
1952
 
2048
- /**
2049
- * Copyright (c) 2013-present, Facebook, Inc.
2050
- *
2051
- * This source code is licensed under the MIT license found in the
2052
- * LICENSE file in the root directory of this source tree.
2053
- *
2054
- *
2055
- */
2056
-
2057
1953
  var fakeInternalInstance = {};
2058
1954
  var isArray = Array.isArray;
2059
1955
 
@@ -2154,6 +2050,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2154
2050
  var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext);
2155
2051
  stopPhaseTimer();
2156
2052
 
2053
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
2054
+ if (debugRenderPhaseSideEffects) {
2055
+ instance.shouldComponentUpdate(newProps, newState, newContext);
2056
+ }
2057
+
2157
2058
  {
2158
2059
  warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown');
2159
2060
  }
@@ -2210,10 +2111,10 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2210
2111
 
2211
2112
  var state = instance.state;
2212
2113
  if (state && (typeof state !== 'object' || isArray(state))) {
2213
- invariant(false, '%s.state: must be set to an object or null', getComponentName(workInProgress));
2114
+ warning(false, '%s.state: must be set to an object or null', getComponentName(workInProgress));
2214
2115
  }
2215
2116
  if (typeof instance.getChildContext === 'function') {
2216
- !(typeof workInProgress.type.childContextTypes === 'object') ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', getComponentName(workInProgress)) : void 0;
2117
+ warning(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress));
2217
2118
  }
2218
2119
  }
2219
2120
 
@@ -2253,9 +2154,13 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2253
2154
  startPhaseTimer(workInProgress, 'componentWillMount');
2254
2155
  var oldState = instance.state;
2255
2156
  instance.componentWillMount();
2256
-
2257
2157
  stopPhaseTimer();
2258
2158
 
2159
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
2160
+ if (debugRenderPhaseSideEffects) {
2161
+ instance.componentWillMount();
2162
+ }
2163
+
2259
2164
  if (oldState !== instance.state) {
2260
2165
  {
2261
2166
  warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress));
@@ -2270,6 +2175,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2270
2175
  instance.componentWillReceiveProps(newProps, newContext);
2271
2176
  stopPhaseTimer();
2272
2177
 
2178
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
2179
+ if (debugRenderPhaseSideEffects) {
2180
+ instance.componentWillReceiveProps(newProps, newContext);
2181
+ }
2182
+
2273
2183
  if (instance.state !== oldState) {
2274
2184
  {
2275
2185
  var componentName = getComponentName(workInProgress) || 'Component';
@@ -2479,6 +2389,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2479
2389
  startPhaseTimer(workInProgress, 'componentWillUpdate');
2480
2390
  instance.componentWillUpdate(newProps, newState, newContext);
2481
2391
  stopPhaseTimer();
2392
+
2393
+ // Simulate an async bailout/interruption by invoking lifecycle twice.
2394
+ if (debugRenderPhaseSideEffects) {
2395
+ instance.componentWillUpdate(newProps, newState, newContext);
2396
+ }
2482
2397
  }
2483
2398
  if (typeof instance.componentDidUpdate === 'function') {
2484
2399
  workInProgress.effectTag |= Update;
@@ -2516,25 +2431,29 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber
2516
2431
  };
2517
2432
  };
2518
2433
 
2519
- // The Symbol used to tag the special React types. If there is no native Symbol
2434
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
2520
2435
  // nor polyfill, then a plain number is used for performance.
2521
- var REACT_PORTAL_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.portal') || 0xeaca; /**
2522
- * Copyright (c) 2014-present, Facebook, Inc.
2523
- *
2524
- * This source code is licensed under the MIT license found in the
2525
- * LICENSE file in the root directory of this source tree.
2526
- *
2527
- *
2528
- */
2436
+ var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
2529
2437
 
2530
- /**
2531
- * Copyright (c) 2013-present, Facebook, Inc.
2532
- *
2533
- * This source code is licensed under the MIT license found in the
2534
- * LICENSE file in the root directory of this source tree.
2535
- *
2536
- *
2537
- */
2438
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7;
2439
+ var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8;
2440
+ var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
2441
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
2442
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
2443
+
2444
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2445
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
2446
+
2447
+ function getIteratorFn(maybeIterable) {
2448
+ if (maybeIterable === null || typeof maybeIterable === 'undefined') {
2449
+ return null;
2450
+ }
2451
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
2452
+ if (typeof maybeIterator === 'function') {
2453
+ return maybeIterator;
2454
+ }
2455
+ return null;
2456
+ }
2538
2457
 
2539
2458
  var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum;
2540
2459
 
@@ -2571,38 +2490,6 @@ var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStack
2571
2490
 
2572
2491
  var isArray$1 = Array.isArray;
2573
2492
 
2574
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2575
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
2576
-
2577
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
2578
- // nor polyfill, then a plain number is used for performance.
2579
- var REACT_ELEMENT_TYPE;
2580
- var REACT_CALL_TYPE;
2581
- var REACT_RETURN_TYPE;
2582
- var REACT_FRAGMENT_TYPE;
2583
- if (typeof Symbol === 'function' && Symbol['for']) {
2584
- REACT_ELEMENT_TYPE = Symbol['for']('react.element');
2585
- REACT_CALL_TYPE = Symbol['for']('react.call');
2586
- REACT_RETURN_TYPE = Symbol['for']('react.return');
2587
- REACT_FRAGMENT_TYPE = Symbol['for']('react.fragment');
2588
- } else {
2589
- REACT_ELEMENT_TYPE = 0xeac7;
2590
- REACT_CALL_TYPE = 0xeac8;
2591
- REACT_RETURN_TYPE = 0xeac9;
2592
- REACT_FRAGMENT_TYPE = 0xeacb;
2593
- }
2594
-
2595
- function getIteratorFn(maybeIterable) {
2596
- if (maybeIterable === null || typeof maybeIterable === 'undefined') {
2597
- return null;
2598
- }
2599
- var iteratorFn = ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
2600
- if (typeof iteratorFn === 'function') {
2601
- return iteratorFn;
2602
- }
2603
- return null;
2604
- }
2605
-
2606
2493
  function coerceRef(current, element) {
2607
2494
  var mixedRef = element.ref;
2608
2495
  if (mixedRef !== null && typeof mixedRef !== 'function') {
@@ -2663,21 +2550,12 @@ function warnOnFunctionType() {
2663
2550
  // to be able to optimize each path individually by branching early. This needs
2664
2551
  // a compiler or we can do it manually. Helpers that don't need this branching
2665
2552
  // live outside of this function.
2666
- function ChildReconciler(shouldClone, shouldTrackSideEffects) {
2553
+ function ChildReconciler(shouldTrackSideEffects) {
2667
2554
  function deleteChild(returnFiber, childToDelete) {
2668
2555
  if (!shouldTrackSideEffects) {
2669
2556
  // Noop.
2670
2557
  return;
2671
2558
  }
2672
- if (!shouldClone) {
2673
- // When we're reconciling in place we have a work in progress copy. We
2674
- // actually want the current copy. If there is no current copy, then we
2675
- // don't need to track deletion side-effects.
2676
- if (childToDelete.alternate === null) {
2677
- return;
2678
- }
2679
- childToDelete = childToDelete.alternate;
2680
- }
2681
2559
  // Deletions are added in reversed order so we add it to the front.
2682
2560
  // At this point, the return fiber's effect list is empty except for
2683
2561
  // deletions, so we can just append the deletion to the list. The remaining
@@ -2730,22 +2608,10 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
2730
2608
  function useFiber(fiber, pendingProps, expirationTime) {
2731
2609
  // We currently set sibling to null and index to 0 here because it is easy
2732
2610
  // to forget to do before returning it. E.g. for the single child case.
2733
- if (shouldClone) {
2734
- var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
2735
- clone.index = 0;
2736
- clone.sibling = null;
2737
- return clone;
2738
- } else {
2739
- // We override the expiration time even if it is earlier, because if
2740
- // we're reconciling at a later time that means that this was
2741
- // down-prioritized.
2742
- fiber.expirationTime = expirationTime;
2743
- fiber.effectTag = NoEffect;
2744
- fiber.index = 0;
2745
- fiber.sibling = null;
2746
- fiber.pendingProps = pendingProps;
2747
- return fiber;
2748
- }
2611
+ var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
2612
+ clone.index = 0;
2613
+ clone.sibling = null;
2614
+ return clone;
2749
2615
  }
2750
2616
 
2751
2617
  function placeChild(newFiber, lastPlacedIndex, newIndex) {
@@ -3542,7 +3408,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
3542
3408
  // Handle top level unkeyed fragments as if they were arrays.
3543
3409
  // This leads to an ambiguity between <>{[...]}</> and <>...</>.
3544
3410
  // We treat the ambiguous cases above the same.
3545
- if (enableReactFragment && typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {
3411
+ if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {
3546
3412
  newChild = newChild.props.children;
3547
3413
  }
3548
3414
 
@@ -3617,11 +3483,8 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
3617
3483
  return reconcileChildFibers;
3618
3484
  }
3619
3485
 
3620
- var reconcileChildFibers = ChildReconciler(true, true);
3621
-
3622
- var reconcileChildFibersInPlace = ChildReconciler(false, true);
3623
-
3624
- var mountChildFibersInPlace = ChildReconciler(false, false);
3486
+ var reconcileChildFibers = ChildReconciler(true);
3487
+ var mountChildFibers = ChildReconciler(false);
3625
3488
 
3626
3489
  function cloneChildFibers(current, workInProgress) {
3627
3490
  !(current === null || workInProgress.child === current.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0;
@@ -3676,20 +3539,15 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched
3676
3539
  // won't update its child set by applying minimal side-effects. Instead,
3677
3540
  // we will add them all to the child before it gets rendered. That means
3678
3541
  // we can optimize this reconciliation pass by not tracking side-effects.
3679
- workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime);
3680
- } else if (current.child === workInProgress.child) {
3542
+ workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
3543
+ } else {
3681
3544
  // If the current child is the same as the work in progress, it means that
3682
3545
  // we haven't yet started any work on these children. Therefore, we use
3683
3546
  // the clone algorithm to create a copy of all the current children.
3684
3547
 
3685
3548
  // If we had any progressed work already, that is invalid at this point so
3686
3549
  // let's throw it out.
3687
- workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, renderExpirationTime);
3688
- } else {
3689
- // If, on the other hand, it is already using a clone, that means we've
3690
- // already begun some work on this tree and we can continue where we left
3691
- // off by reconciling against the existing children.
3692
- workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime);
3550
+ workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
3693
3551
  }
3694
3552
  }
3695
3553
 
@@ -3799,6 +3657,9 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched
3799
3657
  {
3800
3658
  ReactDebugCurrentFiber.setCurrentPhase('render');
3801
3659
  nextChildren = instance.render();
3660
+ if (debugRenderPhaseSideEffects) {
3661
+ instance.render();
3662
+ }
3802
3663
  ReactDebugCurrentFiber.setCurrentPhase(null);
3803
3664
  }
3804
3665
  // React DevTools reads this flag.
@@ -3857,7 +3718,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched
3857
3718
  // Ensure that children mount into this root without tracking
3858
3719
  // side-effects. This ensures that we don't store Placement effects on
3859
3720
  // nodes that will be hydrated.
3860
- workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, renderExpirationTime);
3721
+ workInProgress.child = mountChildFibers(workInProgress, null, element, renderExpirationTime);
3861
3722
  } else {
3862
3723
  // Otherwise reset hydration state in case we aborted and resumed another
3863
3724
  // root.
@@ -4024,11 +3885,9 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched
4024
3885
  // The following is a fork of reconcileChildrenAtExpirationTime but using
4025
3886
  // stateNode to store the child.
4026
3887
  if (current === null) {
4027
- workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
4028
- } else if (current.child === workInProgress.child) {
4029
- workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
3888
+ workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
4030
3889
  } else {
4031
- workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
3890
+ workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
4032
3891
  }
4033
3892
 
4034
3893
  memoizeProps(workInProgress, nextCall);
@@ -4057,7 +3916,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched
4057
3916
  // flow doesn't do during mount. This doesn't happen at the root because
4058
3917
  // the root always starts with a "current" with a null child.
4059
3918
  // TODO: Consider unifying this with how the root works.
4060
- workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, renderExpirationTime);
3919
+ workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
4061
3920
  memoizeProps(workInProgress, nextChildren);
4062
3921
  } else {
4063
3922
  reconcileChildren(current, workInProgress, nextChildren);
@@ -4641,15 +4500,6 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) {
4641
4500
  };
4642
4501
  };
4643
4502
 
4644
- /**
4645
- * Copyright (c) 2013-present, Facebook, Inc.
4646
- *
4647
- * This source code is licensed under the MIT license found in the
4648
- * LICENSE file in the root directory of this source tree.
4649
- *
4650
- *
4651
- */
4652
-
4653
4503
  var invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback;
4654
4504
  var hasCaughtError$1 = ReactErrorUtils.hasCaughtError;
4655
4505
  var clearCaughtError$1 = ReactErrorUtils.clearCaughtError;
@@ -5327,15 +5177,6 @@ var ReactFiberHostContext = function (config) {
5327
5177
  };
5328
5178
  };
5329
5179
 
5330
- /**
5331
- * Copyright (c) 2013-present, Facebook, Inc.
5332
- *
5333
- * This source code is licensed under the MIT license found in the
5334
- * LICENSE file in the root directory of this source tree.
5335
- *
5336
- *
5337
- */
5338
-
5339
5180
  var ReactFiberHydrationContext = function (config) {
5340
5181
  var shouldSetTextContent = config.shouldSetTextContent,
5341
5182
  hydration = config.hydration;
@@ -5465,18 +5306,28 @@ var ReactFiberHydrationContext = function (config) {
5465
5306
  }
5466
5307
  }
5467
5308
 
5468
- function canHydrate(fiber, nextInstance) {
5309
+ function tryHydrate(fiber, nextInstance) {
5469
5310
  switch (fiber.tag) {
5470
5311
  case HostComponent:
5471
5312
  {
5472
5313
  var type = fiber.type;
5473
5314
  var props = fiber.pendingProps;
5474
- return canHydrateInstance(nextInstance, type, props);
5315
+ var instance = canHydrateInstance(nextInstance, type, props);
5316
+ if (instance !== null) {
5317
+ fiber.stateNode = instance;
5318
+ return true;
5319
+ }
5320
+ return false;
5475
5321
  }
5476
5322
  case HostText:
5477
5323
  {
5478
5324
  var text = fiber.pendingProps;
5479
- return canHydrateTextInstance(nextInstance, text);
5325
+ var textInstance = canHydrateTextInstance(nextInstance, text);
5326
+ if (textInstance !== null) {
5327
+ fiber.stateNode = textInstance;
5328
+ return true;
5329
+ }
5330
+ return false;
5480
5331
  }
5481
5332
  default:
5482
5333
  return false;
@@ -5495,12 +5346,12 @@ var ReactFiberHydrationContext = function (config) {
5495
5346
  hydrationParentFiber = fiber;
5496
5347
  return;
5497
5348
  }
5498
- if (!canHydrate(fiber, nextInstance)) {
5349
+ if (!tryHydrate(fiber, nextInstance)) {
5499
5350
  // If we can't hydrate this instance let's try the next one.
5500
5351
  // We use this as a heuristic. It's based on intuition and not data so it
5501
5352
  // might be flawed or unnecessary.
5502
5353
  nextInstance = getNextHydratableSibling(nextInstance);
5503
- if (!nextInstance || !canHydrate(fiber, nextInstance)) {
5354
+ if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
5504
5355
  // Nothing to hydrate. Make it an insertion.
5505
5356
  insertNonHydratedInstance(hydrationParentFiber, fiber);
5506
5357
  isHydrating = false;
@@ -5513,7 +5364,6 @@ var ReactFiberHydrationContext = function (config) {
5513
5364
  // fiber associated with it.
5514
5365
  deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);
5515
5366
  }
5516
- fiber.stateNode = nextInstance;
5517
5367
  hydrationParentFiber = fiber;
5518
5368
  nextHydratableInstance = getFirstHydratableChild(nextInstance);
5519
5369
  }
@@ -5622,15 +5472,6 @@ var ReactFiberHydrationContext = function (config) {
5622
5472
  };
5623
5473
  };
5624
5474
 
5625
- /**
5626
- * Copyright (c) 2013-present, Facebook, Inc.
5627
- *
5628
- * This source code is licensed under the MIT license found in the
5629
- * LICENSE file in the root directory of this source tree.
5630
- *
5631
- *
5632
- */
5633
-
5634
5475
  // This lets us hook into Fiber to debug what it's doing.
5635
5476
  // See https://github.com/facebook/react/pull/8033.
5636
5477
  // This is not part of the public API, not even for React DevTools.
@@ -5656,6 +5497,12 @@ function logCapturedError(capturedError) {
5656
5497
  return;
5657
5498
  }
5658
5499
 
5500
+ var error = capturedError.error;
5501
+ var suppressLogging = error && error.suppressReactErrorLogging;
5502
+ if (suppressLogging) {
5503
+ return;
5504
+ }
5505
+
5659
5506
  {
5660
5507
  var componentName = capturedError.componentName,
5661
5508
  componentStack = capturedError.componentStack,
@@ -5751,6 +5598,7 @@ var ReactFiberScheduler = function (config) {
5751
5598
 
5752
5599
  var now = config.now,
5753
5600
  scheduleDeferredCallback = config.scheduleDeferredCallback,
5601
+ cancelDeferredCallback = config.cancelDeferredCallback,
5754
5602
  useSyncScheduling = config.useSyncScheduling,
5755
5603
  prepareForCommit = config.prepareForCommit,
5756
5604
  resetAfterCommit = config.resetAfterCommit;
@@ -5792,6 +5640,9 @@ var ReactFiberScheduler = function (config) {
5792
5640
  var isCommitting = false;
5793
5641
  var isUnmounting = false;
5794
5642
 
5643
+ // Used for performance tracking.
5644
+ var interruptedBy = null;
5645
+
5795
5646
  function resetContextStack() {
5796
5647
  // Reset the stack
5797
5648
  reset();
@@ -6155,6 +6006,7 @@ var ReactFiberScheduler = function (config) {
6155
6006
  {
6156
6007
  ReactDebugCurrentFiber.setCurrentFiber(workInProgress);
6157
6008
  }
6009
+
6158
6010
  var next = beginWork(current, workInProgress, nextRenderExpirationTime);
6159
6011
  {
6160
6012
  ReactDebugCurrentFiber.resetCurrentFiber();
@@ -6275,8 +6127,6 @@ var ReactFiberScheduler = function (config) {
6275
6127
  }
6276
6128
 
6277
6129
  function renderRoot(root, expirationTime) {
6278
- startWorkLoopTimer();
6279
-
6280
6130
  !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;
6281
6131
  isWorking = true;
6282
6132
 
@@ -6287,13 +6137,15 @@ var ReactFiberScheduler = function (config) {
6287
6137
  // Check if we're starting from a fresh stack, or if we're resuming from
6288
6138
  // previously yielded work.
6289
6139
  if (root !== nextRoot || expirationTime !== nextRenderExpirationTime || nextUnitOfWork === null) {
6290
- // This is a restart. Reset the stack.
6140
+ // Reset the stack and start working from the root.
6291
6141
  resetContextStack();
6292
6142
  nextRoot = root;
6293
6143
  nextRenderExpirationTime = expirationTime;
6294
6144
  nextUnitOfWork = createWorkInProgress(nextRoot.current, null, expirationTime);
6295
6145
  }
6296
6146
 
6147
+ startWorkLoopTimer(nextUnitOfWork);
6148
+
6297
6149
  var didError = false;
6298
6150
  var error = null;
6299
6151
  {
@@ -6348,12 +6200,12 @@ var ReactFiberScheduler = function (config) {
6348
6200
  var uncaughtError = firstUncaughtError;
6349
6201
 
6350
6202
  // We're done performing work. Time to clean up.
6203
+ stopWorkLoopTimer(interruptedBy);
6204
+ interruptedBy = null;
6351
6205
  isWorking = false;
6352
6206
  didFatal = false;
6353
6207
  firstUncaughtError = null;
6354
6208
 
6355
- stopWorkLoopTimer();
6356
-
6357
6209
  if (uncaughtError !== null) {
6358
6210
  onUncaughtError(uncaughtError);
6359
6211
  }
@@ -6475,7 +6327,10 @@ var ReactFiberScheduler = function (config) {
6475
6327
  } catch (e) {
6476
6328
  // Prevent cycle if logCapturedError() throws.
6477
6329
  // A cycle may still occur if logCapturedError renders a component that throws.
6478
- console.error(e);
6330
+ var suppressLogging = e && e.suppressReactErrorLogging;
6331
+ if (!suppressLogging) {
6332
+ console.error(e);
6333
+ }
6479
6334
  }
6480
6335
 
6481
6336
  // If we're in the commit phase, defer scheduling an update on the
@@ -6620,6 +6475,19 @@ var ReactFiberScheduler = function (config) {
6620
6475
  return scheduleWorkImpl(fiber, expirationTime, false);
6621
6476
  }
6622
6477
 
6478
+ function checkRootNeedsClearing(root, fiber, expirationTime) {
6479
+ if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) {
6480
+ // Restart the root from the top.
6481
+ if (nextUnitOfWork !== null) {
6482
+ // This is an interruption. (Used for performance tracking.)
6483
+ interruptedBy = fiber;
6484
+ }
6485
+ nextRoot = null;
6486
+ nextUnitOfWork = null;
6487
+ nextRenderExpirationTime = NoWork;
6488
+ }
6489
+ }
6490
+
6623
6491
  function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) {
6624
6492
  recordScheduleUpdate();
6625
6493
 
@@ -6645,13 +6513,10 @@ var ReactFiberScheduler = function (config) {
6645
6513
  if (node['return'] === null) {
6646
6514
  if (node.tag === HostRoot) {
6647
6515
  var root = node.stateNode;
6648
- if (!isWorking && root === nextRoot && expirationTime <= nextRenderExpirationTime) {
6649
- // This is an interruption. Restart the root from the top.
6650
- nextRoot = null;
6651
- nextUnitOfWork = null;
6652
- nextRenderExpirationTime = NoWork;
6653
- }
6516
+
6517
+ checkRootNeedsClearing(root, fiber, expirationTime);
6654
6518
  requestWork(root, expirationTime);
6519
+ checkRootNeedsClearing(root, fiber, expirationTime);
6655
6520
  } else {
6656
6521
  {
6657
6522
  if (!isErrorRecovery && fiber.tag === ClassComponent) {
@@ -6703,7 +6568,8 @@ var ReactFiberScheduler = function (config) {
6703
6568
  var firstScheduledRoot = null;
6704
6569
  var lastScheduledRoot = null;
6705
6570
 
6706
- var isCallbackScheduled = false;
6571
+ var callbackExpirationTime = NoWork;
6572
+ var callbackID = -1;
6707
6573
  var isRendering = false;
6708
6574
  var nextFlushedRoot = null;
6709
6575
  var nextFlushedExpirationTime = NoWork;
@@ -6721,6 +6587,31 @@ var ReactFiberScheduler = function (config) {
6721
6587
 
6722
6588
  var timeHeuristicForUnitOfWork = 1;
6723
6589
 
6590
+ function scheduleCallbackWithExpiration(expirationTime) {
6591
+ if (callbackExpirationTime !== NoWork) {
6592
+ // A callback is already scheduled. Check its expiration time (timeout).
6593
+ if (expirationTime > callbackExpirationTime) {
6594
+ // Existing callback has sufficient timeout. Exit.
6595
+ return;
6596
+ } else {
6597
+ // Existing callback has insufficient timeout. Cancel and schedule a
6598
+ // new one.
6599
+ cancelDeferredCallback(callbackID);
6600
+ }
6601
+ // The request callback timer is already running. Don't start a new one.
6602
+ } else {
6603
+ startRequestCallbackTimer();
6604
+ }
6605
+
6606
+ // Compute a timeout for the given expiration time.
6607
+ var currentMs = now() - startTime;
6608
+ var expirationMs = expirationTimeToMs(expirationTime);
6609
+ var timeout = expirationMs - currentMs;
6610
+
6611
+ callbackExpirationTime = expirationTime;
6612
+ callbackID = scheduleDeferredCallback(performAsyncWork, { timeout: timeout });
6613
+ }
6614
+
6724
6615
  // requestWork is called by the scheduler whenever a root receives an update.
6725
6616
  // It's up to the renderer to call renderRoot at some point in the future.
6726
6617
  function requestWork(root, expirationTime) {
@@ -6761,7 +6652,9 @@ var ReactFiberScheduler = function (config) {
6761
6652
  if (isUnbatchingUpdates) {
6762
6653
  // ...unless we're inside unbatchedUpdates, in which case we should
6763
6654
  // flush it now.
6764
- performWorkOnRoot(root, Sync);
6655
+ nextFlushedRoot = root;
6656
+ nextFlushedExpirationTime = Sync;
6657
+ performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);
6765
6658
  }
6766
6659
  return;
6767
6660
  }
@@ -6769,9 +6662,8 @@ var ReactFiberScheduler = function (config) {
6769
6662
  // TODO: Get rid of Sync and use current time?
6770
6663
  if (expirationTime === Sync) {
6771
6664
  performWork(Sync, null);
6772
- } else if (!isCallbackScheduled) {
6773
- isCallbackScheduled = true;
6774
- scheduleDeferredCallback(performAsyncWork);
6665
+ } else {
6666
+ scheduleCallbackWithExpiration(expirationTime);
6775
6667
  }
6776
6668
  }
6777
6669
 
@@ -6849,8 +6741,14 @@ var ReactFiberScheduler = function (config) {
6849
6741
  deadline = dl;
6850
6742
 
6851
6743
  // Keep working on roots until there's no more work, or until the we reach
6852
- // the deadlne.
6744
+ // the deadline.
6853
6745
  findHighestPriorityRoot();
6746
+
6747
+ if (enableUserTimingAPI && deadline !== null) {
6748
+ var didExpire = nextFlushedExpirationTime < recalculateCurrentTime();
6749
+ stopRequestCallbackTimer(didExpire);
6750
+ }
6751
+
6854
6752
  while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) {
6855
6753
  performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime);
6856
6754
  // Find the next highest priority work.
@@ -6862,12 +6760,12 @@ var ReactFiberScheduler = function (config) {
6862
6760
 
6863
6761
  // If we're inside a callback, set this to false since we just completed it.
6864
6762
  if (deadline !== null) {
6865
- isCallbackScheduled = false;
6763
+ callbackExpirationTime = NoWork;
6764
+ callbackID = -1;
6866
6765
  }
6867
6766
  // If there's work left over, schedule a new callback.
6868
- if (nextFlushedRoot !== null && !isCallbackScheduled) {
6869
- isCallbackScheduled = true;
6870
- scheduleDeferredCallback(performAsyncWork);
6767
+ if (nextFlushedExpirationTime !== NoWork) {
6768
+ scheduleCallbackWithExpiration(nextFlushedExpirationTime);
6871
6769
  }
6872
6770
 
6873
6771
  // Clean-up.
@@ -6940,6 +6838,8 @@ var ReactFiberScheduler = function (config) {
6940
6838
  return false;
6941
6839
  }
6942
6840
  if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {
6841
+ // Disregard deadline.didTimeout. Only expired work should be flushed
6842
+ // during a timeout. This path is only hit for non-expired work.
6943
6843
  return false;
6944
6844
  }
6945
6845
  deadlineDidExpire = true;
@@ -7174,17 +7074,6 @@ var ReactFiberReconciler$1 = Object.freeze({
7174
7074
 
7175
7075
  var ReactFiberReconciler$2 = ( ReactFiberReconciler$1 && ReactFiberReconciler ) || ReactFiberReconciler$1;
7176
7076
 
7177
- /**
7178
- * Copyright (c) 2013-present, Facebook, Inc.
7179
- *
7180
- * This source code is licensed under the MIT license found in the
7181
- * LICENSE file in the root directory of this source tree.
7182
- *
7183
- *
7184
- */
7185
-
7186
-
7187
-
7188
7077
  // TODO: bundle Flow types with the package.
7189
7078
 
7190
7079
 
@@ -7194,8 +7083,6 @@ var ReactFiberReconciler$2 = ( ReactFiberReconciler$1 && ReactFiberReconciler )
7194
7083
  var reactReconciler = ReactFiberReconciler$2['default'] ? ReactFiberReconciler$2['default'] : ReactFiberReconciler$2;
7195
7084
 
7196
7085
  module.exports = reactReconciler;
7197
-
7198
- return ($$$reconciler || ($$$reconciler = module.exports))(config);
7199
- };
7200
-
7086
+ return ($$$reconciler || ($$$reconciler = module.exports))(config);
7087
+ };
7201
7088
  }