Skip to content

Commit 340bfd9

Browse files
authored
Rename ReactTypeOfWork to ReactWorkTags, ReactTypeOfSideEffect to ReactSideEffectTags (facebook#13476)
* Rename ReactTypeOfWork to ReactWorkTags And `type TypeOfWork` to `type WorkTag`. * Rename ReactTypeOfSideEffect too
1 parent 53ddcec commit 340bfd9

25 files changed

+42
-46
lines changed

packages/events/__tests__/ResponderEventPlugin-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
const {HostComponent} = require('shared/ReactTypeOfWork');
12+
const {HostComponent} = require('shared/ReactWorkTags');
1313

1414
let EventPluginHub;
1515
let ResponderEventPlugin;

packages/react-dom/src/client/ReactDOMComponentTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {HostComponent, HostText} from 'shared/ReactTypeOfWork';
8+
import {HostComponent, HostText} from 'shared/ReactWorkTags';
99
import invariant from 'shared/invariant';
1010

1111
const randomKey = Math.random()

packages/react-dom/src/events/ReactDOMEventListener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes';
1414
import {batchedUpdates, interactiveUpdates} from 'events/ReactGenericBatching';
1515
import {runExtractedEventsInBatch} from 'events/EventPluginHub';
1616
import {isFiberMounted} from 'react-reconciler/reflection';
17-
import {HostRoot} from 'shared/ReactTypeOfWork';
17+
import {HostRoot} from 'shared/ReactWorkTags';
1818

1919
import {addEventBubbleListener, addEventCaptureListener} from './EventListener';
2020
import getEventTarget from './getEventTarget';

packages/react-dom/src/test-utils/ReactTestUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
FunctionalComponentLazy,
1717
HostComponent,
1818
HostText,
19-
} from 'shared/ReactTypeOfWork';
19+
} from 'shared/ReactWorkTags';
2020
import SyntheticEvent from 'events/SyntheticEvent';
2121
import invariant from 'shared/invariant';
2222
import lowPriorityWarning from 'shared/lowPriorityWarning';

packages/react-native-renderer/src/ReactNativeFiberInspector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
findCurrentFiberUsingSlowPath,
1515
} from 'react-reconciler/reflection';
1616
import getComponentName from 'shared/getComponentName';
17-
import {HostComponent} from 'shared/ReactTypeOfWork';
17+
import {HostComponent} from 'shared/ReactWorkTags';
1818
import invariant from 'shared/invariant';
1919
// Module provided by RN:
2020
import UIManager from 'UIManager';

packages/react-reconciler/src/ReactChildFiber.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
1313
import type {ExpirationTime} from 'react-reconciler/src/ReactFiberExpirationTime';
1414

1515
import getComponentName from 'shared/getComponentName';
16-
import {Placement, Deletion} from 'shared/ReactTypeOfSideEffect';
16+
import {Placement, Deletion} from 'shared/ReactSideEffectTags';
1717
import {
1818
getIteratorFn,
1919
REACT_ELEMENT_TYPE,
@@ -27,7 +27,7 @@ import {
2727
HostText,
2828
HostPortal,
2929
Fragment,
30-
} from 'shared/ReactTypeOfWork';
30+
} from 'shared/ReactWorkTags';
3131
import invariant from 'shared/invariant';
3232
import warning from 'shared/warning';
3333
import warningWithoutStack from 'shared/warningWithoutStack';

packages/react-reconciler/src/ReactCurrentFiber.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ClassComponentLazy,
1717
HostComponent,
1818
Mode,
19-
} from 'shared/ReactTypeOfWork';
19+
} from 'shared/ReactWorkTags';
2020
import describeComponentFrame from 'shared/describeComponentFrame';
2121
import getComponentName from 'shared/getComponentName';
2222

packages/react-reconciler/src/ReactDebugFiberPerf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
ContextProvider,
2121
ContextConsumer,
2222
Mode,
23-
} from 'shared/ReactTypeOfWork';
23+
} from 'shared/ReactWorkTags';
2424

2525
type MeasurementPhase =
2626
| 'componentWillMount'

packages/react-reconciler/src/ReactFiber.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
import type {ReactElement, Source} from 'shared/ReactElementType';
1111
import type {ReactFragment, ReactPortal, RefObject} from 'shared/ReactTypes';
12-
import type {TypeOfWork} from 'shared/ReactTypeOfWork';
12+
import type {WorkTag} from 'shared/ReactWorkTags';
1313
import type {TypeOfMode} from './ReactTypeOfMode';
14-
import type {TypeOfSideEffect} from 'shared/ReactTypeOfSideEffect';
14+
import type {SideEffectTag} from 'shared/ReactSideEffectTags';
1515
import type {ExpirationTime} from './ReactFiberExpirationTime';
1616
import type {UpdateQueue} from './ReactUpdateQueue';
1717
import type {ContextDependency} from './ReactFiberNewContext';
1818

1919
import invariant from 'shared/invariant';
2020
import {enableProfilerTimer} from 'shared/ReactFeatureFlags';
21-
import {NoEffect} from 'shared/ReactTypeOfSideEffect';
21+
import {NoEffect} from 'shared/ReactSideEffectTags';
2222
import {
2323
IndeterminateComponent,
2424
ClassComponent,
@@ -36,7 +36,7 @@ import {
3636
FunctionalComponentLazy,
3737
ClassComponentLazy,
3838
ForwardRefLazy,
39-
} from 'shared/ReactTypeOfWork';
39+
} from 'shared/ReactWorkTags';
4040
import getComponentName from 'shared/getComponentName';
4141

4242
import {isDevToolsPresent} from './ReactFiberDevToolsHook';
@@ -86,7 +86,7 @@ export type Fiber = {|
8686
// minimize the number of objects created during the initial render.
8787

8888
// Tag identifying the type of fiber.
89-
tag: TypeOfWork,
89+
tag: WorkTag,
9090

9191
// Unique identifier of this child.
9292
key: null | string,
@@ -140,7 +140,7 @@ export type Fiber = {|
140140
mode: TypeOfMode,
141141

142142
// Effect
143-
effectTag: TypeOfSideEffect,
143+
effectTag: SideEffectTag,
144144

145145
// Singly linked list fast path to the next fiber with side-effects.
146146
nextEffect: Fiber | null,
@@ -201,7 +201,7 @@ if (__DEV__) {
201201
}
202202

203203
function FiberNode(
204-
tag: TypeOfWork,
204+
tag: WorkTag,
205205
pendingProps: mixed,
206206
key: null | string,
207207
mode: TypeOfMode,
@@ -272,7 +272,7 @@ function FiberNode(
272272
// 5) It should be easy to port this to a C struct and keep a C implementation
273273
// compatible.
274274
const createFiber = function(
275-
tag: TypeOfWork,
275+
tag: WorkTag,
276276
pendingProps: mixed,
277277
key: null | string,
278278
mode: TypeOfMode,
@@ -294,7 +294,7 @@ function shouldConstruct(Component: Function) {
294294
export function resolveLazyComponentTag(
295295
fiber: Fiber,
296296
Component: Function,
297-
): TypeOfWork {
297+
): WorkTag {
298298
if (typeof Component === 'function') {
299299
return shouldConstruct(Component)
300300
? ClassComponentLazy

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
ContextConsumer,
3232
Profiler,
3333
PlaceholderComponent,
34-
} from 'shared/ReactTypeOfWork';
34+
} from 'shared/ReactWorkTags';
3535
import {
3636
NoEffect,
3737
PerformedWork,
@@ -40,7 +40,7 @@ import {
4040
DidCapture,
4141
Update,
4242
Ref,
43-
} from 'shared/ReactTypeOfSideEffect';
43+
} from 'shared/ReactSideEffectTags';
4444
import ReactSharedInternals from 'shared/ReactSharedInternals';
4545
import {
4646
enableGetDerivedStateFromCatch,

0 commit comments

Comments
 (0)