Skip to content

Commit f84b1e0

Browse files
gaearonjetoneza
authored andcommitted
Rename schedule to scheduler (facebook#13683)
1 parent 0cfa4bc commit f84b1e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+213
-209
lines changed

fixtures/schedule/index.html renamed to fixtures/scheduler/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html style="width: 100%; height: 100%;">
33
<head>
44
<meta charset="utf-8">
5-
<title>Schedule Test Page</title>
5+
<title>Scheduler Test Page</title>
66
<style>
77
.correct {
88
border: solid green 2px;
@@ -13,7 +13,7 @@
1313
</style>
1414
</head>
1515
<body>
16-
<h1>Schedule Fixture</h1>
16+
<h1>Scheduler Fixture</h1>
1717
<p>
1818
This fixture is for manual testing purposes, and the patterns used in
1919
implementing it should not be used as a model. This is mainly for anyone
@@ -89,14 +89,15 @@ <h2>Tests:</h2>
8989
<div> If the counter advanced while you were away from this tab, it's correct.</div>
9090
</li>
9191
</ol>
92-
<script src="../../build/dist/schedule.development.js"></script>
92+
<script src="../../build/dist/react.development.js"></script>
93+
<script src="../../build/node_modules/scheduler/umd/scheduler.development.js"></script>
9394
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
9495
<script type="text/babel">
9596
const {
9697
unstable_scheduleWork: scheduleWork,
9798
unstable_cancelWork: cancelWork,
9899
unstable_now: now
99-
} = Schedule;
100+
} = Scheduler;
100101
function displayTestResult(testNumber) {
101102
const expectationNode = document.getElementById('test-' + testNumber + '-expected');
102103
const resultNode = document.getElementById('test-' + testNumber);

fixtures/tracing/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ <h3>
6363
</li>
6464
</ol>
6565
<!-- Load the tracing API before react to test that it's lazily evaluated -->
66-
<script src="../../build/node_modules/schedule/umd/schedule.development.js"></script>
67-
<script src="../../build/node_modules/schedule/umd/schedule-tracing.development.js"></script>
66+
<script src="../../build/node_modules/scheduler/umd/scheduler.development.js"></script>
67+
<script src="../../build/node_modules/scheduler/umd/scheduler-tracing.development.js"></script>
6868
<script src="../../build/node_modules/react/umd/react.development.js"></script>
6969
<script src="../../build/node_modules/react-dom/umd/react-dom.development.js"></script>
7070
<script src="./script.js"></script>

fixtures/tracing/script.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ function runAllTests() {
2828
function checkSchedulerAPI() {
2929
runTest(document.getElementById('checkSchedulerAPI'), () => {
3030
if (
31-
typeof Schedule === 'undefined' ||
32-
typeof Schedule.unstable_now !== 'function' ||
33-
typeof Schedule.unstable_scheduleWork !== 'function' ||
34-
typeof Schedule.unstable_cancelScheduledWork !== 'function'
31+
typeof Scheduler === 'undefined' ||
32+
typeof Scheduler.unstable_now !== 'function' ||
33+
typeof Scheduler.unstable_scheduleWork !== 'function' ||
34+
typeof Scheduler.unstable_cancelScheduledWork !== 'function'
3535
) {
3636
throw 'API is not defined';
3737
}
3838

39-
if (Schedule.unstable_now() !== performance.now()) {
39+
if (Scheduler.unstable_now() !== performance.now()) {
4040
throw 'API does not work';
4141
}
4242

@@ -47,20 +47,20 @@ function checkSchedulerAPI() {
4747
function checkSchedulerTracingAPI() {
4848
runTest(document.getElementById('checkSchedulerTracingAPI'), () => {
4949
if (
50-
typeof ScheduleTracing === 'undefined' ||
51-
typeof ScheduleTracing.unstable_clear !== 'function' ||
52-
typeof ScheduleTracing.unstable_getCurrent !== 'function' ||
53-
typeof ScheduleTracing.unstable_getThreadID !== 'function' ||
54-
typeof ScheduleTracing.unstable_trace !== 'function' ||
55-
typeof ScheduleTracing.unstable_wrap !== 'function'
50+
typeof SchedulerTracing === 'undefined' ||
51+
typeof SchedulerTracing.unstable_clear !== 'function' ||
52+
typeof SchedulerTracing.unstable_getCurrent !== 'function' ||
53+
typeof SchedulerTracing.unstable_getThreadID !== 'function' ||
54+
typeof SchedulerTracing.unstable_trace !== 'function' ||
55+
typeof SchedulerTracing.unstable_wrap !== 'function'
5656
) {
5757
throw 'API is not defined';
5858
}
5959

6060
try {
6161
let interactionsSet;
62-
ScheduleTracing.unstable_trace('test', 123, () => {
63-
interactionsSet = ScheduleTracing.unstable_getCurrent();
62+
SchedulerTracing.unstable_trace('test', 123, () => {
63+
interactionsSet = SchedulerTracing.unstable_getCurrent();
6464
});
6565
if (interactionsSet.size !== 1) {
6666
throw null;
@@ -74,10 +74,10 @@ function checkSchedulerTracingAPI() {
7474
}
7575

7676
const ForwardedSchedulerTracing =
77-
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing;
77+
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing;
7878

7979
if (
80-
ScheduleTracing.unstable_getThreadID() ===
80+
SchedulerTracing.unstable_getThreadID() ===
8181
ForwardedSchedulerTracing.unstable_getThreadID()
8282
) {
8383
throw 'API forwarding is broken';
@@ -90,9 +90,9 @@ function checkSchedulerTracingSubscriptionsAPI() {
9090
document.getElementById('checkSchedulerTracingSubscriptionsAPI'),
9191
() => {
9292
if (
93-
typeof ScheduleTracing === 'undefined' ||
94-
typeof ScheduleTracing.unstable_subscribe !== 'function' ||
95-
typeof ScheduleTracing.unstable_unsubscribe !== 'function'
93+
typeof SchedulerTracing === 'undefined' ||
94+
typeof SchedulerTracing.unstable_subscribe !== 'function' ||
95+
typeof SchedulerTracing.unstable_unsubscribe !== 'function'
9696
) {
9797
throw 'API is not defined';
9898
}
@@ -114,17 +114,17 @@ function checkSchedulerTracingSubscriptionsAPI() {
114114
};
115115

116116
try {
117-
ScheduleTracing.unstable_subscribe(subscriber);
118-
ScheduleTracing.unstable_trace('foo', 123, () => {});
119-
ScheduleTracing.unstable_unsubscribe(subscriber);
117+
SchedulerTracing.unstable_subscribe(subscriber);
118+
SchedulerTracing.unstable_trace('foo', 123, () => {});
119+
SchedulerTracing.unstable_unsubscribe(subscriber);
120120
if (onInteractionTracedCalls.length !== 1) {
121121
throw null;
122122
}
123123
const interaction = onInteractionTracedCalls[0][0];
124124
if (interaction.name !== 'foo' || interaction.timestamp !== 123) {
125125
throw null;
126126
}
127-
ScheduleTracing.unstable_trace('bar', 456, () => {});
127+
SchedulerTracing.unstable_trace('bar', 456, () => {});
128128
if (onInteractionTracedCalls.length !== 1) {
129129
throw null;
130130
}
@@ -134,13 +134,13 @@ function checkSchedulerTracingSubscriptionsAPI() {
134134

135135
const ForwardedSchedulerTracing =
136136
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
137-
.ScheduleTracing;
137+
.SchedulerTracing;
138138

139139
try {
140140
ForwardedSchedulerTracing.unstable_subscribe(subscriber);
141-
ScheduleTracing.unstable_trace('foo', 123, () => {});
141+
SchedulerTracing.unstable_trace('foo', 123, () => {});
142142
ForwardedSchedulerTracing.unstable_trace('bar', 456, () => {});
143-
ScheduleTracing.unstable_unsubscribe(subscriber);
143+
SchedulerTracing.unstable_unsubscribe(subscriber);
144144
if (onInteractionTracedCalls.length !== 3) {
145145
throw null;
146146
}
@@ -172,7 +172,7 @@ function checkEndToEndIntegration() {
172172
const onRender = (...args) => onRenderCalls.push(args);
173173
const container = document.createElement('div');
174174

175-
ScheduleTracing.unstable_trace('render', 123, () => {
175+
SchedulerTracing.unstable_trace('render', 123, () => {
176176
ReactDOM.render(
177177
React.createElement(
178178
React.unstable_Profiler,

fixtures/unstable-async/suspense/src/components/App.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React, {Placeholder, PureComponent} from 'react';
2-
import {unstable_scheduleWork} from 'schedule';
3-
import {unstable_trace as trace, unstable_wrap as wrap} from 'schedule/tracing';
2+
import {unstable_scheduleWork} from 'scheduler';
3+
import {
4+
unstable_trace as trace,
5+
unstable_wrap as wrap,
6+
} from 'scheduler/tracing';
47
import {createResource} from 'simple-cache-provider';
58
import {cache} from '../cache';
69
import Spinner from './Spinner';

fixtures/unstable-async/suspense/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {Fragment, PureComponent} from 'react';
22
import {unstable_createRoot, render} from 'react-dom';
3-
import {unstable_trace as trace} from 'schedule/tracing';
3+
import {unstable_trace as trace} from 'scheduler/tracing';
44
import {cache} from './cache';
55
import {
66
setFakeRequestTime,

fixtures/unstable-async/time-slicing/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ There are also known bugs and inefficiencies in master so **don't use this fixtu
1818
# 1: Build react from source
1919
cd /path/to/react
2020
yarn
21-
yarn build dom-client,core,simple-cache-provider,schedule --type=NODE
21+
yarn build dom-client,core,simple-cache-provider,scheduler --type=NODE
2222

2323
# 2: Install fixture dependencies
2424
cd fixtures/unstable-async/time-slicing/

fixtures/unstable-async/time-slicing/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {PureComponent} from 'react';
22
import {flushSync, render} from 'react-dom';
3-
import {unstable_scheduleWork} from 'schedule';
3+
import {unstable_scheduleWork} from 'scheduler';
44
import _ from 'lodash';
55
import Charts from './Charts';
66
import Clock from './Clock';

packages/react-art/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"loose-envify": "^1.1.0",
2424
"object-assign": "^4.1.1",
2525
"prop-types": "^15.6.2",
26-
"schedule": "^0.5.0"
26+
"scheduler": "^0.9.0"
2727
},
2828
"peerDependencies": {
2929
"react": "^16.0.0"

packages/react-art/src/ReactARTHostConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export {
99
unstable_now as now,
1010
unstable_scheduleWork as scheduleDeferredCallback,
1111
unstable_cancelScheduledWork as cancelDeferredCallback,
12-
} from 'schedule';
12+
} from 'scheduler';
1313
import Transform from 'art/core/transform';
1414
import Mode from 'art/modes/current';
1515
import invariant from 'shared/invariant';

packages/react-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"loose-envify": "^1.1.0",
1717
"object-assign": "^4.1.1",
1818
"prop-types": "^15.6.2",
19-
"schedule": "^0.5.0"
19+
"scheduler": "^0.9.0"
2020
},
2121
"peerDependencies": {
2222
"react": "^16.0.0"

0 commit comments

Comments
 (0)