Rename "react-scheduler" package to "schedule" (#13543)
* Git moved packages/react-scheduler -> packages/schedule * Global find+replace 'react-scheduler' -> 'schedule' * Global find+replace 'ReactScheduler' -> 'Scheduler' * Renamed remaining files "ReactScheduler" -> "Schedule" * Add thank-you note to schedule package README * Replaced schedule package versions 0.1.0-alpha-1 -> 0.2.0 * Patched our local fixtures to work around Yarn install issue * Removed some fixture hacks
Brian Vaughn committed
Sep 3, 2018 at 11:27 UTC
b92f947af1b5d8804026cb0e1cfa59ead7484ca5
64 files changed
+162
-352
fixtures/packaging/browserify/dev/package.json
+3
-5
@@ -2,12 +2,10 @@
2
"private": true,
3
"name": "browserify-dev-fixture",
4
"dependencies": {
5
- "browserify": "^13.3.0",
6
- "react": "link:../../../../build/node_modules/react",
7
- "react-dom": "link:../../../../build/node_modules/react-dom",
8
- "react-scheduler": "link:../../../../build/node_modules/react-scheduler"
5
+ "browserify": "^13.3.0"
6
},
7
"scripts": {
11
- "build": "rm -f output.js && browserify ./input.js -o output.js"
8
+ "build": "rm -f output.js && browserify ./input.js -o output.js",
9
+ "prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
10
}
11
}
fixtures/packaging/browserify/dev/yarn.lock
-37
@@ -483,10 +483,6 @@ isarray@~0.0.1:
483
version "0.0.1"
484
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
485
486
-"js-tokens@^3.0.0 || ^4.0.0":
487
- version "4.0.0"
488
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
489
-
486
json-stable-stringify@~0.0.0:
487
version "0.0.1"
488
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
@@ -519,12 +515,6 @@ lodash.memoize@~3.0.3:
515
version "3.0.4"
516
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
517
522
-loose-envify@^1.1.0, loose-envify@^1.3.1:
523
- version "1.4.0"
524
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
525
- dependencies:
526
- js-tokens "^3.0.0 || ^4.0.0"
527
-
518
md5.js@^1.3.4:
519
version "1.3.4"
520
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -577,10 +567,6 @@ module-deps@^4.0.8:
567
through2 "^2.0.0"
568
xtend "^4.0.0"
569
580
-object-assign@^4.1.1:
581
- version "4.1.1"
582
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
583
-
570
once@^1.3.0:
571
version "1.4.0"
572
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -645,13 +631,6 @@ process@~0.11.0:
631
version "0.11.10"
632
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
633
648
-prop-types@^15.6.2:
649
- version "15.6.2"
650
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
651
- dependencies:
652
- loose-envify "^1.3.1"
653
- object-assign "^4.1.1"
654
-
634
public-encrypt@^4.0.0:
635
version "4.0.0"
636
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
@@ -684,22 +663,6 @@ randombytes@^2.0.0, randombytes@^2.0.1:
663
dependencies:
664
safe-buffer "^5.1.0"
665
687
-"react-dom@link:../../../../build/node_modules/react-dom":
688
- version "0.0.0"
689
- uid ""
690
-
691
-react-scheduler@^0.1.0-alpha-1:
692
- version "0.1.0"
693
- resolved "https://registry.yarnpkg.com/react-scheduler/-/react-scheduler-0.1.0.tgz#d16c0ee90d2895ff1941e0d681293dbe4f4b4f38"
694
-
695
-"react-scheduler@link:../../../../build/node_modules/react-scheduler":
696
- version "0.0.0"
697
- uid ""
698
-
699
-"react@link:../../../../build/node_modules/react":
700
- version "0.0.0"
701
- uid ""
702
-
666
read-only-stream@^2.0.0:
667
version "2.0.0"
668
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
fixtures/packaging/browserify/prod/package.json
+3
-5
@@ -2,13 +2,11 @@
2
"private": true,
3
"name": "browserify-prod-fixture",
4
"dependencies": {
5
- "browserify": "^13.3.0",
6
- "react": "link:../../../../build/node_modules/react",
7
- "react-dom": "link:../../../../build/node_modules/react-dom",
8
- "react-scheduler": "link:../../../../build/node_modules/react-scheduler"
5
+ "browserify": "^13.3.0"
6
},
7
"scripts": {
11
- "build": "rm -f output.js && browserify ./input.js -g [envify --NODE_ENV 'production'] -o output.js"
8
+ "build": "rm -f output.js && browserify ./input.js -g [envify --NODE_ENV 'production'] -o output.js",
9
+ "prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
10
},
11
"devDependencies": {
12
"envify": "^4.0.0"
fixtures/packaging/browserify/prod/yarn.lock
-37
@@ -494,10 +494,6 @@ isarray@~0.0.1:
494
version "0.0.1"
495
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
496
497
-"js-tokens@^3.0.0 || ^4.0.0":
498
- version "4.0.0"
499
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
500
-
497
json-stable-stringify@~0.0.0:
498
version "0.0.1"
499
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45"
@@ -530,12 +526,6 @@ lodash.memoize@~3.0.3:
526
version "3.0.4"
527
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"
528
533
-loose-envify@^1.1.0, loose-envify@^1.3.1:
534
- version "1.4.0"
535
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
536
- dependencies:
537
- js-tokens "^3.0.0 || ^4.0.0"
538
-
529
md5.js@^1.3.4:
530
version "1.3.4"
531
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -588,10 +578,6 @@ module-deps@^4.0.8:
578
through2 "^2.0.0"
579
xtend "^4.0.0"
580
591
-object-assign@^4.1.1:
592
- version "4.1.1"
593
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
594
-
581
once@^1.3.0:
582
version "1.4.0"
583
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -656,13 +642,6 @@ process@~0.11.0:
642
version "0.11.10"
643
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
644
659
-prop-types@^15.6.2:
660
- version "15.6.2"
661
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
662
- dependencies:
663
- loose-envify "^1.3.1"
664
- object-assign "^4.1.1"
665
-
645
public-encrypt@^4.0.0:
646
version "4.0.0"
647
resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6"
@@ -695,22 +674,6 @@ randombytes@^2.0.0, randombytes@^2.0.1:
674
dependencies:
675
safe-buffer "^5.1.0"
676
698
-"react-dom@link:../../../../build/node_modules/react-dom":
699
- version "0.0.0"
700
- uid ""
701
-
702
-react-scheduler@^0.1.0-alpha-1:
703
- version "0.1.0"
704
- resolved "https://registry.yarnpkg.com/react-scheduler/-/react-scheduler-0.1.0.tgz#d16c0ee90d2895ff1941e0d681293dbe4f4b4f38"
705
-
706
-"react-scheduler@link:../../../../build/node_modules/react-scheduler":
707
- version "0.0.0"
708
- uid ""
709
-
710
-"react@link:../../../../build/node_modules/react":
711
- version "0.0.0"
712
- uid ""
713
-
677
read-only-stream@^2.0.0:
678
version "2.0.0"
679
resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0"
fixtures/packaging/brunch/dev/package.json
+3
-5
@@ -3,12 +3,10 @@
3
"name": "brunch-dev-fixture",
4
"devDependencies": {
5
"brunch": "^2.9.1",
6
- "javascript-brunch": "^2.0.0",
7
- "react": "link:../../../../build/node_modules/react",
8
- "react-dom": "link:../../../../build/node_modules/react-dom",
9
- "react-scheduler": "link:../../../../build/node_modules/react-scheduler"
6
+ "javascript-brunch": "^2.0.0"
7
},
8
"scripts": {
12
- "build": "rm -rf public && brunch build"
9
+ "build": "rm -rf public && brunch build",
10
+ "prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
11
}
12
}
fixtures/packaging/brunch/dev/yarn.lock
+1
-34
@@ -1162,10 +1162,6 @@ javascript-brunch@^2.0.0:
1162
dependencies:
1163
esprima "~3.0.0"
1164
1165
-js-tokens@^3.0.0:
1166
- version "3.0.2"
1167
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
1168
-
1165
jsbn@~0.1.0:
1166
version "0.1.1"
1167
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
@@ -1227,12 +1223,6 @@ loggy@~0.3.0:
1223
ansicolors "~0.3.2"
1224
growl "~1.8.1"
1225
1230
-loose-envify@^1.1.0, loose-envify@^1.3.1:
1231
- version "1.3.1"
1232
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
1233
- dependencies:
1234
- js-tokens "^3.0.0"
1235
-
1226
md5.js@^1.3.4:
1227
version "1.3.4"
1228
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -1435,7 +1425,7 @@ oauth-sign@~0.8.1:
1425
version "0.8.2"
1426
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
1427
1438
-object-assign@^4.1.0, object-assign@^4.1.1:
1428
+object-assign@^4.1.0:
1429
version "4.1.1"
1430
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
1431
@@ -1561,13 +1551,6 @@ promise.prototype.finally@^2:
1551
es-abstract "^1.6.1"
1552
function-bind "^1.1.0"
1553
1564
-prop-types@^15.6.2:
1565
- version "15.6.2"
1566
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
1567
- dependencies:
1568
- loose-envify "^1.3.1"
1569
- object-assign "^4.1.1"
1570
-
1554
proxy-addr@~2.0.2:
1555
version "2.0.2"
1556
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
@@ -1653,22 +1636,6 @@ rc@^1.1.7:
1636
minimist "^1.2.0"
1637
strip-json-comments "~2.0.1"
1638
1656
-"react-dom@link:../../../../build/node_modules/react-dom":
1657
- version "0.0.0"
1658
- uid ""
1659
-
1660
-react-scheduler@^0.1.0-alpha-1:
1661
- version "0.1.0"
1662
- resolved "https://registry.yarnpkg.com/react-scheduler/-/react-scheduler-0.1.0.tgz#d16c0ee90d2895ff1941e0d681293dbe4f4b4f38"
1663
-
1664
-"react-scheduler@link:../../../../build/node_modules/react-scheduler":
1665
- version "0.0.0"
1666
- uid ""
1667
-
1668
-"react@link:../../../../build/node_modules/react":
1669
- version "0.0.0"
1670
- uid ""
1671
-
1639
read-components@~0.7:
1640
version "0.7.0"
1641
resolved "https://registry.yarnpkg.com/read-components/-/read-components-0.7.0.tgz#77dce7adcb72a514240c47a675b9bcf7a3509dd9"
fixtures/packaging/brunch/prod/package.json
+3
-5
@@ -3,12 +3,10 @@
3
"name": "brunch-prod-fixture",
4
"devDependencies": {
5
"brunch": "^2.9.1",
6
- "javascript-brunch": "^2.0.0",
7
- "react": "link:../../../../build/node_modules/react",
8
- "react-dom": "link:../../../../build/node_modules/react-dom",
9
- "react-scheduler": "link:../../../../build/node_modules/react-scheduler"
6
+ "javascript-brunch": "^2.0.0"
7
},
8
"scripts": {
12
- "build": "rm -rf public && brunch build -p"
9
+ "build": "rm -rf public && brunch build -p",
10
+ "prebuild": "cp -r ../../../../build/node_modules/* ./node_modules/"
11
}
12
}
fixtures/packaging/brunch/prod/yarn.lock
+1
-34
@@ -1162,10 +1162,6 @@ javascript-brunch@^2.0.0:
1162
dependencies:
1163
esprima "~3.0.0"
1164
1165
-js-tokens@^3.0.0:
1166
- version "3.0.2"
1167
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
1168
-
1165
jsbn@~0.1.0:
1166
version "0.1.1"
1167
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
@@ -1227,12 +1223,6 @@ loggy@~0.3.0:
1223
ansicolors "~0.3.2"
1224
growl "~1.8.1"
1225
1230
-loose-envify@^1.1.0, loose-envify@^1.3.1:
1231
- version "1.3.1"
1232
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
1233
- dependencies:
1234
- js-tokens "^3.0.0"
1235
-
1226
md5.js@^1.3.4:
1227
version "1.3.4"
1228
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d"
@@ -1435,7 +1425,7 @@ oauth-sign@~0.8.1:
1425
version "0.8.2"
1426
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
1427
1438
-object-assign@^4.1.0, object-assign@^4.1.1:
1428
+object-assign@^4.1.0:
1429
version "4.1.1"
1430
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
1431
@@ -1561,13 +1551,6 @@ promise.prototype.finally@^2:
1551
es-abstract "^1.6.1"
1552
function-bind "^1.1.0"
1553
1564
-prop-types@^15.6.2:
1565
- version "15.6.2"
1566
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
1567
- dependencies:
1568
- loose-envify "^1.3.1"
1569
- object-assign "^4.1.1"
1570
-
1554
proxy-addr@~2.0.2:
1555
version "2.0.2"
1556
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
@@ -1653,22 +1636,6 @@ rc@^1.1.7:
1636
minimist "^1.2.0"
1637
strip-json-comments "~2.0.1"
1638
1656
-"react-dom@link:../../../../build/node_modules/react-dom":
1657
- version "0.0.0"
1658
- uid ""
1659
-
1660
-react-scheduler@^0.1.0-alpha-1:
1661
- version "0.1.0"
1662
- resolved "https://registry.yarnpkg.com/react-scheduler/-/react-scheduler-0.1.0.tgz#d16c0ee90d2895ff1941e0d681293dbe4f4b4f38"
1663
-
1664
-"react-scheduler@link:../../../../build/node_modules/react-scheduler":
1665
- version "0.0.0"
1666
- uid ""
1667
-
1668
-"react@link:../../../../build/node_modules/react":
1669
- version "0.0.0"
1670
- uid ""
1671
-
1639
read-components@~0.7:
1640
version "0.7.0"
1641
resolved "https://registry.yarnpkg.com/read-components/-/read-components-0.7.0.tgz#77dce7adcb72a514240c47a675b9bcf7a3509dd9"
fixtures/packaging/rjs/dev/config.js
+1
-1
@@ -6,6 +6,6 @@ module.exports = {
6
paths: {
7
react: '../../../../build/dist/react.development',
8
'react-dom': '../../../../build/dist/react-dom.development',
9
- 'react-scheduler': '../../../../build/dist/react-scheduler.development',
9
+ schedule: '../../../../build/dist/schedule.development',
10
},
11
};
fixtures/packaging/rjs/prod/config.js
+1
-1
@@ -6,6 +6,6 @@ module.exports = {
6
paths: {
7
react: '../../../../build/dist/react.production.min',
8
'react-dom': '../../../../build/dist/react-dom.production.min',
9
- 'react-scheduler': '../../../../build/dist/react-scheduler.development',
9
+ schedule: '../../../../build/dist/schedule.development',
10
},
11
};
fixtures/packaging/systemjs-builder/dev/config.js
+1
-1
@@ -2,6 +2,6 @@ System.config({
2
paths: {
3
react: '../../../../build/dist/react.development.js',
4
'react-dom': '../../../../build/dist/react-dom.development.js',
5
- 'react-scheduler': '../../../../build/dist/react-scheduler.development',
5
+ schedule: '../../../../build/dist/schedule.development',
6
},
7
});
fixtures/packaging/systemjs-builder/prod/config.js
+1
-1
@@ -2,6 +2,6 @@ System.config({
2
paths: {
3
react: '../../../../build/dist/react.production.min.js',
4
'react-dom': '../../../../build/dist/react-dom.production.min.js',
5
- 'react-scheduler': '../../../../build/dist/react-scheduler.development',
5
+ schedule: '../../../../build/dist/schedule.development',
6
},
7
});
fixtures/schedule/index.html
+2
-2
@@ -89,14 +89,14 @@
89
<div> If the counter advanced while you were away from this tab, it's correct.</div>
90
</li>
91
</ol>
92
- <script src="../../build/dist/react-scheduler.development.js"></script>
92
+ <script src="../../build/dist/schedule.development.js"></script>
93
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
94
<script type="text/babel">
95
const {
96
unstable_scheduleWork: scheduleWork,
97
unstable_cancelWork: cancelWork,
98
unstable_now: now
99
-} = ReactScheduler;
99
+} = Schedule;
100
function displayTestResult(testNumber) {
101
const expectationNode = document.getElementById('test-' + testNumber + '-expected');
102
const resultNode = document.getElementById('test-' + testNumber);
fixtures/tracking/index.html
+2
-2
@@ -63,8 +63,8 @@
63
</li>
64
</ol>
65
<!-- Load the tracking API before react to test that it's lazily evaluated -->
66
- <script src="../../build/node_modules/react-scheduler/umd/react-scheduler.development.js"></script>
67
- <script src="../../build/node_modules/react-scheduler/umd/react-scheduler-tracking.development.js"></script>
66
+ <script src="../../build/node_modules/schedule/umd/schedule.development.js"></script>
67
+ <script src="../../build/node_modules/schedule/umd/schedule-tracking.development.js"></script>
68
<script src="../../build/node_modules/react/umd/react.development.js"></script>
69
<script src="../../build/node_modules/react-dom/umd/react-dom.development.js"></script>
70
<script src="./script.js"></script>
fixtures/tracking/script.js
+26
-26
@@ -28,15 +28,15 @@ function runAllTests() {
28
function checkSchedulerAPI() {
29
runTest(document.getElementById('checkSchedulerAPI'), () => {
30
if (
31
- typeof ReactScheduler === 'undefined' ||
32
- typeof ReactScheduler.unstable_now !== 'function' ||
33
- typeof ReactScheduler.unstable_scheduleWork !== 'function' ||
34
- typeof ReactScheduler.unstable_cancelScheduledWork !== 'function'
31
+ typeof Schedule === 'undefined' ||
32
+ typeof Schedule.unstable_now !== 'function' ||
33
+ typeof Schedule.unstable_scheduleWork !== 'function' ||
34
+ typeof Schedule.unstable_cancelScheduledWork !== 'function'
35
) {
36
throw 'API is not defined';
37
}
38
39
- if (ReactScheduler.unstable_now() !== performance.now()) {
39
+ if (Schedule.unstable_now() !== performance.now()) {
40
throw 'API does not work';
41
}
42
@@ -47,22 +47,22 @@ function checkSchedulerAPI() {
47
function checkSchedulerTrackingAPI() {
48
runTest(document.getElementById('checkSchedulerTrackingAPI'), () => {
49
if (
50
- typeof ReactSchedulerTracking === 'undefined' ||
51
- typeof ReactSchedulerTracking.__getInteractionsRef !== 'function' ||
52
- typeof ReactSchedulerTracking.__getSubscriberRef !== 'function' ||
53
- typeof ReactSchedulerTracking.unstable_clear !== 'function' ||
54
- typeof ReactSchedulerTracking.unstable_getCurrent !== 'function' ||
55
- typeof ReactSchedulerTracking.unstable_getThreadID !== 'function' ||
56
- typeof ReactSchedulerTracking.unstable_track !== 'function' ||
57
- typeof ReactSchedulerTracking.unstable_wrap !== 'function'
50
+ typeof ScheduleTracking === 'undefined' ||
51
+ typeof ScheduleTracking.__getInteractionsRef !== 'function' ||
52
+ typeof ScheduleTracking.__getSubscriberRef !== 'function' ||
53
+ typeof ScheduleTracking.unstable_clear !== 'function' ||
54
+ typeof ScheduleTracking.unstable_getCurrent !== 'function' ||
55
+ typeof ScheduleTracking.unstable_getThreadID !== 'function' ||
56
+ typeof ScheduleTracking.unstable_track !== 'function' ||
57
+ typeof ScheduleTracking.unstable_wrap !== 'function'
58
) {
59
throw 'API is not defined';
60
}
61
62
try {
63
let interactionsSet;
64
- ReactSchedulerTracking.unstable_track('test', 123, () => {
65
- interactionsSet = ReactSchedulerTracking.__getInteractionsRef().current;
64
+ ScheduleTracking.unstable_track('test', 123, () => {
65
+ interactionsSet = ScheduleTracking.__getInteractionsRef().current;
66
});
67
if (interactionsSet.size !== 1) {
68
throw null;
@@ -80,7 +80,7 @@ function checkSchedulerTrackingAPI() {
80
.SchedulerTracking;
81
82
if (
83
- ReactSchedulerTracking.unstable_getThreadID() ===
83
+ ScheduleTracking.unstable_getThreadID() ===
84
ForwardedSchedulerTracking.unstable_getThreadID()
85
) {
86
throw 'API forwarding is broken';
@@ -93,9 +93,9 @@ function checkSchedulerTrackingSubscriptionsAPI() {
93
document.getElementById('checkSchedulerTrackingSubscriptionsAPI'),
94
() => {
95
if (
96
- typeof ReactSchedulerTracking === 'undefined' ||
97
- typeof ReactSchedulerTracking.unstable_subscribe !== 'function' ||
98
- typeof ReactSchedulerTracking.unstable_unsubscribe !== 'function'
96
+ typeof ScheduleTracking === 'undefined' ||
97
+ typeof ScheduleTracking.unstable_subscribe !== 'function' ||
98
+ typeof ScheduleTracking.unstable_unsubscribe !== 'function'
99
) {
100
throw 'API is not defined';
101
}
@@ -117,9 +117,9 @@ function checkSchedulerTrackingSubscriptionsAPI() {
117
};
118
119
try {
120
- ReactSchedulerTracking.unstable_subscribe(subscriber);
121
- ReactSchedulerTracking.unstable_track('foo', 123, () => {});
122
- ReactSchedulerTracking.unstable_unsubscribe(subscriber);
120
+ ScheduleTracking.unstable_subscribe(subscriber);
121
+ ScheduleTracking.unstable_track('foo', 123, () => {});
122
+ ScheduleTracking.unstable_unsubscribe(subscriber);
123
if (onInteractionTrackedCalls.length !== 1) {
124
throw null;
125
}
@@ -127,7 +127,7 @@ function checkSchedulerTrackingSubscriptionsAPI() {
127
if (interaction.name !== 'foo' || interaction.timestamp !== 123) {
128
throw null;
129
}
130
- ReactSchedulerTracking.unstable_track('bar', 456, () => {});
130
+ ScheduleTracking.unstable_track('bar', 456, () => {});
131
if (onInteractionTrackedCalls.length !== 1) {
132
throw null;
133
}
@@ -141,9 +141,9 @@ function checkSchedulerTrackingSubscriptionsAPI() {
141
142
try {
143
ForwardedSchedulerTracking.unstable_subscribe(subscriber);
144
- ReactSchedulerTracking.unstable_track('foo', 123, () => {});
144
+ ScheduleTracking.unstable_track('foo', 123, () => {});
145
ForwardedSchedulerTracking.unstable_track('bar', 456, () => {});
146
- ReactSchedulerTracking.unstable_unsubscribe(subscriber);
146
+ ScheduleTracking.unstable_unsubscribe(subscriber);
147
if (onInteractionTrackedCalls.length !== 3) {
148
throw null;
149
}
@@ -175,7 +175,7 @@ function checkEndToEndIntegration() {
175
const onRender = (...args) => onRenderCalls.push(args);
176
const container = document.createElement('div');
177
178
- ReactSchedulerTracking.unstable_track('render', 123, () => {
178
+ ScheduleTracking.unstable_track('render', 123, () => {
179
ReactDOM.render(
180
React.createElement(
181
React.unstable_Profiler,
fixtures/unstable-async/suspense/package.json
+3
-6
@@ -10,18 +10,15 @@
10
"dependencies": {
11
"clipboard": "^1.7.1",
12
"github-fork-ribbon-css": "^0.2.1",
13
- "react": "../../../build/node_modules/react",
14
- "react-dom": "../../../build/node_modules/react-dom",
15
- "react-draggable": "^3.0.5",
16
- "react-scheduler": "../../../build/node_modules/react-scheduler",
17
- "simple-cache-provider": "../../../build/node_modules/simple-cache-provider"
13
+ "react-draggable": "^3.0.5"
14
},
15
"scripts": {
16
"start": "react-scripts start",
17
"build": "react-scripts build",
18
"test": "react-scripts test --env=jsdom",
19
"eject": "react-scripts eject",
24
- "deploy": "gh-pages -d build"
20
+ "deploy": "gh-pages -d build",
21
+ "prestart": "cp -r ../../../build/node_modules/* ./node_modules/"
22
},
23
"eslintConfig": {
24
"extends": "./node_modules/react-scripts/config/eslint.js"
fixtures/unstable-async/suspense/src/components/App.js
+1
-1
@@ -2,7 +2,7 @@ import React, {Placeholder, PureComponent} from 'react';
2
import {
3
unstable_track as track,
4
unstable_wrap as wrap,
5
-} from 'react-scheduler/tracking';
5
+} from 'schedule/tracking';
6
import {createResource} from 'simple-cache-provider';
7
import {cache} from '../cache';
8
import Spinner from './Spinner';
fixtures/unstable-async/suspense/src/index.js
+1
-1
@@ -1,6 +1,6 @@
1
import React, {Fragment, PureComponent} from 'react';
2
import {unstable_createRoot, render} from 'react-dom';
3
-import {unstable_track as track} from 'react-scheduler/tracking';
3
+import {unstable_track as track} from 'schedule/tracking';
4
import {cache} from './cache';
5
import {
6
setFakeRequestTime,
fixtures/unstable-async/suspense/yarn.lock
+1
-39
@@ -4099,10 +4099,6 @@ js-tokens@^3.0.0, js-tokens@^3.0.2:
4099
version "3.0.2"
4100
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
4101
4102
-"js-tokens@^3.0.0 || ^4.0.0":
4103
- version "4.0.0"
4104
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
4105
-
4102
js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1:
4103
version "3.10.0"
4104
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
@@ -4396,12 +4392,6 @@ loose-envify@^1.0.0, loose-envify@^1.3.1:
4392
dependencies:
4393
js-tokens "^3.0.0"
4394
4399
-loose-envify@^1.1.0:
4400
- version "1.4.0"
4401
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
4402
- dependencies:
4403
- js-tokens "^3.0.0 || ^4.0.0"
4404
-
4395
loud-rejection@^1.0.0:
4396
version "1.6.0"
4397
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
@@ -5563,7 +5553,7 @@ promise@^7.1.1:
5553
dependencies:
5554
asap "~2.0.3"
5555
5566
-prop-types@^15.5.10, prop-types@^15.6.2:
5556
+prop-types@^15.5.10:
5557
version "15.6.2"
5558
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
5559
dependencies:
@@ -5726,14 +5716,6 @@ react-dev-utils@^5.0.1:
5716
strip-ansi "3.0.1"
5717
text-table "0.2.0"
5718
5729
-react-dom@../../../build/node_modules/react-dom:
5730
- version "16.4.3-alpha.0"
5731
- dependencies:
5732
- loose-envify "^1.1.0"
5733
- object-assign "^4.1.1"
5734
- prop-types "^15.6.2"
5735
- react-scheduler "^0.1.0-alpha-1"
5736
-
5719
react-draggable@^3.0.5:
5720
version "3.0.5"
5721
resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-3.0.5.tgz#c031e0ed4313531f9409d6cd84c8ebcec0ddfe2d"
@@ -5745,15 +5727,6 @@ react-error-overlay@^4.0.0:
5727
version "4.0.0"
5728
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4"
5729
5748
-react-scheduler@../../../build/node_modules/react-scheduler:
5749
- version "0.1.0-alpha-1"
5750
- dependencies:
5751
- object-assign "^4.1.1"
5752
-
5753
-react-scheduler@^0.1.0-alpha-1:
5754
- version "0.1.0"
5755
- resolved "https://registry.yarnpkg.com/react-scheduler/-/react-scheduler-0.1.0.tgz#d16c0ee90d2895ff1941e0d681293dbe4f4b4f38"
5756
-
5730
react-scripts@^1.1.4:
5731
version "1.1.4"
5732
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-1.1.4.tgz#d5c230e707918d6dd2d06f303b10f5222d017c88"
@@ -5799,14 +5772,6 @@ react-scripts@^1.1.4:
5772
optionalDependencies:
5773
fsevents "^1.1.3"
5774
5802
-react@../../../build/node_modules/react:
5803
- version "16.4.3-alpha.0"
5804
- dependencies:
5805
- loose-envify "^1.1.0"
5806
- object-assign "^4.1.1"
5807
- prop-types "^15.6.2"
5808
- react-scheduler "^0.1.0-alpha-1"
5809
-
5775
read-pkg-up@^1.0.1:
5776
version "1.0.1"
5777
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
@@ -6349,9 +6314,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
6314
version "3.0.2"
6315
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
6316
6352
-simple-cache-provider@../../../build/node_modules/simple-cache-provider:
6353
- version "0.7.0"
6354
-
6317
slash@^1.0.0:
6318
version "1.0.0"
6319
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
packages/react-art/package.json
+1
-1
@@ -23,7 +23,7 @@
23
"loose-envify": "^1.1.0",
24
"object-assign": "^4.1.1",
25
"prop-types": "^15.6.2",
26
- "react-scheduler": "^0.1.0-alpha-1"
26
+ "schedule": "^0.2.0"
27
},
28
"peerDependencies": {
29
"react": "^16.0.0"
packages/react-art/src/ReactARTHostConfig.js
+1
-1
@@ -9,7 +9,7 @@ export {
9
unstable_now as now,
10
unstable_scheduleWork as scheduleDeferredCallback,
11
unstable_cancelScheduledWork as cancelDeferredCallback,
12
-} from 'react-scheduler';
12
+} from 'schedule';
13
import Transform from 'art/core/transform';
14
import Mode from 'art/modes/current';
15
import invariant from 'shared/invariant';
packages/react-dom/package.json
+1
-1
@@ -16,7 +16,7 @@
16
"loose-envify": "^1.1.0",
17
"object-assign": "^4.1.1",
18
"prop-types": "^15.6.2",
19
- "react-scheduler": "^0.1.0-alpha-1"
19
+ "schedule": "^0.2.0"
20
},
21
"peerDependencies": {
22
"react": "^16.0.0"
packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.internal.js
+1
-1
@@ -26,7 +26,7 @@ describe('ReactDOMFiberAsync', () => {
26
27
beforeEach(() => {
28
// TODO pull this into helper method, reduce repetition.
29
- // mock the browser APIs which are used in react-scheduler:
29
+ // mock the browser APIs which are used in schedule:
30
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
31
// - calling 'window.postMessage' should actually fire postmessage handlers
32
global.requestAnimationFrame = function(cb) {
packages/react-dom/src/__tests__/ReactDOMRoot-test.js
+1
-1
@@ -22,7 +22,7 @@ describe('ReactDOMRoot', () => {
22
beforeEach(() => {
23
container = document.createElement('div');
24
// TODO pull this into helper method, reduce repetition.
25
- // mock the browser APIs which are used in react-scheduler:
25
+ // mock the browser APIs which are used in schedule:
26
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
27
// - calling 'window.postMessage' should actually fire postmessage handlers
28
// - must allow artificially changing time returned by Date.now
packages/react-dom/src/client/ReactDOMHostConfig.js
+1
-1
@@ -64,7 +64,7 @@ export {
64
unstable_now as now,
65
unstable_scheduleWork as scheduleDeferredCallback,
66
unstable_cancelScheduledWork as cancelDeferredCallback,
67
-} from 'react-scheduler';
67
+} from 'schedule';
68
69
let SUPPRESS_HYDRATION_WARNING;
70
if (__DEV__) {
packages/react-dom/src/events/__tests__/ChangeEventPlugin-test.internal.js
+1
-1
@@ -33,7 +33,7 @@ describe('ChangeEventPlugin', () => {
33
34
beforeEach(() => {
35
// TODO pull this into helper method, reduce repetition.
36
- // mock the browser APIs which are used in react-scheduler:
36
+ // mock the browser APIs which are used in schedule:
37
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
38
// - calling 'window.postMessage' should actually fire postmessage handlers
39
global.requestAnimationFrame = function(cb) {
packages/react-dom/src/events/__tests__/SimpleEventPlugin-test.internal.js
+1
-1
@@ -36,7 +36,7 @@ describe('SimpleEventPlugin', function() {
36
37
beforeEach(function() {
38
// TODO pull this into helper method, reduce repetition.
39
- // mock the browser APIs which are used in react-scheduler:
39
+ // mock the browser APIs which are used in schedule:
40
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
41
// - calling 'window.postMessage' should actually fire postmessage handlers
42
global.requestAnimationFrame = function(cb) {
packages/react-native-renderer/package.json
+1
-1
@@ -6,7 +6,7 @@
6
"dependencies": {
7
"object-assign": "^4.1.1",
8
"prop-types": "^15.6.2",
9
- "react-scheduler": "^0.1.0-alpha-1"
9
+ "schedule": "^0.2.0"
10
},
11
"peerDependencies": {
12
"react": "^16.0.0"
packages/react-reconciler/package.json
+1
-1
@@ -28,7 +28,7 @@
28
"loose-envify": "^1.1.0",
29
"object-assign": "^4.1.1",
30
"prop-types": "^15.6.2",
31
- "react-scheduler": "^0.1.0-alpha-1"
31
+ "schedule": "^0.2.0"
32
},
33
"browserify": {
34
"transform": [
packages/react-reconciler/src/ReactFiberRoot.js
+2
-2
@@ -10,13 +10,13 @@
10
import type {Fiber} from './ReactFiber';
11
import type {ExpirationTime} from './ReactFiberExpirationTime';
12
import type {TimeoutHandle, NoTimeout} from './ReactFiberHostConfig';
13
-import type {Interaction} from 'react-scheduler/src/Tracking';
13
+import type {Interaction} from 'schedule/src/Tracking';
14
15
import {noTimeout} from './ReactFiberHostConfig';
16
import {createHostRootFiber} from './ReactFiber';
17
import {NoWork} from './ReactFiberExpirationTime';
18
import {enableSchedulerTracking} from 'shared/ReactFeatureFlags';
19
-import {unstable_getThreadID} from 'react-scheduler/tracking';
19
+import {unstable_getThreadID} from 'schedule/tracking';
20
21
// TODO: This should be lifted into the renderer.
22
export type Batch = {
packages/react-reconciler/src/ReactFiberScheduler.js
+2
-5
@@ -14,12 +14,9 @@ import type {
14
Interaction,
15
InteractionsRef,
16
SubscriberRef,
17
-} from 'react-scheduler/src/Tracking';
17
+} from 'schedule/src/Tracking';
18
19
-import {
20
- __getInteractionsRef,
21
- __getSubscriberRef,
22
-} from 'react-scheduler/tracking';
19
+import {__getInteractionsRef, __getSubscriberRef} from 'schedule/tracking';
20
import {
21
invokeGuardedCallback,
22
hasCaughtError,
packages/react-scheduler/README.md
deleted
-4
@@ -1,4 +0,0 @@
1
-# React Scheduler
2
-
3
-This is a work in progress - we are building a utility to better coordinate
4
-React and other JavaScript work.
packages/react-scheduler/npm/index.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-scheduler.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-scheduler.development.js');
7
-}
packages/react-scheduler/npm/tracking.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-scheduler-tracking.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-scheduler-tracking.development.js');
7
-}
packages/react-test-renderer/package.json
+1
-1
@@ -18,7 +18,7 @@
18
"object-assign": "^4.1.1",
19
"prop-types": "^15.6.2",
20
"react-is": "^16.4.3-alpha.0",
21
- "react-scheduler": "^0.1.0-alpha-1"
21
+ "schedule": "^0.2.0"
22
},
23
"peerDependencies": {
24
"react": "^16.0.0"
packages/react/package.json
+1
-1
@@ -24,7 +24,7 @@
24
"loose-envify": "^1.1.0",
25
"object-assign": "^4.1.1",
26
"prop-types": "^15.6.2",
27
- "react-scheduler": "^0.1.0-alpha-1"
27
+ "schedule": "^0.2.0"
28
},
29
"browserify": {
30
"transform": [
packages/react/src/ReactSharedInternals.js
+3
-3
@@ -10,7 +10,7 @@ import {
10
unstable_cancelScheduledWork,
11
unstable_now,
12
unstable_scheduleWork,
13
-} from 'react-scheduler';
13
+} from 'schedule';
14
import {
15
__getInteractionsRef,
16
__getSubscriberRef,
@@ -21,7 +21,7 @@ import {
21
unstable_track,
22
unstable_unsubscribe,
23
unstable_wrap,
24
-} from 'react-scheduler/tracking';
24
+} from 'schedule/tracking';
25
import ReactCurrentOwner from './ReactCurrentOwner';
26
import ReactDebugCurrentFrame from './ReactDebugCurrentFrame';
27
@@ -32,7 +32,7 @@ const ReactSharedInternals = {
32
};
33
34
if (__UMD__) {
35
- // Re-export the react-scheduler API(s) for UMD bundles.
35
+ // Re-export the schedule API(s) for UMD bundles.
36
// This avoids introducing a dependency on a new UMD global in a minor update,
37
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
38
// This re-export is only required for UMD bundles;
packages/react/src/__tests__/ReactProfiler-test.internal.js
+5
-5
@@ -42,7 +42,7 @@ function loadModules({
42
ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = replayFailedUnitOfWorkWithInvokeGuardedCallback;
43
44
React = require('react');
45
- SchedulerTracking = require('react-scheduler/tracking');
45
+ SchedulerTracking = require('schedule/tracking');
46
47
if (useNoopRenderer) {
48
ReactNoop = require('react-noop-renderer');
@@ -1401,7 +1401,7 @@ describe('Profiler', () => {
1401
);
1402
expect(onInteractionScheduledWorkCompleted).not.toHaveBeenCalled();
1403
1404
- // The react-scheduler/tracking package will notify of work started for the default thread,
1404
+ // The schedule/tracking package will notify of work started for the default thread,
1405
// But React shouldn't notify until it's been flushed.
1406
expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1407
expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1459,7 +1459,7 @@ describe('Profiler', () => {
1459
// Update state again to verify our tracked interaction isn't registered twice
1460
instance.setState({count: 2});
1461
1462
- // The react-scheduler/tracking package will notify of work started for the default thread,
1462
+ // The schedule/tracking package will notify of work started for the default thread,
1463
// But React shouldn't notify until it's been flushed.
1464
expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1465
expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1562,7 +1562,7 @@ describe('Profiler', () => {
1562
);
1563
expect(onInteractionScheduledWorkCompleted).toHaveBeenCalledTimes(2);
1564
1565
- // The react-scheduler/tracking package will notify of work started for the default thread,
1565
+ // The schedule/tracking package will notify of work started for the default thread,
1566
// But React shouldn't notify until it's been flushed.
1567
expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1568
expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1745,7 +1745,7 @@ describe('Profiler', () => {
1745
expect(onInteractionScheduledWorkCompleted).toHaveBeenCalledTimes(1);
1746
1747
// Work might be started multiple times before being completed.
1748
- // This is okay; it's part of the react-scheduler/tracking contract.
1748
+ // This is okay; it's part of the schedule/tracking contract.
1749
expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(3);
1750
expect(
1751
getWorkForReactThreads(onWorkStarted)[1][0],
packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js
+1
-1
@@ -39,7 +39,7 @@ describe('ReactProfiler DevTools integration', () => {
39
ReactFeatureFlags = require('shared/ReactFeatureFlags');
40
ReactFeatureFlags.enableProfilerTimer = true;
41
ReactFeatureFlags.enableSchedulerTracking = true;
42
- SchedulerTracking = require('react-scheduler/tracking');
42
+ SchedulerTracking = require('schedule/tracking');
43
React = require('react');
44
ReactTestRenderer = require('react-test-renderer');
45
packages/schedule/README.md
new
+7
@@ -0,0 +1,7 @@
1
+# React Scheduler
2
+
3
+This is a work in progress - we are building a utility to better coordinate React and other JavaScript work.
4
+
5
+### Thanks!
6
+
7
+The React team thanks Haoliang Gao (https://github.com/popomore) for donating this package name!
\ No newline at end of file
packages/schedule/index.js
renamed
+1
-1
@@ -9,4 +9,4 @@
9
10
'use strict';
11
12
-export * from './src/ReactScheduler';
12
+export * from './src/Schedule';
packages/schedule/npm/index.js
new
+7
@@ -0,0 +1,7 @@
1
+'use strict';
2
+
3
+if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/schedule.production.min.js');
5
+} else {
6
+ module.exports = require('./cjs/schedule.development.js');
7
+}
packages/schedule/npm/tracking.js
new
+7
@@ -0,0 +1,7 @@
1
+'use strict';
2
+
3
+if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/schedule-tracking.production.min.js');
5
+} else {
6
+ module.exports = require('./cjs/schedule-tracking.development.js');
7
+}
packages/schedule/npm/umd/schedule-tracking.development.js
renamed
+1
-1
@@ -14,7 +14,7 @@
14
? (module.exports = factory(require('react')))
15
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
16
? define(['react'], factory) // eslint-disable-line no-undef
17
- : (global.ReactSchedulerTracking = factory(global));
17
+ : (global.ScheduleTracking = factory(global));
18
})(this, function(global) {
19
function __getInteractionsRef() {
20
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracking.__getInteractionsRef.apply(
packages/schedule/npm/umd/schedule-tracking.production.min.js
renamed
+1
-1
@@ -14,7 +14,7 @@
14
? (module.exports = factory(require('react')))
15
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
16
? define(['react'], factory) // eslint-disable-line no-undef
17
- : (global.ReactSchedulerTracking = factory(global));
17
+ : (global.ScheduleTracking = factory(global));
18
})(this, function(global) {
19
function __getInteractionsRef() {
20
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracking.__getInteractionsRef.apply(
packages/schedule/npm/umd/schedule.development.js
renamed
+1
-1
@@ -14,7 +14,7 @@
14
? (module.exports = factory(require('react')))
15
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
16
? define(['react'], factory) // eslint-disable-line no-undef
17
- : (global.ReactScheduler = factory(global));
17
+ : (global.Schedule = factory(global));
18
})(this, function(global) {
19
function unstable_now() {
20
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
packages/schedule/npm/umd/schedule.production.min.js
renamed
+1
-1
@@ -14,7 +14,7 @@
14
? (module.exports = factory(require('react')))
15
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
16
? define(['react'], factory) // eslint-disable-line no-undef
17
- : (global.ReactScheduler = factory(global));
17
+ : (global.Schedule = factory(global));
18
})(this, function(global) {
19
function unstable_now() {
20
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
packages/schedule/package.json
renamed
+2
-3
@@ -1,7 +1,6 @@
1
{
2
- "name": "react-scheduler",
3
- "version": "0.1.0-alpha-1",
4
- "private": true,
2
+ "name": "schedule",
3
+ "version": "0.2.0",
4
"description": "unstable scheduling helper for coordinating React and other JS libraries",
5
"main": "index.js",
6
"repository": "facebook/react",
packages/schedule/src/Schedule.js
renamed
packages/schedule/src/Tracking.js
renamed
packages/schedule/src/TrackingSubscriptions.js
renamed
+1
-1
@@ -10,7 +10,7 @@
10
import type {Interaction, Subscriber, SubscriberRef} from './Tracking';
11
12
import {enableSchedulerTracking} from 'shared/ReactFeatureFlags';
13
-import {__getSubscriberRef} from 'react-scheduler/tracking';
13
+import {__getSubscriberRef} from 'schedule/tracking';
14
15
let subscriberRef: SubscriberRef = (null: any);
16
let subscribers: Set<Subscriber> = (null: any);
packages/schedule/src/__tests__/Schedule-test.js
renamed
+20
-20
@@ -9,14 +9,14 @@
9
10
'use strict';
11
12
-let ReactScheduler;
12
+let Schedule;
13
type FrameTimeoutConfigType = {
14
// should only specify one or the other
15
timeLeftInFrame: ?number,
16
timePastFrameDeadline: ?number,
17
};
18
19
-describe('ReactScheduler', () => {
19
+describe('Schedule', () => {
20
let rAFCallbacks = [];
21
let postMessageCallback;
22
let postMessageEvents = [];
@@ -64,7 +64,7 @@ describe('ReactScheduler', () => {
64
65
beforeEach(() => {
66
// TODO pull this into helper method, reduce repetition.
67
- // mock the browser APIs which are used in react-scheduler:
67
+ // mock the browser APIs which are used in schedule:
68
// - requestAnimationFrame should pass the DOMHighResTimeStamp argument
69
// - calling 'window.postMessage' should actually fire postmessage handlers
70
// - Date.now should return the correct thing
@@ -94,12 +94,12 @@ describe('ReactScheduler', () => {
94
return currentTime;
95
};
96
jest.resetModules();
97
- ReactScheduler = require('react-scheduler');
97
+ Schedule = require('schedule');
98
});
99
100
describe('scheduleWork', () => {
101
it('calls the callback within the frame when not blocked', () => {
102
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
102
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
103
const cb = jest.fn();
104
scheduleWork(cb);
105
advanceOneFrame({timeLeftInFrame: 15});
@@ -111,7 +111,7 @@ describe('ReactScheduler', () => {
111
112
describe('with multiple callbacks', () => {
113
it('accepts multiple callbacks and calls within frame when not blocked', () => {
114
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
114
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
115
const callbackLog = [];
116
const callbackA = jest.fn(() => callbackLog.push('A'));
117
const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -137,7 +137,7 @@ describe('ReactScheduler', () => {
137
});
138
139
it("accepts callbacks betweeen animationFrame and postMessage and doesn't stall", () => {
140
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
140
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
141
const callbackLog = [];
142
const callbackA = jest.fn(() => callbackLog.push('A'));
143
const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -167,7 +167,7 @@ describe('ReactScheduler', () => {
167
'schedules callbacks in correct order and' +
168
'keeps calling them if there is time',
169
() => {
170
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
170
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
171
const callbackLog = [];
172
const callbackA = jest.fn(() => {
173
callbackLog.push('A');
@@ -194,7 +194,7 @@ describe('ReactScheduler', () => {
194
);
195
196
it('schedules callbacks in correct order when callbacks have many nested scheduleWork calls', () => {
197
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
197
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
198
const callbackLog = [];
199
const callbackA = jest.fn(() => {
200
callbackLog.push('A');
@@ -229,7 +229,7 @@ describe('ReactScheduler', () => {
229
});
230
231
it('schedules callbacks in correct order when they use scheduleWork to schedule themselves', () => {
232
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
232
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
233
const callbackLog = [];
234
let callbackAIterations = 0;
235
const callbackA = jest.fn(() => {
@@ -260,7 +260,7 @@ describe('ReactScheduler', () => {
260
261
describe('when there is no more time left in the frame', () => {
262
it('calls any callback which has timed out, waits for others', () => {
263
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
263
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
264
startOfLatestFrame = 1000000000000;
265
currentTime = startOfLatestFrame - 10;
266
const callbackLog = [];
@@ -295,7 +295,7 @@ describe('ReactScheduler', () => {
295
296
describe('when there is some time left in the frame', () => {
297
it('calls timed out callbacks and then any more pending callbacks, defers others if time runs out', () => {
298
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
298
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
299
startOfLatestFrame = 1000000000000;
300
currentTime = startOfLatestFrame - 10;
301
const callbackLog = [];
@@ -346,7 +346,7 @@ describe('ReactScheduler', () => {
346
const {
347
unstable_scheduleWork: scheduleWork,
348
unstable_cancelScheduledWork: cancelScheduledWork,
349
- } = ReactScheduler;
349
+ } = Schedule;
350
const cb = jest.fn();
351
const callbackId = scheduleWork(cb);
352
expect(cb).toHaveBeenCalledTimes(0);
@@ -360,7 +360,7 @@ describe('ReactScheduler', () => {
360
const {
361
unstable_scheduleWork: scheduleWork,
362
unstable_cancelScheduledWork: cancelScheduledWork,
363
- } = ReactScheduler;
363
+ } = Schedule;
364
const callbackLog = [];
365
const callbackA = jest.fn(() => callbackLog.push('A'));
366
const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -384,7 +384,7 @@ describe('ReactScheduler', () => {
384
const {
385
unstable_scheduleWork: scheduleWork,
386
unstable_cancelScheduledWork: cancelScheduledWork,
387
- } = ReactScheduler;
387
+ } = Schedule;
388
const callbackLog = [];
389
let callbackBId;
390
const callbackA = jest.fn(() => {
@@ -421,7 +421,7 @@ describe('ReactScheduler', () => {
421
*
422
*/
423
it('still calls all callbacks within same frame', () => {
424
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
424
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
425
const callbackLog = [];
426
const callbackA = jest.fn(() => callbackLog.push('A'));
427
const callbackB = jest.fn(() => {
@@ -467,7 +467,7 @@ describe('ReactScheduler', () => {
467
*
468
*/
469
it('and with some timed out callbacks, still calls all callbacks within same frame', () => {
470
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
470
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
471
const callbackLog = [];
472
const callbackA = jest.fn(() => {
473
callbackLog.push('A');
@@ -513,7 +513,7 @@ describe('ReactScheduler', () => {
513
*
514
*/
515
it('still calls all callbacks within same frame', () => {
516
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
516
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
517
const callbackLog = [];
518
const callbackA = jest.fn(() => {
519
callbackLog.push('A');
@@ -574,7 +574,7 @@ describe('ReactScheduler', () => {
574
*
575
*/
576
it('and with all timed out callbacks, still calls all callbacks within same frame', () => {
577
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
577
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
578
const callbackLog = [];
579
const callbackA = jest.fn(() => {
580
callbackLog.push('A');
@@ -655,7 +655,7 @@ describe('ReactScheduler', () => {
655
*
656
*/
657
it('still calls all callbacks within same frame', () => {
658
- const {unstable_scheduleWork: scheduleWork} = ReactScheduler;
658
+ const {unstable_scheduleWork: scheduleWork} = Schedule;
659
startOfLatestFrame = 1000000000000;
660
currentTime = startOfLatestFrame - 10;
661
catchPostMessageErrors = true;
packages/schedule/src/__tests__/ScheduleUMDBundle-test.internal.js
renamed
+4
-4
@@ -25,16 +25,16 @@ describe('Scheduling UMD bundle', () => {
25
26
it('should define the same scheduling API', () => {
27
const api = require('../../index');
28
- const umdAPIDev = require('../../npm/umd/react-scheduler.development');
29
- const umdAPIProd = require('../../npm/umd/react-scheduler.production.min');
28
+ const umdAPIDev = require('../../npm/umd/schedule.development');
29
+ const umdAPIProd = require('../../npm/umd/schedule.production.min');
30
const secretAPI = require('react/src/ReactSharedInternals').default;
31
validateForwardedAPIs(api, [umdAPIDev, umdAPIProd, secretAPI.Scheduler]);
32
});
33
34
it('should define the same tracking API', () => {
35
const api = require('../../tracking');
36
- const umdAPIDev = require('../../npm/umd/react-scheduler-tracking.development');
37
- const umdAPIProd = require('../../npm/umd/react-scheduler-tracking.production.min');
36
+ const umdAPIDev = require('../../npm/umd/schedule-tracking.development');
37
+ const umdAPIProd = require('../../npm/umd/schedule-tracking.production.min');
38
const secretAPI = require('react/src/ReactSharedInternals').default;
39
validateForwardedAPIs(api, [
40
umdAPIDev,
packages/schedule/src/__tests__/Tracking-test.internal.js
renamed
+1
-1
@@ -29,7 +29,7 @@ describe('Tracking', () => {
29
ReactFeatureFlags = require('shared/ReactFeatureFlags');
30
ReactFeatureFlags.enableSchedulerTracking = enableSchedulerTracking;
31
32
- SchedulerTracking = require('react-scheduler/tracking');
32
+ SchedulerTracking = require('schedule/tracking');
33
}
34
35
describe('enableSchedulerTracking enabled', () => {
packages/schedule/src/__tests__/Tracking-test.js
renamed
+1
-1
@@ -14,7 +14,7 @@ describe('Tracking', () => {
14
beforeEach(() => {
15
jest.resetModules();
16
17
- SchedulerTracking = require('react-scheduler/tracking');
17
+ SchedulerTracking = require('schedule/tracking');
18
});
19
20
it('should return the value of a tracked function', () => {
packages/schedule/src/__tests__/TrackingSubscriptions-test.internal.js
renamed
+1
-1
@@ -42,7 +42,7 @@ describe('TrackingSubscriptions', () => {
42
ReactFeatureFlags = require('shared/ReactFeatureFlags');
43
ReactFeatureFlags.enableSchedulerTracking = enableSchedulerTracking;
44
45
- SchedulerTracking = require('react-scheduler/tracking');
45
+ SchedulerTracking = require('schedule/tracking');
46
47
throwInOnInteractionScheduledWorkCompleted = false;
48
throwInOnInteractionTracked = false;
packages/schedule/tracking.js
renamed
packages/shared/forks/Schedule.umd.js
renamed
packages/shared/forks/Schedule.www.js
renamed
packages/shared/forks/ScheduleTracking.umd.js
renamed
scripts/rollup/bundles.js
+6
-6
@@ -382,16 +382,16 @@ const bundles = [
382
383
/******* React Scheduler (experimental) *******/
384
{
385
- label: 'react-scheduler',
385
+ label: 'schedule',
386
bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV, FB_WWW_PROD],
387
moduleType: ISOMORPHIC,
388
- entry: 'react-scheduler',
389
- global: 'ReactScheduler',
388
+ entry: 'schedule',
389
+ global: 'Schedule',
390
externals: [],
391
},
392
393
{
394
- label: 'react-scheduler-tracking',
394
+ label: 'schedule-tracking',
395
bundleTypes: [
396
FB_WWW_DEV,
397
FB_WWW_PROD,
@@ -401,8 +401,8 @@ const bundles = [
401
NODE_PROFILING,
402
],
403
moduleType: ISOMORPHIC,
404
- entry: 'react-scheduler/tracking',
405
- global: 'ReactSchedulerTracking',
404
+ entry: 'schedule/tracking',
405
+ global: 'ScheduleTracking',
406
externals: [],
407
},
408
];
scripts/rollup/forks.js
+5
-5
@@ -114,12 +114,12 @@ const forks = Object.freeze({
114
return null;
115
},
116
117
- 'react-scheduler': (bundleType, entry, dependencies) => {
117
+ schedule: (bundleType, entry, dependencies) => {
118
switch (bundleType) {
119
case FB_WWW_DEV:
120
case FB_WWW_PROD:
121
case FB_WWW_PROFILING:
122
- return 'shared/forks/ReactScheduler.www.js';
122
+ return 'shared/forks/Schedule.www.js';
123
case UMD_DEV:
124
case UMD_PROD:
125
if (dependencies.indexOf('react') === -1) {
@@ -129,14 +129,14 @@ const forks = Object.freeze({
129
}
130
// Optimization: for UMDs, use the API that is already a part of the React
131
// package instead of requiring it to be loaded via a separate <script> tag
132
- return 'shared/forks/ReactScheduler.umd.js';
132
+ return 'shared/forks/Schedule.umd.js';
133
default:
134
// For CJS bundles, use the shared NPM package.
135
return null;
136
}
137
},
138
139
- 'react-scheduler/tracking': (bundleType, entry, dependencies) => {
139
+ 'schedule/tracking': (bundleType, entry, dependencies) => {
140
switch (bundleType) {
141
case UMD_DEV:
142
case UMD_PROD:
@@ -147,7 +147,7 @@ const forks = Object.freeze({
147
}
148
// Optimization: for UMDs, use the API that is already a part of the React
149
// package instead of requiring it to be loaded via a separate <script> tag
150
- return 'shared/forks/ReactSchedulerTracking.umd.js';
150
+ return 'shared/forks/ScheduleTracking.umd.js';
151
default:
152
// For CJS bundles, use the shared NPM package.
153
return null;
scripts/rollup/modules.js
+4
-4
@@ -14,16 +14,16 @@ const HAS_NO_SIDE_EFFECTS_ON_IMPORT = false;
14
const importSideEffects = Object.freeze({
15
'prop-types/checkPropTypes': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
16
deepFreezeAndThrowOnMutationInDev: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
17
- 'react-scheduler': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
18
- 'react-scheduler/tracking': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
17
+ schedule: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
18
+ 'schedule/tracking': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
19
});
20
21
// Bundles exporting globals that other modules rely on.
22
const knownGlobals = Object.freeze({
23
react: 'React',
24
'react-dom': 'ReactDOM',
25
- 'react-scheduler': 'ReactScheduler',
26
- 'react-scheduler/tracking': 'ReactSchedulerTracking',
25
+ schedule: 'Schedule',
26
+ 'schedule/tracking': 'ScheduleTracking',
27
});
28
29
// Given ['react'] in bundle externals, returns { 'react': 'React' }.
scripts/rollup/results.json
+12
-12
@@ -659,30 +659,30 @@
659
"gzip": 999
660
},
661
{
662
- "filename": "react-scheduler.development.js",
662
+ "filename": "schedule.development.js",
663
"bundleType": "UMD_DEV",
664
- "packageName": "react-scheduler",
664
+ "packageName": "schedule",
665
"size": 19628,
666
"gzip": 5881
667
},
668
{
669
- "filename": "react-scheduler.production.min.js",
669
+ "filename": "schedule.production.min.js",
670
"bundleType": "UMD_PROD",
671
- "packageName": "react-scheduler",
671
+ "packageName": "schedule",
672
"size": 3233,
673
"gzip": 1562
674
},
675
{
676
- "filename": "react-scheduler.development.js",
676
+ "filename": "schedule.development.js",
677
"bundleType": "NODE_DEV",
678
- "packageName": "react-scheduler",
678
+ "packageName": "schedule",
679
"size": 14449,
680
"gzip": 4354
681
},
682
{
683
- "filename": "react-scheduler.production.min.js",
683
+ "filename": "schedule.production.min.js",
684
"bundleType": "NODE_PROD",
685
- "packageName": "react-scheduler",
685
+ "packageName": "schedule",
686
"size": 2825,
687
"gzip": 1387
688
},
@@ -736,16 +736,16 @@
736
"gzip": 33867
737
},
738
{
739
- "filename": "ReactScheduler-dev.js",
739
+ "filename": "Schedule-dev.js",
740
"bundleType": "FB_WWW_DEV",
741
- "packageName": "react-scheduler",
741
+ "packageName": "schedule",
742
"size": 14452,
743
"gzip": 4364
744
},
745
{
746
- "filename": "ReactScheduler-prod.js",
746
+ "filename": "Schedule-prod.js",
747
"bundleType": "FB_WWW_PROD",
748
- "packageName": "react-scheduler",
748
+ "packageName": "schedule",
749
"size": 7800,
750
"gzip": 2108
751
}