Skip to content

Commit

Permalink
fix lint & remove unnecessary flag in devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
mondaychen committed Nov 11, 2022
1 parent b1a3e02 commit 5101801
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ export const PerformedWork = /* */ 0b00000000000000000000000001;
export const Placement = /* */ 0b00000000000000000000000010;
export const DidCapture = /* */ 0b00000000000000000001000000;
export const Hydrating = /* */ 0b00000000000000100000000000;
export const Incomplete = /* */ 0b00000000000100000000000000;
29 changes: 0 additions & 29 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import {
NoFlags,
PerformedWork,
Placement,
Incomplete,
Hydrating,
} from './ReactFiberFlags';
import {format} from './utils';
Expand Down Expand Up @@ -143,15 +142,6 @@ type ReactPriorityLevelsType = {
NoPriority: number,
};

type ReactTypeOfSideEffectType = {
DidCapture: number,
NoFlags: number,
PerformedWork: number,
Placement: number,
Incomplete: number,
Hydrating: number,
};

function getFiberFlags(fiber: Fiber): number {
// The name of this field changed from "effectTag" to "flags"
return fiber.flags !== undefined ? fiber.flags : (fiber: any).effectTag;
Expand All @@ -170,19 +160,9 @@ export function getInternalReactConstants(
getDisplayNameForFiber: getDisplayNameForFiberType,
getTypeSymbol: getTypeSymbolType,
ReactPriorityLevels: ReactPriorityLevelsType,
ReactTypeOfSideEffect: ReactTypeOfSideEffectType,
ReactTypeOfWork: WorkTagMap,
StrictModeBits: number,
} {
const ReactTypeOfSideEffect: ReactTypeOfSideEffectType = {
DidCapture,
NoFlags,
PerformedWork,
Placement,
Incomplete,
Hydrating,
};

// **********************************************************
// The section below is copied from files in React repo.
// Keep it in sync, and add version guards if it changes.
Expand Down Expand Up @@ -570,7 +550,6 @@ export function getInternalReactConstants(
getTypeSymbol,
ReactPriorityLevels,
ReactTypeOfWork,
ReactTypeOfSideEffect,
StrictModeBits,
};
}
Expand Down Expand Up @@ -603,16 +582,8 @@ export function attach(
getTypeSymbol,
ReactPriorityLevels,
ReactTypeOfWork,
ReactTypeOfSideEffect,
StrictModeBits,
} = getInternalReactConstants(version);
const {
DidCapture,
Hydrating,
NoFlags,
PerformedWork,
Placement,
} = ReactTypeOfSideEffect;
const {
CacheComponent,
ClassComponent,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const PerformedWork = /* */ 0b00000000000000000000000001;
export const Placement = /* */ 0b00000000000000000000000010;
export const DidCapture = /* */ 0b00000000000000000001000000;
export const Hydrating = /* */ 0b00000000000000100000000000;
export const Incomplete = /* */ 0b00000000000100000000000000;

// You can change the rest (and add more).
export const Update = /* */ 0b00000000000000000000000100;
Expand All @@ -38,6 +37,7 @@ export const LifecycleEffectMask =
export const HostEffectMask = /* */ 0b00000000000011111111111111;

// These are not really side effects, but we still reuse this field.
export const Incomplete = /* */ 0b00000000000100000000000000;
export const ShouldCapture = /* */ 0b00000000001000000000000000;
export const ForceUpdateForLegacySuspense = /* */ 0b00000000010000000000000000;
export const DidPropagateContext = /* */ 0b00000000100000000000000000;
Expand Down

0 comments on commit 5101801

Please sign in to comment.