Skip to content

Commit

Permalink
Switch to new ReactFiberScheduler implementation
Browse files Browse the repository at this point in the history
Sets the `enableNewScheduler` feature flag to true.

`yarn test` now runs against the new implementation, so use
`yarn test-old-scheduler` to test the old implementation. Both commands
will run in CI, in case we need to revert.
  • Loading branch information
acdlite committed Mar 23, 2019
1 parent fc0d30e commit e649dbe
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
"test-persistent": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-persistent.js",
"test-fire": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-fire.js",
"test-new-scheduler": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-new-scheduler.js",
"test-old-scheduler": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-old-scheduler.js",
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
"test-fire-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source-fire.js",
"test-prod-build": "yarn test-build-prod",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ export const enableEventAPI = false;

// Enables rewritten version of ReactFiberScheduler. Added in case we need to
// quickly revert it.
export const enableNewScheduler = false;
export const enableNewScheduler = true;
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
export const warnAboutDeprecatedLifecycles = true;
export const warnAboutDeprecatedSetNativeProps = true;
export const enableEventAPI = false;
export const enableNewScheduler = false;
export const enableNewScheduler = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const warnAboutShorthandPropertyCollision = false;
export const enableSchedulerDebugging = false;
export const warnAboutDeprecatedSetNativeProps = false;
export const enableEventAPI = false;
export const enableNewScheduler = false;
export const enableNewScheduler = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.persistent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const warnAboutShorthandPropertyCollision = false;
export const enableSchedulerDebugging = false;
export const warnAboutDeprecatedSetNativeProps = false;
export const enableEventAPI = false;
export const enableNewScheduler = false;
export const enableNewScheduler = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const warnAboutShorthandPropertyCollision = false;
export const enableSchedulerDebugging = false;
export const warnAboutDeprecatedSetNativeProps = false;
export const enableEventAPI = false;
export const enableNewScheduler = false;
export const enableNewScheduler = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const warnAboutDeprecatedSetNativeProps = false;
export const disableJavaScriptURLs = false;
export const disableYielding = false;
export const enableEventAPI = true;
export const enableNewScheduler = false;
export const enableNewScheduler = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const enableSuspenseServerRenderer = true;
// I've chosen to make this a static flag instead of a dynamic flag controlled
// by a GK so that it doesn't increase bundle size. It should still be easy
// to rollback by reverting the commit that turns this on.
export const enableNewScheduler = false;
export const enableNewScheduler = true;

let refCount = 0;
export function addUserTimingListener() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/circleci/test_entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('node ./scripts/tasks/flow-ci')
COMMANDS_TO_RUN+=('node ./scripts/tasks/eslint')
COMMANDS_TO_RUN+=('yarn test --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-new-scheduler --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-old-scheduler --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-persistent --maxWorkers=2')
COMMANDS_TO_RUN+=('./scripts/circleci/check_license.sh')
COMMANDS_TO_RUN+=('./scripts/circleci/check_modules.sh')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const baseConfig = require('./config.base');
module.exports = Object.assign({}, baseConfig, {
setupFiles: [
...baseConfig.setupFiles,
require.resolve('./setupNewScheduler.js'),
require.resolve('./setupOldScheduler.js'),
require.resolve('./setupHostConfigs.js'),
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

jest.mock('shared/ReactFeatureFlags', () => {
const ReactFeatureFlags = require.requireActual('shared/ReactFeatureFlags');
ReactFeatureFlags.enableNewScheduler = true;
ReactFeatureFlags.enableNewScheduler = false;
return ReactFeatureFlags;
});

0 comments on commit e649dbe

Please sign in to comment.