GeezerVison is showing github.com — Removed forked DevTools Flow types · react/react@8c684bf
File treeExpand file treeCollapse file tree Open diff view settings packages/react-devtools-shared/src devtools/views/Components
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/console.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | import {getInternalReactConstants} from './renderer'; | 4 | 4 | import describeComponentFrame from './describeComponentFrame'; | 5 | 5 |
| 6 | | -import type {Fiber, ReactRenderer} from './types'; | | 6 | +import type {Fiber} from 'react-reconciler/src/ReactFiber'; | | 7 | +import type {ReactRenderer} from './types'; | 7 | 8 |
| 8 | 9 | const APPEND_STACK_TO_METHODS = ['error', 'trace', 'warn']; | 9 | 10 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/renderer.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,11 +42,11 @@ import { | 42 | 42 | registerRenderer as registerRendererWithConsole, | 43 | 43 | } from './console'; | 44 | 44 |
| | 45 | +import type {Fiber} from 'react-reconciler/src/ReactFiber'; | 45 | 46 | import type { | 46 | 47 | ChangeDescription, | 47 | 48 | CommitDataBackend, | 48 | 49 | DevToolsHook, | 49 | | - Fiber, | 50 | 50 | InspectedElement, | 51 | 51 | InspectedElementPayload, | 52 | 52 | InstanceAndStyle, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/types.js +3-103Lines changed: 3 additions & 103 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | // @flow | 2 | 2 |
| | 3 | +import type {ReactContext} from 'shared/ReactTypes'; | | 4 | +import type {Source} from 'shared/ReactElementType'; | | 5 | +import type {Fiber} from 'react-reconciler/src/ReactFiber'; | 3 | 6 | import type { | 4 | 7 | ComponentFilter, | 5 | 8 | ElementType, | @@ -14,69 +17,6 @@ type BundleType = | 14 | 17 | export type WorkTag = number; | 15 | 18 | export type SideEffectTag = number; | 16 | 19 | export type ExpirationTime = number; | 17 | | -export type RefObject = {| | 18 | | - current: any, | 19 | | -|}; | 20 | | -export type Source = {| | 21 | | - fileName: string, | 22 | | - lineNumber: number, | 23 | | -|}; | 24 | | - | 25 | | -export type HookType = | 26 | | - | 'useState' | 27 | | - | 'useReducer' | 28 | | - | 'useContext' | 29 | | - | 'useRef' | 30 | | - | 'useEffect' | 31 | | - | 'useLayoutEffect' | 32 | | - | 'useCallback' | 33 | | - | 'useMemo' | 34 | | - | 'useImperativeHandle' | 35 | | - | 'useDebugValue'; | 36 | | - | 37 | | -// The Fiber type is copied from React and should be kept in sync: | 38 | | -// https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiber.js | 39 | | -// The properties we don't use in DevTools are omitted. | 40 | | -export type Fiber = {| | 41 | | - tag: WorkTag, | 42 | | - | 43 | | - key: null | string, | 44 | | - | 45 | | - // Dependencies (contexts, events) for this fiber, if it has any | 46 | | - dependencies: mixed | null, | 47 | | - | 48 | | - elementType: any, | 49 | | - | 50 | | - type: any, | 51 | | - | 52 | | - stateNode: any, | 53 | | - | 54 | | - return: Fiber | null, | 55 | | - | 56 | | - child: Fiber | null, | 57 | | - sibling: Fiber | null, | 58 | | - index: number, | 59 | | - | 60 | | - ref: null | (((handle: mixed) => void) & {_stringRef: ?string}) | RefObject, | 61 | | - | 62 | | - pendingProps: any, // This type will be more specific once we overload the tag. | 63 | | - memoizedProps: any, // The props used to create the output. | 64 | | - | 65 | | - memoizedState: any, | 66 | | - | 67 | | - effectTag: SideEffectTag, | 68 | | - | 69 | | - alternate: Fiber | null, | 70 | | - | 71 | | - actualDuration?: number, | 72 | | - | 73 | | - actualStartTime?: number, | 74 | | - | 75 | | - treeBaseDuration?: number, | 76 | | - | 77 | | - _debugSource?: Source | null, | 78 | | - _debugOwner?: Fiber | null, | 79 | | -|}; | 80 | 20 |
| 81 | 21 | // TODO: If it's useful for the frontend to know which types of data an Element has | 82 | 22 | // (e.g. props, state, context, hooks) then we could add a bitmask field for this | @@ -103,22 +43,6 @@ export type ReactProviderType<T> = { | 103 | 43 | _context: ReactContext<T>, | 104 | 44 | }; | 105 | 45 |
| 106 | | -export type ReactContext<T> = { | 107 | | - $$typeof: Symbol | number, | 108 | | - Consumer: ReactContext<T>, | 109 | | - Provider: ReactProviderType<T>, | 110 | | - | 111 | | - _calculateChangedBits: ((a: T, b: T) => number) | null, | 112 | | - | 113 | | - _currentValue: T, | 114 | | - _currentValue2: T, | 115 | | - _threadCount: number, | 116 | | - | 117 | | - // DEV only | 118 | | - _currentRenderer?: Object | null, | 119 | | - _currentRenderer2?: Object | null, | 120 | | -}; | 121 | | - | 122 | 46 | export type ReactRenderer = { | 123 | 47 | findFiberByHostInstance: (hostInstance: NativeType) => ?Fiber, | 124 | 48 | version: string, | @@ -349,27 +273,3 @@ export type DevToolsHook = { | 349 | 273 | commitPriority?: number, | 350 | 274 | ) => void, | 351 | 275 | }; | 352 | | - | 353 | | -export type ReactEventResponder<E, C> = { | 354 | | - $$typeof: Symbol | number, | 355 | | - displayName: string, | 356 | | - targetEventTypes: null | Array<string>, | 357 | | - rootEventTypes: null | Array<string>, | 358 | | - getInitialState: null | ((props: Object) => Object), | 359 | | - onEvent: | 360 | | - | null | 361 | | - | ((event: E, context: C, props: Object, state: Object) => void), | 362 | | - onRootEvent: | 363 | | - | null | 364 | | - | ((event: E, context: C, props: Object, state: Object) => void), | 365 | | - onMount: null | ((context: C, props: Object, state: Object) => void), | 366 | | - onUnmount: null | ((context: C, props: Object, state: Object) => void), | 367 | | - onOwnershipChange: | 368 | | - | null | 369 | | - | ((context: C, props: Object, state: Object) => void), | 370 | | -}; | 371 | | - | 372 | | -export type ReactEventResponderListener<E, C> = {| | 373 | | - props: Object, | 374 | | - responder: ReactEventResponder<E, C>, | 375 | | -|}; |
Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Components/types.js +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | // @flow | 2 | 2 |
| | 3 | +import type {Source} from 'shared/ReactElementType'; | 3 | 4 | import type { | 4 | 5 | Dehydrated, | 5 | 6 | Unserializable, | @@ -48,11 +49,6 @@ export type OwnersList = {| | 48 | 49 | owners: Array<Owner> | null, | 49 | 50 | |}; | 50 | 51 |
| 51 | | -export type Source = {| | 52 | | - fileName: string, | 53 | | - lineNumber: number, | 54 | | -|}; | 55 | | - | 56 | 52 | export type InspectedElement = {| | 57 | 53 | id: number, | 58 | 54 |
| |
|