Skip to content

Commit

Permalink
Clean up Scheduler forks
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Mar 2, 2021
1 parent d857f9e commit 4e91985
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 1,508 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/react", "packages/react-dom", "packages/scheduler"],
"buildCommand": "build --type=NODE react/index,react-dom/index,react-dom/server,react-dom/test-utils,scheduler/index,scheduler/unstable_no_dom,scheduler/tracing,react/jsx-runtime,react/jsx-dev-runtime",
"buildCommand": "build --type=NODE react/index,react-dom/index,react-dom/server,react-dom/test-utils,scheduler/index,scheduler/tracing,react/jsx-runtime,react/jsx-dev-runtime",
"publishDirectory": {
"react": "build/node_modules/react",
"react-dom": "build/node_modules/react-dom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function unmount(dom) {

beforeEach(() => {
jest.resetModules();
jest.mock('scheduler', () =>
require.requireActual('scheduler/unstable_no_dom'),
);
jest.unmock('scheduler');
yields = [];
React = require('react');
ReactDOM = require('react-dom');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function App() {

beforeEach(() => {
jest.resetModules();
jest.mock('scheduler', () => require('scheduler/unstable_no_dom'));
jest.unmock('scheduler');
React = require('react');
ReactDOM = require('react-dom');
ReactFeatureFlags = require('shared/ReactFeatureFlags');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ function App() {

beforeEach(() => {
jest.resetModules();
jest.mock('scheduler', () =>
require.requireActual('scheduler/unstable_no_dom'),
);
jest.unmock('scheduler');
React = require('react');
ReactDOM = require('react-dom');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/scheduler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

'use strict';

export * from './src/forks/SchedulerDOM';
export * from './src/forks/Scheduler';
4 changes: 1 addition & 3 deletions packages/scheduler/npm/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

if (typeof window === 'undefined' || typeof MessageChannel !== 'function') {
module.exports = require('./unstable_no_dom');
} else if (process.env.NODE_ENV === 'production') {
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/scheduler.production.min.js');
} else {
module.exports = require('./cjs/scheduler.development.js');
Expand Down
7 changes: 0 additions & 7 deletions packages/scheduler/npm/unstable_no_dom.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/scheduler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"tracing.js",
"tracing-profiling.js",
"unstable_mock.js",
"unstable_no_dom.js",
"unstable_post_task.js",
"cjs/",
"umd/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ let NormalPriority;
describe('SchedulerBrowser', () => {
beforeEach(() => {
jest.resetModules();

// Un-mock scheduler
jest.mock('scheduler', () => require.requireActual('scheduler'));
jest.unmock('scheduler');

runtime = installMockBrowserRuntime();
performance = global.performance;
Expand Down Expand Up @@ -71,11 +69,6 @@ describe('SchedulerBrowser', () => {
const window = {};
global.window = window;

// TODO: Scheduler no longer requires these methods to be polyfilled. But
// maybe we want to continue warning if they don't exist, to preserve the
// option to rely on it in the future?
window.requestAnimationFrame = window.cancelAnimationFrame = () => {};

window.setTimeout = (cb, delay) => {
const id = timerIDCounter++;
log(`Set Timer`);
Expand Down
2 changes: 0 additions & 2 deletions packages/scheduler/src/__tests__/SchedulerPostTask-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ let IdlePriority;
describe('SchedulerPostTask', () => {
beforeEach(() => {
jest.resetModules();

// Un-mock scheduler
jest.mock('scheduler', () =>
require.requireActual('scheduler/unstable_post_task'),
);
Expand Down
275 changes: 0 additions & 275 deletions packages/scheduler/src/__tests__/SchedulerPostTaskOnly-test.js

This file was deleted.

Loading

0 comments on commit 4e91985

Please sign in to comment.