@samitouri / QOS-React-2 / commits / 7ea3ca1d13

Rename schedule to scheduler (#13683)

Dan Abramov committed Sep 19, 2018 at 01:26 UTC 7ea3ca1d13b1b609678fa1369f8a1020c3ecb976
52 files changed +213 -209
fixtures/scheduler/index.html renamed
+5 -4
@@ -2,7 +2,7 @@
2 <html style="width: 100%; height: 100%;">
3 <head>
4 <meta charset="utf-8">
5 - <title>Schedule Test Page</title>
5 + <title>Scheduler Test Page</title>
6 <style>
7 .correct {
8 border: solid green 2px;
@@ -13,7 +13,7 @@
13 </style>
14 </head>
15 <body>
16 - <h1>Schedule Fixture</h1>
16 + <h1>Scheduler Fixture</h1>
17 <p>
18 This fixture is for manual testing purposes, and the patterns used in
19 implementing it should not be used as a model. This is mainly for anyone
@@ -89,14 +89,15 @@
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/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>
94 <script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
95 <script type="text/babel">
96 const {
97 unstable_scheduleWork: scheduleWork,
98 unstable_cancelWork: cancelWork,
99 unstable_now: now
99 -} = Schedule;
100 +} = Scheduler;
101 function displayTestResult(testNumber) {
102 const expectationNode = document.getElementById('test-' + testNumber + '-expected');
103 const resultNode = document.getElementById('test-' + testNumber);
fixtures/tracing/index.html
+2 -2
@@ -63,8 +63,8 @@
63 </li>
64 </ol>
65 <!-- 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>
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/tracing/script.js
+26 -26
@@ -28,15 +28,15 @@ function runAllTests() {
28 function checkSchedulerAPI() {
29 runTest(document.getElementById('checkSchedulerAPI'), () => {
30 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'
35 ) {
36 throw 'API is not defined';
37 }
38
39 - if (Schedule.unstable_now() !== performance.now()) {
39 + if (Scheduler.unstable_now() !== performance.now()) {
40 throw 'API does not work';
41 }
42
@@ -47,20 +47,20 @@ function checkSchedulerAPI() {
47 function checkSchedulerTracingAPI() {
48 runTest(document.getElementById('checkSchedulerTracingAPI'), () => {
49 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'
56 ) {
57 throw 'API is not defined';
58 }
59
60 try {
61 let interactionsSet;
62 - ScheduleTracing.unstable_trace('test', 123, () => {
63 - interactionsSet = ScheduleTracing.unstable_getCurrent();
62 + SchedulerTracing.unstable_trace('test', 123, () => {
63 + interactionsSet = SchedulerTracing.unstable_getCurrent();
64 });
65 if (interactionsSet.size !== 1) {
66 throw null;
@@ -74,10 +74,10 @@ function checkSchedulerTracingAPI() {
74 }
75
76 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;
78
79 if (
80 - ScheduleTracing.unstable_getThreadID() ===
80 + SchedulerTracing.unstable_getThreadID() ===
81 ForwardedSchedulerTracing.unstable_getThreadID()
82 ) {
83 throw 'API forwarding is broken';
@@ -90,9 +90,9 @@ function checkSchedulerTracingSubscriptionsAPI() {
90 document.getElementById('checkSchedulerTracingSubscriptionsAPI'),
91 () => {
92 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'
96 ) {
97 throw 'API is not defined';
98 }
@@ -114,9 +114,9 @@ function checkSchedulerTracingSubscriptionsAPI() {
114 };
115
116 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);
120 if (onInteractionTracedCalls.length !== 1) {
121 throw null;
122 }
@@ -124,7 +124,7 @@ function checkSchedulerTracingSubscriptionsAPI() {
124 if (interaction.name !== 'foo' || interaction.timestamp !== 123) {
125 throw null;
126 }
127 - ScheduleTracing.unstable_trace('bar', 456, () => {});
127 + SchedulerTracing.unstable_trace('bar', 456, () => {});
128 if (onInteractionTracedCalls.length !== 1) {
129 throw null;
130 }
@@ -134,13 +134,13 @@ function checkSchedulerTracingSubscriptionsAPI() {
134
135 const ForwardedSchedulerTracing =
136 React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
137 - .ScheduleTracing;
137 + .SchedulerTracing;
138
139 try {
140 ForwardedSchedulerTracing.unstable_subscribe(subscriber);
141 - ScheduleTracing.unstable_trace('foo', 123, () => {});
141 + SchedulerTracing.unstable_trace('foo', 123, () => {});
142 ForwardedSchedulerTracing.unstable_trace('bar', 456, () => {});
143 - ScheduleTracing.unstable_unsubscribe(subscriber);
143 + SchedulerTracing.unstable_unsubscribe(subscriber);
144 if (onInteractionTracedCalls.length !== 3) {
145 throw null;
146 }
@@ -172,7 +172,7 @@ function checkEndToEndIntegration() {
172 const onRender = (...args) => onRenderCalls.push(args);
173 const container = document.createElement('div');
174
175 - ScheduleTracing.unstable_trace('render', 123, () => {
175 + SchedulerTracing.unstable_trace('render', 123, () => {
176 ReactDOM.render(
177 React.createElement(
178 React.unstable_Profiler,
fixtures/unstable-async/suspense/src/components/App.js
+5 -2
@@ -1,6 +1,9 @@
1 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';
7 import {createResource} from 'simple-cache-provider';
8 import {cache} from '../cache';
9 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_trace as trace} from 'schedule/tracing';
3 +import {unstable_trace as trace} from 'scheduler/tracing';
4 import {cache} from './cache';
5 import {
6 setFakeRequestTime,
fixtures/unstable-async/time-slicing/README.md
+1 -1
@@ -18,7 +18,7 @@ There are also known bugs and inefficiencies in master so **don't use this fixtu
18 # 1: Build react from source
19 cd /path/to/react
20 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
22
23 # 2: Install fixture dependencies
24 cd fixtures/unstable-async/time-slicing/
fixtures/unstable-async/time-slicing/src/index.js
+1 -1
@@ -1,6 +1,6 @@
1 import React, {PureComponent} from 'react';
2 import {flushSync, render} from 'react-dom';
3 -import {unstable_scheduleWork} from 'schedule';
3 +import {unstable_scheduleWork} from 'scheduler';
4 import _ from 'lodash';
5 import Charts from './Charts';
6 import Clock from './Clock';
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 - "schedule": "^0.5.0"
26 + "scheduler": "^0.9.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 'schedule';
12 +} from 'scheduler';
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 - "schedule": "^0.5.0"
19 + "scheduler": "^0.9.0"
20 },
21 "peerDependencies": {
22 "react": "^16.0.0"
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 'schedule';
67 +} from 'scheduler';
68
69 let SUPPRESS_HYDRATION_WARNING;
70 if (__DEV__) {
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 - "schedule": "^0.5.0"
9 + "scheduler": "^0.9.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 - "schedule": "^0.5.0"
31 + "scheduler": "^0.9.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 'schedule/src/Tracing';
13 +import type {Interaction} from 'scheduler/src/Tracing';
14
15 import {noTimeout} from './ReactFiberHostConfig';
16 import {createHostRootFiber} from './ReactFiber';
17 import {NoWork} from './ReactFiberExpirationTime';
18 import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
19 -import {unstable_getThreadID} from 'schedule/tracing';
19 +import {unstable_getThreadID} from 'scheduler/tracing';
20
21 /* eslint-disable no-use-before-define */
22 // TODO: This should be lifted into the renderer.
packages/react-reconciler/src/ReactFiberScheduler.js
+2 -2
@@ -10,9 +10,9 @@
10 import type {Fiber} from './ReactFiber';
11 import type {Batch, FiberRoot} from './ReactFiberRoot';
12 import type {ExpirationTime} from './ReactFiberExpirationTime';
13 -import type {Interaction} from 'schedule/src/Tracing';
13 +import type {Interaction} from 'scheduler/src/Tracing';
14
15 -import {__interactionsRef, __subscriberRef} from 'schedule/tracing';
15 +import {__interactionsRef, __subscriberRef} from 'scheduler/tracing';
16 import {
17 invokeGuardedCallback,
18 hasCaughtError,
packages/react-reconciler/src/__tests__/ReactTracing-test.internal.js
+1 -1
@@ -17,7 +17,7 @@ describe('ReactTracing', () => {
17 const ReactFeatureFlags = require('shared/ReactFeatureFlags');
18 ReactFeatureFlags.enableSchedulerTracing = false;
19
20 - require('schedule/tracing');
20 + require('scheduler/tracing');
21
22 ReactFeatureFlags.enableSchedulerTracing = true;
23
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.5.2",
21 - "schedule": "^0.5.0"
21 + "scheduler": "^0.9.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 - "schedule": "^0.5.0"
27 + "scheduler": "^0.9.0"
28 },
29 "browserify": {
30 "transform": [
packages/react/src/ReactSharedInternals.js
+4 -4
@@ -10,7 +10,7 @@ import {
10 unstable_cancelScheduledWork,
11 unstable_now,
12 unstable_scheduleWork,
13 -} from 'schedule';
13 +} from 'scheduler';
14 import {
15 __interactionsRef,
16 __subscriberRef,
@@ -21,7 +21,7 @@ import {
21 unstable_trace,
22 unstable_unsubscribe,
23 unstable_wrap,
24 -} from 'schedule/tracing';
24 +} from 'scheduler/tracing';
25 import ReactCurrentOwner from './ReactCurrentOwner';
26 import ReactDebugCurrentFrame from './ReactDebugCurrentFrame';
27
@@ -38,12 +38,12 @@ if (__UMD__) {
38 // This re-export is only required for UMD bundles;
39 // CJS bundles use the shared NPM package.
40 Object.assign(ReactSharedInternals, {
41 - Schedule: {
41 + Scheduler: {
42 unstable_cancelScheduledWork,
43 unstable_now,
44 unstable_scheduleWork,
45 },
46 - ScheduleTracing: {
46 + SchedulerTracing: {
47 __interactionsRef,
48 __subscriberRef,
49 unstable_clear,
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 - SchedulerTracing = require('schedule/tracing');
45 + SchedulerTracing = require('scheduler/tracing');
46
47 if (useNoopRenderer) {
48 ReactNoop = require('react-noop-renderer');
@@ -1460,7 +1460,7 @@ describe('Profiler', () => {
1460 );
1461 expect(onInteractionScheduledWorkCompleted).not.toHaveBeenCalled();
1462
1463 - // The schedule/tracing package will notify of work started for the default thread,
1463 + // The scheduler/tracing package will notify of work started for the default thread,
1464 // But React shouldn't notify until it's been flushed.
1465 expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1466 expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1518,7 +1518,7 @@ describe('Profiler', () => {
1518 // Update state again to verify our traced interaction isn't registered twice
1519 instance.setState({count: 2});
1520
1521 - // The schedule/tracing package will notify of work started for the default thread,
1521 + // The scheduler/tracing package will notify of work started for the default thread,
1522 // But React shouldn't notify until it's been flushed.
1523 expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1524 expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1621,7 +1621,7 @@ describe('Profiler', () => {
1621 );
1622 expect(onInteractionScheduledWorkCompleted).toHaveBeenCalledTimes(2);
1623
1624 - // The schedule/tracing package will notify of work started for the default thread,
1624 + // The scheduler/tracing package will notify of work started for the default thread,
1625 // But React shouldn't notify until it's been flushed.
1626 expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(0);
1627 expect(getWorkForReactThreads(onWorkStopped)).toHaveLength(0);
@@ -1799,7 +1799,7 @@ describe('Profiler', () => {
1799 expect(onInteractionScheduledWorkCompleted).toHaveBeenCalledTimes(1);
1800
1801 // Work might be started multiple times before being completed.
1802 - // This is okay; it's part of the schedule/tracing contract.
1802 + // This is okay; it's part of the scheduler/tracing contract.
1803 expect(getWorkForReactThreads(onWorkStarted)).toHaveLength(3);
1804 expect(getWorkForReactThreads(onWorkStarted)[1][0]).toMatchInteractions(
1805 [interactionLowPri, interactionHighPri],
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.enableSchedulerTracing = true;
42 - SchedulerTracing = require('schedule/tracing');
42 + SchedulerTracing = require('scheduler/tracing');
43 React = require('react');
44 ReactTestRenderer = require('react-test-renderer');
45
packages/schedule/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/schedule.production.min.js');
5 -} else {
6 - module.exports = require('./cjs/schedule.development.js');
7 -}
packages/schedule/npm/tracing-profiling.js deleted
-7
@@ -1,7 +0,0 @@
1 -'use strict';
2 -
3 -if (process.env.NODE_ENV === 'production') {
4 - module.exports = require('./cjs/schedule-tracing.profiling.min.js');
5 -} else {
6 - module.exports = require('./cjs/schedule-tracing.development.js');
7 -}
packages/schedule/npm/tracing.js deleted
-7
@@ -1,7 +0,0 @@
1 -'use strict';
2 -
3 -if (process.env.NODE_ENV === 'production') {
4 - module.exports = require('./cjs/schedule-tracing.production.min.js');
5 -} else {
6 - module.exports = require('./cjs/schedule-tracing.development.js');
7 -}
packages/scheduler/README.md renamed
+2 -2
@@ -1,4 +1,4 @@
1 -# `schedule`
1 +# `scheduler`
2
3 This is a package for cooperative scheduling in a browser environment. It is currently used internally by React, but we plan to make it more generic.
4
@@ -6,4 +6,4 @@ The public API for this package is not yet finalized.
6
7 ### Thanks
8
9 -The React team thanks [Haoliang Gao](https://github.com/popomore) for donating the `schedule` package name.
9 +The React team thanks [Anton Podviaznikov](https://podviaznikov.com/) for donating the `scheduler` package name.
packages/scheduler/index.js renamed
+1 -1
@@ -7,4 +7,4 @@
7
8 'use strict';
9
10 -export * from './src/Schedule';
10 +export * from './src/Scheduler';
packages/scheduler/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/scheduler.production.min.js');
5 +} else {
6 + module.exports = require('./cjs/scheduler.development.js');
7 +}
packages/scheduler/npm/tracing-profiling.js new
+7
@@ -0,0 +1,7 @@
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/scheduler-tracing.profiling.min.js');
5 +} else {
6 + module.exports = require('./cjs/scheduler-tracing.development.js');
7 +}
packages/scheduler/npm/tracing.js new
+7
@@ -0,0 +1,7 @@
1 +'use strict';
2 +
3 +if (process.env.NODE_ENV === 'production') {
4 + module.exports = require('./cjs/scheduler-tracing.production.min.js');
5 +} else {
6 + module.exports = require('./cjs/scheduler-tracing.development.js');
7 +}
packages/scheduler/npm/umd/scheduler-tracing.development.js renamed
+8 -8
@@ -14,24 +14,24 @@
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.ScheduleTracing = factory(global));
17 + : (global.SchedulerTracing = factory(global));
18 })(this, function(global) {
19 function unstable_clear() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_clear.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_clear.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_getCurrent() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getCurrent.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getCurrent.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_getThreadID() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getThreadID.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getThreadID.apply(
35 this,
36 arguments
37 );
@@ -39,14 +39,14 @@
39
40 function unstable_subscribe() {
41 // eslint-disable-next-line max-len
42 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_subscribe.apply(
42 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_subscribe.apply(
43 this,
44 arguments
45 );
46 }
47
48 function unstable_trace() {
49 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_trace.apply(
49 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_trace.apply(
50 this,
51 arguments
52 );
@@ -54,14 +54,14 @@
54
55 function unstable_unsubscribe() {
56 // eslint-disable-next-line max-len
57 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_unsubscribe.apply(
57 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_unsubscribe.apply(
58 this,
59 arguments
60 );
61 }
62
63 function unstable_wrap() {
64 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_wrap.apply(
64 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_wrap.apply(
65 this,
66 arguments
67 );
packages/scheduler/npm/umd/scheduler-tracing.production.min.js renamed
+8 -8
@@ -14,24 +14,24 @@
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.ScheduleTracing = factory(global));
17 + : (global.SchedulerTracing = factory(global));
18 })(this, function(global) {
19 function unstable_clear() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_clear.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_clear.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_getCurrent() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getCurrent.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getCurrent.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_getThreadID() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getThreadID.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getThreadID.apply(
35 this,
36 arguments
37 );
@@ -39,14 +39,14 @@
39
40 function unstable_subscribe() {
41 // eslint-disable-next-line max-len
42 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_subscribe.apply(
42 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_subscribe.apply(
43 this,
44 arguments
45 );
46 }
47
48 function unstable_trace() {
49 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_trace.apply(
49 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_trace.apply(
50 this,
51 arguments
52 );
@@ -54,14 +54,14 @@
54
55 function unstable_unsubscribe() {
56 // eslint-disable-next-line max-len
57 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_unsubscribe.apply(
57 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_unsubscribe.apply(
58 this,
59 arguments
60 );
61 }
62
63 function unstable_wrap() {
64 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_wrap.apply(
64 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_wrap.apply(
65 this,
66 arguments
67 );
packages/scheduler/npm/umd/scheduler-tracing.profiling.min.js renamed
+8 -8
@@ -14,24 +14,24 @@
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.ScheduleTracing = factory(global));
17 + : (global.SchedulerTracing = factory(global));
18 })(this, function(global) {
19 function unstable_clear() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_clear.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_clear.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_getCurrent() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getCurrent.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getCurrent.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_getThreadID() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_getThreadID.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_getThreadID.apply(
35 this,
36 arguments
37 );
@@ -39,14 +39,14 @@
39
40 function unstable_subscribe() {
41 // eslint-disable-next-line max-len
42 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_subscribe.apply(
42 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_subscribe.apply(
43 this,
44 arguments
45 );
46 }
47
48 function unstable_trace() {
49 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_trace.apply(
49 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_trace.apply(
50 this,
51 arguments
52 );
@@ -54,14 +54,14 @@
54
55 function unstable_unsubscribe() {
56 // eslint-disable-next-line max-len
57 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_unsubscribe.apply(
57 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_unsubscribe.apply(
58 this,
59 arguments
60 );
61 }
62
63 function unstable_wrap() {
64 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ScheduleTracing.unstable_wrap.apply(
64 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing.unstable_wrap.apply(
65 this,
66 arguments
67 );
packages/scheduler/npm/umd/scheduler.development.js renamed
+4 -4
@@ -14,24 +14,24 @@
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.Schedule = factory(global));
17 + : (global.Scheduler = factory(global));
18 })(this, function(global) {
19 function unstable_now() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_now.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_scheduleWork() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_scheduleWork.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleWork.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_cancelScheduledWork() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_cancelScheduledWork.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelScheduledWork.apply(
35 this,
36 arguments
37 );
packages/scheduler/npm/umd/scheduler.production.min.js renamed
+4 -4
@@ -14,24 +14,24 @@
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.Schedule = factory(global));
17 + : (global.Scheduler = factory(global));
18 })(this, function(global) {
19 function unstable_now() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_now.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_scheduleWork() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_scheduleWork.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleWork.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_cancelScheduledWork() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_cancelScheduledWork.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelScheduledWork.apply(
35 this,
36 arguments
37 );
packages/scheduler/npm/umd/scheduler.profiling.min.js renamed
+4 -4
@@ -14,24 +14,24 @@
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.Schedule = factory(global));
17 + : (global.Scheduler = factory(global));
18 })(this, function(global) {
19 function unstable_now() {
20 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_now.apply(
20 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
21 this,
22 arguments
23 );
24 }
25
26 function unstable_scheduleWork() {
27 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_scheduleWork.apply(
27 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_scheduleWork.apply(
28 this,
29 arguments
30 );
31 }
32
33 function unstable_cancelScheduledWork() {
34 - return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Schedule.unstable_cancelScheduledWork.apply(
34 + return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_cancelScheduledWork.apply(
35 this,
36 arguments
37 );
packages/scheduler/package.json renamed
+2 -2
@@ -1,6 +1,6 @@
1 {
2 - "name": "schedule",
3 - "version": "0.5.0",
2 + "name": "scheduler",
3 + "version": "0.9.0",
4 "description": "Cooperative scheduler for the browser environment.",
5 "main": "index.js",
6 "repository": "facebook/react",
packages/scheduler/src/Scheduler.js renamed
packages/scheduler/src/Tracing.js renamed
packages/scheduler/src/TracingSubscriptions.js renamed
+1 -1
@@ -10,7 +10,7 @@
10 import type {Interaction, Subscriber} from './Tracing';
11
12 import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
13 -import {__subscriberRef} from 'schedule/tracing';
13 +import {__subscriberRef} from 'scheduler/tracing';
14
15 let subscribers: Set<Subscriber> = (null: any);
16 if (enableSchedulerTracing) {
packages/scheduler/src/__tests__/Scheduler-test.internal.js renamed
+4 -4
@@ -18,7 +18,7 @@ let yieldedValues;
18 let yieldValue;
19 let clearYieldedValues;
20
21 -describe('Schedule', () => {
21 +describe('Scheduler', () => {
22 beforeEach(() => {
23 jest.useFakeTimers();
24 jest.resetModules();
@@ -94,9 +94,9 @@ describe('Schedule', () => {
94 global.Date.now = () => currentTime;
95 window._schedMock = [requestCallback, cancelCallback, getTimeRemaining];
96
97 - const Schedule = require('schedule');
98 - scheduleWork = Schedule.unstable_scheduleWork;
99 - cancelScheduledWork = Schedule.unstable_cancelScheduledWork;
97 + const Scheduler = require('scheduler');
98 + scheduleWork = Scheduler.unstable_scheduleWork;
99 + cancelScheduledWork = Scheduler.unstable_cancelScheduledWork;
100 });
101
102 it('flushes work incrementally', () => {
packages/scheduler/src/__tests__/SchedulerDOM-test.js renamed
+19 -19
@@ -9,14 +9,14 @@
9
10 'use strict';
11
12 -let Schedule;
12 +let Scheduler;
13 type FrameTimeoutConfigType = {
14 // should only specify one or the other
15 timeLeftInFrame: ?number,
16 timePastFrameDeadline: ?number,
17 };
18
19 -describe('ScheduleDOM', () => {
19 +describe('SchedulerDOM', () => {
20 let rAFCallbacks = [];
21 let postMessageCallback;
22 let postMessageEvents = [];
@@ -94,12 +94,12 @@ describe('ScheduleDOM', () => {
94 return currentTime;
95 };
96 jest.resetModules();
97 - Schedule = require('schedule');
97 + Scheduler = require('scheduler');
98 });
99
100 describe('scheduleWork', () => {
101 it('calls the callback within the frame when not blocked', () => {
102 - const {unstable_scheduleWork: scheduleWork} = Schedule;
102 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
103 const cb = jest.fn();
104 scheduleWork(cb);
105 advanceOneFrame({timeLeftInFrame: 15});
@@ -111,7 +111,7 @@ describe('ScheduleDOM', () => {
111
112 describe('with multiple callbacks', () => {
113 it('accepts multiple callbacks and calls within frame when not blocked', () => {
114 - const {unstable_scheduleWork: scheduleWork} = Schedule;
114 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
115 const callbackLog = [];
116 const callbackA = jest.fn(() => callbackLog.push('A'));
117 const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -137,7 +137,7 @@ describe('ScheduleDOM', () => {
137 });
138
139 it("accepts callbacks betweeen animationFrame and postMessage and doesn't stall", () => {
140 - const {unstable_scheduleWork: scheduleWork} = Schedule;
140 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
141 const callbackLog = [];
142 const callbackA = jest.fn(() => callbackLog.push('A'));
143 const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -167,7 +167,7 @@ describe('ScheduleDOM', () => {
167 'schedules callbacks in correct order and' +
168 'keeps calling them if there is time',
169 () => {
170 - const {unstable_scheduleWork: scheduleWork} = Schedule;
170 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
171 const callbackLog = [];
172 const callbackA = jest.fn(() => {
173 callbackLog.push('A');
@@ -194,7 +194,7 @@ describe('ScheduleDOM', () => {
194 );
195
196 it('schedules callbacks in correct order when callbacks have many nested scheduleWork calls', () => {
197 - const {unstable_scheduleWork: scheduleWork} = Schedule;
197 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
198 const callbackLog = [];
199 const callbackA = jest.fn(() => {
200 callbackLog.push('A');
@@ -229,7 +229,7 @@ describe('ScheduleDOM', () => {
229 });
230
231 it('schedules callbacks in correct order when they use scheduleWork to schedule themselves', () => {
232 - const {unstable_scheduleWork: scheduleWork} = Schedule;
232 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
233 const callbackLog = [];
234 let callbackAIterations = 0;
235 const callbackA = jest.fn(() => {
@@ -260,7 +260,7 @@ describe('ScheduleDOM', () => {
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} = Schedule;
263 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
264 startOfLatestFrame = 1000000000000;
265 currentTime = startOfLatestFrame - 10;
266 const callbackLog = [];
@@ -295,7 +295,7 @@ describe('ScheduleDOM', () => {
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} = Schedule;
298 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
299 startOfLatestFrame = 1000000000000;
300 currentTime = startOfLatestFrame - 10;
301 const callbackLog = [];
@@ -346,7 +346,7 @@ describe('ScheduleDOM', () => {
346 const {
347 unstable_scheduleWork: scheduleWork,
348 unstable_cancelScheduledWork: cancelScheduledWork,
349 - } = Schedule;
349 + } = Scheduler;
350 const cb = jest.fn();
351 const callbackId = scheduleWork(cb);
352 expect(cb).toHaveBeenCalledTimes(0);
@@ -360,7 +360,7 @@ describe('ScheduleDOM', () => {
360 const {
361 unstable_scheduleWork: scheduleWork,
362 unstable_cancelScheduledWork: cancelScheduledWork,
363 - } = Schedule;
363 + } = Scheduler;
364 const callbackLog = [];
365 const callbackA = jest.fn(() => callbackLog.push('A'));
366 const callbackB = jest.fn(() => callbackLog.push('B'));
@@ -384,7 +384,7 @@ describe('ScheduleDOM', () => {
384 const {
385 unstable_scheduleWork: scheduleWork,
386 unstable_cancelScheduledWork: cancelScheduledWork,
387 - } = Schedule;
387 + } = Scheduler;
388 const callbackLog = [];
389 let callbackBId;
390 const callbackA = jest.fn(() => {
@@ -421,7 +421,7 @@ describe('ScheduleDOM', () => {
421 *
422 */
423 it('still calls all callbacks within same frame', () => {
424 - const {unstable_scheduleWork: scheduleWork} = Schedule;
424 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
425 const callbackLog = [];
426 const callbackA = jest.fn(() => callbackLog.push('A'));
427 const callbackB = jest.fn(() => {
@@ -467,7 +467,7 @@ describe('ScheduleDOM', () => {
467 *
468 */
469 it('and with some timed out callbacks, still calls all callbacks within same frame', () => {
470 - const {unstable_scheduleWork: scheduleWork} = Schedule;
470 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
471 const callbackLog = [];
472 const callbackA = jest.fn(() => {
473 callbackLog.push('A');
@@ -513,7 +513,7 @@ describe('ScheduleDOM', () => {
513 *
514 */
515 it('still calls all callbacks within same frame', () => {
516 - const {unstable_scheduleWork: scheduleWork} = Schedule;
516 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
517 const callbackLog = [];
518 const callbackA = jest.fn(() => {
519 callbackLog.push('A');
@@ -574,7 +574,7 @@ describe('ScheduleDOM', () => {
574 *
575 */
576 it('and with all timed out callbacks, still calls all callbacks within same frame', () => {
577 - const {unstable_scheduleWork: scheduleWork} = Schedule;
577 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
578 const callbackLog = [];
579 const callbackA = jest.fn(() => {
580 callbackLog.push('A');
@@ -655,7 +655,7 @@ describe('ScheduleDOM', () => {
655 *
656 */
657 it('still calls all callbacks within same frame', () => {
658 - const {unstable_scheduleWork: scheduleWork} = Schedule;
658 + const {unstable_scheduleWork: scheduleWork} = Scheduler;
659 startOfLatestFrame = 1000000000000;
660 currentTime = startOfLatestFrame - 10;
661 catchPostMessageErrors = true;
packages/scheduler/src/__tests__/SchedulerUMDBundle-test.internal.js renamed
+8 -8
@@ -35,29 +35,29 @@ describe('Scheduling UMD bundle', () => {
35
36 it('should define the same scheduling API', () => {
37 const api = require('../../index');
38 - const umdAPIDev = require('../../npm/umd/schedule.development');
39 - const umdAPIProd = require('../../npm/umd/schedule.production.min');
40 - const umdAPIProfiling = require('../../npm/umd/schedule.profiling.min');
38 + const umdAPIDev = require('../../npm/umd/scheduler.development');
39 + const umdAPIProd = require('../../npm/umd/scheduler.production.min');
40 + const umdAPIProfiling = require('../../npm/umd/scheduler.profiling.min');
41 const secretAPI = require('react/src/ReactSharedInternals').default;
42 validateForwardedAPIs(api, [
43 umdAPIDev,
44 umdAPIProd,
45 umdAPIProfiling,
46 - secretAPI.Schedule,
46 + secretAPI.Scheduler,
47 ]);
48 });
49
50 it('should define the same tracing API', () => {
51 const api = require('../../tracing');
52 - const umdAPIDev = require('../../npm/umd/schedule-tracing.development');
53 - const umdAPIProd = require('../../npm/umd/schedule-tracing.production.min');
54 - const umdAPIProfiling = require('../../npm/umd/schedule-tracing.profiling.min');
52 + const umdAPIDev = require('../../npm/umd/scheduler-tracing.development');
53 + const umdAPIProd = require('../../npm/umd/scheduler-tracing.production.min');
54 + const umdAPIProfiling = require('../../npm/umd/scheduler-tracing.profiling.min');
55 const secretAPI = require('react/src/ReactSharedInternals').default;
56 validateForwardedAPIs(api, [
57 umdAPIDev,
58 umdAPIProd,
59 umdAPIProfiling,
60 - secretAPI.ScheduleTracing,
60 + secretAPI.SchedulerTracing,
61 ]);
62 });
63 });
packages/scheduler/src/__tests__/Tracing-test.internal.js renamed
+1 -1
@@ -29,7 +29,7 @@ describe('Tracing', () => {
29 ReactFeatureFlags = require('shared/ReactFeatureFlags');
30 ReactFeatureFlags.enableSchedulerTracing = enableSchedulerTracing;
31
32 - SchedulerTracing = require('schedule/tracing');
32 + SchedulerTracing = require('scheduler/tracing');
33 }
34
35 describe('enableSchedulerTracing enabled', () => {
packages/scheduler/src/__tests__/Tracing-test.js renamed
+1 -1
@@ -14,7 +14,7 @@ describe('Tracing', () => {
14 beforeEach(() => {
15 jest.resetModules();
16
17 - SchedulerTracing = require('schedule/tracing');
17 + SchedulerTracing = require('scheduler/tracing');
18 });
19
20 it('should return the value of a traced function', () => {
packages/scheduler/src/__tests__/TracingSubscriptions-test.internal.js renamed
+1 -1
@@ -42,7 +42,7 @@ describe('TracingSubscriptions', () => {
42 ReactFeatureFlags = require('shared/ReactFeatureFlags');
43 ReactFeatureFlags.enableSchedulerTracing = enableSchedulerTracing;
44
45 - SchedulerTracing = require('schedule/tracing');
45 + SchedulerTracing = require('scheduler/tracing');
46
47 throwInOnInteractionScheduledWorkCompleted = false;
48 throwInOnInteractionTraced = false;
packages/scheduler/tracing.js renamed
packages/shared/forks/Scheduler.umd.js renamed
+1 -1
@@ -15,6 +15,6 @@ const {
15 unstable_cancelScheduledWork,
16 unstable_now,
17 unstable_scheduleWork,
18 -} = ReactInternals.Schedule;
18 +} = ReactInternals.Scheduler;
19
20 export {unstable_cancelScheduledWork, unstable_now, unstable_scheduleWork};
packages/shared/forks/SchedulerTracing.umd.js renamed
+1 -1
@@ -21,7 +21,7 @@ const {
21 unstable_trace,
22 unstable_unsubscribe,
23 unstable_wrap,
24 -} = ReactInternals.ScheduleTracing;
24 +} = ReactInternals.SchedulerTracing;
25
26 export {
27 __interactionsRef,
scripts/rollup/bundles.js
+6 -6
@@ -385,16 +385,16 @@ const bundles = [
385
386 /******* React Scheduler (experimental) *******/
387 {
388 - label: 'schedule',
388 + label: 'scheduler',
389 bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV, FB_WWW_PROD],
390 moduleType: ISOMORPHIC,
391 - entry: 'schedule',
392 - global: 'Schedule',
391 + entry: 'scheduler',
392 + global: 'Scheduler',
393 externals: [],
394 },
395
396 {
397 - label: 'schedule-tracing',
397 + label: 'scheduler-tracing',
398 bundleTypes: [
399 FB_WWW_DEV,
400 FB_WWW_PROD,
@@ -404,8 +404,8 @@ const bundles = [
404 NODE_PROFILING,
405 ],
406 moduleType: ISOMORPHIC,
407 - entry: 'schedule/tracing',
408 - global: 'ScheduleTracing',
407 + entry: 'scheduler/tracing',
408 + global: 'SchedulerTracing',
409 externals: [],
410 },
411 ];
scripts/rollup/forks.js
+4 -4
@@ -119,7 +119,7 @@ const forks = Object.freeze({
119 return null;
120 },
121
122 - schedule: (bundleType, entry, dependencies) => {
122 + scheduler: (bundleType, entry, dependencies) => {
123 switch (bundleType) {
124 case UMD_DEV:
125 case UMD_PROD:
@@ -131,14 +131,14 @@ const forks = Object.freeze({
131 }
132 // Optimization: for UMDs, use the API that is already a part of the React
133 // package instead of requiring it to be loaded via a separate <script> tag
134 - return 'shared/forks/Schedule.umd.js';
134 + return 'shared/forks/Scheduler.umd.js';
135 default:
136 // For other bundles, use the shared NPM package.
137 return null;
138 }
139 },
140
141 - 'schedule/tracing': (bundleType, entry, dependencies) => {
141 + 'scheduler/tracing': (bundleType, entry, dependencies) => {
142 switch (bundleType) {
143 case UMD_DEV:
144 case UMD_PROD:
@@ -150,7 +150,7 @@ const forks = Object.freeze({
150 }
151 // Optimization: for UMDs, use the API that is already a part of the React
152 // package instead of requiring it to be loaded via a separate <script> tag
153 - return 'shared/forks/ScheduleTracing.umd.js';
153 + return 'shared/forks/SchedulerTracing.umd.js';
154 default:
155 // For other bundles, use the shared NPM package.
156 return null;
scripts/rollup/modules.js
+4 -4
@@ -15,16 +15,16 @@ const HAS_NO_SIDE_EFFECTS_ON_IMPORT = false;
15 const importSideEffects = Object.freeze({
16 'prop-types/checkPropTypes': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
17 deepFreezeAndThrowOnMutationInDev: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
18 - schedule: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
19 - 'schedule/tracing': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
18 + scheduler: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
19 + 'scheduler/tracing': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
20 });
21
22 // Bundles exporting globals that other modules rely on.
23 const knownGlobals = Object.freeze({
24 react: 'React',
25 'react-dom': 'ReactDOM',
26 - schedule: 'Schedule',
27 - 'schedule/tracing': 'ScheduleTracing',
26 + scheduler: 'Scheduler',
27 + 'scheduler/tracing': 'SchedulerTracing',
28 });
29
30 // Given ['react'] in bundle externals, returns { 'react': 'React' }.
scripts/rollup/results.json
+36 -36
@@ -659,30 +659,30 @@
659 "gzip": 1013
660 },
661 {
662 - "filename": "schedule.development.js",
662 + "filename": "scheduler.development.js",
663 "bundleType": "UMD_DEV",
664 - "packageName": "schedule",
664 + "packageName": "scheduler",
665 "size": 19628,
666 "gzip": 5881
667 },
668 {
669 - "filename": "schedule.production.min.js",
669 + "filename": "scheduler.production.min.js",
670 "bundleType": "UMD_PROD",
671 - "packageName": "schedule",
671 + "packageName": "scheduler",
672 "size": 3233,
673 "gzip": 1562
674 },
675 {
676 - "filename": "schedule.development.js",
676 + "filename": "scheduler.development.js",
677 "bundleType": "NODE_DEV",
678 - "packageName": "schedule",
678 + "packageName": "scheduler",
679 "size": 14175,
680 "gzip": 4343
681 },
682 {
683 - "filename": "schedule.production.min.js",
683 + "filename": "scheduler.production.min.js",
684 "bundleType": "NODE_PROD",
685 - "packageName": "schedule",
685 + "packageName": "scheduler",
686 "size": 3260,
687 "gzip": 1428
688 },
@@ -736,16 +736,16 @@
736 "gzip": 36778
737 },
738 {
739 - "filename": "Schedule-dev.js",
739 + "filename": "Scheduler-dev.js",
740 "bundleType": "FB_WWW_DEV",
741 - "packageName": "schedule",
741 + "packageName": "scheduler",
742 "size": 14361,
743 "gzip": 4374
744 },
745 {
746 - "filename": "Schedule-prod.js",
746 + "filename": "Scheduler-prod.js",
747 "bundleType": "FB_WWW_PROD",
748 - "packageName": "schedule",
748 + "packageName": "scheduler",
749 "size": 8327,
750 "gzip": 2105
751 },
@@ -785,44 +785,44 @@
785 "gzip": 36760
786 },
787 {
788 - "filename": "schedule-tracking.development.js",
788 + "filename": "scheduler-tracking.development.js",
789 "bundleType": "NODE_DEV",
790 - "packageName": "schedule",
790 + "packageName": "scheduler",
791 "size": 10514,
792 "gzip": 2411
793 },
794 {
795 - "filename": "schedule-tracking.production.min.js",
795 + "filename": "scheduler-tracking.production.min.js",
796 "bundleType": "NODE_PROD",
797 - "packageName": "schedule",
797 + "packageName": "scheduler",
798 "size": 719,
799 "gzip": 374
800 },
801 {
802 - "filename": "schedule-tracking.profiling.min.js",
802 + "filename": "scheduler-tracking.profiling.min.js",
803 "bundleType": "NODE_PROFILING",
804 - "packageName": "schedule",
804 + "packageName": "scheduler",
805 "size": 3337,
806 "gzip": 992
807 },
808 {
809 - "filename": "ScheduleTracking-dev.js",
809 + "filename": "SchedulerTracking-dev.js",
810 "bundleType": "FB_WWW_DEV",
811 - "packageName": "schedule",
811 + "packageName": "scheduler",
812 "size": 10608,
813 "gzip": 2330
814 },
815 {
816 - "filename": "ScheduleTracking-prod.js",
816 + "filename": "SchedulerTracking-prod.js",
817 "bundleType": "FB_WWW_PROD",
818 - "packageName": "schedule",
818 + "packageName": "scheduler",
819 "size": 899,
820 "gzip": 425
821 },
822 {
823 - "filename": "ScheduleTracking-profiling.js",
823 + "filename": "SchedulerTracking-profiling.js",
824 "bundleType": "FB_WWW_PROFILING",
825 - "packageName": "schedule",
825 + "packageName": "scheduler",
826 "size": 6984,
827 "gzip": 1258
828 },
@@ -841,44 +841,44 @@
841 "gzip": 31534
842 },
843 {
844 - "filename": "schedule-tracing.development.js",
844 + "filename": "scheduler-tracing.development.js",
845 "bundleType": "NODE_DEV",
846 - "packageName": "schedule",
846 + "packageName": "scheduler",
847 "size": 10496,
848 "gzip": 2410
849 },
850 {
851 - "filename": "schedule-tracing.production.min.js",
851 + "filename": "scheduler-tracing.production.min.js",
852 "bundleType": "NODE_PROD",
853 - "packageName": "schedule",
853 + "packageName": "scheduler",
854 "size": 718,
855 "gzip": 374
856 },
857 {
858 - "filename": "schedule-tracing.profiling.min.js",
858 + "filename": "scheduler-tracing.profiling.min.js",
859 "bundleType": "NODE_PROFILING",
860 - "packageName": "schedule",
860 + "packageName": "scheduler",
861 "size": 3333,
862 "gzip": 991
863 },
864 {
865 - "filename": "ScheduleTracing-dev.js",
865 + "filename": "SchedulerTracing-dev.js",
866 "bundleType": "FB_WWW_DEV",
867 - "packageName": "schedule",
867 + "packageName": "scheduler",
868 "size": 10591,
869 "gzip": 2327
870 },
871 {
872 - "filename": "ScheduleTracing-prod.js",
872 + "filename": "SchedulerTracing-prod.js",
873 "bundleType": "FB_WWW_PROD",
874 - "packageName": "schedule",
874 + "packageName": "scheduler",
875 "size": 899,
876 "gzip": 425
877 },
878 {
879 - "filename": "ScheduleTracing-profiling.js",
879 + "filename": "SchedulerTracing-profiling.js",
880 "bundleType": "FB_WWW_PROFILING",
881 - "packageName": "schedule",
881 + "packageName": "scheduler",
882 "size": 6979,
883 "gzip": 1257
884 }