Removed forked DevTools Flow types

This commit is contained in:
Brian Vaughn
2019-08-27 10:42:02 -07:00
parent 24a01bcd81
commit 1ebf7f638c
4 changed files with 7 additions and 110 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
import {getInternalReactConstants} from './renderer';
import describeComponentFrame from './describeComponentFrame';
import type {Fiber, ReactRenderer} from './types';
import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {ReactRenderer} from './types';
const APPEND_STACK_TO_METHODS = ['error', 'trace', 'warn'];
+1 -1
View File
@@ -42,11 +42,11 @@ import {
registerRenderer as registerRendererWithConsole,
} from './console';
import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {
ChangeDescription,
CommitDataBackend,
DevToolsHook,
Fiber,
InspectedElement,
InspectedElementPayload,
InstanceAndStyle,
+3 -103
View File
@@ -1,5 +1,8 @@
// @flow
import type {ReactContext} from 'shared/ReactTypes';
import type {Source} from 'shared/ReactElementType';
import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {
ComponentFilter,
ElementType,
@@ -14,69 +17,6 @@ type BundleType =
export type WorkTag = number;
export type SideEffectTag = number;
export type ExpirationTime = number;
export type RefObject = {|
current: any,
|};
export type Source = {|
fileName: string,
lineNumber: number,
|};
export type HookType =
| 'useState'
| 'useReducer'
| 'useContext'
| 'useRef'
| 'useEffect'
| 'useLayoutEffect'
| 'useCallback'
| 'useMemo'
| 'useImperativeHandle'
| 'useDebugValue';
// The Fiber type is copied from React and should be kept in sync:
// https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiber.js
// The properties we don't use in DevTools are omitted.
export type Fiber = {|
tag: WorkTag,
key: null | string,
// Dependencies (contexts, events) for this fiber, if it has any
dependencies: mixed | null,
elementType: any,
type: any,
stateNode: any,
return: Fiber | null,
child: Fiber | null,
sibling: Fiber | null,
index: number,
ref: null | (((handle: mixed) => void) & {_stringRef: ?string}) | RefObject,
pendingProps: any, // This type will be more specific once we overload the tag.
memoizedProps: any, // The props used to create the output.
memoizedState: any,
effectTag: SideEffectTag,
alternate: Fiber | null,
actualDuration?: number,
actualStartTime?: number,
treeBaseDuration?: number,
_debugSource?: Source | null,
_debugOwner?: Fiber | null,
|};
// TODO: If it's useful for the frontend to know which types of data an Element has
// (e.g. props, state, context, hooks) then we could add a bitmask field for this
@@ -103,22 +43,6 @@ export type ReactProviderType<T> = {
_context: ReactContext<T>,
};
export type ReactContext<T> = {
$$typeof: Symbol | number,
Consumer: ReactContext<T>,
Provider: ReactProviderType<T>,
_calculateChangedBits: ((a: T, b: T) => number) | null,
_currentValue: T,
_currentValue2: T,
_threadCount: number,
// DEV only
_currentRenderer?: Object | null,
_currentRenderer2?: Object | null,
};
export type ReactRenderer = {
findFiberByHostInstance: (hostInstance: NativeType) => ?Fiber,
version: string,
@@ -349,27 +273,3 @@ export type DevToolsHook = {
commitPriority?: number,
) => void,
};
export type ReactEventResponder<E, C> = {
$$typeof: Symbol | number,
displayName: string,
targetEventTypes: null | Array<string>,
rootEventTypes: null | Array<string>,
getInitialState: null | ((props: Object) => Object),
onEvent:
| null
| ((event: E, context: C, props: Object, state: Object) => void),
onRootEvent:
| null
| ((event: E, context: C, props: Object, state: Object) => void),
onMount: null | ((context: C, props: Object, state: Object) => void),
onUnmount: null | ((context: C, props: Object, state: Object) => void),
onOwnershipChange:
| null
| ((context: C, props: Object, state: Object) => void),
};
export type ReactEventResponderListener<E, C> = {|
props: Object,
responder: ReactEventResponder<E, C>,
|};
@@ -1,5 +1,6 @@
// @flow
import type {Source} from 'shared/ReactElementType';
import type {
Dehydrated,
Unserializable,
@@ -48,11 +49,6 @@ export type OwnersList = {|
owners: Array<Owner> | null,
|};
export type Source = {|
fileName: string,
lineNumber: number,
|};
export type InspectedElement = {|
id: number,