scheduler 0.11.3 → 0.12.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "branch": "pull/14384",
3
- "buildNumber": "12853",
4
- "checksum": "7b1e67b",
5
- "commit": "8599a6296",
2
+ "branch": "master",
3
+ "buildNumber": "12928",
4
+ "checksum": "7d45248",
5
+ "commit": "4a1072194",
6
6
  "environment": "ci",
7
- "reactVersion": "16.6.1-canary-8599a6296"
7
+ "reactVersion": "16.6.1-canary-4a1072194"
8
8
  }
@@ -1,4 +1,4 @@
1
- /** @license React v0.11.3
1
+ /** @license React v0.12.0
2
2
  * scheduler-tracing.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -39,6 +39,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
39
39
  // Trace which interactions trigger each commit.
40
40
  var enableSchedulerTracing = true;
41
41
 
42
+ // Only used in www builds.
43
+ // TODO: true? Here it might just be false.
44
+
42
45
  // Only used in www builds.
43
46
 
44
47
 
@@ -1,4 +1,4 @@
1
- /** @license React v0.11.3
1
+ /** @license React v0.12.0
2
2
  * scheduler-tracing.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.11.3
1
+ /** @license React v0.12.0
2
2
  * scheduler-tracing.profiling.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v0.11.3
1
+ /** @license React v0.12.0
2
2
  * scheduler.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -17,6 +17,44 @@ if (process.env.NODE_ENV !== "production") {
17
17
 
18
18
  Object.defineProperty(exports, '__esModule', { value: true });
19
19
 
20
+ // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
21
+
22
+
23
+ // In some cases, StrictMode should also double-render lifecycles.
24
+ // This can be confusing for tests though,
25
+ // And it can be bad for performance in production.
26
+ // This feature flag can be used to control the behavior:
27
+
28
+
29
+ // To preserve the "Pause on caught exceptions" behavior of the debugger, we
30
+ // replay the begin phase of a failed component inside invokeGuardedCallback.
31
+
32
+
33
+ // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
34
+
35
+
36
+ // Gather advanced timing metrics for Profiler subtrees.
37
+
38
+
39
+ // Trace which interactions trigger each commit.
40
+
41
+
42
+ // Only used in www builds.
43
+ // TODO: true? Here it might just be false.
44
+
45
+ // Only used in www builds.
46
+ var enableSchedulerDebugging = true;
47
+
48
+ // Only used in www builds.
49
+
50
+
51
+ // React Fire: prevent the value and checked attributes from syncing
52
+ // with their related DOM properties
53
+
54
+
55
+ // These APIs will no longer be "unstable" in the upcoming 16.7 release,
56
+ // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
57
+
20
58
  /* eslint-disable no-var */
21
59
 
22
60
  // TODO: Use symbols?
@@ -44,6 +82,9 @@ var IDLE_PRIORITY = maxSigned31BitInt;
44
82
  var firstCallbackNode = null;
45
83
 
46
84
  var currentDidTimeout = false;
85
+ // Pausing the scheduler is useful for debugging.
86
+ var isSchedulerPaused = false;
87
+
47
88
  var currentPriorityLevel = NormalPriority;
48
89
  var currentEventStartTime = -1;
49
90
  var currentExpirationTime = -1;
@@ -178,13 +219,20 @@ function flushImmediateWork() {
178
219
  }
179
220
 
180
221
  function flushWork(didTimeout) {
222
+ // Exit right away if we're currently paused
223
+
224
+ if (enableSchedulerDebugging && isSchedulerPaused) {
225
+ return;
226
+ }
227
+
181
228
  isExecutingCallback = true;
182
229
  var previousDidTimeout = currentDidTimeout;
183
230
  currentDidTimeout = didTimeout;
184
231
  try {
185
232
  if (didTimeout) {
186
233
  // Flush all the expired callbacks without yielding.
187
- while (firstCallbackNode !== null) {
234
+ while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
235
+ // TODO Wrap i nfeature flag
188
236
  // Read the current time. Flush all the callbacks that expire at or
189
237
  // earlier than that time. Then read the current time again and repeat.
190
238
  // This optimizes for as few performance.now calls as possible.
@@ -192,7 +240,7 @@ function flushWork(didTimeout) {
192
240
  if (firstCallbackNode.expirationTime <= currentTime) {
193
241
  do {
194
242
  flushFirstCallback();
195
- } while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime);
243
+ } while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused));
196
244
  continue;
197
245
  }
198
246
  break;
@@ -201,6 +249,9 @@ function flushWork(didTimeout) {
201
249
  // Keep flushing callbacks until we run out of time in the frame.
202
250
  if (firstCallbackNode !== null) {
203
251
  do {
252
+ if (enableSchedulerDebugging && isSchedulerPaused) {
253
+ break;
254
+ }
204
255
  flushFirstCallback();
205
256
  } while (firstCallbackNode !== null && !shouldYieldToHost());
206
257
  }
@@ -339,6 +390,21 @@ function unstable_scheduleCallback(callback, deprecated_options) {
339
390
  return newNode;
340
391
  }
341
392
 
393
+ function unstable_pauseExecution() {
394
+ isSchedulerPaused = true;
395
+ }
396
+
397
+ function unstable_continueExecution() {
398
+ isSchedulerPaused = false;
399
+ if (firstCallbackNode !== null) {
400
+ ensureHostCallbackIsScheduled();
401
+ }
402
+ }
403
+
404
+ function unstable_getFirstCallbackNode() {
405
+ return firstCallbackNode;
406
+ }
407
+
342
408
  function unstable_cancelCallback(callbackNode) {
343
409
  var next = callbackNode.next;
344
410
  if (next === null) {
@@ -630,5 +696,8 @@ exports.unstable_cancelCallback = unstable_cancelCallback;
630
696
  exports.unstable_wrapCallback = unstable_wrapCallback;
631
697
  exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
632
698
  exports.unstable_shouldYield = unstable_shouldYield;
699
+ exports.unstable_continueExecution = unstable_continueExecution;
700
+ exports.unstable_pauseExecution = unstable_pauseExecution;
701
+ exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
633
702
  })();
634
703
  }
@@ -1,4 +1,4 @@
1
- /** @license React v0.11.3
1
+ /** @license React v0.12.0
2
2
  * scheduler.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -7,15 +7,15 @@
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 d=null,f=!1,h=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=d.expirationTime;n?q():n=!0;r(t,a)}}
11
- function u(){var a=d,b=d.next;if(d===b)d=null;else{var c=d.previous;d=c.next=b;b.previous=c}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=h,Q=l;h=a;l=b;try{var g=c()}finally{h=e,l=Q}if("function"===typeof g)if(g={callback:g,priorityLevel:a,expirationTime:b,next:null,previous:null},null===d)d=g.next=g.previous=g;else{c=null;a=d;do{if(a.expirationTime>=b){c=a;break}a=a.next}while(a!==d);null===c?c=d:c===d&&(d=g,p());b=c.previous;b.next=c.previous=g;g.next=c;g.previous=
12
- b}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,f=b,null!==d?p():n=!1,v()}}
10
+ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var c=null,f=!1,h=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=c.expirationTime;n?q():n=!0;r(t,a)}}
11
+ function u(){var a=c,b=c.next;if(c===b)c=null;else{var d=c.previous;c=d.next=b;b.previous=d}a.next=a.previous=null;d=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=h,Q=l;h=a;l=b;try{var g=d()}finally{h=e,l=Q}if("function"===typeof g)if(g={callback:g,priorityLevel:a,expirationTime:b,next:null,previous:null},null===c)c=g.next=g.previous=g;else{d=null;a=c;do{if(a.expirationTime>=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d===c&&(c=g,p());b=d.previous;b.next=d.previous=g;g.next=d;g.previous=
12
+ b}}function v(){if(-1===k&&null!==c&&1===c.priorityLevel){m=!0;try{do u();while(null!==c&&1===c.priorityLevel)}finally{m=!1,null!==c?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==c;){var d=exports.unstable_now();if(c.expirationTime<=d){do u();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do u();while(null!==c&&!w())}}finally{m=!1,f=b,null!==c?p():n=!1,v()}}
13
13
  var x=Date,y="function"===typeof setTimeout?setTimeout:void 0,z="function"===typeof clearTimeout?clearTimeout:void 0,A="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)}
14
14
  if("object"===typeof performance&&"function"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;"undefined"!==typeof window?G=window:"undefined"!==typeof global&&(G=global);
15
15
  if(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a)}finally{I=null}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1))};q=function(){I=null};w=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof A&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),
16
- "function"!==typeof B&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var c=exports.unstable_now(),e=!1;if(0>=P-c)if(-1!==b&&b<=c)e=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}};
16
+ "function"!==typeof B&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var d=exports.unstable_now(),e=!1;if(0>=P-d)if(-1!==b&&b<=d)e=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}};
17
17
  var V=function(a){if(null!==K){E(V);var b=a-P+S;b<S&&R<S?(8>b&&(b=8),S=b<R?R:b):R=b;P=a+S;L||(L=!0,U.postMessage(void 0))}else N=!1};r=function(a,b){K=a;M=b;O||0>b?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;
18
- 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,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=c,k=e,v()}};
19
- exports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=c+b.timeout;else switch(h){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var e=d;do{if(e.expirationTime>b){c=e;break}e=e.next}while(e!==d);null===c?c=d:c===d&&(d=a,p());
20
- b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var c=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=c,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h};
21
- exports.unstable_shouldYield=function(){return!f&&(null!==d&&d.expirationTime<l||w())};
18
+ exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var d=h,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=d,k=e,v()}};
19
+ exports.unstable_scheduleCallback=function(a,b){var d=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=d+b.timeout;else switch(h){case 1:b=d+-1;break;case 2:b=d+250;break;case 5:b=d+1073741823;break;case 4:b=d+1E4;break;default:b=d+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===c)c=a.next=a.previous=a,p();else{d=null;var e=c;do{if(e.expirationTime>b){d=e;break}e=e.next}while(e!==c);null===d?d=c:d===c&&(c=a,p());
20
+ b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var d=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=d,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h};
21
+ exports.unstable_shouldYield=function(){return!f&&(null!==c&&c.expirationTime<l||w())};exports.unstable_continueExecution=function(){null!==c&&p()};exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return c};
package/package.json CHANGED
@@ -1,21 +1,48 @@
1
1
  {
2
- "name": "scheduler",
3
- "version": "0.11.3",
4
- "description": "Cooperative scheduler for the browser environment.",
5
- "main": "index.js",
6
- "repository": "facebook/react",
7
- "license": "MIT",
8
- "keywords": [
9
- "react"
2
+ "_from": "scheduler@0.0.0-4a1072194",
3
+ "_id": "scheduler@0.0.0-4a1072194",
4
+ "_inBundle": false,
5
+ "_integrity": "sha512-U+PqKfBcR39RFbJrlJPFwDXG2iLOZBGOPzNSWTAGUoOfTiL8qHTkemJeyV5CcL0UyaRgR8g3S469cNWFs/SHIw==",
6
+ "_location": "/scheduler",
7
+ "_phantomChildren": {},
8
+ "_requested": {
9
+ "type": "version",
10
+ "registry": true,
11
+ "raw": "scheduler@0.0.0-4a1072194",
12
+ "name": "scheduler",
13
+ "escapedName": "scheduler",
14
+ "rawSpec": "0.0.0-4a1072194",
15
+ "saveSpec": null,
16
+ "fetchSpec": "0.0.0-4a1072194"
17
+ },
18
+ "_requiredBy": [
19
+ "#USER",
20
+ "/",
21
+ "/react",
22
+ "/react-art",
23
+ "/react-dom",
24
+ "/react-reconciler",
25
+ "/react-test-renderer"
10
26
  ],
27
+ "_resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.0.0-4a1072194.tgz",
28
+ "_shasum": "0af54576603ff27990191d592acbcb147eba28d4",
29
+ "_spec": "scheduler@0.0.0-4a1072194",
30
+ "_where": "/Users/acdlite/Code/react/build/node_modules",
31
+ "browserify": {
32
+ "transform": [
33
+ "loose-envify"
34
+ ]
35
+ },
11
36
  "bugs": {
12
37
  "url": "https://github.com/facebook/react/issues"
13
38
  },
14
- "homepage": "https://reactjs.org/",
39
+ "bundleDependencies": false,
15
40
  "dependencies": {
16
41
  "loose-envify": "^1.1.0",
17
42
  "object-assign": "^4.1.1"
18
43
  },
44
+ "deprecated": false,
45
+ "description": "Cooperative scheduler for the browser environment.",
19
46
  "files": [
20
47
  "LICENSE",
21
48
  "README.md",
@@ -26,9 +53,16 @@
26
53
  "cjs/",
27
54
  "umd/"
28
55
  ],
29
- "browserify": {
30
- "transform": [
31
- "loose-envify"
32
- ]
33
- }
56
+ "homepage": "https://reactjs.org/",
57
+ "keywords": [
58
+ "react"
59
+ ],
60
+ "license": "MIT",
61
+ "main": "index.js",
62
+ "name": "scheduler",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/facebook/react.git"
66
+ },
67
+ "version": "0.12.0"
34
68
  }
@@ -68,6 +68,27 @@
68
68
  );
69
69
  }
70
70
 
71
+ function unstable_getFirstCallbackNode() {
72
+ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
73
+ this,
74
+ arguments
75
+ );
76
+ }
77
+
78
+ function unstable_pauseExecution() {
79
+ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_pauseExecution.apply(
80
+ this,
81
+ arguments
82
+ );
83
+ }
84
+
85
+ function unstable_continueExecution() {
86
+ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_continueExecution.apply(
87
+ this,
88
+ arguments
89
+ );
90
+ }
91
+
71
92
  return Object.freeze({
72
93
  unstable_now: unstable_now,
73
94
  unstable_scheduleCallback: unstable_scheduleCallback,
@@ -76,5 +97,8 @@
76
97
  unstable_runWithPriority: unstable_runWithPriority,
77
98
  unstable_wrapCallback: unstable_wrapCallback,
78
99
  unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
100
+ unstable_continueExecution: unstable_continueExecution,
101
+ unstable_pauseExecution: unstable_pauseExecution,
102
+ unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
79
103
  });
80
104
  });
@@ -68,6 +68,21 @@
68
68
  );
69
69
  }
70
70
 
71
+ function unstable_getFirstCallbackNode() {
72
+ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
73
+ this,
74
+ arguments
75
+ );
76
+ }
77
+
78
+ function unstable_pauseExecution() {
79
+ return undefined;
80
+ }
81
+
82
+ function unstable_continueExecution() {
83
+ return undefined;
84
+ }
85
+
71
86
  return Object.freeze({
72
87
  unstable_now: unstable_now,
73
88
  unstable_scheduleCallback: unstable_scheduleCallback,
@@ -76,5 +91,8 @@
76
91
  unstable_runWithPriority: unstable_runWithPriority,
77
92
  unstable_wrapCallback: unstable_wrapCallback,
78
93
  unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
94
+ unstable_continueExecution: unstable_continueExecution,
95
+ unstable_pauseExecution: unstable_pauseExecution,
96
+ unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
79
97
  });
80
98
  });
@@ -68,6 +68,21 @@
68
68
  );
69
69
  }
70
70
 
71
+ function unstable_getFirstCallbackNode() {
72
+ return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_getFirstCallbackNode.apply(
73
+ this,
74
+ arguments
75
+ );
76
+ }
77
+
78
+ function unstable_pauseExecution() {
79
+ return undefined;
80
+ }
81
+
82
+ function unstable_continueExecution() {
83
+ return undefined;
84
+ }
85
+
71
86
  return Object.freeze({
72
87
  unstable_now: unstable_now,
73
88
  unstable_scheduleCallback: unstable_scheduleCallback,
@@ -76,5 +91,8 @@
76
91
  unstable_runWithPriority: unstable_runWithPriority,
77
92
  unstable_wrapCallback: unstable_wrapCallback,
78
93
  unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
94
+ unstable_continueExecution: unstable_continueExecution,
95
+ unstable_pauseExecution: unstable_pauseExecution,
96
+ unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
79
97
  });
80
98
  });