scheduler 0.17.0 → 0.18.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.
- package/build-info.json +4 -4
- package/cjs/scheduler-tracing.development.js +10 -8
- package/cjs/scheduler-tracing.production.min.js +1 -1
- package/cjs/scheduler-tracing.profiling.min.js +1 -1
- package/cjs/scheduler-unstable_mock.development.js +1 -2
- package/cjs/scheduler-unstable_mock.production.min.js +1 -1
- package/cjs/scheduler.development.js +56 -177
- package/cjs/scheduler.production.min.js +12 -12
- package/package.json +1 -1
- package/umd/scheduler-unstable_mock.development.js +1 -2
- package/umd/scheduler-unstable_mock.production.min.js +1 -1
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "59518",
|
|
4
|
+
"checksum": "6f449c4",
|
|
5
|
+
"commit": "b53ea6ca0",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.11.0-b53ea6ca0"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.18.0
|
|
2
2
|
* scheduler-tracing.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -17,12 +17,8 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
19
19
|
|
|
20
|
-
// Helps identify side effects in
|
|
21
|
-
|
|
22
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
23
|
-
// This can be confusing for tests though,
|
|
24
|
-
// And it can be bad for performance in production.
|
|
25
|
-
// This feature flag can be used to control the behavior:
|
|
20
|
+
// Helps identify side effects in render-phase lifecycle hooks and setState
|
|
21
|
+
// reducers by double invoking them in Strict Mode.
|
|
26
22
|
|
|
27
23
|
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
28
24
|
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
@@ -58,7 +54,7 @@ var enableSchedulerTracing = true; // SSR experiments
|
|
|
58
54
|
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
59
55
|
|
|
60
56
|
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
61
|
-
// Till then, we warn about the missing mock, but still fallback to a
|
|
57
|
+
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
62
58
|
|
|
63
59
|
// For tests, we flush suspense fallbacks in an act scope;
|
|
64
60
|
// *except* in some of our own tests, where we test incremental loading states.
|
|
@@ -73,6 +69,12 @@ var enableSchedulerTracing = true; // SSR experiments
|
|
|
73
69
|
// from React.createElement to React.jsx
|
|
74
70
|
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
75
71
|
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
|
|
77
|
+
|
|
76
78
|
var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
|
|
77
79
|
|
|
78
80
|
var interactionIDCounter = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.18.0
|
|
2
2
|
* scheduler-unstable_mock.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -19,7 +19,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
19
19
|
|
|
20
20
|
var enableSchedulerDebugging = false;
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
var enableProfiling = true;
|
|
24
23
|
|
|
25
24
|
var currentTime = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.18.0
|
|
2
2
|
* scheduler.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -19,16 +19,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
19
19
|
|
|
20
20
|
var enableSchedulerDebugging = false;
|
|
21
21
|
var enableIsInputPending = false;
|
|
22
|
-
var enableMessageLoopImplementation = true;
|
|
23
22
|
var enableProfiling = true;
|
|
24
23
|
|
|
25
|
-
// works by scheduling a requestAnimationFrame, storing the time for the start
|
|
26
|
-
// of the frame, then scheduling a postMessage which gets scheduled after paint.
|
|
27
|
-
// Within the postMessage handler do as much work as possible until time + frame
|
|
28
|
-
// rate. By separating the idle call into a separate event tick we ensure that
|
|
29
|
-
// layout, paint and other browser work is counted against the available time.
|
|
30
|
-
// The frame rate is dynamically adjusted.
|
|
31
|
-
|
|
32
24
|
var requestHostCallback;
|
|
33
25
|
|
|
34
26
|
var requestHostTimeout;
|
|
@@ -98,11 +90,14 @@ typeof MessageChannel !== 'function') {
|
|
|
98
90
|
var _Date = window.Date;
|
|
99
91
|
var _setTimeout = window.setTimeout;
|
|
100
92
|
var _clearTimeout = window.clearTimeout;
|
|
101
|
-
var requestAnimationFrame = window.requestAnimationFrame;
|
|
102
|
-
var cancelAnimationFrame = window.cancelAnimationFrame;
|
|
103
93
|
|
|
104
94
|
if (typeof console !== 'undefined') {
|
|
105
|
-
// TODO:
|
|
95
|
+
// TODO: Scheduler no longer requires these methods to be polyfilled. But
|
|
96
|
+
// maybe we want to continue warning if they don't exist, to preserve the
|
|
97
|
+
// option to rely on it in the future?
|
|
98
|
+
var requestAnimationFrame = window.requestAnimationFrame;
|
|
99
|
+
var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link
|
|
100
|
+
|
|
106
101
|
if (typeof requestAnimationFrame !== 'function') {
|
|
107
102
|
console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
|
|
108
103
|
}
|
|
@@ -124,26 +119,18 @@ typeof MessageChannel !== 'function') {
|
|
|
124
119
|
};
|
|
125
120
|
}
|
|
126
121
|
|
|
127
|
-
var isRAFLoopRunning = false;
|
|
128
122
|
var isMessageLoopRunning = false;
|
|
129
123
|
var scheduledHostCallback = null;
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// heuristic tracking will adjust this value to a faster fps if we get
|
|
138
|
-
// more frequent animation frames.
|
|
139
|
-
33.33;
|
|
140
|
-
var prevRAFTime = -1;
|
|
141
|
-
var prevRAFInterval = -1;
|
|
142
|
-
var frameDeadline = 0;
|
|
143
|
-
var fpsLocked = false; // TODO: Make this configurable
|
|
124
|
+
var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
|
|
125
|
+
// thread, like user events. By default, it yields multiple times per frame.
|
|
126
|
+
// It does not attempt to align with frame boundaries, since most tasks don't
|
|
127
|
+
// need to be frame aligned; for those that do, use requestAnimationFrame.
|
|
128
|
+
|
|
129
|
+
var yieldInterval = 5;
|
|
130
|
+
var deadline = 0; // TODO: Make this configurable
|
|
144
131
|
// TODO: Adjust this based on priority?
|
|
145
132
|
|
|
146
|
-
var
|
|
133
|
+
var maxYieldInterval = 300;
|
|
147
134
|
var needsPaint = false;
|
|
148
135
|
|
|
149
136
|
if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) {
|
|
@@ -152,23 +139,23 @@ typeof MessageChannel !== 'function') {
|
|
|
152
139
|
shouldYieldToHost = function () {
|
|
153
140
|
var currentTime = exports.unstable_now();
|
|
154
141
|
|
|
155
|
-
if (currentTime >=
|
|
156
|
-
// There's no time left
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
142
|
+
if (currentTime >= deadline) {
|
|
143
|
+
// There's no time left. We may want to yield control of the main
|
|
144
|
+
// thread, so the browser can perform high priority tasks. The main ones
|
|
145
|
+
// are painting and user input. If there's a pending paint or a pending
|
|
146
|
+
// input, then we should yield. But if there's neither, then we can
|
|
147
|
+
// yield less often while remaining responsive. We'll eventually yield
|
|
148
|
+
// regardless, since there could be a pending paint that wasn't
|
|
162
149
|
// accompanied by a call to `requestPaint`, or other main thread tasks
|
|
163
150
|
// like network events.
|
|
164
151
|
if (needsPaint || scheduling.isInputPending()) {
|
|
165
152
|
// There is either a pending paint or a pending input.
|
|
166
153
|
return true;
|
|
167
154
|
} // There's no pending input. Only yield if we've reached the max
|
|
168
|
-
//
|
|
155
|
+
// yield interval.
|
|
169
156
|
|
|
170
157
|
|
|
171
|
-
return currentTime >=
|
|
158
|
+
return currentTime >= maxYieldInterval;
|
|
172
159
|
} else {
|
|
173
160
|
// There's still time left in the frame.
|
|
174
161
|
return false;
|
|
@@ -182,7 +169,7 @@ typeof MessageChannel !== 'function') {
|
|
|
182
169
|
// `isInputPending` is not available. Since we have no way of knowing if
|
|
183
170
|
// there's pending input, always yield at the end of the frame.
|
|
184
171
|
shouldYieldToHost = function () {
|
|
185
|
-
return exports.unstable_now() >=
|
|
172
|
+
return exports.unstable_now() >= deadline;
|
|
186
173
|
}; // Since we yield every frame regardless, `requestPaint` has no effect.
|
|
187
174
|
|
|
188
175
|
|
|
@@ -196,166 +183,58 @@ typeof MessageChannel !== 'function') {
|
|
|
196
183
|
}
|
|
197
184
|
|
|
198
185
|
if (fps > 0) {
|
|
199
|
-
|
|
200
|
-
fpsLocked = true;
|
|
186
|
+
yieldInterval = Math.floor(1000 / fps);
|
|
201
187
|
} else {
|
|
202
188
|
// reset the framerate
|
|
203
|
-
|
|
204
|
-
fpsLocked = false;
|
|
189
|
+
yieldInterval = 5;
|
|
205
190
|
}
|
|
206
191
|
};
|
|
207
192
|
|
|
208
193
|
var performWorkUntilDeadline = function () {
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
// the message event.
|
|
214
|
-
|
|
215
|
-
frameDeadline = currentTime + frameLength;
|
|
216
|
-
var hasTimeRemaining = true;
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
|
220
|
-
|
|
221
|
-
if (!hasMoreWork) {
|
|
222
|
-
isMessageLoopRunning = false;
|
|
223
|
-
scheduledHostCallback = null;
|
|
224
|
-
} else {
|
|
225
|
-
// If there's more work, schedule the next message event at the end
|
|
226
|
-
// of the preceding one.
|
|
227
|
-
port.postMessage(null);
|
|
228
|
-
}
|
|
229
|
-
} catch (error) {
|
|
230
|
-
// If a scheduler task throws, exit the current browser task so the
|
|
231
|
-
// error can be observed.
|
|
232
|
-
port.postMessage(null);
|
|
233
|
-
throw error;
|
|
234
|
-
}
|
|
235
|
-
} else {
|
|
236
|
-
isMessageLoopRunning = false;
|
|
237
|
-
} // Yielding to the browser will give it a chance to paint, so we can
|
|
238
|
-
// reset this.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
needsPaint = false;
|
|
242
|
-
} else {
|
|
243
|
-
if (scheduledHostCallback !== null) {
|
|
244
|
-
var _currentTime = exports.unstable_now();
|
|
245
|
-
|
|
246
|
-
var _hasTimeRemaining = frameDeadline - _currentTime > 0;
|
|
194
|
+
if (scheduledHostCallback !== null) {
|
|
195
|
+
var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
|
|
196
|
+
// cycle. This means there's always time remaining at the beginning of
|
|
197
|
+
// the message event.
|
|
247
198
|
|
|
248
|
-
|
|
249
|
-
|
|
199
|
+
deadline = currentTime + yieldInterval;
|
|
200
|
+
var hasTimeRemaining = true;
|
|
250
201
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
202
|
+
try {
|
|
203
|
+
var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
|
204
|
+
|
|
205
|
+
if (!hasMoreWork) {
|
|
206
|
+
isMessageLoopRunning = false;
|
|
207
|
+
scheduledHostCallback = null;
|
|
208
|
+
} else {
|
|
209
|
+
// If there's more work, schedule the next message event at the end
|
|
210
|
+
// of the preceding one.
|
|
258
211
|
port.postMessage(null);
|
|
259
|
-
throw error;
|
|
260
212
|
}
|
|
261
|
-
}
|
|
262
|
-
|
|
213
|
+
} catch (error) {
|
|
214
|
+
// If a scheduler task throws, exit the current browser task so the
|
|
215
|
+
// error can be observed.
|
|
216
|
+
port.postMessage(null);
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
isMessageLoopRunning = false;
|
|
221
|
+
} // Yielding to the browser will give it a chance to paint, so we can
|
|
222
|
+
// reset this.
|
|
263
223
|
|
|
264
224
|
|
|
265
|
-
|
|
266
|
-
}
|
|
225
|
+
needsPaint = false;
|
|
267
226
|
};
|
|
268
227
|
|
|
269
228
|
var channel = new MessageChannel();
|
|
270
229
|
var port = channel.port2;
|
|
271
230
|
channel.port1.onmessage = performWorkUntilDeadline;
|
|
272
231
|
|
|
273
|
-
var onAnimationFrame = function (rAFTime) {
|
|
274
|
-
if (scheduledHostCallback === null) {
|
|
275
|
-
// No scheduled work. Exit.
|
|
276
|
-
prevRAFTime = -1;
|
|
277
|
-
prevRAFInterval = -1;
|
|
278
|
-
isRAFLoopRunning = false;
|
|
279
|
-
return;
|
|
280
|
-
} // Eagerly schedule the next animation callback at the beginning of the
|
|
281
|
-
// frame. If the scheduler queue is not empty at the end of the frame, it
|
|
282
|
-
// will continue flushing inside that callback. If the queue *is* empty,
|
|
283
|
-
// then it will exit immediately. Posting the callback at the start of the
|
|
284
|
-
// frame ensures it's fired within the earliest possible frame. If we
|
|
285
|
-
// waited until the end of the frame to post the callback, we risk the
|
|
286
|
-
// browser skipping a frame and not firing the callback until the frame
|
|
287
|
-
// after that.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
isRAFLoopRunning = true;
|
|
291
|
-
requestAnimationFrame(function (nextRAFTime) {
|
|
292
|
-
_clearTimeout(rAFTimeoutID);
|
|
293
|
-
|
|
294
|
-
onAnimationFrame(nextRAFTime);
|
|
295
|
-
}); // requestAnimationFrame is throttled when the tab is backgrounded. We
|
|
296
|
-
// don't want to stop working entirely. So we'll fallback to a timeout loop.
|
|
297
|
-
// TODO: Need a better heuristic for backgrounded work.
|
|
298
|
-
|
|
299
|
-
var onTimeout = function () {
|
|
300
|
-
frameDeadline = exports.unstable_now() + frameLength / 2;
|
|
301
|
-
performWorkUntilDeadline();
|
|
302
|
-
rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3);
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3);
|
|
306
|
-
|
|
307
|
-
if (prevRAFTime !== -1 && // Make sure this rAF time is different from the previous one. This check
|
|
308
|
-
// could fail if two rAFs fire in the same frame.
|
|
309
|
-
rAFTime - prevRAFTime > 0.1) {
|
|
310
|
-
var rAFInterval = rAFTime - prevRAFTime;
|
|
311
|
-
|
|
312
|
-
if (!fpsLocked && prevRAFInterval !== -1) {
|
|
313
|
-
// We've observed two consecutive frame intervals. We'll use this to
|
|
314
|
-
// dynamically adjust the frame rate.
|
|
315
|
-
//
|
|
316
|
-
// If one frame goes long, then the next one can be short to catch up.
|
|
317
|
-
// If two frames are short in a row, then that's an indication that we
|
|
318
|
-
// actually have a higher frame rate than what we're currently
|
|
319
|
-
// optimizing. For example, if we're running on 120hz display or 90hz VR
|
|
320
|
-
// display. Take the max of the two in case one of them was an anomaly
|
|
321
|
-
// due to missed frame deadlines.
|
|
322
|
-
if (rAFInterval < frameLength && prevRAFInterval < frameLength) {
|
|
323
|
-
frameLength = rAFInterval < prevRAFInterval ? prevRAFInterval : rAFInterval;
|
|
324
|
-
|
|
325
|
-
if (frameLength < 8.33) {
|
|
326
|
-
// Defensive coding. We don't support higher frame rates than 120hz.
|
|
327
|
-
// If the calculated frame length gets lower than 8, it is probably
|
|
328
|
-
// a bug.
|
|
329
|
-
frameLength = 8.33;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
prevRAFInterval = rAFInterval;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
prevRAFTime = rAFTime;
|
|
338
|
-
frameDeadline = rAFTime + frameLength; // We use the postMessage trick to defer idle work until after the repaint.
|
|
339
|
-
|
|
340
|
-
port.postMessage(null);
|
|
341
|
-
};
|
|
342
|
-
|
|
343
232
|
requestHostCallback = function (callback) {
|
|
344
233
|
scheduledHostCallback = callback;
|
|
345
234
|
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
port.postMessage(null);
|
|
350
|
-
}
|
|
351
|
-
} else {
|
|
352
|
-
if (!isRAFLoopRunning) {
|
|
353
|
-
// Start a rAF loop.
|
|
354
|
-
isRAFLoopRunning = true;
|
|
355
|
-
requestAnimationFrame(function (rAFTime) {
|
|
356
|
-
onAnimationFrame(rAFTime);
|
|
357
|
-
});
|
|
358
|
-
}
|
|
235
|
+
if (!isMessageLoopRunning) {
|
|
236
|
+
isMessageLoopRunning = true;
|
|
237
|
+
port.postMessage(null);
|
|
359
238
|
}
|
|
360
239
|
};
|
|
361
240
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.18.0
|
|
2
2
|
* scheduler.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var f,g,h,k,l;
|
|
11
11
|
if("undefined"===typeof window||"function"!==typeof MessageChannel){var p=null,q=null,t=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null}catch(b){throw setTimeout(t,0),b;}},u=Date.now();exports.unstable_now=function(){return Date.now()-u};f=function(a){null!==p?setTimeout(f,0,a):(p=a,setTimeout(t,0))};g=function(a,b){q=setTimeout(a,b)};h=function(){clearTimeout(q)};k=function(){return!1};l=exports.unstable_forceFrameRate=function(){}}else{var w=window.performance,x=window.Date,
|
|
12
|
-
y=window.setTimeout,z=window.clearTimeout
|
|
13
|
-
"function"===typeof w.now)exports.unstable_now=function(){return w.now()};else{var
|
|
14
|
-
function(){if(null!==
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
exports.unstable_next=function(a){switch(
|
|
20
|
-
exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if("object"===typeof c&&null!==c){var e=c.delay;e="number"===typeof e&&0<e?d+e:d;c="number"===typeof c.timeout?c.timeout:
|
|
21
|
-
exports.unstable_wrapCallback=function(a){var b=
|
|
22
|
-
exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return
|
|
12
|
+
y=window.setTimeout,z=window.clearTimeout;if("undefined"!==typeof console){var A=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");"function"!==typeof A&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===
|
|
13
|
+
typeof w&&"function"===typeof w.now)exports.unstable_now=function(){return w.now()};else{var B=x.now();exports.unstable_now=function(){return x.now()-B}}var C=!1,D=null,E=-1,F=5,G=0;k=function(){return exports.unstable_now()>=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):F=0<a?Math.floor(1E3/a):5};var H=new MessageChannel,I=H.port2;H.port1.onmessage=
|
|
14
|
+
function(){if(null!==D){var a=exports.unstable_now();G=a+F;try{D(!0,a)?I.postMessage(null):(C=!1,D=null)}catch(b){throw I.postMessage(null),b;}}else C=!1};f=function(a){D=a;C||(C=!0,I.postMessage(null))};g=function(a,b){E=y(function(){a(exports.unstable_now())},b)};h=function(){z(E);E=-1}}function J(a,b){var c=a.length;a.push(b);a:for(;;){var d=Math.floor((c-1)/2),e=a[d];if(void 0!==e&&0<K(e,b))a[d]=b,a[c]=e,c=d;else break a}}function L(a){a=a[0];return void 0===a?null:a}
|
|
15
|
+
function M(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;
|
|
16
|
+
function V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}
|
|
17
|
+
function X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}
|
|
18
|
+
function Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};
|
|
19
|
+
exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};
|
|
20
|
+
exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if("object"===typeof c&&null!==c){var e=c.delay;e="number"===typeof e&&0<e?d+e:d;c="number"===typeof c.timeout?c.timeout:Y(a)}else c=Y(a),e=d;c=e+c;a={id:P++,callback:b,priorityLevel:a,startTime:e,expirationTime:c,sortIndex:-1};e>d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};exports.unstable_cancelCallback=function(a){a.callback=null};
|
|
21
|
+
exports.unstable_wrapCallback=function(a){var b=R;return function(){var c=R;R=b;try{return a.apply(this,arguments)}finally{R=c}}};exports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime<Q.expirationTime||k()};exports.unstable_requestPaint=Z;exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))};
|
|
22
|
+
exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_Profiling=null;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.18.0
|
|
2
2
|
* scheduler-unstable_mock.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
|
|
18
18
|
var enableSchedulerDebugging = false;
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
var enableProfiling = true;
|
|
22
21
|
|
|
23
22
|
var currentTime = 0;
|