scheduler 0.15.0 → 0.17.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 +39 -84
- package/cjs/scheduler-tracing.production.min.js +1 -1
- package/cjs/scheduler-tracing.profiling.min.js +8 -9
- package/cjs/scheduler-unstable_mock.development.js +444 -298
- package/cjs/scheduler-unstable_mock.production.min.js +12 -13
- package/cjs/scheduler.development.js +493 -369
- package/cjs/scheduler.production.min.js +14 -15
- package/package.json +1 -1
- package/umd/scheduler-unstable_mock.development.js +444 -298
- package/umd/scheduler-unstable_mock.production.min.js +10 -11
- package/umd/scheduler.development.js +4 -0
- package/umd/scheduler.production.min.js +4 -0
- package/umd/scheduler.profiling.min.js +4 -0
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "54423",
|
|
4
|
+
"checksum": "3b849cc",
|
|
5
|
+
"commit": "5faf377df",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.10.2-5faf377df"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.17.0
|
|
2
2
|
* scheduler-tracing.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -19,98 +19,70 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
19
19
|
|
|
20
20
|
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
22
|
+
// In some cases, StrictMode should also double-render lifecycles.
|
|
24
23
|
// This can be confusing for tests though,
|
|
25
24
|
// And it can be bad for performance in production.
|
|
26
25
|
// This feature flag can be used to control the behavior:
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
27
|
+
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
30
28
|
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
31
29
|
|
|
30
|
+
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
32
31
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Trace which interactions trigger each commit.
|
|
40
|
-
var enableSchedulerTracing = true;
|
|
41
|
-
|
|
42
|
-
// Only used in www builds.
|
|
43
|
-
// TODO: true? Here it might just be false.
|
|
32
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
44
33
|
|
|
45
|
-
//
|
|
34
|
+
// Trace which interactions trigger each commit.
|
|
46
35
|
|
|
36
|
+
var enableSchedulerTracing = true; // SSR experiments
|
|
47
37
|
|
|
48
|
-
// Only used in www builds.
|
|
49
38
|
|
|
39
|
+
// Only used in www builds.
|
|
50
40
|
|
|
51
|
-
//
|
|
41
|
+
// Only used in www builds.
|
|
52
42
|
|
|
43
|
+
// Disable javascript: URL strings in href for XSS protection.
|
|
53
44
|
|
|
54
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
45
|
+
// React Fire: prevent the value and checked attributes from syncing
|
|
55
46
|
// with their related DOM properties
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
48
|
+
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
59
49
|
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
60
50
|
|
|
61
51
|
|
|
52
|
+
// Experimental React Flare event system and event components support.
|
|
62
53
|
|
|
54
|
+
// Experimental Host Component support.
|
|
63
55
|
|
|
64
|
-
//
|
|
65
|
-
// This is a flag so we can fix warnings in RN core before turning it on
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Experimental React Flare event system and event components support.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Experimental Host Component support.
|
|
72
|
-
|
|
56
|
+
// Experimental Scope support.
|
|
73
57
|
|
|
74
|
-
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
58
|
+
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
60
|
+
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
78
61
|
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
|
|
79
62
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
63
|
+
// For tests, we flush suspense fallbacks in an act scope;
|
|
84
64
|
// *except* in some of our own tests, where we test incremental loading states.
|
|
85
65
|
|
|
86
|
-
|
|
87
|
-
// Changes priority of some events like mousemove to user-blocking priority,
|
|
88
|
-
// but without making them discrete. The flag exists in case it causes
|
|
89
|
-
// starvation problems.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
66
|
+
// Add a callback property to suspense to notify which promises are currently
|
|
93
67
|
// in the update queue. This allows reporting and tracing of what is causing
|
|
94
68
|
// the user to see a loading state.
|
|
69
|
+
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
70
|
+
// hydrated or deleted.
|
|
95
71
|
|
|
96
|
-
|
|
97
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
72
|
+
// Part of the simplification of React.createElement so we can eventually move
|
|
98
73
|
// from React.createElement to React.jsx
|
|
99
74
|
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
100
75
|
|
|
101
|
-
var DEFAULT_THREAD_ID = 0;
|
|
76
|
+
var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
|
|
102
77
|
|
|
103
|
-
// Counters used to generate unique IDs.
|
|
104
78
|
var interactionIDCounter = 0;
|
|
105
|
-
var threadIDCounter = 0;
|
|
106
|
-
|
|
107
|
-
// Set of currently traced interactions.
|
|
79
|
+
var threadIDCounter = 0; // Set of currently traced interactions.
|
|
108
80
|
// Interactions "stack"–
|
|
109
81
|
// Meaning that newly traced interactions are appended to the previously active set.
|
|
110
82
|
// When an interaction goes out of scope, the previous set (if any) is restored.
|
|
111
|
-
exports.__interactionsRef = null;
|
|
112
83
|
|
|
113
|
-
// Listener(s) to notify when interactions begin and end.
|
|
84
|
+
exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.
|
|
85
|
+
|
|
114
86
|
exports.__subscriberRef = null;
|
|
115
87
|
|
|
116
88
|
if (enableSchedulerTracing) {
|
|
@@ -136,7 +108,6 @@ function unstable_clear(callback) {
|
|
|
136
108
|
exports.__interactionsRef.current = prevInteractions;
|
|
137
109
|
}
|
|
138
110
|
}
|
|
139
|
-
|
|
140
111
|
function unstable_getCurrent() {
|
|
141
112
|
if (!enableSchedulerTracing) {
|
|
142
113
|
return null;
|
|
@@ -144,11 +115,9 @@ function unstable_getCurrent() {
|
|
|
144
115
|
return exports.__interactionsRef.current;
|
|
145
116
|
}
|
|
146
117
|
}
|
|
147
|
-
|
|
148
118
|
function unstable_getThreadID() {
|
|
149
119
|
return ++threadIDCounter;
|
|
150
120
|
}
|
|
151
|
-
|
|
152
121
|
function unstable_trace(name, timestamp, callback) {
|
|
153
122
|
var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
|
|
154
123
|
|
|
@@ -162,18 +131,15 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
162
131
|
name: name,
|
|
163
132
|
timestamp: timestamp
|
|
164
133
|
};
|
|
165
|
-
|
|
166
|
-
var prevInteractions = exports.__interactionsRef.current;
|
|
167
|
-
|
|
168
|
-
// Traced interactions should stack/accumulate.
|
|
134
|
+
var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
|
|
169
135
|
// To do that, clone the current interactions.
|
|
170
136
|
// The previous set will be restored upon completion.
|
|
137
|
+
|
|
171
138
|
var interactions = new Set(prevInteractions);
|
|
172
139
|
interactions.add(interaction);
|
|
173
140
|
exports.__interactionsRef.current = interactions;
|
|
174
|
-
|
|
175
141
|
var subscriber = exports.__subscriberRef.current;
|
|
176
|
-
var returnValue
|
|
142
|
+
var returnValue;
|
|
177
143
|
|
|
178
144
|
try {
|
|
179
145
|
if (subscriber !== null) {
|
|
@@ -195,10 +161,9 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
195
161
|
subscriber.onWorkStopped(interactions, threadID);
|
|
196
162
|
}
|
|
197
163
|
} finally {
|
|
198
|
-
interaction.__count--;
|
|
199
|
-
|
|
200
|
-
// If no async work was scheduled for this interaction,
|
|
164
|
+
interaction.__count--; // If no async work was scheduled for this interaction,
|
|
201
165
|
// Notify subscribers that it's completed.
|
|
166
|
+
|
|
202
167
|
if (subscriber !== null && interaction.__count === 0) {
|
|
203
168
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
204
169
|
}
|
|
@@ -209,7 +174,6 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
209
174
|
|
|
210
175
|
return returnValue;
|
|
211
176
|
}
|
|
212
|
-
|
|
213
177
|
function unstable_wrap(callback) {
|
|
214
178
|
var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
|
|
215
179
|
|
|
@@ -218,28 +182,26 @@ function unstable_wrap(callback) {
|
|
|
218
182
|
}
|
|
219
183
|
|
|
220
184
|
var wrappedInteractions = exports.__interactionsRef.current;
|
|
221
|
-
|
|
222
185
|
var subscriber = exports.__subscriberRef.current;
|
|
186
|
+
|
|
223
187
|
if (subscriber !== null) {
|
|
224
188
|
subscriber.onWorkScheduled(wrappedInteractions, threadID);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Update the pending async work count for the current interactions.
|
|
189
|
+
} // Update the pending async work count for the current interactions.
|
|
228
190
|
// Update after calling subscribers in case of error.
|
|
191
|
+
|
|
192
|
+
|
|
229
193
|
wrappedInteractions.forEach(function (interaction) {
|
|
230
194
|
interaction.__count++;
|
|
231
195
|
});
|
|
232
|
-
|
|
233
196
|
var hasRun = false;
|
|
234
197
|
|
|
235
198
|
function wrapped() {
|
|
236
199
|
var prevInteractions = exports.__interactionsRef.current;
|
|
237
200
|
exports.__interactionsRef.current = wrappedInteractions;
|
|
238
|
-
|
|
239
201
|
subscriber = exports.__subscriberRef.current;
|
|
240
202
|
|
|
241
203
|
try {
|
|
242
|
-
var returnValue
|
|
204
|
+
var returnValue;
|
|
243
205
|
|
|
244
206
|
try {
|
|
245
207
|
if (subscriber !== null) {
|
|
@@ -263,11 +225,10 @@ function unstable_wrap(callback) {
|
|
|
263
225
|
// We only expect a wrapped function to be executed once,
|
|
264
226
|
// But in the event that it's executed more than once–
|
|
265
227
|
// Only decrement the outstanding interaction counts once.
|
|
266
|
-
hasRun = true;
|
|
267
|
-
|
|
268
|
-
// Update pending async counts for all wrapped interactions.
|
|
228
|
+
hasRun = true; // Update pending async counts for all wrapped interactions.
|
|
269
229
|
// If this was the last scheduled async work for any of them,
|
|
270
230
|
// Mark them as completed.
|
|
231
|
+
|
|
271
232
|
wrappedInteractions.forEach(function (interaction) {
|
|
272
233
|
interaction.__count--;
|
|
273
234
|
|
|
@@ -304,6 +265,7 @@ function unstable_wrap(callback) {
|
|
|
304
265
|
}
|
|
305
266
|
|
|
306
267
|
var subscribers = null;
|
|
268
|
+
|
|
307
269
|
if (enableSchedulerTracing) {
|
|
308
270
|
subscribers = new Set();
|
|
309
271
|
}
|
|
@@ -324,7 +286,6 @@ function unstable_subscribe(subscriber) {
|
|
|
324
286
|
}
|
|
325
287
|
}
|
|
326
288
|
}
|
|
327
|
-
|
|
328
289
|
function unstable_unsubscribe(subscriber) {
|
|
329
290
|
if (enableSchedulerTracing) {
|
|
330
291
|
subscribers.delete(subscriber);
|
|
@@ -338,7 +299,6 @@ function unstable_unsubscribe(subscriber) {
|
|
|
338
299
|
function onInteractionTraced(interaction) {
|
|
339
300
|
var didCatchError = false;
|
|
340
301
|
var caughtError = null;
|
|
341
|
-
|
|
342
302
|
subscribers.forEach(function (subscriber) {
|
|
343
303
|
try {
|
|
344
304
|
subscriber.onInteractionTraced(interaction);
|
|
@@ -358,7 +318,6 @@ function onInteractionTraced(interaction) {
|
|
|
358
318
|
function onInteractionScheduledWorkCompleted(interaction) {
|
|
359
319
|
var didCatchError = false;
|
|
360
320
|
var caughtError = null;
|
|
361
|
-
|
|
362
321
|
subscribers.forEach(function (subscriber) {
|
|
363
322
|
try {
|
|
364
323
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
@@ -378,7 +337,6 @@ function onInteractionScheduledWorkCompleted(interaction) {
|
|
|
378
337
|
function onWorkScheduled(interactions, threadID) {
|
|
379
338
|
var didCatchError = false;
|
|
380
339
|
var caughtError = null;
|
|
381
|
-
|
|
382
340
|
subscribers.forEach(function (subscriber) {
|
|
383
341
|
try {
|
|
384
342
|
subscriber.onWorkScheduled(interactions, threadID);
|
|
@@ -398,7 +356,6 @@ function onWorkScheduled(interactions, threadID) {
|
|
|
398
356
|
function onWorkStarted(interactions, threadID) {
|
|
399
357
|
var didCatchError = false;
|
|
400
358
|
var caughtError = null;
|
|
401
|
-
|
|
402
359
|
subscribers.forEach(function (subscriber) {
|
|
403
360
|
try {
|
|
404
361
|
subscriber.onWorkStarted(interactions, threadID);
|
|
@@ -418,7 +375,6 @@ function onWorkStarted(interactions, threadID) {
|
|
|
418
375
|
function onWorkStopped(interactions, threadID) {
|
|
419
376
|
var didCatchError = false;
|
|
420
377
|
var caughtError = null;
|
|
421
|
-
|
|
422
378
|
subscribers.forEach(function (subscriber) {
|
|
423
379
|
try {
|
|
424
380
|
subscriber.onWorkStopped(interactions, threadID);
|
|
@@ -438,7 +394,6 @@ function onWorkStopped(interactions, threadID) {
|
|
|
438
394
|
function onWorkCanceled(interactions, threadID) {
|
|
439
395
|
var didCatchError = false;
|
|
440
396
|
var caughtError = null;
|
|
441
|
-
|
|
442
397
|
subscribers.forEach(function (subscriber) {
|
|
443
398
|
try {
|
|
444
399
|
subscriber.onWorkCanceled(interactions, threadID);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.17.0
|
|
2
2
|
* scheduler-tracing.profiling.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var g=0,
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
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
|
|
14
|
-
0
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.unstable_subscribe=function(e){n.add(e);1===n.size&&(exports.__subscriberRef.current={onInteractionScheduledWorkCompleted:q,onInteractionTraced:p,onWorkCanceled:v,onWorkScheduled:r,onWorkStarted:t,onWorkStopped:u})};exports.unstable_unsubscribe=function(e){n.delete(e);0===n.size&&(exports.__subscriberRef.current=null)};
|
|
10
|
+
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});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;}
|
|
11
|
+
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;}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;}
|
|
12
|
+
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;}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_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};
|
|
14
|
+
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
|
+
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)};
|