Skip to content

Commit

Permalink
Remove unnecessary ReactMutableSource fork
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed May 8, 2020
1 parent 6abeb5b commit a110dc2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 54 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOMRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export type RootOptions = {
...
};

import {findHostInstanceWithNoPortals} from 'react-reconciler/src/ReactFiberReconciler';
import {registerMutableSourceForHydration} from 'react-reconciler/src/ReactMutableSource';
import {
isContainerMarkedAsRoot,
markContainerAsRoot,
Expand All @@ -48,6 +46,8 @@ import {ensureListeningTo} from './ReactDOMComponent';
import {
createContainer,
updateContainer,
findHostInstanceWithNoPortals,
registerMutableSourceForHydration,
} from 'react-reconciler/src/ReactFiberReconciler';
import invariant from 'shared/invariant';
import {
Expand Down
6 changes: 6 additions & 0 deletions packages/react-reconciler/src/ReactFiberReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
findBoundingRects as findBoundingRects_old,
focusWithin as focusWithin_old,
observeVisibleRects as observeVisibleRects_old,
registerMutableSourceForHydration as registerMutableSourceForHydration_old,
} from './ReactFiberReconciler.old';

import {
Expand Down Expand Up @@ -86,6 +87,7 @@ import {
findBoundingRects as findBoundingRects_new,
focusWithin as focusWithin_new,
observeVisibleRects as observeVisibleRects_new,
registerMutableSourceForHydration as registerMutableSourceForHydration_new,
} from './ReactFiberReconciler.new';

export const createContainer = enableNewReconciler
Expand Down Expand Up @@ -186,3 +188,7 @@ export const focusWithin = enableNewReconciler
export const observeVisibleRects = enableNewReconciler
? observeVisibleRects_new
: observeVisibleRects_old;

export const registerMutableSourceForHydration = enableNewReconciler
? registerMutableSourceForHydration_new
: registerMutableSourceForHydration_old;
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberReconciler.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import {
findHostInstancesForRefresh,
} from './ReactFiberHotReloading.new';

export {registerMutableSourceForHydration} from './ReactMutableSource.new';
export {createPortal} from './ReactPortal';
export {
createComponentSelector,
Expand Down
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberReconciler.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import {
findHostInstancesForRefresh,
} from './ReactFiberHotReloading.old';

export {registerMutableSourceForHydration} from './ReactMutableSource.old';
export {createPortal} from './ReactPortal';
export {
createComponentSelector,
Expand Down
24 changes: 0 additions & 24 deletions packages/react-reconciler/src/ReactMutableSource.js

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/jest/setupHostConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ jest.mock('react-reconciler/src/ReactFiberReconciler', () => {
);
});

jest.mock('react-reconciler/src/ReactMutableSource', () => {
return require.requireActual(
__VARIANT__
? 'react-reconciler/src/ReactMutableSource.new'
: 'react-reconciler/src/ReactMutableSource.old'
);
});

// When testing the custom renderer code path through `react-reconciler`,
// turn the export into a function, and use the argument as host config.
const shimHostConfigPath = 'react-reconciler/src/ReactFiberHostConfig';
Expand Down
20 changes: 0 additions & 20 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,26 +280,6 @@ const forks = Object.freeze({
return 'react-reconciler/src/ReactFiberReconciler.old.js';
},

'react-reconciler/src/ReactMutableSource': (
bundleType,
entry,
dependencies,
moduleType,
bundle
) => {
if (bundle.enableNewReconciler) {
switch (bundleType) {
case FB_WWW_DEV:
case FB_WWW_PROD:
case FB_WWW_PROFILING:
// Use the forked version of the reconciler
return 'react-reconciler/src/ReactMutableSource.new.js';
}
}
// Otherwise, use the non-forked version.
return 'react-reconciler/src/ReactMutableSource.old.js';
},

'react-reconciler/src/ReactFiberHotReloading': (
bundleType,
entry,
Expand Down

0 comments on commit a110dc2

Please sign in to comment.