Skip to content

Commit

Permalink
Move ReactWorkTags to the reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 21, 2020
1 parent dd1a013 commit 8d700df
Show file tree
Hide file tree
Showing 36 changed files with 45 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

const {HostComponent} = require('shared/ReactWorkTags');
const {HostComponent} = require('react-reconciler/src/ReactWorkTags');
const {PLUGIN_EVENT_SYSTEM} = require('legacy-events/EventSystemFlags');

let EventBatching;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-debug-tools/src/ReactDebugHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ContextProvider,
ForwardRef,
Block,
} from 'shared/ReactWorkTags';
} from 'react-reconciler/src/ReactWorkTags';

type CurrentDispatcherRef = typeof ReactSharedInternals.ReactCurrentDispatcher;

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMComponentTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
HostText,
HostRoot,
SuspenseComponent,
} from 'shared/ReactWorkTags';
} from 'react-reconciler/src/ReactWorkTags';
import invariant from 'shared/invariant';

import {getParentSuspenseInstance} from './ReactDOMHostConfig';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import {
enableFundamentalAPI,
enableUseEventAPI,
} from 'shared/ReactFeatureFlags';
import {HostComponent} from 'shared/ReactWorkTags';
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';
import {
RESPONDER_EVENT_SYSTEM,
IS_PASSIVE,
Expand Down
6 changes: 5 additions & 1 deletion packages/react-dom/src/events/DOMLegacyEventPluginSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import type {PluginModule} from 'legacy-events/PluginModuleType';
import type {ReactSyntheticEvent} from 'legacy-events/ReactSyntheticEventType';
import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';

import {HostRoot, HostComponent, HostText} from 'shared/ReactWorkTags';
import {
HostRoot,
HostComponent,
HostText,
} from 'react-reconciler/src/ReactWorkTags';
import {IS_FIRST_ANCESTOR} from 'legacy-events/EventSystemFlags';
import {batchedEventUpdates} from 'legacy-events/ReactGenericBatching';
import {runEventsInBatch} from 'legacy-events/EventBatching';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
IS_TARGET_EVENT_ONLY,
} from 'legacy-events/EventSystemFlags';

import {HostRoot, HostPortal} from 'shared/ReactWorkTags';
import {HostRoot, HostPortal} from 'react-reconciler/src/ReactWorkTags';

import {
addTrappedEventListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import {
PASSIVE_NOT_SUPPORTED,
} from 'legacy-events/EventSystemFlags';
import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import {HostComponent, ScopeComponent, HostPortal} from 'shared/ReactWorkTags';
import {
HostComponent,
ScopeComponent,
HostPortal,
} from 'react-reconciler/src/ReactWorkTags';
import type {EventPriority} from 'shared/ReactTypes';
import type {
ReactDOMEventResponder,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/EnterLeaveEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
getClosestInstanceFromNode,
getNodeFromInstance,
} from '../client/ReactDOMComponentTree';
import {HostComponent, HostText} from 'shared/ReactWorkTags';
import {HostComponent, HostText} from 'react-reconciler/src/ReactWorkTags';
import {getNearestMountedFiber} from 'react-reconciler/src/ReactFiberTreeReflection';
import {enableModernEventSystem} from 'shared/ReactFeatureFlags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
getContainerFromFiber,
getSuspenseInstanceFromFiber,
} from 'react-reconciler/src/ReactFiberTreeReflection';
import {HostRoot, SuspenseComponent} from 'shared/ReactWorkTags';
import {HostRoot, SuspenseComponent} from 'react-reconciler/src/ReactWorkTags';
import {
type EventSystemFlags,
PLUGIN_EVENT_SYSTEM,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/ReactDOMEventReplaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
getClosestInstanceFromNode,
} from '../client/ReactDOMComponentTree';
import {unsafeCastDOMTopLevelTypeToString} from 'legacy-events/TopLevelEventTypes';
import {HostRoot, SuspenseComponent} from 'shared/ReactWorkTags';
import {HostRoot, SuspenseComponent} from 'react-reconciler/src/ReactWorkTags';

let attemptSynchronousHydration: (fiber: Object) => void;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {EventSystemFlags} from 'legacy-events/EventSystemFlags';
import type {ReactSyntheticEvent} from 'legacy-events/ReactSyntheticEventType';

import {HostComponent} from 'shared/ReactWorkTags';
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';
import {enableUseEventAPI} from 'shared/ReactFeatureFlags';

import getListener from 'legacy-events/getListener';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/test-utils/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
FunctionComponent,
HostComponent,
HostText,
} from 'shared/ReactWorkTags';
} from 'react-reconciler/src/ReactWorkTags';
import SyntheticEvent from 'legacy-events/SyntheticEvent';
import invariant from 'shared/invariant';
import {ELEMENT_NODE} from '../shared/HTMLNodeType';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
findCurrentFiberUsingSlowPath,
} from 'react-reconciler/src/ReactFiberTreeReflection';
import getComponentName from 'shared/getComponentName';
import {HostComponent} from 'shared/ReactWorkTags';
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';
import invariant from 'shared/invariant';
// Module provided by RN:
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactChildFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
HostPortal,
Fragment,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import invariant from 'shared/invariant';
import {warnAboutStringRefs, enableBlocksAPI} from 'shared/ReactFeatureFlags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactCurrentFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Fragment,
ContextProvider,
ContextConsumer,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import describeComponentFrame from 'shared/describeComponentFrame';
import getComponentName from 'shared/getComponentName';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactDebugFiberPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
ContextConsumer,
Mode,
SuspenseComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';

type MeasurementPhase =
| 'componentWillMount'
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
ReactScope,
} from 'shared/ReactTypes';
import type {RootTag} from 'react-reconciler/src/ReactRootTags';
import type {WorkTag} from 'shared/ReactWorkTags';
import type {WorkTag} from './ReactWorkTags';
import type {TypeOfMode} from './ReactTypeOfMode';
import type {SideEffectTag} from './ReactSideEffectTags';
import type {ExpirationTime} from './ReactFiberExpirationTime';
Expand Down Expand Up @@ -61,7 +61,7 @@ import {
FundamentalComponent,
ScopeComponent,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import getComponentName from 'shared/getComponentName';

import {isDevToolsPresent} from './ReactFiberDevToolsHook';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
FundamentalComponent,
ScopeComponent,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {
NoEffect,
PerformedWork,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
FundamentalComponent,
ScopeComponent,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {
invokeGuardedCallback,
hasCaughtError,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
FundamentalComponent,
ScopeComponent,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {NoMode, BlockingMode} from './ReactTypeOfMode';
import {
Ref,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {StackCursor} from './ReactFiberStack';

import {isFiberMounted} from 'react-reconciler/src/ReactFiberTreeReflection';
import {disableLegacyContext} from 'shared/ReactFeatureFlags';
import {ClassComponent, HostRoot} from 'shared/ReactWorkTags';
import {ClassComponent, HostRoot} from './ReactWorkTags';
import getComponentName from 'shared/getComponentName';
import invariant from 'shared/invariant';
import checkPropTypes from 'shared/checkPropTypes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {NoWork} from './ReactFiberExpirationTime';
import {REACT_RESPONDER_TYPE} from 'shared/ReactSymbols';

import invariant from 'shared/invariant';
import {HostComponent, HostRoot} from 'shared/ReactWorkTags';
import {HostComponent, HostRoot} from './ReactWorkTags';

const emptyObject = {};
const isArray = Array.isArray;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberHotReloading.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
HostRoot,
MemoComponent,
SimpleMemoComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {
REACT_FORWARD_REF_TYPE,
REACT_MEMO_TYPE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
HostText,
HostRoot,
SuspenseComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {Deletion, Placement, Hydrating} from './ReactSideEffectTags';
import invariant from 'shared/invariant';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberNewContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
ContextProvider,
ClassComponent,
DehydratedFragment,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';

import invariant from 'shared/invariant';
import is from 'shared/objectIs';
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberReconciler.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
Container,
PublicInstance,
} from './ReactFiberHostConfig';
import {FundamentalComponent} from 'shared/ReactWorkTags';
import {FundamentalComponent} from './ReactWorkTags';
import type {ReactNodeList} from 'shared/ReactTypes';
import type {ExpirationTime} from './ReactFiberExpirationTime';
import type {
Expand All @@ -34,7 +34,7 @@ import {
ClassComponent,
HostRoot,
SuspenseComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import getComponentName from 'shared/getComponentName';
import invariant from 'shared/invariant';
import ReactSharedInternals from 'shared/ReactSharedInternals';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
SuspenseComponent,
ScopeComponent,
ContextProvider,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {enableScopeAPI} from 'shared/ReactFeatureFlags';

function isFiberSuspenseAndTimedOut(fiber: Fiber): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import type {Fiber} from './ReactFiber';
import type {SuspenseInstance} from './ReactFiberHostConfig';
import type {ExpirationTime} from './ReactFiberExpirationTime';
import {SuspenseComponent, SuspenseListComponent} from 'shared/ReactWorkTags';
import {SuspenseComponent, SuspenseListComponent} from './ReactWorkTags';
import {NoEffect, DidCapture} from './ReactSideEffectTags';
import {
isSuspenseInstancePending,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberThrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
HostRoot,
SuspenseComponent,
IncompleteClassComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {
DidCapture,
Incomplete,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberTreeReflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
HostText,
FundamentalComponent,
SuspenseComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {NoEffect, Placement, Hydrating} from './ReactSideEffectTags';
import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberUnwindWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
ContextProvider,
SuspenseComponent,
SuspenseListComponent,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {DidCapture, NoEffect, ShouldCapture} from './ReactSideEffectTags';
import {enableSuspenseServerRenderer} from 'shared/ReactFeatureFlags';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import {
MemoComponent,
SimpleMemoComponent,
Block,
} from 'shared/ReactWorkTags';
} from './ReactWorkTags';
import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
import {
NoEffect,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactProfilerTimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
enableProfilerTimer,
enableProfilerCommitHooks,
} from 'shared/ReactFeatureFlags';
import {Profiler} from 'shared/ReactWorkTags';
import {Profiler} from './ReactWorkTags';

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactTreeTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {HostComponent} from 'shared/ReactWorkTags';
import {HostComponent} from './ReactWorkTags';

function getParent(inst) {
do {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/react-test-renderer/src/ReactTestRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
Block,
IncompleteClassComponent,
ScopeComponent,
} from 'shared/ReactWorkTags';
} from 'react-reconciler/src/ReactWorkTags';
import invariant from 'shared/invariant';
import getComponentName from 'shared/getComponentName';
import ReactVersion from 'shared/ReactVersion';
Expand Down

0 comments on commit 8d700df

Please sign in to comment.