Skip to content

Commit

Permalink
Remove Reconciler fork (1/2) (#25774)
Browse files Browse the repository at this point in the history
We've heard from multiple contributors that the Reconciler forking
mechanism was confusing and/or annoying to deal with. Since it's
currently unused and there's no immediate plans to start using it again,
this removes the forking.

Fully removing the fork is split into 2 steps to preserve file history:

**This PR**
- remove `enableNewReconciler` feature flag.
- remove `unstable_isNewReconciler` export
- remove eslint rules for cross fork imports
- remove `*.new.js` files and update imports
- merge non-suffixed files into `*.old` files where both exist
(sometimes types were defined there)

**#25775**
- rename `*.old` files
  • Loading branch information
kassens committed Dec 2, 2022
1 parent 030dae2 commit 420f0b7
Show file tree
Hide file tree
Showing 110 changed files with 71 additions and 33,065 deletions.
34 changes: 0 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,35 +462,6 @@ jobs:
cp ./scripts/release/ci-npmrc ~/.npmrc
scripts/release/publish.js --ci --tags << parameters.dist_tag >>
# We don't always keep the reconciler forks in sync (otherwise it we wouldn't
# have forked it) but during periods when they are meant to be in sync, we
# use this job to confirm there are no differences.
sync_reconciler_forks:
docker: *docker
environment: *environment
steps:
- checkout
- *restore_node_modules
- run:
name: Fetch revisions that contain an intentional fork
# This will fetch each revision listed in the `forked-revisions` file,
# which may be necessary if it's not part of main. For example, it
# may have been part of a PR branch that was squashed on merge.
command: |
cut -d " " -f 1 scripts/merge-fork/forked-revisions | xargs -r git fetch origin
- run:
name: Revert forked revisions
# This will revert the changes without committing. At the end, it's
# expected that both forks will be identical.
command: |
cut -d " " -f 1 scripts/merge-fork/forked-revisions | xargs -r git revert --no-commit
- run:
name: Confirm reconciler forks are the same
command: |
yarn replace-fork
git diff --quiet || (echo "Reconciler forks are not the same! Run yarn replace-fork. Or, if this was intentional, add the commit SHA to scripts/merge-fork/forked-revisions." && false)
workflows:
version: 2

Expand All @@ -506,11 +477,6 @@ workflows:
- yarn_flow:
requires:
- setup
# NOTE: This job is only enabled when we want the forks to be in sync.
# When the forks intentionally diverge, comment out the job to disable it.
- sync_reconciler_forks:
requires:
- setup
- check_generated_fizz_runtime:
requires:
- setup
Expand Down
8 changes: 0 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ module.exports = {
'react-internal/no-to-warn-dev-within-to-throw': ERROR,
'react-internal/warning-args': ERROR,
'react-internal/no-production-logging': ERROR,
'react-internal/no-cross-fork-imports': ERROR,
'react-internal/no-cross-fork-types': [
ERROR,
{
old: [],
new: [],
},
],
},

overrides: [
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@
"prettier": "node ./scripts/prettier/index.js write-changed",
"prettier-all": "node ./scripts/prettier/index.js write",
"version-check": "node ./scripts/tasks/version-check.js",
"merge-fork": "node ./scripts/merge-fork/merge-fork.js",
"replace-fork": "node ./scripts/merge-fork/replace-fork.js",
"publish-prereleases": "node ./scripts/release/publish-using-ci-workflow.js",
"download-build": "node ./scripts/release/download-experimental-build.js",
"download-build-for-head": "node ./scripts/release/download-experimental-build.js --commit=$(git rev-parse HEAD)",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-art/src/ReactART.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createContainer,
updateContainer,
injectIntoDevTools,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
import Transform from 'art/core/transform';
import Mode from 'art/modes/current';
import FastNoSideEffects from 'art/modes/fast-noSideEffects';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Mode from 'art/modes/current';

import {TYPES, EVENT_TYPES, childrenAsString} from './ReactARTInternals';

import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities';
import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities.old';

const pooledTransform = new Transform();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
markNodeAsResource,
} from './ReactDOMComponentTree';
import {HTML_NAMESPACE, SVG_NAMESPACE} from '../shared/DOMNamespaces';
import {getCurrentRootHostContainer} from 'react-reconciler/src/ReactFiberHostContext';
import {getCurrentRootHostContainer} from 'react-reconciler/src/ReactFiberHostContext.old';

// The resource types we support. currently they match the form for the as argument.
// In the future this may need to change, especially when modules / scripts are supported
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom-bindings/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities.old';
import type {DOMEventName} from '../events/DOMEventNames';
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {
Expand Down Expand Up @@ -81,7 +81,7 @@ import {
} from 'react-reconciler/src/ReactWorkTags';
import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem';

import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities';
import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities.old';

// TODO: Remove this deep import when we delete the legacy root API
import {ConcurrentMode, NoMode} from 'react-reconciler/src/ReactTypeOfMode';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities.old';
import type {AnyNativeEvent} from '../events/PluginModuleType';
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
Expand Down Expand Up @@ -52,7 +52,7 @@ import {
IdleEventPriority,
getCurrentUpdatePriority,
setCurrentUpdatePriority,
} from 'react-reconciler/src/ReactEventPriorities';
} from 'react-reconciler/src/ReactEventPriorities.old';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMEventName} from '../events/DOMEventNames';
import type {EventSystemFlags} from './EventSystemFlags';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities.old';

import {enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay} from 'shared/ReactFeatureFlags';
import {
Expand All @@ -35,7 +35,7 @@ import {
getClosestInstanceFromNode,
} from '../client/ReactDOMComponentTree';
import {HostRoot, SuspenseComponent} from 'react-reconciler/src/ReactWorkTags';
import {isHigherEventPriority} from 'react-reconciler/src/ReactEventPriorities';
import {isHigherEventPriority} from 'react-reconciler/src/ReactEventPriorities.old';
import {isRootDehydrated} from 'react-reconciler/src/ReactFiberShellHydration';

let _attemptSynchronousHydration: (fiber: Object) => void;
Expand Down
1 change: 0 additions & 1 deletion packages/react-dom/index.classic.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export {
unstable_batchedUpdates,
unstable_createEventHandle,
unstable_flushControlled,
unstable_isNewReconciler,
unstable_renderSubtreeIntoContainer,
unstable_runWithPriority, // DO NOT USE: Temporarily exposed to migrate off of Scheduler.runWithPriority.
preinit,
Expand Down
1 change: 0 additions & 1 deletion packages/react-dom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export {
unstable_batchedUpdates,
unstable_createEventHandle,
unstable_flushControlled,
unstable_isNewReconciler,
unstable_renderSubtreeIntoContainer,
unstable_runWithPriority, // DO NOT USE: Temporarily exposed to migrate off of Scheduler.runWithPriority.
preinit,
Expand Down
1 change: 0 additions & 1 deletion packages/react-dom/index.modern.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export {
unstable_batchedUpdates,
unstable_createEventHandle,
unstable_flushControlled,
unstable_isNewReconciler,
unstable_runWithPriority, // DO NOT USE: Temporarily exposed to migrate off of Scheduler.runWithPriority.
preinit,
preload,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('react-dom-server-rendering-stub', () => {
expect(ReactDOM.unstable_batchedUpdates).toBe(undefined);
expect(ReactDOM.unstable_createEventHandle).toBe(undefined);
expect(ReactDOM.unstable_flushControlled).toBe(undefined);
expect(ReactDOM.unstable_isNewReconciler).toBe(undefined);
expect(ReactDOM.unstable_renderSubtreeIntoContainer).toBe(undefined);
expect(ReactDOM.unstable_runWithPriority).toBe(undefined);
});
Expand Down
7 changes: 2 additions & 5 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ import {
attemptDiscreteHydration,
attemptContinuousHydration,
attemptHydrationAtCurrentPriority,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
import {
runWithPriority,
getCurrentUpdatePriority,
} from 'react-reconciler/src/ReactEventPriorities';
} from 'react-reconciler/src/ReactEventPriorities.old';
import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
import {canUseDOM} from 'shared/ExecutionEnvironment';
import ReactVersion from 'shared/ReactVersion';
import {enableNewReconciler} from 'shared/ReactFeatureFlags';

import {
getClosestInstanceFromNode,
Expand Down Expand Up @@ -256,5 +255,3 @@ if (__DEV__) {
}
}
}

export const unstable_isNewReconciler = enableNewReconciler;
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMLegacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
getPublicRootInstance,
findHostInstance,
findHostInstanceWithWarning,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
import getComponentNameFromType from 'shared/getComponentNameFromType';
import ReactSharedInternals from 'shared/ReactSharedInternals';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import {
registerMutableSourceForHydration,
flushSync,
isAlreadyRendering,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
import {ConcurrentRoot} from 'react-reconciler/src/ReactRootTags';

/* global reportError */
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/unstable_testing.classic.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export {
findBoundingRects,
focusWithin,
observeVisibleRects,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
2 changes: 1 addition & 1 deletion packages/react-dom/unstable_testing.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export {
findBoundingRects,
focusWithin,
observeVisibleRects,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
2 changes: 1 addition & 1 deletion packages/react-dom/unstable_testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export {
findBoundingRects,
focusWithin,
observeVisibleRects,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
2 changes: 1 addition & 1 deletion packages/react-dom/unstable_testing.modern.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export {
findBoundingRects,
focusWithin,
observeVisibleRects,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
updateContainer,
injectIntoDevTools,
getPublicRootInstance,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';

import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
import {setBatchingImplementation} from './legacy-events/ReactGenericBatching';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {dispatchEvent} from './ReactFabricEventEmitter';
import {
DefaultEventPriority,
DiscreteEventPriority,
} from 'react-reconciler/src/ReactEventPriorities';
} from 'react-reconciler/src/ReactEventPriorities.old';

// Modules provided by RN:
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from './ReactNativeComponentTree';
import ReactNativeFiberHostComponent from './ReactNativeFiberHostComponent';

import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities';
import {DefaultEventPriority} from 'react-reconciler/src/ReactEventPriorities.old';

const {get: getViewConfigForType} = ReactNativeViewConfigRegistry;

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactNativeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
updateContainer,
injectIntoDevTools,
getPublicRootInstance,
} from 'react-reconciler/src/ReactFiberReconciler';
} from 'react-reconciler/src/ReactFiberReconciler.old';
// TODO: direct imports like some-package/src/* are bad. Fix me.
import {getStackByFiberInDevAndProd} from 'react-reconciler/src/ReactFiberComponentStack';
import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
Fiber,
TransitionTracingCallbacks,
} from 'react-reconciler/src/ReactInternalTypes';
import type {UpdateQueue} from 'react-reconciler/src/ReactFiberClassUpdateQueue.new';
import type {UpdateQueue} from 'react-reconciler/src/ReactFiberClassUpdateQueue';
import type {ReactNodeList} from 'shared/ReactTypes';
import type {RootTag} from 'react-reconciler/src/ReactRootTags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export * from './src/ReactFiberReconciler';
export * from './src/ReactFiberReconciler.old';
Loading

0 comments on commit 420f0b7

Please sign in to comment.