scheduler 0.15.0-rc.0 → 0.16.2
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 +5 -5
- package/cjs/scheduler-tracing.development.js +41 -78
- 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 +441 -298
- package/cjs/scheduler-unstable_mock.production.min.js +12 -13
- package/cjs/scheduler.development.js +489 -368
- package/cjs/scheduler.production.min.js +14 -15
- package/package.json +1 -1
- package/umd/scheduler-unstable_mock.development.js +441 -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
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "pull/17007",
|
|
3
|
+
"buildNumber": "50178",
|
|
4
|
+
"checksum": "39106c3",
|
|
5
|
+
"commit": "4ab6305f6",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.10.1-canary-4ab6305f6"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.16.2
|
|
2
2
|
* scheduler-tracing.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -19,98 +19,78 @@ 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.
|
|
32
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
37
33
|
|
|
34
|
+
// Trace which interactions trigger each commit.
|
|
38
35
|
|
|
39
|
-
//
|
|
40
|
-
var enableSchedulerTracing = true;
|
|
36
|
+
var enableSchedulerTracing = true; // Only used in www builds.
|
|
41
37
|
|
|
42
|
-
// Only used in www builds.
|
|
43
38
|
// TODO: true? Here it might just be false.
|
|
44
39
|
|
|
45
|
-
// Only used in www builds.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Only used in www builds.
|
|
49
|
-
|
|
40
|
+
// Only used in www builds.
|
|
50
41
|
|
|
51
|
-
//
|
|
42
|
+
// Only used in www builds.
|
|
52
43
|
|
|
44
|
+
// Disable javascript: URL strings in href for XSS protection.
|
|
53
45
|
|
|
54
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
46
|
+
// React Fire: prevent the value and checked attributes from syncing
|
|
55
47
|
// with their related DOM properties
|
|
56
48
|
|
|
57
|
-
|
|
58
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
49
|
+
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
59
50
|
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
60
51
|
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
|
|
53
|
+
// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
|
|
65
54
|
// This is a flag so we can fix warnings in RN core before turning it on
|
|
66
55
|
|
|
56
|
+
// Experimental React Flare event system and event components support.
|
|
67
57
|
|
|
68
|
-
// Experimental
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Experimental Host Component support.
|
|
72
|
-
|
|
58
|
+
// Experimental Host Component support.
|
|
73
59
|
|
|
74
|
-
//
|
|
60
|
+
// Experimental Scope support.
|
|
75
61
|
|
|
62
|
+
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
76
63
|
|
|
77
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
64
|
+
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
78
65
|
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
|
|
79
66
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
67
|
+
// For tests, we flush suspense fallbacks in an act scope;
|
|
84
68
|
// *except* in some of our own tests, where we test incremental loading states.
|
|
85
69
|
|
|
86
|
-
|
|
87
|
-
// Changes priority of some events like mousemove to user-blocking priority,
|
|
70
|
+
// Changes priority of some events like mousemove to user-blocking priority,
|
|
88
71
|
// but without making them discrete. The flag exists in case it causes
|
|
89
72
|
// starvation problems.
|
|
90
73
|
|
|
91
|
-
|
|
92
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
74
|
+
// Add a callback property to suspense to notify which promises are currently
|
|
93
75
|
// in the update queue. This allows reporting and tracing of what is causing
|
|
94
76
|
// the user to see a loading state.
|
|
77
|
+
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
78
|
+
// hydrated or deleted.
|
|
95
79
|
|
|
96
|
-
|
|
97
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
80
|
+
// Part of the simplification of React.createElement so we can eventually move
|
|
98
81
|
// from React.createElement to React.jsx
|
|
99
82
|
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
100
83
|
|
|
101
|
-
var DEFAULT_THREAD_ID = 0;
|
|
84
|
+
var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
|
|
102
85
|
|
|
103
|
-
// Counters used to generate unique IDs.
|
|
104
86
|
var interactionIDCounter = 0;
|
|
105
|
-
var threadIDCounter = 0;
|
|
106
|
-
|
|
107
|
-
// Set of currently traced interactions.
|
|
87
|
+
var threadIDCounter = 0; // Set of currently traced interactions.
|
|
108
88
|
// Interactions "stack"–
|
|
109
89
|
// Meaning that newly traced interactions are appended to the previously active set.
|
|
110
90
|
// When an interaction goes out of scope, the previous set (if any) is restored.
|
|
111
|
-
exports.__interactionsRef = null;
|
|
112
91
|
|
|
113
|
-
// Listener(s) to notify when interactions begin and end.
|
|
92
|
+
exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.
|
|
93
|
+
|
|
114
94
|
exports.__subscriberRef = null;
|
|
115
95
|
|
|
116
96
|
if (enableSchedulerTracing) {
|
|
@@ -136,7 +116,6 @@ function unstable_clear(callback) {
|
|
|
136
116
|
exports.__interactionsRef.current = prevInteractions;
|
|
137
117
|
}
|
|
138
118
|
}
|
|
139
|
-
|
|
140
119
|
function unstable_getCurrent() {
|
|
141
120
|
if (!enableSchedulerTracing) {
|
|
142
121
|
return null;
|
|
@@ -144,11 +123,9 @@ function unstable_getCurrent() {
|
|
|
144
123
|
return exports.__interactionsRef.current;
|
|
145
124
|
}
|
|
146
125
|
}
|
|
147
|
-
|
|
148
126
|
function unstable_getThreadID() {
|
|
149
127
|
return ++threadIDCounter;
|
|
150
128
|
}
|
|
151
|
-
|
|
152
129
|
function unstable_trace(name, timestamp, callback) {
|
|
153
130
|
var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
|
|
154
131
|
|
|
@@ -162,18 +139,15 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
162
139
|
name: name,
|
|
163
140
|
timestamp: timestamp
|
|
164
141
|
};
|
|
165
|
-
|
|
166
|
-
var prevInteractions = exports.__interactionsRef.current;
|
|
167
|
-
|
|
168
|
-
// Traced interactions should stack/accumulate.
|
|
142
|
+
var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
|
|
169
143
|
// To do that, clone the current interactions.
|
|
170
144
|
// The previous set will be restored upon completion.
|
|
145
|
+
|
|
171
146
|
var interactions = new Set(prevInteractions);
|
|
172
147
|
interactions.add(interaction);
|
|
173
148
|
exports.__interactionsRef.current = interactions;
|
|
174
|
-
|
|
175
149
|
var subscriber = exports.__subscriberRef.current;
|
|
176
|
-
var returnValue
|
|
150
|
+
var returnValue;
|
|
177
151
|
|
|
178
152
|
try {
|
|
179
153
|
if (subscriber !== null) {
|
|
@@ -195,10 +169,9 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
195
169
|
subscriber.onWorkStopped(interactions, threadID);
|
|
196
170
|
}
|
|
197
171
|
} finally {
|
|
198
|
-
interaction.__count--;
|
|
199
|
-
|
|
200
|
-
// If no async work was scheduled for this interaction,
|
|
172
|
+
interaction.__count--; // If no async work was scheduled for this interaction,
|
|
201
173
|
// Notify subscribers that it's completed.
|
|
174
|
+
|
|
202
175
|
if (subscriber !== null && interaction.__count === 0) {
|
|
203
176
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
204
177
|
}
|
|
@@ -209,7 +182,6 @@ function unstable_trace(name, timestamp, callback) {
|
|
|
209
182
|
|
|
210
183
|
return returnValue;
|
|
211
184
|
}
|
|
212
|
-
|
|
213
185
|
function unstable_wrap(callback) {
|
|
214
186
|
var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
|
|
215
187
|
|
|
@@ -218,28 +190,26 @@ function unstable_wrap(callback) {
|
|
|
218
190
|
}
|
|
219
191
|
|
|
220
192
|
var wrappedInteractions = exports.__interactionsRef.current;
|
|
221
|
-
|
|
222
193
|
var subscriber = exports.__subscriberRef.current;
|
|
194
|
+
|
|
223
195
|
if (subscriber !== null) {
|
|
224
196
|
subscriber.onWorkScheduled(wrappedInteractions, threadID);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Update the pending async work count for the current interactions.
|
|
197
|
+
} // Update the pending async work count for the current interactions.
|
|
228
198
|
// Update after calling subscribers in case of error.
|
|
199
|
+
|
|
200
|
+
|
|
229
201
|
wrappedInteractions.forEach(function (interaction) {
|
|
230
202
|
interaction.__count++;
|
|
231
203
|
});
|
|
232
|
-
|
|
233
204
|
var hasRun = false;
|
|
234
205
|
|
|
235
206
|
function wrapped() {
|
|
236
207
|
var prevInteractions = exports.__interactionsRef.current;
|
|
237
208
|
exports.__interactionsRef.current = wrappedInteractions;
|
|
238
|
-
|
|
239
209
|
subscriber = exports.__subscriberRef.current;
|
|
240
210
|
|
|
241
211
|
try {
|
|
242
|
-
var returnValue
|
|
212
|
+
var returnValue;
|
|
243
213
|
|
|
244
214
|
try {
|
|
245
215
|
if (subscriber !== null) {
|
|
@@ -263,11 +233,10 @@ function unstable_wrap(callback) {
|
|
|
263
233
|
// We only expect a wrapped function to be executed once,
|
|
264
234
|
// But in the event that it's executed more than once–
|
|
265
235
|
// Only decrement the outstanding interaction counts once.
|
|
266
|
-
hasRun = true;
|
|
267
|
-
|
|
268
|
-
// Update pending async counts for all wrapped interactions.
|
|
236
|
+
hasRun = true; // Update pending async counts for all wrapped interactions.
|
|
269
237
|
// If this was the last scheduled async work for any of them,
|
|
270
238
|
// Mark them as completed.
|
|
239
|
+
|
|
271
240
|
wrappedInteractions.forEach(function (interaction) {
|
|
272
241
|
interaction.__count--;
|
|
273
242
|
|
|
@@ -304,6 +273,7 @@ function unstable_wrap(callback) {
|
|
|
304
273
|
}
|
|
305
274
|
|
|
306
275
|
var subscribers = null;
|
|
276
|
+
|
|
307
277
|
if (enableSchedulerTracing) {
|
|
308
278
|
subscribers = new Set();
|
|
309
279
|
}
|
|
@@ -324,7 +294,6 @@ function unstable_subscribe(subscriber) {
|
|
|
324
294
|
}
|
|
325
295
|
}
|
|
326
296
|
}
|
|
327
|
-
|
|
328
297
|
function unstable_unsubscribe(subscriber) {
|
|
329
298
|
if (enableSchedulerTracing) {
|
|
330
299
|
subscribers.delete(subscriber);
|
|
@@ -338,7 +307,6 @@ function unstable_unsubscribe(subscriber) {
|
|
|
338
307
|
function onInteractionTraced(interaction) {
|
|
339
308
|
var didCatchError = false;
|
|
340
309
|
var caughtError = null;
|
|
341
|
-
|
|
342
310
|
subscribers.forEach(function (subscriber) {
|
|
343
311
|
try {
|
|
344
312
|
subscriber.onInteractionTraced(interaction);
|
|
@@ -358,7 +326,6 @@ function onInteractionTraced(interaction) {
|
|
|
358
326
|
function onInteractionScheduledWorkCompleted(interaction) {
|
|
359
327
|
var didCatchError = false;
|
|
360
328
|
var caughtError = null;
|
|
361
|
-
|
|
362
329
|
subscribers.forEach(function (subscriber) {
|
|
363
330
|
try {
|
|
364
331
|
subscriber.onInteractionScheduledWorkCompleted(interaction);
|
|
@@ -378,7 +345,6 @@ function onInteractionScheduledWorkCompleted(interaction) {
|
|
|
378
345
|
function onWorkScheduled(interactions, threadID) {
|
|
379
346
|
var didCatchError = false;
|
|
380
347
|
var caughtError = null;
|
|
381
|
-
|
|
382
348
|
subscribers.forEach(function (subscriber) {
|
|
383
349
|
try {
|
|
384
350
|
subscriber.onWorkScheduled(interactions, threadID);
|
|
@@ -398,7 +364,6 @@ function onWorkScheduled(interactions, threadID) {
|
|
|
398
364
|
function onWorkStarted(interactions, threadID) {
|
|
399
365
|
var didCatchError = false;
|
|
400
366
|
var caughtError = null;
|
|
401
|
-
|
|
402
367
|
subscribers.forEach(function (subscriber) {
|
|
403
368
|
try {
|
|
404
369
|
subscriber.onWorkStarted(interactions, threadID);
|
|
@@ -418,7 +383,6 @@ function onWorkStarted(interactions, threadID) {
|
|
|
418
383
|
function onWorkStopped(interactions, threadID) {
|
|
419
384
|
var didCatchError = false;
|
|
420
385
|
var caughtError = null;
|
|
421
|
-
|
|
422
386
|
subscribers.forEach(function (subscriber) {
|
|
423
387
|
try {
|
|
424
388
|
subscriber.onWorkStopped(interactions, threadID);
|
|
@@ -438,7 +402,6 @@ function onWorkStopped(interactions, threadID) {
|
|
|
438
402
|
function onWorkCanceled(interactions, threadID) {
|
|
439
403
|
var didCatchError = false;
|
|
440
404
|
var caughtError = null;
|
|
441
|
-
|
|
442
405
|
subscribers.forEach(function (subscriber) {
|
|
443
406
|
try {
|
|
444
407
|
subscriber.onWorkCanceled(interactions, threadID);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.
|
|
1
|
+
/** @license React v0.16.2
|
|
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)};
|