Skip to content

Commit 79fc2e8

Browse files
committed
Set up infra for react-reconciler fork
We're planning to land some significant refactors of the reconciler. We want to be able to gradually roll out the new implementation side-by- side with the existing one. So we'll create a short-lived fork of the react-reconciler package. Once the new implementation has stablized, we'll delete the old implementation and promote the new one. This means, for as long as the fork exists, we'll need to maintain two separate implementations. This sounds painful, but since the forks will still be largely the same, most changes will not require two separate implementations. In practice, you'll implement the change in the old fork and then copy paste it to the new one. This commit only sets up the build and testing infrastructure. It does not actually fork any modules. I'll do that in subsequent PRs. The forked version of the reconciler will be used to build a special version of React DOM. I've called this build ReactDOMForked. It's only built for www; there's no open source version. The new reconciler is disabled by default. It's enabled in the `yarn test-www-variant` command. The reconciler fork isn't really related to the "variant" feature of the www builds, but I'm piggy backing on that concept to avoid having to add yet another testing dimension.
1 parent 8b155d2 commit 79fc2e8

15 files changed

+923
-720
lines changed

packages/react-reconciler/src/ReactFiberReconciler.js

Lines changed: 126 additions & 714 deletions
Large diffs are not rendered by default.

packages/react-reconciler/src/ReactFiberReconciler.old.js

Lines changed: 727 additions & 0 deletions
Large diffs are not rendered by default.

packages/shared/ReactFeatureFlags.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export const warnAboutSpreadingKeyToJSX = false;
111111
// Internal-only attempt to debug a React Native issue. See D20130868.
112112
export const throwEarlyForMysteriousError = false;
113113

114+
export const enableNewReconciler = false;
115+
114116
// --------------------------
115117
// Future APIs to be deprecated
116118
// --------------------------

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const enableLegacyFBPrimerSupport = false;
5252
// Internal-only attempt to debug a React Native issue. See D20130868.
5353
export const throwEarlyForMysteriousError = true;
5454

55+
export const enableNewReconciler = false;
56+
5557
// Only used in www builds.
5658
export function addUserTimingListener() {
5759
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const enableLegacyFBPrimerSupport = false;
5151
// Internal-only attempt to debug a React Native issue. See D20130868.
5252
export const throwEarlyForMysteriousError = false;
5353

54+
export const enableNewReconciler = false;
55+
5456
// Only used in www builds.
5557
export function addUserTimingListener() {
5658
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const enableLegacyFBPrimerSupport = false;
5151
// Internal-only attempt to debug a React Native issue. See D20130868.
5252
export const throwEarlyForMysteriousError = false;
5353

54+
export const enableNewReconciler = false;
55+
5456
// Only used in www builds.
5557
export function addUserTimingListener() {
5658
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const enableLegacyFBPrimerSupport = false;
5151
// Internal-only attempt to debug a React Native issue. See D20130868.
5252
export const throwEarlyForMysteriousError = false;
5353

54+
export const enableNewReconciler = false;
55+
5456
// Only used in www builds.
5557
export function addUserTimingListener() {
5658
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.testing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const enableLegacyFBPrimerSupport = false;
5151
// Internal-only attempt to debug a React Native issue. See D20130868.
5252
export const throwEarlyForMysteriousError = false;
5353

54+
export const enableNewReconciler = false;
55+
5456
// Only used in www builds.
5557
export function addUserTimingListener() {
5658
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.testing.www.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const enableLegacyFBPrimerSupport = !__EXPERIMENTAL__;
5151
// Internal-only attempt to debug a React Native issue. See D20130868.
5252
export const throwEarlyForMysteriousError = false;
5353

54+
export const enableNewReconciler = false;
55+
5456
// Only used in www builds.
5557
export function addUserTimingListener() {
5658
invariant(false, 'Not implemented.');

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ export const enableLegacyFBPrimerSupport = !__EXPERIMENTAL__;
109109
// Internal-only attempt to debug a React Native issue. See D20130868.
110110
export const throwEarlyForMysteriousError = false;
111111

112+
// Enable forked reconciler. Piggy-backing on the "variant" global so that we
113+
// don't have to add another test dimension. The build system will compile this
114+
// to the correct value.
115+
export const enableNewReconciler = __VARIANT__;
116+
112117
// Flow magic to verify the exports of this file match the original version.
113118
// eslint-disable-next-line no-unused-vars
114119
type Check<_X, Y: _X, X: Y = _X> = null;

0 commit comments

Comments
 (0)