scheduler 0.18.0 → 0.19.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 +8 -82
- package/cjs/scheduler-tracing.production.min.js +2 -2
- package/cjs/scheduler-tracing.profiling.min.js +6 -5
- package/cjs/scheduler-unstable_mock.development.js +51 -63
- package/cjs/scheduler-unstable_mock.production.min.js +12 -12
- package/cjs/scheduler.development.js +45 -91
- package/cjs/scheduler.production.min.js +7 -8
- package/package.json +1 -1
- package/umd/scheduler-tracing.development.js +2 -2
- package/umd/scheduler-tracing.production.min.js +2 -2
- package/umd/scheduler-tracing.profiling.min.js +2 -2
- package/umd/scheduler-unstable_mock.development.js +671 -683
- package/umd/scheduler-unstable_mock.production.min.js +10 -10
- package/umd/scheduler.development.js +2 -2
- package/umd/scheduler.production.min.js +2 -2
- package/umd/scheduler.profiling.min.js +2 -2
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "91354",
|
|
4
|
+
"checksum": "b0ed8f5",
|
|
5
|
+
"commit": "d28bd2994",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.12.0-d28bd2994"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.19.0
|
|
2
2
|
* scheduler-tracing.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,66 +15,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
(function() {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
19
|
-
|
|
20
|
-
// Helps identify side effects in render-phase lifecycle hooks and setState
|
|
21
|
-
// reducers by double invoking them in Strict Mode.
|
|
22
|
-
|
|
23
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
24
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
25
|
-
|
|
26
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
27
|
-
|
|
28
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
29
|
-
|
|
30
|
-
// Trace which interactions trigger each commit.
|
|
31
|
-
|
|
32
|
-
var enableSchedulerTracing = true; // SSR experiments
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Only used in www builds.
|
|
36
|
-
|
|
37
|
-
// Only used in www builds.
|
|
38
|
-
|
|
39
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
40
|
-
|
|
41
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
42
|
-
// with their related DOM properties
|
|
43
|
-
|
|
44
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
45
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Experimental React Flare event system and event components support.
|
|
49
|
-
|
|
50
|
-
// Experimental Host Component support.
|
|
51
|
-
|
|
52
|
-
// Experimental Scope support.
|
|
53
|
-
|
|
54
|
-
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
55
|
-
|
|
56
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
57
|
-
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
58
|
-
|
|
59
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
60
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
61
|
-
|
|
62
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
63
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
64
|
-
// the user to see a loading state.
|
|
65
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
66
|
-
// hydrated or deleted.
|
|
67
|
-
|
|
68
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
69
|
-
// from React.createElement to React.jsx
|
|
70
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
|
|
77
|
-
|
|
78
18
|
var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
|
|
79
19
|
|
|
80
20
|
var interactionIDCounter = 0;
|
|
@@ -87,7 +27,7 @@ exports.__interactionsRef = null; // Listener(s) to notify when interactions beg
|
|
|
87
27
|
|
|
88
28
|
exports.__subscriberRef = null;
|
|
89
29
|
|
|
90
|
-
|
|
30
|
+
{
|
|
91
31
|
exports.__interactionsRef = {
|
|
92
32
|
current: new Set()
|
|
93
33
|
};
|
|
@@ -95,11 +35,7 @@ if (enableSchedulerTracing) {
|
|
|
95
35
|
current: null
|
|
96
36
|
};
|
|
97
37
|
}
|
|
98
|
-
|
|
99
38
|
function unstable_clear(callback) {
|
|
100
|
-
if (!enableSchedulerTracing) {
|
|
101
|
-
return callback();
|
|
102
|
-
}
|
|
103
39
|
|
|
104
40
|
var prevInteractions = exports.__interactionsRef.current;
|
|
105
41
|
exports.__interactionsRef.current = new Set();
|
|
@@ -111,9 +47,7 @@ function unstable_clear(callback) {
|
|
|
111
47
|
}
|
|
112
48
|
}
|
|
113
49
|
function unstable_getCurrent() {
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
} else {
|
|
50
|
+
{
|
|
117
51
|
return exports.__interactionsRef.current;
|
|
118
52
|
}
|
|
119
53
|
}
|
|
@@ -123,10 +57,6 @@ function unstable_getThreadID() {
|
|
|
123
57
|
function unstable_trace(name, timestamp, callback) {
|
|
124
58
|
var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
|
|
125
59
|
|
|
126
|
-
if (!enableSchedulerTracing) {
|
|
127
|
-
return callback();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
60
|
var interaction = {
|
|
131
61
|
__count: 1,
|
|
132
62
|
id: interactionIDCounter++,
|
|
@@ -179,10 +109,6 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
179
109
|
function unstable_wrap(callback) {
|
|
180
110
|
var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
|
|
181
111
|
|
|
182
|
-
if (!enableSchedulerTracing) {
|
|
183
|
-
return callback;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
112
|
var wrappedInteractions = exports.__interactionsRef.current;
|
|
187
113
|
var subscriber = exports.__subscriberRef.current;
|
|
188
114
|
|
|
@@ -268,12 +194,12 @@ function unstable_wrap(callback) {
|
|
|
268
194
|
|
|
269
195
|
var subscribers = null;
|
|
270
196
|
|
|
271
|
-
|
|
197
|
+
{
|
|
272
198
|
subscribers = new Set();
|
|
273
199
|
}
|
|
274
200
|
|
|
275
201
|
function unstable_subscribe(subscriber) {
|
|
276
|
-
|
|
202
|
+
{
|
|
277
203
|
subscribers.add(subscriber);
|
|
278
204
|
|
|
279
205
|
if (subscribers.size === 1) {
|
|
@@ -289,7 +215,7 @@ function unstable_subscribe(subscriber) {
|
|
|
289
215
|
}
|
|
290
216
|
}
|
|
291
217
|
function unstable_unsubscribe(subscriber) {
|
|
292
|
-
|
|
218
|
+
{
|
|
293
219
|
subscribers.delete(subscriber);
|
|
294
220
|
|
|
295
221
|
if (subscribers.size === 0) {
|
|
@@ -415,9 +341,9 @@ function onWorkCanceled(interactions, threadID) {
|
|
|
415
341
|
exports.unstable_clear = unstable_clear;
|
|
416
342
|
exports.unstable_getCurrent = unstable_getCurrent;
|
|
417
343
|
exports.unstable_getThreadID = unstable_getThreadID;
|
|
418
|
-
exports.unstable_trace = unstable_trace;
|
|
419
|
-
exports.unstable_wrap = unstable_wrap;
|
|
420
344
|
exports.unstable_subscribe = unstable_subscribe;
|
|
345
|
+
exports.unstable_trace = unstable_trace;
|
|
421
346
|
exports.unstable_unsubscribe = unstable_unsubscribe;
|
|
347
|
+
exports.unstable_wrap = unstable_wrap;
|
|
422
348
|
})();
|
|
423
349
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.19.0
|
|
2
2
|
* scheduler-tracing.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';
|
|
10
|
+
'use strict';var b=0;exports.__interactionsRef=null;exports.__subscriberRef=null;exports.unstable_clear=function(a){return a()};exports.unstable_getCurrent=function(){return null};exports.unstable_getThreadID=function(){return++b};exports.unstable_subscribe=function(){};exports.unstable_trace=function(a,d,c){return c()};exports.unstable_unsubscribe=function(){};exports.unstable_wrap=function(a){return a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.19.0
|
|
2
2
|
* scheduler-tracing.profiling.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';
|
|
11
|
-
function
|
|
12
|
-
|
|
10
|
+
'use strict';var g=0,l=0;exports.__interactionsRef=null;exports.__subscriberRef=null;exports.__interactionsRef={current:new Set};exports.__subscriberRef={current:null};var m=null;m=new Set;function n(e){var d=!1,a=null;m.forEach(function(c){try{c.onInteractionTraced(e)}catch(b){d||(d=!0,a=b)}});if(d)throw a;}function p(e){var d=!1,a=null;m.forEach(function(c){try{c.onInteractionScheduledWorkCompleted(e)}catch(b){d||(d=!0,a=b)}});if(d)throw a;}
|
|
11
|
+
function q(e,d){var a=!1,c=null;m.forEach(function(b){try{b.onWorkScheduled(e,d)}catch(f){a||(a=!0,c=f)}});if(a)throw c;}function r(e,d){var a=!1,c=null;m.forEach(function(b){try{b.onWorkStarted(e,d)}catch(f){a||(a=!0,c=f)}});if(a)throw c;}function t(e,d){var a=!1,c=null;m.forEach(function(b){try{b.onWorkStopped(e,d)}catch(f){a||(a=!0,c=f)}});if(a)throw c;}function u(e,d){var a=!1,c=null;m.forEach(function(b){try{b.onWorkCanceled(e,d)}catch(f){a||(a=!0,c=f)}});if(a)throw c;}
|
|
12
|
+
exports.unstable_clear=function(e){var d=exports.__interactionsRef.current;exports.__interactionsRef.current=new Set;try{return e()}finally{exports.__interactionsRef.current=d}};exports.unstable_getCurrent=function(){return exports.__interactionsRef.current};exports.unstable_getThreadID=function(){return++l};
|
|
13
|
+
exports.unstable_subscribe=function(e){m.add(e);1===m.size&&(exports.__subscriberRef.current={onInteractionScheduledWorkCompleted:p,onInteractionTraced:n,onWorkCanceled:u,onWorkScheduled:q,onWorkStarted:r,onWorkStopped:t})};
|
|
13
14
|
exports.unstable_trace=function(e,d,a){var c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,b={__count:1,id:g++,name:e,timestamp:d},f=exports.__interactionsRef.current,k=new Set(f);k.add(b);exports.__interactionsRef.current=k;var h=exports.__subscriberRef.current;try{if(null!==h)h.onInteractionTraced(b)}finally{try{if(null!==h)h.onWorkStarted(k,c)}finally{try{var v=a()}finally{exports.__interactionsRef.current=f;try{if(null!==h)h.onWorkStopped(k,c)}finally{if(b.__count--,null!==h&&0===b.__count)h.onInteractionScheduledWorkCompleted(b)}}}}return v};
|
|
15
|
+
exports.unstable_unsubscribe=function(e){m.delete(e);0===m.size&&(exports.__subscriberRef.current=null)};
|
|
14
16
|
exports.unstable_wrap=function(e){function d(){var d=exports.__interactionsRef.current;exports.__interactionsRef.current=c;b=exports.__subscriberRef.current;try{try{if(null!==b)b.onWorkStarted(c,a)}finally{try{var h=e.apply(void 0,arguments)}finally{if(exports.__interactionsRef.current=d,null!==b)b.onWorkStopped(c,a)}}return h}finally{f||(f=!0,c.forEach(function(a){a.__count--;if(null!==b&&0===a.__count)b.onInteractionScheduledWorkCompleted(a)}))}}var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
|
15
17
|
0,c=exports.__interactionsRef.current,b=exports.__subscriberRef.current;if(null!==b)b.onWorkScheduled(c,a);c.forEach(function(a){a.__count++});var f=!1;d.cancel=function(){b=exports.__subscriberRef.current;try{if(null!==b)b.onWorkCanceled(c,a)}finally{c.forEach(function(a){a.__count--;if(b&&0===a.__count)b.onInteractionScheduledWorkCompleted(a)})}};return d};
|
|
16
|
-
exports.unstable_subscribe=function(e){m.add(e);1===m.size&&(exports.__subscriberRef.current={onInteractionScheduledWorkCompleted:p,onInteractionTraced:n,onWorkCanceled:u,onWorkScheduled:q,onWorkStarted:r,onWorkStopped:t})};exports.unstable_unsubscribe=function(e){m.delete(e);0===m.size&&(exports.__subscriberRef.current=null)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.19.0
|
|
2
2
|
* scheduler-unstable_mock.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,10 +15,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
(function() {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
19
|
-
|
|
20
18
|
var enableSchedulerDebugging = false;
|
|
21
|
-
|
|
22
19
|
var enableProfiling = true;
|
|
23
20
|
|
|
24
21
|
var currentTime = 0;
|
|
@@ -34,7 +31,6 @@ var shouldYieldForPaint = false;
|
|
|
34
31
|
function requestHostCallback(callback) {
|
|
35
32
|
scheduledCallback = callback;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
function requestHostTimeout(callback, ms) {
|
|
39
35
|
scheduledTimeout = callback;
|
|
40
36
|
timeoutTime = currentTime + ms;
|
|
@@ -57,7 +53,6 @@ function getCurrentTime() {
|
|
|
57
53
|
}
|
|
58
54
|
function forceFrameRate() {// No-op
|
|
59
55
|
}
|
|
60
|
-
// Should only be used via an assertion helper that inspects the yielded values.
|
|
61
56
|
|
|
62
57
|
function unstable_flushNumberOfYields(count) {
|
|
63
58
|
if (isFlushing) {
|
|
@@ -192,14 +187,10 @@ function unstable_yieldValue(value) {
|
|
|
192
187
|
function unstable_advanceTime(ms) {
|
|
193
188
|
currentTime += ms;
|
|
194
189
|
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
scheduledTimeout = null;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
unstable_flushExpired();
|
|
190
|
+
if (scheduledTimeout !== null && timeoutTime <= currentTime) {
|
|
191
|
+
scheduledTimeout(currentTime);
|
|
192
|
+
timeoutTime = -1;
|
|
193
|
+
scheduledTimeout = null;
|
|
203
194
|
}
|
|
204
195
|
}
|
|
205
196
|
function requestPaint() {
|
|
@@ -236,7 +227,7 @@ function siftUp(heap, node, i) {
|
|
|
236
227
|
var index = i;
|
|
237
228
|
|
|
238
229
|
while (true) {
|
|
239
|
-
var parentIndex =
|
|
230
|
+
var parentIndex = index - 1 >>> 1;
|
|
240
231
|
var parent = heap[parentIndex];
|
|
241
232
|
|
|
242
233
|
if (parent !== undefined && compare(parent, node) > 0) {
|
|
@@ -299,18 +290,18 @@ var IdlePriority = 5;
|
|
|
299
290
|
var runIdCounter = 0;
|
|
300
291
|
var mainThreadIdCounter = 0;
|
|
301
292
|
var profilingStateSize = 4;
|
|
302
|
-
var sharedProfilingBuffer =
|
|
293
|
+
var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer
|
|
303
294
|
typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
|
|
304
295
|
typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
|
|
305
|
-
|
|
306
|
-
var profilingState =
|
|
296
|
+
;
|
|
297
|
+
var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
|
|
307
298
|
|
|
308
299
|
var PRIORITY = 0;
|
|
309
300
|
var CURRENT_TASK_ID = 1;
|
|
310
301
|
var CURRENT_RUN_ID = 2;
|
|
311
302
|
var QUEUE_SIZE = 3;
|
|
312
303
|
|
|
313
|
-
|
|
304
|
+
{
|
|
314
305
|
profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
|
|
315
306
|
// array might include canceled tasks.
|
|
316
307
|
|
|
@@ -344,7 +335,8 @@ function logEvent(entries) {
|
|
|
344
335
|
eventLogSize *= 2;
|
|
345
336
|
|
|
346
337
|
if (eventLogSize > MAX_EVENT_LOG_SIZE) {
|
|
347
|
-
|
|
338
|
+
// Using console['error'] to evade Babel and ESLint
|
|
339
|
+
console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
|
|
348
340
|
stopLoggingProfilingEvents();
|
|
349
341
|
return;
|
|
350
342
|
}
|
|
@@ -374,7 +366,7 @@ function stopLoggingProfilingEvents() {
|
|
|
374
366
|
return buffer;
|
|
375
367
|
}
|
|
376
368
|
function markTaskStart(task, ms) {
|
|
377
|
-
|
|
369
|
+
{
|
|
378
370
|
profilingState[QUEUE_SIZE]++;
|
|
379
371
|
|
|
380
372
|
if (eventLog !== null) {
|
|
@@ -386,7 +378,7 @@ function markTaskStart(task, ms) {
|
|
|
386
378
|
}
|
|
387
379
|
}
|
|
388
380
|
function markTaskCompleted(task, ms) {
|
|
389
|
-
|
|
381
|
+
{
|
|
390
382
|
profilingState[PRIORITY] = NoPriority;
|
|
391
383
|
profilingState[CURRENT_TASK_ID] = 0;
|
|
392
384
|
profilingState[QUEUE_SIZE]--;
|
|
@@ -397,7 +389,7 @@ function markTaskCompleted(task, ms) {
|
|
|
397
389
|
}
|
|
398
390
|
}
|
|
399
391
|
function markTaskCanceled(task, ms) {
|
|
400
|
-
|
|
392
|
+
{
|
|
401
393
|
profilingState[QUEUE_SIZE]--;
|
|
402
394
|
|
|
403
395
|
if (eventLog !== null) {
|
|
@@ -406,7 +398,7 @@ function markTaskCanceled(task, ms) {
|
|
|
406
398
|
}
|
|
407
399
|
}
|
|
408
400
|
function markTaskErrored(task, ms) {
|
|
409
|
-
|
|
401
|
+
{
|
|
410
402
|
profilingState[PRIORITY] = NoPriority;
|
|
411
403
|
profilingState[CURRENT_TASK_ID] = 0;
|
|
412
404
|
profilingState[QUEUE_SIZE]--;
|
|
@@ -417,7 +409,7 @@ function markTaskErrored(task, ms) {
|
|
|
417
409
|
}
|
|
418
410
|
}
|
|
419
411
|
function markTaskRun(task, ms) {
|
|
420
|
-
|
|
412
|
+
{
|
|
421
413
|
runIdCounter++;
|
|
422
414
|
profilingState[PRIORITY] = task.priorityLevel;
|
|
423
415
|
profilingState[CURRENT_TASK_ID] = task.id;
|
|
@@ -429,7 +421,7 @@ function markTaskRun(task, ms) {
|
|
|
429
421
|
}
|
|
430
422
|
}
|
|
431
423
|
function markTaskYield(task, ms) {
|
|
432
|
-
|
|
424
|
+
{
|
|
433
425
|
profilingState[PRIORITY] = NoPriority;
|
|
434
426
|
profilingState[CURRENT_TASK_ID] = 0;
|
|
435
427
|
profilingState[CURRENT_RUN_ID] = 0;
|
|
@@ -440,7 +432,7 @@ function markTaskYield(task, ms) {
|
|
|
440
432
|
}
|
|
441
433
|
}
|
|
442
434
|
function markSchedulerSuspended(ms) {
|
|
443
|
-
|
|
435
|
+
{
|
|
444
436
|
mainThreadIdCounter++;
|
|
445
437
|
|
|
446
438
|
if (eventLog !== null) {
|
|
@@ -449,7 +441,7 @@ function markSchedulerSuspended(ms) {
|
|
|
449
441
|
}
|
|
450
442
|
}
|
|
451
443
|
function markSchedulerUnsuspended(ms) {
|
|
452
|
-
|
|
444
|
+
{
|
|
453
445
|
if (eventLog !== null) {
|
|
454
446
|
logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
|
|
455
447
|
}
|
|
@@ -474,8 +466,6 @@ var taskQueue = [];
|
|
|
474
466
|
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
|
|
475
467
|
|
|
476
468
|
var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
|
|
477
|
-
|
|
478
|
-
var isSchedulerPaused = false;
|
|
479
469
|
var currentTask = null;
|
|
480
470
|
var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
|
|
481
471
|
|
|
@@ -497,7 +487,7 @@ function advanceTimers(currentTime) {
|
|
|
497
487
|
timer.sortIndex = timer.expirationTime;
|
|
498
488
|
push(taskQueue, timer);
|
|
499
489
|
|
|
500
|
-
|
|
490
|
+
{
|
|
501
491
|
markTaskStart(timer, currentTime);
|
|
502
492
|
timer.isQueued = true;
|
|
503
493
|
}
|
|
@@ -529,7 +519,7 @@ function handleTimeout(currentTime) {
|
|
|
529
519
|
}
|
|
530
520
|
|
|
531
521
|
function flushWork(hasTimeRemaining, initialTime) {
|
|
532
|
-
|
|
522
|
+
{
|
|
533
523
|
markSchedulerUnsuspended(initialTime);
|
|
534
524
|
} // We'll need a host callback the next time work is scheduled.
|
|
535
525
|
|
|
@@ -567,7 +557,7 @@ function flushWork(hasTimeRemaining, initialTime) {
|
|
|
567
557
|
currentPriorityLevel = previousPriorityLevel;
|
|
568
558
|
isPerformingWork = false;
|
|
569
559
|
|
|
570
|
-
|
|
560
|
+
{
|
|
571
561
|
var _currentTime = getCurrentTime();
|
|
572
562
|
|
|
573
563
|
markSchedulerSuspended(_currentTime);
|
|
@@ -580,7 +570,7 @@ function workLoop(hasTimeRemaining, initialTime) {
|
|
|
580
570
|
advanceTimers(currentTime);
|
|
581
571
|
currentTask = peek(taskQueue);
|
|
582
572
|
|
|
583
|
-
while (currentTask !== null && !(enableSchedulerDebugging
|
|
573
|
+
while (currentTask !== null && !(enableSchedulerDebugging )) {
|
|
584
574
|
if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
|
|
585
575
|
// This currentTask hasn't expired, and we've reached the deadline.
|
|
586
576
|
break;
|
|
@@ -600,7 +590,7 @@ function workLoop(hasTimeRemaining, initialTime) {
|
|
|
600
590
|
currentTask.callback = continuationCallback;
|
|
601
591
|
markTaskYield(currentTask, currentTime);
|
|
602
592
|
} else {
|
|
603
|
-
|
|
593
|
+
{
|
|
604
594
|
markTaskCompleted(currentTask, currentTime);
|
|
605
595
|
currentTask.isQueued = false;
|
|
606
596
|
}
|
|
@@ -747,7 +737,7 @@ function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
|
747
737
|
sortIndex: -1
|
|
748
738
|
};
|
|
749
739
|
|
|
750
|
-
|
|
740
|
+
{
|
|
751
741
|
newTask.isQueued = false;
|
|
752
742
|
}
|
|
753
743
|
|
|
@@ -772,7 +762,7 @@ function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
|
772
762
|
newTask.sortIndex = expirationTime;
|
|
773
763
|
push(taskQueue, newTask);
|
|
774
764
|
|
|
775
|
-
|
|
765
|
+
{
|
|
776
766
|
markTaskStart(newTask, currentTime);
|
|
777
767
|
newTask.isQueued = true;
|
|
778
768
|
} // Schedule a host callback, if needed. If we're already performing work,
|
|
@@ -789,11 +779,9 @@ function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
|
789
779
|
}
|
|
790
780
|
|
|
791
781
|
function unstable_pauseExecution() {
|
|
792
|
-
isSchedulerPaused = true;
|
|
793
782
|
}
|
|
794
783
|
|
|
795
784
|
function unstable_continueExecution() {
|
|
796
|
-
isSchedulerPaused = false;
|
|
797
785
|
|
|
798
786
|
if (!isHostCallbackScheduled && !isPerformingWork) {
|
|
799
787
|
isHostCallbackScheduled = true;
|
|
@@ -806,7 +794,7 @@ function unstable_getFirstCallbackNode() {
|
|
|
806
794
|
}
|
|
807
795
|
|
|
808
796
|
function unstable_cancelCallback(task) {
|
|
809
|
-
|
|
797
|
+
{
|
|
810
798
|
if (task.isQueued) {
|
|
811
799
|
var currentTime = getCurrentTime();
|
|
812
800
|
markTaskCanceled(task, currentTime);
|
|
@@ -832,38 +820,38 @@ function unstable_shouldYield() {
|
|
|
832
820
|
}
|
|
833
821
|
|
|
834
822
|
var unstable_requestPaint = requestPaint;
|
|
835
|
-
var unstable_Profiling =
|
|
823
|
+
var unstable_Profiling = {
|
|
836
824
|
startLoggingProfilingEvents: startLoggingProfilingEvents,
|
|
837
825
|
stopLoggingProfilingEvents: stopLoggingProfilingEvents,
|
|
838
826
|
sharedProfilingBuffer: sharedProfilingBuffer
|
|
839
|
-
}
|
|
827
|
+
} ;
|
|
840
828
|
|
|
841
|
-
exports.unstable_flushAllWithoutAsserting = unstable_flushAllWithoutAsserting;
|
|
842
|
-
exports.unstable_flushNumberOfYields = unstable_flushNumberOfYields;
|
|
843
|
-
exports.unstable_flushExpired = unstable_flushExpired;
|
|
844
|
-
exports.unstable_clearYields = unstable_clearYields;
|
|
845
|
-
exports.unstable_flushUntilNextPaint = unstable_flushUntilNextPaint;
|
|
846
|
-
exports.unstable_flushAll = unstable_flushAll;
|
|
847
|
-
exports.unstable_yieldValue = unstable_yieldValue;
|
|
848
|
-
exports.unstable_advanceTime = unstable_advanceTime;
|
|
849
|
-
exports.unstable_ImmediatePriority = ImmediatePriority;
|
|
850
|
-
exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
|
851
|
-
exports.unstable_NormalPriority = NormalPriority;
|
|
852
829
|
exports.unstable_IdlePriority = IdlePriority;
|
|
830
|
+
exports.unstable_ImmediatePriority = ImmediatePriority;
|
|
853
831
|
exports.unstable_LowPriority = LowPriority;
|
|
854
|
-
exports.
|
|
855
|
-
exports.
|
|
856
|
-
exports.
|
|
832
|
+
exports.unstable_NormalPriority = NormalPriority;
|
|
833
|
+
exports.unstable_Profiling = unstable_Profiling;
|
|
834
|
+
exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
|
835
|
+
exports.unstable_advanceTime = unstable_advanceTime;
|
|
857
836
|
exports.unstable_cancelCallback = unstable_cancelCallback;
|
|
858
|
-
exports.
|
|
859
|
-
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
|
860
|
-
exports.unstable_shouldYield = unstable_shouldYield;
|
|
861
|
-
exports.unstable_requestPaint = unstable_requestPaint;
|
|
837
|
+
exports.unstable_clearYields = unstable_clearYields;
|
|
862
838
|
exports.unstable_continueExecution = unstable_continueExecution;
|
|
863
|
-
exports.
|
|
839
|
+
exports.unstable_flushAll = unstable_flushAll;
|
|
840
|
+
exports.unstable_flushAllWithoutAsserting = unstable_flushAllWithoutAsserting;
|
|
841
|
+
exports.unstable_flushExpired = unstable_flushExpired;
|
|
842
|
+
exports.unstable_flushNumberOfYields = unstable_flushNumberOfYields;
|
|
843
|
+
exports.unstable_flushUntilNextPaint = unstable_flushUntilNextPaint;
|
|
844
|
+
exports.unstable_forceFrameRate = forceFrameRate;
|
|
845
|
+
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
|
864
846
|
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
|
847
|
+
exports.unstable_next = unstable_next;
|
|
865
848
|
exports.unstable_now = getCurrentTime;
|
|
866
|
-
exports.
|
|
867
|
-
exports.
|
|
849
|
+
exports.unstable_pauseExecution = unstable_pauseExecution;
|
|
850
|
+
exports.unstable_requestPaint = unstable_requestPaint;
|
|
851
|
+
exports.unstable_runWithPriority = unstable_runWithPriority;
|
|
852
|
+
exports.unstable_scheduleCallback = unstable_scheduleCallback;
|
|
853
|
+
exports.unstable_shouldYield = unstable_shouldYield;
|
|
854
|
+
exports.unstable_wrapCallback = unstable_wrapCallback;
|
|
855
|
+
exports.unstable_yieldValue = unstable_yieldValue;
|
|
868
856
|
})();
|
|
869
857
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.19.0
|
|
2
2
|
* scheduler-unstable_mock.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
10
|
+
'use strict';var f=0,g=null,h=null,k=-1,l=null,m=-1,n=!1,p=!1,q=!1,r=!1;function t(){return-1!==m&&null!==l&&l.length>=m||r&&q?n=!0:!1}function x(){if(p)throw Error("Already flushing work.");if(null!==g){var a=g;p=!0;try{var b=!0;do b=a(!0,f);while(b);b||(g=null);return!0}finally{p=!1}}else return!1}function z(a,b){var c=a.length;a.push(b);a:for(;;){var d=c-1>>>1,e=a[d];if(void 0!==e&&0<A(e,b))a[d]=b,a[c]=e,c=d;else break a}}function B(a){a=a[0];return void 0===a?null:a}
|
|
11
|
+
function C(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 u=2*(d+1)-1,v=a[u],w=u+1,y=a[w];if(void 0!==v&&0>A(v,c))void 0!==y&&0>A(y,v)?(a[d]=y,a[w]=c,d=w):(a[d]=v,a[u]=c,d=u);else if(void 0!==y&&0>A(y,c))a[d]=y,a[w]=c,d=w;else break a}}return b}return null}function A(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var D=[],E=[],F=1,G=null,H=3,I=!1,J=!1,K=!1;
|
|
12
|
+
function L(a){for(var b=B(E);null!==b;){if(null===b.callback)C(E);else if(b.startTime<=a)C(E),b.sortIndex=b.expirationTime,z(D,b);else break;b=B(E)}}function M(a){K=!1;L(a);if(!J)if(null!==B(D))J=!0,g=N;else{var b=B(E);null!==b&&(a=b.startTime-a,h=M,k=f+a)}}
|
|
13
|
+
function N(a,b){J=!1;K&&(K=!1,h=null,k=-1);I=!0;var c=H;try{L(b);for(G=B(D);null!==G&&(!(G.expirationTime>b)||a&&!t());){var d=G.callback;if(null!==d){G.callback=null;H=G.priorityLevel;var e=d(G.expirationTime<=b);b=f;"function"===typeof e?G.callback=e:G===B(D)&&C(D);L(b)}else C(D);G=B(D)}if(null!==G)var u=!0;else{var v=B(E);if(null!==v){var w=v.startTime-b;h=M;k=f+w}u=!1}return u}finally{G=null,H=c,I=!1}}
|
|
14
|
+
function O(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_advanceTime=function(a){f+=a;null!==h&&k<=f&&(h(f),k=-1,h=null)};exports.unstable_cancelCallback=function(a){a.callback=null};
|
|
15
|
+
exports.unstable_clearYields=function(){if(null===l)return[];var a=l;l=null;return a};exports.unstable_continueExecution=function(){J||I||(J=!0,g=N)};exports.unstable_flushAll=function(){if(null!==l)throw Error("Log is not empty. Assert on the log of yielded values before flushing additional work.");x();if(null!==l)throw Error("While flushing work, something yielded a value. Use an assertion helper to assert on the log of yielded values, e.g. expect(Scheduler).toFlushAndYield([...])");};
|
|
16
|
+
exports.unstable_flushAllWithoutAsserting=x;exports.unstable_flushExpired=function(){if(p)throw Error("Already flushing work.");if(null!==g){p=!0;try{g(!1,f)||(g=null)}finally{p=!1}}};exports.unstable_flushNumberOfYields=function(a){if(p)throw Error("Already flushing work.");if(null!==g){var b=g;m=a;p=!0;try{a=!0;do a=b(!0,f);while(a&&!n);a||(g=null)}finally{m=-1,p=n=!1}}};
|
|
17
|
+
exports.unstable_flushUntilNextPaint=function(){if(p)throw Error("Already flushing work.");if(null!==g){var a=g;r=!0;q=!1;p=!0;try{var b=!0;do b=a(!0,f);while(b&&!n);b||(g=null)}finally{p=n=r=!1}}};exports.unstable_forceFrameRate=function(){};exports.unstable_getCurrentPriorityLevel=function(){return H};exports.unstable_getFirstCallbackNode=function(){return B(D)};exports.unstable_next=function(a){switch(H){case 1:case 2:case 3:var b=3;break;default:b=H}var c=H;H=b;try{return a()}finally{H=c}};
|
|
18
|
+
exports.unstable_now=function(){return f};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){q=!0};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=H;H=a;try{return b()}finally{H=c}};
|
|
19
|
+
exports.unstable_scheduleCallback=function(a,b,c){var d=f;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:O(a)}else c=O(a),e=d;c=e+c;a={id:F++,callback:b,priorityLevel:a,startTime:e,expirationTime:c,sortIndex:-1};e>d?(a.sortIndex=e,z(E,a),null===B(D)&&a===B(E)&&(K?(h=null,k=-1):K=!0,h=M,k=f+(e-d))):(a.sortIndex=c,z(D,a),J||I||(J=!0,g=N));return a};
|
|
20
|
+
exports.unstable_shouldYield=function(){var a=f;L(a);var b=B(D);return b!==G&&null!==G&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime<G.expirationTime||t()};exports.unstable_wrapCallback=function(a){var b=H;return function(){var c=H;H=b;try{return a.apply(this,arguments)}finally{H=c}}};exports.unstable_yieldValue=function(a){null===l?l=[a]:l.push(a)};
|