[flow] enable LTI inference mode (#26104)
This is the next generation inference mode for Flow.
Jan Kassens committed
Feb 9, 2023 at 17:07 UTC
6ddcbd4f96cb103de3978617a53c200baf5b546c
110 files changed
+378
-283
package.json
+1
-1
@@ -61,7 +61,7 @@
61
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
62
"fbjs-scripts": "^3.0.1",
63
"filesize": "^6.0.1",
64
- "flow-bin": "^0.199.0",
64
+ "flow-bin": "^0.199.1",
65
"flow-remove-types": "^2.198.2",
66
"glob": "^7.1.6",
67
"glob-stream": "^6.1.0",
packages/jest-react/src/internalAct.js
+2
-2
@@ -77,7 +77,7 @@ export function act<T>(scope: () => Thenable<T> | T): Thenable<T> {
77
) {
78
const thenableResult: Thenable<T> = (result: any);
79
return {
80
- then(resolve, reject) {
80
+ then(resolve: T => mixed, reject: mixed => mixed) {
81
thenableResult.then(
82
returnValue => {
83
flushActWork(
@@ -108,7 +108,7 @@ export function act<T>(scope: () => Thenable<T> | T): Thenable<T> {
108
didFlushWork = Scheduler.unstable_flushAllWithoutAsserting();
109
} while (didFlushWork);
110
return {
111
- then(resolve, reject) {
111
+ then(resolve: T => mixed, reject: mixed => mixed) {
112
resolve(returnValue);
113
},
114
};
packages/react-cache/src/ReactCacheOld.js
+2
-2
@@ -85,11 +85,11 @@ function identityHashFn(input) {
85
}
86
87
const CACHE_LIMIT = 500;
88
-const lru = createLRU(CACHE_LIMIT);
88
+const lru = createLRU<$FlowFixMe>(CACHE_LIMIT);
89
90
const entries: Map<Resource<any, any>, Map<any, any>> = new Map();
91
92
-const CacheContext = React.createContext(null);
92
+const CacheContext = React.createContext<mixed>(null);
93
94
function accessResult<I, K, V>(
95
resource: any,
packages/react-client/src/ReactFlightClient.js
+5
-6
@@ -129,13 +129,13 @@ Chunk.prototype.then = function <T>(
129
case BLOCKED:
130
if (resolve) {
131
if (chunk.value === null) {
132
- chunk.value = [];
132
+ chunk.value = ([]: Array<(T) => mixed>);
133
}
134
chunk.value.push(resolve);
135
}
136
if (reject) {
137
if (chunk.reason === null) {
138
- chunk.reason = [];
138
+ chunk.reason = ([]: Array<(mixed) => mixed>);
139
}
140
chunk.reason.push(reject);
141
}
@@ -435,7 +435,7 @@ function createModelResolver<T>(
435
chunk: SomeChunk<T>,
436
parentObject: Object,
437
key: string,
438
-) {
438
+): (value: any) => void {
439
let blocked;
440
if (initializingChunkBlockedModel) {
441
blocked = initializingChunkBlockedModel;
@@ -446,7 +446,6 @@ function createModelResolver<T>(
446
value: null,
447
};
448
}
449
- // $FlowFixMe[missing-local-annot]
449
return value => {
450
parentObject[key] = value;
451
blocked.deps--;
@@ -465,7 +464,7 @@ function createModelResolver<T>(
464
};
465
}
466
468
-function createModelReject<T>(chunk: SomeChunk<T>) {
467
+function createModelReject<T>(chunk: SomeChunk<T>): (error: mixed) => void {
468
return (error: mixed) => triggerErrorOnChunk(chunk, error);
469
}
470
@@ -583,7 +582,7 @@ export function resolveModule(
582
const chunks = response._chunks;
583
const chunk = chunks.get(id);
584
const moduleMetaData: ModuleMetaData = parseModel(response, model);
586
- const moduleReference = resolveClientReference(
585
+ const moduleReference = resolveClientReference<$FlowFixMe>(
586
response._bundlerConfig,
587
moduleMetaData,
588
);
packages/react-debug-tools/src/ReactDebugHooks.js
+3
-3
@@ -60,13 +60,13 @@ function getPrimitiveStackCache(): Map<string, Array<any>> {
60
// This initializes a cache of all primitive hooks so that the top
61
// most stack frames added by calling the primitive hook can be removed.
62
if (primitiveStackCache === null) {
63
- const cache = new Map();
63
+ const cache = new Map<string, Array<any>>();
64
let readHookLog;
65
try {
66
// Use all hooks here to add them to the hook log.
67
Dispatcher.useContext(({_currentValue: null}: any));
68
Dispatcher.useState(null);
69
- Dispatcher.useReducer((s, a) => s, null);
69
+ Dispatcher.useReducer((s: mixed, a: mixed) => s, null);
70
Dispatcher.useRef(null);
71
if (typeof Dispatcher.useCacheRefresh === 'function') {
72
// This type check is for Flow only.
@@ -809,7 +809,7 @@ export function inspectHooksOfFiber(
809
// Set up the current hook so that we can step through and read the
810
// current state from them.
811
currentHook = (fiber.memoizedState: Hook);
812
- const contextMap = new Map();
812
+ const contextMap = new Map<ReactContext<$FlowFixMe>, $FlowFixMe>();
813
try {
814
setupContexts(contextMap, fiber);
815
if (fiber.tag === ForwardRef) {
packages/react-devtools-core/src/backend.js
+3
-3
@@ -67,7 +67,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
67
useHttps = false,
68
port = 8097,
69
websocket,
70
- resolveRNStyle = null,
70
+ resolveRNStyle = (null: $FlowFixMe),
71
retryConnectionDelay = 2000,
72
isAppActive = () => true,
73
devToolsSettingsManager,
@@ -230,7 +230,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
230
get() {
231
return lazyResolveRNStyle;
232
},
233
- set(value) {
233
+ set(value: $FlowFixMe) {
234
lazyResolveRNStyle = value;
235
initAfterTick();
236
},
@@ -246,7 +246,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
246
get() {
247
return lazyNativeStyleEditorValidAttributes;
248
},
249
- set(value) {
249
+ set(value: $FlowFixMe) {
250
lazyNativeStyleEditorValidAttributes = value;
251
initAfterTick();
252
},
packages/react-devtools-core/src/editor.js
+1
-1
@@ -188,7 +188,7 @@ export function launchEditor(
188
}
189
childProcess.on('error', function () {});
190
// $FlowFixMe[incompatible-use] found when upgrading Flow
191
- childProcess.on('exit', function (errorCode) {
191
+ childProcess.on('exit', function () {
192
childProcess = null;
193
});
194
}
packages/react-devtools-core/src/standalone.js
+4
-4
@@ -168,7 +168,7 @@ function onDisconnected() {
168
}
169
170
// $FlowFixMe[missing-local-annot]
171
-function onError({code, message}) {
171
+function onError({code, message}: $FlowFixMe) {
172
safeUnmount();
173
174
if (code === 'EADDRINUSE') {
@@ -335,13 +335,13 @@ function startServer(
335
initialize(socket);
336
});
337
338
- server.on('error', event => {
338
+ server.on('error', (event: $FlowFixMe) => {
339
onError(event);
340
log.error('Failed to start the DevTools server', event);
341
startServerTimeoutID = setTimeout(() => startServer(port), 1000);
342
});
343
344
- httpServer.on('request', (request, response) => {
344
+ httpServer.on('request', (request: $FlowFixMe, response: $FlowFixMe) => {
345
// Serve a file that immediately sets up the connection.
346
const backendFile = readFileSync(join(__dirname, 'backend.js'));
347
@@ -377,7 +377,7 @@ function startServer(
377
);
378
});
379
380
- httpServer.on('error', event => {
380
+ httpServer.on('error', (event: $FlowFixMe) => {
381
onError(event);
382
statusListener('Failed to start the server.', 'error');
383
startServerTimeoutID = setTimeout(() => startServer(port), 1000);
packages/react-devtools-extensions/src/backend.js
+2
-3
@@ -9,7 +9,7 @@
9
let welcomeHasInitialized = false;
10
11
// $FlowFixMe[missing-local-annot]
12
-function welcome(event) {
12
+function welcome(event: $FlowFixMe) {
13
if (
14
event.source !== window ||
15
event.data.source !== 'react-devtools-content-script'
@@ -56,8 +56,7 @@ function setup(hook: any) {
56
57
const bridge = new Bridge({
58
listen(fn) {
59
- // $FlowFixMe[missing-local-annot]
60
- const listener = event => {
59
+ const listener = (event: $FlowFixMe) => {
60
if (
61
event.source !== window ||
62
!event.data ||
packages/react-devtools-inline/src/backend.js
+2
-4
@@ -10,8 +10,7 @@ import type {BackendBridge} from 'react-devtools-shared/src/bridge';
10
import type {Wall} from 'react-devtools-shared/src/types';
11
12
function startActivation(contentWindow: any, bridge: BackendBridge) {
13
- // $FlowFixMe[missing-local-annot]
14
- const onSavedPreferences = data => {
13
+ const onSavedPreferences = (data: $FlowFixMe) => {
14
// This is the only message we're listening for,
15
// so it's safe to cleanup after we've received it.
16
bridge.removeListener('savedPreferences', onSavedPreferences);
@@ -102,8 +101,7 @@ export function createBridge(contentWindow: any, wall?: Wall): BackendBridge {
101
if (wall == null) {
102
wall = {
103
listen(fn) {
105
- // $FlowFixMe[missing-local-annot]
106
- const onMessage = ({data}) => {
104
+ const onMessage = ({data}: $FlowFixMe) => {
105
fn(data);
106
};
107
contentWindow.addEventListener('message', onMessage);
packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js
+1
-1
@@ -54,7 +54,7 @@ let reentry = false;
54
let componentFrameCache;
55
if (__DEV__) {
56
const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
57
- componentFrameCache = new PossiblyWeakMap();
57
+ componentFrameCache = new PossiblyWeakMap<$FlowFixMe, string>();
58
}
59
60
export function describeNativeComponentFrame(
packages/react-devtools-shared/src/backend/StyleX/utils.js
+1
-1
@@ -13,7 +13,7 @@ import isArray from 'react-devtools-shared/src/isArray';
13
const cachedStyleNameToValueMap: Map<string, string> = new Map();
14
15
export function getStyleXData(data: any): StyleXPlugin {
16
- const sources = new Set();
16
+ const sources = new Set<string>();
17
const resolvedStyles = {};
18
19
crawlData(data, sources, resolvedStyles);
packages/react-devtools-shared/src/backend/legacy/renderer.js
+1
-1
@@ -503,7 +503,7 @@ export function attach(
503
const numUnmountIDs =
504
pendingUnmountedIDs.length + (pendingUnmountedRootID === null ? 0 : 1);
505
506
- const operations = new Array(
506
+ const operations = new Array<number>(
507
// Identify which renderer this update is coming from.
508
2 + // [rendererID, rootFiberID]
509
// How big is the string table?
packages/react-devtools-shared/src/backend/profilingHooks.js
+8
-5
@@ -18,14 +18,16 @@ import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
18
import type {Wakeable} from 'shared/ReactTypes';
19
import type {
20
BatchUID,
21
+ InternalModuleSourceToRanges,
22
LaneToLabelMap,
23
ReactComponentMeasure,
24
+ ReactLane,
25
ReactMeasure,
26
ReactMeasureType,
25
- TimelineData,
26
- SuspenseEvent,
27
- SchedulingEvent,
27
ReactScheduleStateUpdateEvent,
28
+ SchedulingEvent,
29
+ SuspenseEvent,
30
+ TimelineData,
31
} from 'react-devtools-timeline/src/types';
32
33
import isArray from 'shared/isArray';
@@ -837,7 +839,8 @@ export function createProfilingHooks({
839
isProfiling = value;
840
841
if (isProfiling) {
840
- const internalModuleSourceToRanges = new Map();
842
+ const internalModuleSourceToRanges: InternalModuleSourceToRanges =
843
+ new Map();
844
845
if (supportsUserTimingV3) {
846
const ranges = getInternalModuleRanges();
@@ -856,7 +859,7 @@ export function createProfilingHooks({
859
}
860
}
861
859
- const laneToReactMeasureMap = new Map();
862
+ const laneToReactMeasureMap = new Map<ReactLane, ReactMeasure[]>();
863
let lane = 1;
864
for (let index = 0; index < REACT_TOTAL_NUM_LANES; index++) {
865
laneToReactMeasureMap.set(lane, []);
packages/react-devtools-shared/src/backend/renderer.js
+5
-5
@@ -415,7 +415,7 @@ export function getInternalReactConstants(version: string): {
415
TracingMarkerComponent,
416
} = ReactTypeOfWork;
417
418
- function resolveFiberType(type: any) {
418
+ function resolveFiberType(type: any): $FlowFixMe {
419
const typeSymbol = getTypeSymbol(type);
420
switch (typeSymbol) {
421
case MEMO_NUMBER:
@@ -1627,7 +1627,7 @@ export function attach(
1627
}
1628
}
1629
1630
- let flushPendingErrorsAndWarningsAfterDelayTimeoutID = null;
1630
+ let flushPendingErrorsAndWarningsAfterDelayTimeoutID: null | TimeoutID = null;
1631
1632
function clearPendingErrorsAndWarningsAfterDelay() {
1633
if (flushPendingErrorsAndWarningsAfterDelayTimeoutID !== null) {
@@ -1790,7 +1790,7 @@ export function attach(
1790
pendingSimulatedUnmountedIDs.length +
1791
(pendingUnmountedRootID === null ? 0 : 1);
1792
1793
- const operations = new Array(
1793
+ const operations = new Array<number>(
1794
// Identify which renderer this update is coming from.
1795
2 + // [rendererID, rootFiberID]
1796
// How big is the string table?
@@ -4144,7 +4144,7 @@ export function attach(
4144
4145
// Map of id and its force error status: true (error), false (toggled off),
4146
// null (do nothing)
4147
- const forceErrorForFiberIDs = new Map();
4147
+ const forceErrorForFiberIDs = new Map<number | null, $FlowFixMe>();
4148
4149
function shouldErrorFiberAccordingToMap(fiber: any) {
4150
if (typeof setErrorHandler !== 'function') {
@@ -4209,7 +4209,7 @@ export function attach(
4209
return false;
4210
}
4211
4212
- const forceFallbackForSuspenseIDs = new Set();
4212
+ const forceFallbackForSuspenseIDs = new Set<number>();
4213
4214
function shouldSuspendFiberAccordingToSet(fiber: any) {
4215
const maybeID = getFiberIDUnsafe(((fiber: any): Fiber));
packages/react-devtools-shared/src/backend/utils.js
+1
-1
@@ -144,7 +144,7 @@ export function getEffectDurations(root: Object): {
144
}
145
146
export function serializeToString(data: any): string {
147
- const cache = new Set();
147
+ const cache = new Set<mixed>();
148
// Use a custom replacer function to protect against circular references.
149
return JSON.stringify(data, (key, value) => {
150
if (typeof value === 'object' && value !== null) {
packages/react-devtools-shared/src/backend/views/utils.js
+1
-1
@@ -83,7 +83,7 @@ export function getNestedBoundingClientRect(
83
): Rect {
84
const ownerIframe = getOwnerIframe(node);
85
if (ownerIframe && ownerIframe !== boundaryWindow) {
86
- const rects = [node.getBoundingClientRect()];
86
+ const rects: Array<Rect | ClientRect> = [node.getBoundingClientRect()];
87
let currentIframe: null | HTMLElement = ownerIframe;
88
let onlyOneMore = false;
89
while (currentIframe) {
packages/react-devtools-shared/src/devtools/ProfilerStore.js
+1
-1
@@ -308,7 +308,7 @@ export default class ProfilerStore extends EventEmitter<{
308
// Record snapshot of tree at the time profiling is started.
309
// This info is required to handle cases of e.g. nodes being removed during profiling.
310
this._store.roots.forEach(rootID => {
311
- const profilingSnapshots = new Map();
311
+ const profilingSnapshots = new Map<number, SnapshotNode>();
312
this._initialSnapshotsByRootID.set(rootID, profilingSnapshots);
313
this._takeProfilingSnapshotRecursive(rootID, profilingSnapshots);
314
});
packages/react-devtools-shared/src/devtools/store.js
+2
-2
@@ -642,7 +642,7 @@ export default class Store extends EventEmitter<{
642
}
643
644
getOwnersListForElement(ownerID: number): Array<Element> {
645
- const list = [];
645
+ const list: Array<Element> = [];
646
const element = this._idToElement.get(ownerID);
647
if (element != null) {
648
list.push({
@@ -900,7 +900,7 @@ export default class Store extends EventEmitter<{
900
let i = 2;
901
902
// Reassemble the string table.
903
- const stringTable = [
903
+ const stringTable: Array<string | null> = [
904
null, // ID = 0 corresponds to the null string.
905
];
906
const stringTableSize = operations[i++];
packages/react-devtools-shared/src/devtools/views/Components/EditableName.js
+2
-2
@@ -43,7 +43,7 @@ export default function EditableName({
43
const [isValid, setIsValid] = useState(false);
44
45
const handleChange = useCallback(
46
- ({target}) => {
46
+ ({target}: $FlowFixMe) => {
47
let value = target.value;
48
if (!allowWhiteSpace) {
49
value = value.trim();
@@ -61,7 +61,7 @@ export default function EditableName({
61
);
62
63
const handleKeyDown = useCallback(
64
- event => {
64
+ (event: $FlowFixMe) => {
65
// Prevent keydown events from e.g. change selected element in the tree
66
event.stopPropagation();
67
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
+1
-1
@@ -177,7 +177,7 @@ export function InspectedElementContextController({
177
[setState, state],
178
);
179
180
- const inspectedElementRef = useRef(null);
180
+ const inspectedElementRef = useRef<null | InspectedElement>(null);
181
useEffect(() => {
182
if (
183
inspectedElement !== null &&
packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/StyleEditor.js
+1
-1
@@ -288,7 +288,7 @@ function Field({
288
<AutoSizeInput
289
className={`${className} ${styles.Input}`}
290
onBlur={onSubmit}
291
- onChange={event => onChange(event.target.value)}
291
+ onChange={(event: $FlowFixMe) => onChange(event.target.value)}
292
onKeyDown={onKeyDown}
293
placeholder={placeholder}
294
value={value}
packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/context.js
+2
-2
@@ -72,9 +72,9 @@ const resource: Resource<Element, Element, StyleAndLayoutFrontend> =
72
resolveFn = resolve;
73
});
74
75
- inProgressRequests.set(element, {promise, resolveFn});
75
+ inProgressRequests.set(element, ({promise, resolveFn}: $FlowFixMe));
76
77
- return promise;
77
+ return (promise: $FlowFixMe);
78
},
79
(element: Element) => element,
80
{useWeakMap: true},
packages/react-devtools-shared/src/devtools/views/Components/OwnersListContext.js
+1
-1
@@ -61,7 +61,7 @@ const resource: Resource<
61
// $FlowFixMe[incompatible-call] found when upgrading Flow
62
inProgressRequests.set(element, {promise, resolveFn});
63
64
- return promise;
64
+ return (promise: $FlowFixMe);
65
},
66
(element: Element) => element,
67
{useWeakMap: true},
packages/react-devtools-shared/src/devtools/views/Components/Tree.js
+3
-3
@@ -87,7 +87,7 @@ export default function Tree(props: Props): React.Node {
87
// meaning the scroll action would be skipped (since ref updates don't re-run effects).
88
// Using a callback ref accounts for this case...
89
const listCallbackRef = useCallback(
90
- list => {
90
+ (list: $FlowFixMe) => {
91
if (list != null && selectedElementIndex !== null) {
92
list.scrollToItem(selectedElementIndex, 'smart');
93
}
@@ -226,7 +226,7 @@ export default function Tree(props: Props): React.Node {
226
}, [dispatch, numElements, selectedElementIndex]);
227
228
const handleKeyPress = useCallback(
229
- event => {
229
+ (event: $FlowFixMe) => {
230
switch (event.key) {
231
case 'Enter':
232
case ' ':
@@ -272,7 +272,7 @@ export default function Tree(props: Props): React.Node {
272
273
// Highlight last hovered element.
274
const handleElementMouseEnter = useCallback(
275
- id => {
275
+ (id: $FlowFixMe) => {
276
// Ignore hover while we're navigating with keyboard.
277
// This avoids flicker from the hovered nodes under the mouse.
278
if (!isNavigatingWithKeyboard) {
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/cache.js
+2
-2
@@ -65,9 +65,9 @@ export function findGitHubIssue(errorMessage: string): GitHubIssue | null {
65
let record = map.get(errorMessage);
66
67
if (!record) {
68
- const callbacks = new Set();
68
+ const callbacks = new Set<() => mixed>();
69
const wakeable: Wakeable = {
70
- then(callback) {
70
+ then(callback: () => mixed) {
71
callbacks.add(callback);
72
},
73
packages/react-devtools-shared/src/devtools/views/Profiler/CommitFlamegraph.js
+2
-2
@@ -45,7 +45,7 @@ export default function CommitFlamegraphAutoSizer(_: {}): React.Node {
45
const {profilingCache} = profilerStore;
46
47
const deselectCurrentFiber = useCallback(
48
- event => {
48
+ (event: $FlowFixMe) => {
49
event.stopPropagation();
50
selectFiber(null, null);
51
},
@@ -126,7 +126,7 @@ function CommitFlamegraph({chartData, commitTree, height, width}: Props) {
126
}, [chartData, selectedFiberID, selectedChartNodeIndex]);
127
128
const handleElementMouseEnter = useCallback(
129
- ({id, name}) => {
129
+ ({id, name}: $FlowFixMe) => {
130
highlightNativeElement(id); // Highlight last hovered element.
131
setHoveredFiberData({id, name}); // Set hovered fiber data for tooltip
132
},
packages/react-devtools-shared/src/devtools/views/Profiler/CommitRanked.js
+2
-2
@@ -45,7 +45,7 @@ export default function CommitRankedAutoSizer(_: {}): React.Node {
45
const {profilingCache} = profilerStore;
46
47
const deselectCurrentFiber = useCallback(
48
- event => {
48
+ (event: $FlowFixMe) => {
49
event.stopPropagation();
50
selectFiber(null, null);
51
},
@@ -108,7 +108,7 @@ function CommitRanked({chartData, commitTree, height, width}: Props) {
108
);
109
110
const handleElementMouseEnter = useCallback(
111
- ({id, name}) => {
111
+ ({id, name}: $FlowFixMe) => {
112
highlightNativeElement(id); // Highlight last hovered element.
113
setHoveredFiberData({id, name}); // Set hovered fiber data for tooltip
114
},
packages/react-devtools-shared/src/devtools/views/Profiler/CommitRankedListItem.js
+1
-1
@@ -40,7 +40,7 @@ function CommitRankedListItem({data, index, style}: Props) {
40
const {lineHeight} = useContext(SettingsContext);
41
42
const handleClick = useCallback(
43
- event => {
43
+ (event: $FlowFixMe) => {
44
event.stopPropagation();
45
const {id, name} = node;
46
selectFiber(id, name);
packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js
+2
-2
@@ -84,7 +84,7 @@ export function getCommitTree({
84
// If this is the very first commit, start with the cached snapshot and apply the first mutation.
85
// Otherwise load (or generate) the previous commit and append a mutation to it.
86
if (index === 0) {
87
- const nodes = new Map();
87
+ const nodes = new Map<number, CommitTreeNode>();
88
89
// Construct the initial tree.
90
recursivelyInitializeTree(rootID, 0, nodes, dataForRoot);
@@ -163,7 +163,7 @@ function updateTree(
163
let id: number = ((null: any): number);
164
165
// Reassemble the string table.
166
- const stringTable = [
166
+ const stringTable: Array<null | string> = [
167
null, // ID = 0 corresponds to the null string.
168
];
169
const stringTableSize = operations[i++];
packages/react-devtools-shared/src/devtools/views/Profiler/FlamegraphChartBuilder.js
+10
-2
@@ -63,7 +63,11 @@ export function getChartData({
63
let maxSelfDuration = 0;
64
65
// Generate flame graph structure using tree base durations.
66
- const walkTree = (id: number, rightOffset: number, currentDepth: number) => {
66
+ const walkTree = (
67
+ id: number,
68
+ rightOffset: number,
69
+ currentDepth: number,
70
+ ): ChartNode => {
71
idToDepthMap.set(id, currentDepth);
72
73
const node = nodes.get(id);
@@ -115,7 +119,11 @@ export function getChartData({
119
120
for (let i = children.length - 1; i >= 0; i--) {
121
const childID = children[i];
118
- const childChartNode = walkTree(childID, rightOffset, currentDepth + 1);
122
+ const childChartNode: $FlowFixMe = walkTree(
123
+ childID,
124
+ rightOffset,
125
+ currentDepth + 1,
126
+ );
127
rightOffset -= childChartNode.treeBaseDuration;
128
}
129
packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js
+1
-1
@@ -28,7 +28,7 @@ export default function RootSelector(_: {}): React.Node {
28
}
29
30
const handleChange = useCallback(
31
- ({currentTarget}) => {
31
+ ({currentTarget}: $FlowFixMe) => {
32
setRootID(parseInt(currentTarget.value, 10));
33
},
34
[setRootID],
packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotSelector.js
+1
-1
@@ -45,7 +45,7 @@ export default function SnapshotSelector(_: Props): React.Node {
45
46
const filteredCommitIndices = useMemo(
47
() =>
48
- commitData.reduce((reduced, commitDatum, index) => {
48
+ commitData.reduce((reduced: $FlowFixMe, commitDatum, index) => {
49
if (
50
!isCommitFilterEnabled ||
51
commitDatum.duration >= minCommitDuration
packages/react-devtools-shared/src/devtools/views/Settings/ComponentsSettings.js
+2
-2
@@ -70,14 +70,14 @@ export default function ComponentsSettings(_: {}): React.Node {
70
);
71
72
const updateCollapseNodesByDefault = useCallback(
73
- ({currentTarget}) => {
73
+ ({currentTarget}: $FlowFixMe) => {
74
store.collapseNodesByDefault = !currentTarget.checked;
75
},
76
[store],
77
);
78
79
const updateParseHookNames = useCallback(
80
- ({currentTarget}) => {
80
+ ({currentTarget}: $FlowFixMe) => {
81
setParseHookNames(currentTarget.checked);
82
},
83
[setParseHookNames],
packages/react-devtools-shared/src/devtools/views/Settings/ProfilerSettings.js
+1
-1
@@ -39,7 +39,7 @@ export default function ProfilerSettings(_: {}): React.Node {
39
);
40
41
const updateRecordChangeDescriptions = useCallback(
42
- ({currentTarget}) => {
42
+ ({currentTarget}: $FlowFixMe) => {
43
store.recordChangeDescriptions = currentTarget.checked;
44
},
45
[store],
packages/react-devtools-shared/src/devtools/views/TabBar.js
+2
-2
@@ -46,11 +46,11 @@ export default function TabBar({
46
}
47
48
const onChange = useCallback(
49
- ({currentTarget}) => selectTab(currentTarget.value),
49
+ ({currentTarget}: $FlowFixMe) => selectTab(currentTarget.value),
50
[selectTab],
51
);
52
53
- const handleKeyDown = useCallback(event => {
53
+ const handleKeyDown = useCallback((event: $FlowFixMe) => {
54
switch (event.key) {
55
case 'ArrowDown':
56
case 'ArrowLeft':
packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js
+1
-1
@@ -23,7 +23,7 @@ export default function WarnIfLegacyBackendDetected(_: {}): null {
23
// In this case the frontend should show upgrade instructions.
24
useEffect(() => {
25
// Wall.listen returns a cleanup function
26
- let unlisten = bridge.wall.listen(message => {
26
+ let unlisten: $FlowFixMe = bridge.wall.listen(message => {
27
switch (message.type) {
28
case 'call':
29
case 'event':
packages/react-devtools-shared/src/devtools/views/hooks.js
+1
-1
@@ -168,7 +168,7 @@ export function useLocalStorage<T>(
168
const [storedValue, setStoredValue] = useState<any>(getValueFromLocalStorage);
169
170
const setValue = useCallback(
171
- value => {
171
+ (value: $FlowFixMe) => {
172
try {
173
const valueToStore =
174
value instanceof Function ? (value: any)(storedValue) : value;
packages/react-devtools-shared/src/dynamicImportCache.js
+3
-2
@@ -66,9 +66,9 @@ export function loadModule(moduleLoaderFunction: ModuleLoaderFunction): Module {
66
}
67
68
if (!record) {
69
- const callbacks = new Set();
69
+ const callbacks = new Set<() => mixed>();
70
const wakeable: Wakeable = {
71
- then(callback) {
71
+ then(callback: () => mixed) {
72
callbacks.add(callback);
73
},
74
@@ -155,6 +155,7 @@ export function loadModule(moduleLoaderFunction: ModuleLoaderFunction): Module {
155
moduleLoaderFunctionToModuleMap.set(moduleLoaderFunction, record);
156
}
157
158
+ // $FlowFixMe[underconstrained-implicit-instantiation]
159
const response = readRecord(record).value;
160
return response;
161
}
packages/react-devtools-shared/src/hook.js
+8
-7
@@ -8,13 +8,14 @@
8
* @flow
9
*/
10
11
-import type {BrowserTheme} from 'react-devtools-shared/src/devtools/views/DevTools';
11
+import type {BrowserTheme} from './devtools/views/DevTools';
12
import type {
13
- RendererID,
14
- ReactRenderer,
15
- Handler,
13
DevToolsHook,
17
-} from 'react-devtools-shared/src/backend/types';
14
+ Handler,
15
+ ReactRenderer,
16
+ RendererID,
17
+ RendererInterface,
18
+} from './backend/types';
19
20
import {
21
patchConsoleUsingWindowValues,
@@ -519,9 +520,9 @@ export function installHook(target: any): DevToolsHook | null {
520
521
// TODO: More meaningful names for "rendererInterfaces" and "renderers".
522
const fiberRoots: {[RendererID]: Set<mixed>} = {};
522
- const rendererInterfaces = new Map();
523
+ const rendererInterfaces = new Map<RendererID, RendererInterface>();
524
const listeners: {[string]: Array<Handler>} = {};
524
- const renderers = new Map();
525
+ const renderers = new Map<RendererID, ReactRenderer>();
526
527
const hook: DevToolsHook = {
528
rendererInterfaces,
packages/react-devtools-shared/src/hookNamesCache.js
+3
-3
@@ -87,9 +87,9 @@ export function loadHookNames(
87
}
88
89
if (!record) {
90
- const callbacks = new Set();
90
+ const callbacks = new Set<() => mixed>();
91
const wakeable: Wakeable = {
92
- then(callback) {
92
+ then(callback: () => mixed) {
93
callbacks.add(callback);
94
},
95
@@ -97,7 +97,7 @@ export function loadHookNames(
97
displayName: `Loading hook names for ${element.displayName || 'Unknown'}`,
98
};
99
100
- let timeoutID;
100
+ let timeoutID: $FlowFixMe | null;
101
let didTimeout = false;
102
let status = 'unknown';
103
let resolvedHookNames: HookNames | null = null;
packages/react-devtools-shared/src/hooks/SourceMapMetadataConsumer.js
+2
-2
@@ -131,7 +131,7 @@ export class SourceMapMetadataConsumer {
131
_getMetadataObjectsBySourceNames(sourcemap: MixedSourceMap): MetadataMap {
132
if (sourcemap.mappings === undefined) {
133
const indexSourceMap: IndexSourceMap = sourcemap;
134
- const metadataMap = new Map();
134
+ const metadataMap = new Map<string, ?ReactSourceMetadata>();
135
indexSourceMap.sections.forEach(section => {
136
const metadataMapForIndexMap = this._getMetadataObjectsBySourceNames(
137
section.map,
@@ -143,7 +143,7 @@ export class SourceMapMetadataConsumer {
143
return metadataMap;
144
}
145
146
- const metadataMap = new Map();
146
+ const metadataMap: MetadataMap = new Map();
147
const basicMap: BasicSourceMap = sourcemap;
148
const updateMap = (metadata: ReactSourceMetadata, sourceIndex: number) => {
149
let source = basicMap.sources[sourceIndex];
packages/react-devtools-shared/src/hooks/generateHookMap.js
+1
-1
@@ -65,7 +65,7 @@ export function generateHookMap(sourceAST: File): HookMap {
65
const names = [];
66
const mappings: Array<HookMapLine> = [];
67
68
- let currentLine = null;
68
+ let currentLine: $FlowFixMe | null = null;
69
hookNamesMapping.forEach(({name, start}) => {
70
let nameIndex = namesMap.get(name);
71
if (nameIndex == null) {
packages/react-devtools-shared/src/hooks/parseHookNames/index.js
+1
-1
@@ -32,7 +32,7 @@ export function parseSourceAndMetadata(
32
33
export const purgeCachedMetadata = workerizedParseHookNames.purgeCachedMetadata;
34
35
-const EMPTY_MAP = new Map();
35
+const EMPTY_MAP: HookNames = new Map();
36
37
export async function parseHookNames(
38
hooksTree: HooksTree,
packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js
+2
-2
@@ -136,7 +136,7 @@ function extractAndLoadSourceMapJSON(
136
locationKeyToHookSourceAndMetadata: LocationKeyToHookSourceAndMetadata,
137
): Promise<Array<$Call<<T>(p: Promise<T> | T) => T, Promise<void>>>> {
138
// Deduplicate fetches, since there can be multiple location keys per source map.
139
- const dedupedFetchPromises = new Map();
139
+ const dedupedFetchPromises = new Map<string, Promise<$FlowFixMe>>();
140
141
if (__DEBUG__) {
142
console.log(
@@ -463,7 +463,7 @@ function loadSourceFiles(
463
fetchFileWithCaching: FetchFileWithCaching | null,
464
): Promise<Array<$Call<<T>(p: Promise<T> | T) => T, Promise<void>>>> {
465
// Deduplicate fetches, since there can be multiple location keys per file.
466
- const dedupedFetchPromises = new Map();
466
+ const dedupedFetchPromises = new Map<string, Promise<$FlowFixMe>>();
467
468
const setterPromises = [];
469
locationKeyToHookSourceAndMetadata.forEach(hookSourceAndMetadata => {
packages/react-devtools-shared/src/hydration.js
+8
@@ -429,41 +429,49 @@ export function hydrate(
429
430
function upgradeUnserializable(destination: Object, source: Object) {
431
Object.defineProperties(destination, {
432
+ // $FlowFixMe[invalid-computed-prop]
433
[meta.inspected]: {
434
configurable: true,
435
enumerable: false,
436
value: !!source.inspected,
437
},
438
+ // $FlowFixMe[invalid-computed-prop]
439
[meta.name]: {
440
configurable: true,
441
enumerable: false,
442
value: source.name,
443
},
444
+ // $FlowFixMe[invalid-computed-prop]
445
[meta.preview_long]: {
446
configurable: true,
447
enumerable: false,
448
value: source.preview_long,
449
},
450
+ // $FlowFixMe[invalid-computed-prop]
451
[meta.preview_short]: {
452
configurable: true,
453
enumerable: false,
454
value: source.preview_short,
455
},
456
+ // $FlowFixMe[invalid-computed-prop]
457
[meta.size]: {
458
configurable: true,
459
enumerable: false,
460
value: source.size,
461
},
462
+ // $FlowFixMe[invalid-computed-prop]
463
[meta.readonly]: {
464
configurable: true,
465
enumerable: false,
466
value: !!source.readonly,
467
},
468
+ // $FlowFixMe[invalid-computed-prop]
469
[meta.type]: {
470
configurable: true,
471
enumerable: false,
472
value: source.type,
473
},
474
+ // $FlowFixMe[invalid-computed-prop]
475
[meta.unserializable]: {
476
configurable: true,
477
enumerable: false,
packages/react-devtools-shared/src/inspectedElementCache.js
+2
-2
@@ -89,9 +89,9 @@ export function inspectElement(
89
const map = getRecordMap();
90
let record = map.get(element);
91
if (!record) {
92
- const callbacks = new Set();
92
+ const callbacks = new Set<() => mixed>();
93
const wakeable: Wakeable = {
94
- then(callback) {
94
+ then(callback: () => mixed) {
95
callbacks.add(callback);
96
},
97
packages/react-devtools-shared/src/utils.js
+2
-2
@@ -84,7 +84,7 @@ export function alphaSortKeys(
84
export function getAllEnumerableKeys(
85
obj: Object,
86
): Set<string | number | symbol> {
87
- const keys = new Set();
87
+ const keys = new Set<string | number | symbol>();
88
let current = obj;
89
while (current != null) {
90
const currentKeys = [
@@ -203,7 +203,7 @@ export function printOperationsArray(operations: Array<number>) {
203
let i = 2;
204
205
// Reassemble the string table.
206
- const stringTable = [
206
+ const stringTable: Array<null | string> = [
207
null, // ID = 0 corresponds to the null string.
208
];
209
const stringTableSize = operations[i++];
packages/react-devtools-shell/src/app/ElementTypes/index.js
+1
-1
@@ -58,7 +58,7 @@ export default function ElementTypes(): React.Node {
58
<Profiler id="test" onRender={() => {}}>
59
<Fragment>
60
<Context.Provider value={'def'}>
61
- <Context.Consumer>{value => null}</Context.Consumer>
61
+ <Context.Consumer>{(value: $FlowFixMe) => null}</Context.Consumer>
62
</Context.Provider>
63
<StrictMode>
64
<Cache>
packages/react-devtools-shell/src/app/InspectableElements/CircularReferences.js
+2
-2
@@ -9,8 +9,8 @@
9
10
import * as React from 'react';
11
12
-const arrayOne = [];
13
-const arrayTwo = [];
12
+const arrayOne: $FlowFixMe = [];
13
+const arrayTwo: $FlowFixMe = [];
14
arrayTwo.push(arrayOne);
15
arrayOne.push(arrayTwo);
16
packages/react-devtools-shell/src/app/InspectableElements/Contexts.js
+28
-10
@@ -259,7 +259,7 @@ class ModernClassContextConsumerWithUpdates extends Component<any> {
259
render(): any {
260
return (
261
<StringContextWithUpdates.Consumer>
262
- {({string, setString}) => (
262
+ {({string, setString}: {string: string, setString: string => void}) => (
263
<>
264
{formatContextForDisplay(
265
'ModernClassContextConsumerWithUpdates',
@@ -284,7 +284,9 @@ export default function Contexts(): React.Node {
284
<LegacyContextProviderWithUpdates />
285
<ModernContext.Provider value={contextData}>
286
<ModernContext.Consumer>
287
- {value => formatContextForDisplay('ModernContext.Consumer', value)}
287
+ {(value: $FlowFixMe) =>
288
+ formatContextForDisplay('ModernContext.Consumer', value)
289
+ }
290
</ModernContext.Consumer>
291
<ModernContextType />
292
</ModernContext.Provider>
@@ -292,28 +294,44 @@ export default function Contexts(): React.Node {
294
<FunctionalContextProviderWithContextUpdates />
295
<ModernClassContextProviderWithUpdates />
296
<ArrayContext.Consumer>
295
- {value => formatContextForDisplay('ArrayContext.Consumer', value)}
297
+ {(value: $FlowFixMe) =>
298
+ formatContextForDisplay('ArrayContext.Consumer', value)
299
+ }
300
</ArrayContext.Consumer>
301
<BoolContext.Consumer>
298
- {value => formatContextForDisplay('BoolContext.Consumer', value)}
302
+ {(value: $FlowFixMe) =>
303
+ formatContextForDisplay('BoolContext.Consumer', value)
304
+ }
305
</BoolContext.Consumer>
306
<FuncContext.Consumer>
301
- {value => formatContextForDisplay('FuncContext.Consumer', value)}
307
+ {(value: $FlowFixMe) =>
308
+ formatContextForDisplay('FuncContext.Consumer', value)
309
+ }
310
</FuncContext.Consumer>
311
<NumberContext.Consumer>
304
- {value => formatContextForDisplay('NumberContext.Consumer', value)}
312
+ {(value: $FlowFixMe) =>
313
+ formatContextForDisplay('NumberContext.Consumer', value)
314
+ }
315
</NumberContext.Consumer>
316
<StringContext.Consumer>
307
- {value => formatContextForDisplay('StringContext.Consumer', value)}
317
+ {(value: $FlowFixMe) =>
318
+ formatContextForDisplay('StringContext.Consumer', value)
319
+ }
320
</StringContext.Consumer>
321
<SymbolContext.Consumer>
310
- {value => formatContextForDisplay('SymbolContext.Consumer', value)}
322
+ {(value: $FlowFixMe) =>
323
+ formatContextForDisplay('SymbolContext.Consumer', value)
324
+ }
325
</SymbolContext.Consumer>
326
<NullContext.Consumer>
313
- {value => formatContextForDisplay('NullContext.Consumer', value)}
327
+ {(value: $FlowFixMe) =>
328
+ formatContextForDisplay('NullContext.Consumer', value)
329
+ }
330
</NullContext.Consumer>
331
<UndefinedContext.Consumer>
316
- {value => formatContextForDisplay('UndefinedContext.Consumer', value)}
332
+ {(value: $FlowFixMe) =>
333
+ formatContextForDisplay('UndefinedContext.Consumer', value)
334
+ }
335
</UndefinedContext.Consumer>
336
</ul>
337
</div>
packages/react-devtools-shell/src/app/InspectableElements/SymbolKeys.js
+4
@@ -16,6 +16,7 @@ const base = Object.create(Object.prototype, {
16
enumerable: true,
17
configurable: true,
18
},
19
+ // $FlowFixMe[invalid-computed-prop]
20
[Symbol('enumerableSymbolBase')]: {
21
value: 1,
22
writable: true,
@@ -28,6 +29,7 @@ const base = Object.create(Object.prototype, {
29
enumerable: false,
30
configurable: true,
31
},
32
+ // $FlowFixMe[invalid-computed-prop]
33
[Symbol('nonEnumerableSymbolBase')]: {
34
value: 1,
35
writable: true,
@@ -55,12 +57,14 @@ const data = Object.create(base, {
57
enumerable: true,
58
configurable: true,
59
},
60
+ // $FlowFixMe[invalid-computed-prop]
61
[Symbol('nonEnumerableSymbol')]: {
62
value: 2,
63
writable: true,
64
enumerable: false,
65
configurable: true,
66
},
67
+ // $FlowFixMe[invalid-computed-prop]
68
[Symbol('enumerableSymbol')]: {
69
value: 3,
70
writable: true,
packages/react-devtools-shell/src/app/SuspenseTree/index.js
+2
-2
@@ -54,12 +54,12 @@ function PrimaryFallbackTest({initialSuspend}) {
54
55
function useTestSequence(label: string, T1: any => any, T2: any => any) {
56
const [step, setStep] = useState(0);
57
- const next = (
57
+ const next: $FlowFixMe = (
58
<button onClick={() => setStep(s => (s + 1) % allSteps.length)}>
59
next {label} content
60
</button>
61
);
62
- const allSteps = [
62
+ const allSteps: $FlowFixMe = [
63
<Fragment>{next}</Fragment>,
64
<Fragment>
65
{next} <T1 prop={step}>mount</T1>
packages/react-devtools-shell/src/app/ToDoList/List.js
+5
-4
@@ -45,7 +45,7 @@ export default function List(props: Props): React.Node {
45
}, [newItemText, items, uid]);
46
47
const handleKeyPress = useCallback(
48
- event => {
48
+ (event: $FlowFixMe) => {
49
if (event.key === 'Enter') {
50
handleClick();
51
}
@@ -54,19 +54,20 @@ export default function List(props: Props): React.Node {
54
);
55
56
const handleChange = useCallback(
57
- event => {
57
+ (event: $FlowFixMe) => {
58
setNewItemText(event.currentTarget.value);
59
},
60
[setNewItemText],
61
);
62
63
const removeItem = useCallback(
64
- itemToRemove => setItems(items.filter(item => item !== itemToRemove)),
64
+ (itemToRemove: $FlowFixMe) =>
65
+ setItems(items.filter(item => item !== itemToRemove)),
66
[items],
67
);
68
69
const toggleItem = useCallback(
69
- itemToToggle => {
70
+ (itemToToggle: $FlowFixMe) => {
71
// Dont use indexOf()
72
// because editing props in DevTools creates a new Object.
73
const index = items.findIndex(item => item.id === itemToToggle.id);
packages/react-devtools-timeline/src/CanvasPage.js
+12
-12
@@ -7,7 +7,7 @@
7
* @flow
8
*/
9
10
-import type {Point} from './view-base';
10
+import type {Interaction, Point} from './view-base';
11
import type {
12
ReactEventInfo,
13
TimelineData,
@@ -199,16 +199,16 @@ function AutoSizedCanvas({
199
}, [searchIndex, searchRegExp, searchResults, viewState]);
200
201
const surfaceRef = useRef(new Surface(resetHoveredEvent));
202
- const userTimingMarksViewRef = useRef(null);
203
- const nativeEventsViewRef = useRef(null);
204
- const schedulingEventsViewRef = useRef(null);
205
- const suspenseEventsViewRef = useRef(null);
206
- const componentMeasuresViewRef = useRef(null);
207
- const reactMeasuresViewRef = useRef(null);
208
- const flamechartViewRef = useRef(null);
209
- const networkMeasuresViewRef = useRef(null);
210
- const snapshotsViewRef = useRef(null);
211
- const thrownErrorsViewRef = useRef(null);
202
+ const userTimingMarksViewRef = useRef<null | UserTimingMarksView>(null);
203
+ const nativeEventsViewRef = useRef<null | NativeEventsView>(null);
204
+ const schedulingEventsViewRef = useRef<null | SchedulingEventsView>(null);
205
+ const suspenseEventsViewRef = useRef<null | SuspenseEventsView>(null);
206
+ const componentMeasuresViewRef = useRef<null | ComponentMeasuresView>(null);
207
+ const reactMeasuresViewRef = useRef<null | ReactMeasuresView>(null);
208
+ const flamechartViewRef = useRef<null | FlamechartView>(null);
209
+ const networkMeasuresViewRef = useRef<null | NetworkMeasuresView>(null);
210
+ const snapshotsViewRef = useRef<null | SnapshotsView>(null);
211
+ const thrownErrorsViewRef = useRef<null | ThrownErrorsView>(null);
212
213
const {hideMenu: hideContextMenu} = useContext(RegistryContext);
214
@@ -484,7 +484,7 @@ function AutoSizedCanvas({
484
}
485
}, [width, height]);
486
487
- const interactor = useCallback(interaction => {
487
+ const interactor = useCallback((interaction: Interaction) => {
488
const canvas = canvasRef.current;
489
if (canvas === null) {
490
return;
packages/react-devtools-timeline/src/content-views/utils/text.js
+1
-1
@@ -12,7 +12,7 @@ import type {Rect} from '../../view-base';
12
import {rectEqualToRect} from '../../view-base';
13
import {COLORS, FONT_SIZE, TEXT_PADDING} from '../constants';
14
15
-const cachedTextWidths = new Map();
15
+const cachedTextWidths = new Map<string, number>();
16
17
export function getTextWidth(
18
context: CanvasRenderingContext2D,
packages/react-devtools-timeline/src/import-worker/preprocessData.js
+3
-3
@@ -391,7 +391,7 @@ function processResourceSendRequest(
391
const data = event.args.data;
392
const requestId = data.requestId;
393
394
- const availableDepths = new Array(
394
+ const availableDepths = new Array<boolean>(
395
state.requestIdToNetworkMeasureMap.size + 1,
396
).fill(true);
397
state.requestIdToNetworkMeasureMap.forEach(({depth}) => {
@@ -557,7 +557,7 @@ function processTimelineEvent(
557
.split('-');
558
const lanes = getLanesFromTransportDecimalBitmask(laneBitmaskString);
559
560
- const availableDepths = new Array(
560
+ const availableDepths = new Array<boolean>(
561
state.unresolvedSuspenseEvents.size + 1,
562
).fill(true);
563
state.unresolvedSuspenseEvents.forEach(({depth}) => {
@@ -1009,7 +1009,7 @@ export default async function preprocessData(
1009
): Promise<TimelineData> {
1010
const flamechart = preprocessFlamechart(timeline);
1011
1012
- const laneToReactMeasureMap = new Map();
1012
+ const laneToReactMeasureMap: Map<ReactLane, Array<ReactMeasure>> = new Map();
1013
for (let lane: ReactLane = 0; lane < REACT_TOTAL_NUM_LANES; lane++) {
1014
laneToReactMeasureMap.set(lane, []);
1015
}
packages/react-devtools-timeline/src/timelineCache.js
+2
-2
@@ -55,9 +55,9 @@ export function importFile(file: File): TimelineData | Error {
55
let record = fileNameToProfilerDataMap.get(fileName);
56
57
if (!record) {
58
- const callbacks = new Set();
58
+ const callbacks = new Set<() => mixed>();
59
const wakeable: Wakeable = {
60
- then(callback) {
60
+ then(callback: () => mixed) {
61
callbacks.add(callback);
62
},
63
packages/react-devtools/app.js
+7
-4
@@ -41,10 +41,13 @@ app.on('ready', function () {
41
42
// https://stackoverflow.com/questions/32402327/
43
// $FlowFixMe[incompatible-use] found when upgrading Flow
44
- mainWindow.webContents.on('new-window', function (event, url) {
45
- event.preventDefault();
46
- require('electron').shell.openExternal(url);
47
- });
44
+ mainWindow.webContents.on(
45
+ 'new-window',
46
+ function (event: $FlowFixMe, url: $FlowFixMe) {
47
+ event.preventDefault();
48
+ require('electron').shell.openExternal(url);
49
+ },
50
+ );
51
52
// and load the index.html of the app.
53
// $FlowFixMe[incompatible-use] found when upgrading Flow
packages/react-dom-bindings/src/client/ReactDOMEventHandle.js
+1
-1
@@ -109,7 +109,7 @@ export function createEventHandle(
109
}
110
}
111
112
- const eventHandle = (
112
+ const eventHandle: ReactDOMEventHandle = (
113
target: EventTarget | ReactScopeInstance,
114
callback: (SyntheticEvent<EventTarget>) => void,
115
) => {
packages/react-dom-bindings/src/client/setInnerHTML.js
+3
-1
@@ -12,7 +12,7 @@ import createMicrosoftUnsafeLocalFunction from './createMicrosoftUnsafeLocalFunc
12
import {enableTrustedTypesIntegration} from 'shared/ReactFeatureFlags';
13
14
// SVG temp container for IE lacking innerHTML
15
-let reusableSVGContainer;
15
+let reusableSVGContainer: HTMLElement;
16
17
/**
18
* Set the innerHTML property of a node
@@ -57,6 +57,8 @@ const setInnerHTML: (
57
while (node.firstChild) {
58
node.removeChild(node.firstChild);
59
}
60
+ // $FlowFixMe[incompatible-use]
61
+ // $FlowFixMe[incompatible-type]
62
while (svgNode.firstChild) {
63
node.appendChild(svgNode.firstChild);
64
}
packages/react-dom-bindings/src/events/DOMPluginEventSystem.js
+1
@@ -459,6 +459,7 @@ function addTrappedEventListener(
459
if (enableLegacyFBSupport && isDeferredListenerForLegacyFBSupport) {
460
const originalListener = listener;
461
// $FlowFixMe[missing-this-annot]
462
+ // $FlowFixMe[definition-cycle]
463
listener = function (...p) {
464
removeEventListener(
465
targetContainer,
packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js
+2
-3
@@ -51,8 +51,7 @@ function registerEvents() {
51
}
52
53
function createAndAccumulateChangeEvent(
54
- // $FlowFixMe[missing-local-annot]
55
- dispatchQueue,
54
+ dispatchQueue: DispatchQueue,
55
inst: null | Fiber,
56
nativeEvent: AnyNativeEvent,
57
target: null | EventTarget,
@@ -89,7 +88,7 @@ function shouldUseChangeEvent(elem: Instance | TextInstance) {
88
}
89
90
function manualDispatchChangeEvent(nativeEvent: AnyNativeEvent) {
92
- const dispatchQueue = [];
91
+ const dispatchQueue: DispatchQueue = [];
92
createAndAccumulateChangeEvent(
93
dispatchQueue,
94
activeElementInst,
packages/react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js
+1
@@ -27,6 +27,7 @@ if (document.readyState === 'loading') {
27
} else {
28
// body may not exist yet if the fizz runtime is sent in <head>
29
// (e.g. as a preinit resource)
30
+ // $FlowFixMe[recursive-definition]
31
const domBodyObserver = new MutationObserver(() => {
32
// We expect the body node to be stable once parsed / created
33
if (document.body) {
packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js
+1
-1
@@ -1878,7 +1878,7 @@ function pushStartPreformattedElement(
1878
// HTML, we want to make sure that it's a safe tag.
1879
// http://www.w3.org/TR/REC-xml/#NT-Name
1880
const VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
1881
-const validatedTagCache = new Map();
1881
+const validatedTagCache = new Map<string, PrecomputedChunk>();
1882
function startChunkForTag(tag: string): PrecomputedChunk {
1883
let tagStartChunk = validatedTagCache.get(tag);
1884
if (tagStartChunk === undefined) {
packages/react-dom-bindings/src/shared/ReactDOMResourceValidation.js
+27
-17
@@ -104,9 +104,11 @@ export function validatePreloadResourceDifference(
104
originalWarningName,
105
);
106
} else {
107
- let missingProps = null;
108
- let extraProps = null;
109
- let differentProps = null;
107
+ let missingProps: {[string]: $FlowFixMe} | null = null;
108
+ let extraProps: {[string]: $FlowFixMe} | null = null;
109
+ let differentProps: {
110
+ [string]: {latest: $FlowFixMe, original: $FlowFixMe},
111
+ } | null = null;
112
if (originalProps.media != null && latestProps.media == null) {
113
missingProps = missingProps || ({}: {[string]: $FlowFixMe});
114
missingProps.media = originalProps.media;
@@ -164,9 +166,11 @@ export function validateStyleResourceDifference(
166
latestProps,
167
false,
168
);
167
- let missingProps = null;
168
- let extraProps = null;
169
- let differentProps = null;
169
+ let missingProps: {[string]: $FlowFixMe} | null = null;
170
+ let extraProps: {[string]: $FlowFixMe} | null = null;
171
+ let differentProps: {
172
+ [string]: {latest: $FlowFixMe, original: $FlowFixMe},
173
+ } | null = null;
174
if (originalProps.media != null && latestProps.media == null) {
175
missingProps = missingProps || ({}: {[string]: $FlowFixMe});
176
missingProps.media = originalProps.media;
@@ -224,8 +228,10 @@ export function validateScriptResourceDifference(
228
latestProps,
229
false,
230
);
227
- let extraProps = null;
228
- let differentProps = null;
231
+ let extraProps: {[string]: $FlowFixMe} | null = null;
232
+ let differentProps: {
233
+ [string]: {latest: $FlowFixMe, original: $FlowFixMe},
234
+ } | null = null;
235
236
for (const propName in latestProps) {
237
const propValue = latestProps[propName];
@@ -291,9 +297,11 @@ export function validateStyleAndHintProps(
297
);
298
}
299
294
- let missingProps = null;
295
- let extraProps = null;
296
- let differentProps = null;
300
+ let missingProps: {[string]: $FlowFixMe} | null = null;
301
+ let extraProps: {[string]: $FlowFixMe} | null = null;
302
+ let differentProps: {
303
+ [string]: {latest: $FlowFixMe, original: $FlowFixMe},
304
+ } | null = null;
305
306
for (const propName in styleProps) {
307
const styleValue = styleProps[propName];
@@ -373,9 +381,11 @@ export function validateScriptAndHintProps(
381
);
382
}
383
376
- let missingProps = null;
377
- let extraProps = null;
378
- let differentProps = null;
384
+ let missingProps: {[string]: $FlowFixMe} | null = null;
385
+ let extraProps: {[string]: $FlowFixMe} | null = null;
386
+ let differentProps: {
387
+ [string]: {latest: $FlowFixMe, original: $FlowFixMe},
388
+ } | null = null;
389
390
for (const propName in scriptProps) {
391
const scriptValue = scriptProps[propName];
@@ -505,9 +515,9 @@ export function validateURLKeyedUpdatedProps(
515
// Whether they are null or undefined
516
if (pendingProps[urlPropKey] === currentProps[urlPropKey]) {
517
// If we have the same href/src we need all other props to be the same
508
- let missingProps;
509
- let extraProps;
510
- let differentProps;
518
+ let missingProps: ?{[string]: mixed};
519
+ let extraProps: ?{[string]: mixed};
520
+ let differentProps: ?{[string]: {latest: mixed, original: mixed}};
521
const allProps = Array.from(
522
new Set(Object.keys(currentProps).concat(Object.keys(pendingProps))),
523
);
packages/react-dom/src/client/ReactDOMLegacy.js
+1
-1
@@ -130,7 +130,7 @@ function legacyCreateRootFromDOMContainer(
130
};
131
}
132
133
- const root = createHydrationContainer(
133
+ const root: FiberRoot = createHydrationContainer(
134
initialChildren,
135
callback,
136
container,
packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
+1
-1
@@ -49,7 +49,7 @@ function renderToReadableStream(
49
return new Promise((resolve, reject) => {
50
let onFatalError;
51
let onAllReady;
52
- const allReady = new Promise((res, rej) => {
52
+ const allReady = new Promise<void>((res, rej) => {
53
onAllReady = res;
54
onFatalError = rej;
55
});
packages/react-dom/src/server/ReactDOMFizzServerBun.js
+1
-1
@@ -49,7 +49,7 @@ function renderToReadableStream(
49
return new Promise((resolve, reject) => {
50
let onFatalError;
51
let onAllReady;
52
- const allReady = new Promise((res, rej) => {
52
+ const allReady = new Promise<void>((res, rej) => {
53
onAllReady = res;
54
onFatalError = rej;
55
});
packages/react-dom/src/server/ReactDOMFizzServerEdge.js
+1
-1
@@ -49,7 +49,7 @@ function renderToReadableStream(
49
return new Promise((resolve, reject) => {
50
let onFatalError;
51
let onAllReady;
52
- const allReady = new Promise((res, rej) => {
52
+ const allReady = new Promise<void>((res, rej) => {
53
onAllReady = res;
54
onFatalError = rej;
55
});
packages/react-dom/src/server/ReactDOMFizzStaticNode.js
+1
-1
@@ -66,7 +66,7 @@ function prerenderToNodeStreams(
66
const onFatalError = reject;
67
68
function onAllReady() {
69
- const readable = new Readable({
69
+ const readable: Readable = new Readable({
70
read() {
71
startFlowing(request, writable);
72
},
packages/react-interactions/events/src/dom/create-event-handle/useEvent.js
+1
-1
@@ -32,7 +32,7 @@ export default function useEvent(
32
33
if (useEventHandle === null) {
34
const setEventHandle = unstable_createEventHandle(event, options);
35
- const clears = new Map();
35
+ const clears = new Map<EventTarget, () => void>();
36
useEventHandle = {
37
setListener(
38
target: EventTarget,
packages/react-native-renderer/src/ReactFabric.js
+2
-1
@@ -10,6 +10,7 @@
10
import type {HostComponent} from './ReactNativeTypes';
11
import type {ReactPortal, ReactNodeList} from 'shared/ReactTypes';
12
import type {ElementRef, Element, ElementType} from 'react';
13
+import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
14
15
import './ReactFabricInjection';
16
@@ -257,7 +258,7 @@ function createPortal(
258
259
setBatchingImplementation(batchedUpdatesImpl, discreteUpdates);
260
260
-const roots = new Map();
261
+const roots = new Map<number, FiberRoot>();
262
263
export {
264
// This is needed for implementation details of TouchableNativeFeedback
packages/react-native-renderer/src/ReactFabricEventEmitter.js
+1
-1
@@ -45,7 +45,7 @@ function extractPluginEvents(
45
nativeEvent: AnyNativeEvent,
46
nativeEventTarget: null | EventTarget,
47
): Array<ReactSyntheticEvent> | ReactSyntheticEvent | null {
48
- let events = null;
48
+ let events: Array<ReactSyntheticEvent> | ReactSyntheticEvent | null = null;
49
const legacyPlugins = ((plugins: any): Array<LegacyPluginModule<Event>>);
50
for (let i = 0; i < legacyPlugins.length; i++) {
51
// Not every plugin in the ordering may be loaded at runtime.
packages/react-native-renderer/src/ReactNativeAttributePayload.js
+1
-1
@@ -212,7 +212,7 @@ function addNestedProperty(
212
updatePayload: null | Object,
213
nextProp: NestedNode,
214
validAttributes: AttributeConfiguration,
215
-) {
215
+): $FlowFixMe {
216
if (!nextProp) {
217
return updatePayload;
218
}
packages/react-native-renderer/src/ReactNativeEventEmitter.js
+1
-1
@@ -130,7 +130,7 @@ function extractPluginEvents(
130
nativeEvent: AnyNativeEvent,
131
nativeEventTarget: null | EventTarget,
132
): Array<ReactSyntheticEvent> | ReactSyntheticEvent | null {
133
- let events = null;
133
+ let events: Array<ReactSyntheticEvent> | ReactSyntheticEvent | null = null;
134
const legacyPlugins = ((plugins: any): Array<LegacyPluginModule<Event>>);
135
for (let i = 0; i < legacyPlugins.length; i++) {
136
// Not every plugin in the ordering may be loaded at runtime.
packages/react-native-renderer/src/ReactNativeFiberInspector.js
+3
-3
@@ -34,7 +34,7 @@ let getInspectorDataForInstance: (
34
closestInstance: Fiber | null,
35
) => InspectorData;
36
let getOwnerHierarchy;
37
-let traverseOwnerTreeUp;
37
+let traverseOwnerTreeUp: (hierarchy: Array<$FlowFixMe>, instance: any) => void;
38
39
if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
40
// $FlowFixMe[missing-local-annot]
@@ -124,7 +124,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
124
};
125
126
getOwnerHierarchy = function (instance: any) {
127
- const hierarchy = [];
127
+ const hierarchy: Array<$FlowFixMe> = [];
128
traverseOwnerTreeUp(hierarchy, instance);
129
return hierarchy;
130
};
@@ -142,7 +142,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
142
};
143
144
// $FlowFixMe[missing-local-annot]
145
- traverseOwnerTreeUp = function (hierarchy, instance: any) {
145
+ traverseOwnerTreeUp = function (hierarchy, instance: any): void {
146
if (instance) {
147
hierarchy.unshift(instance);
148
traverseOwnerTreeUp(hierarchy, instance._debugOwner);
packages/react-native-renderer/src/ReactNativeRenderer.js
+2
-1
@@ -10,6 +10,7 @@
10
import type {HostComponent} from './ReactNativeTypes';
11
import type {ReactPortal, ReactNodeList} from 'shared/ReactTypes';
12
import type {ElementRef, Element, ElementType} from 'react';
13
+import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
14
15
import './ReactNativeInjection';
16
@@ -263,7 +264,7 @@ function computeComponentStackForErrorReporting(reactTag: number): string {
264
return getStackByFiberInDevAndProd(fiber);
265
}
266
266
-const roots = new Map();
267
+const roots = new Map<number, FiberRoot>();
268
269
const Internals = {
270
computeComponentStackForErrorReporting,
packages/react-reconciler/src/ReactChildFiber.js
+2
-2
@@ -768,7 +768,7 @@ function createChildReconciler(
768
769
if (__DEV__) {
770
// First, validate keys.
771
- let knownKeys = null;
771
+ let knownKeys: Set<string> | null = null;
772
for (let i = 0; i < newChildren.length; i++) {
773
const child = newChildren[i];
774
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
@@ -961,7 +961,7 @@ function createChildReconciler(
961
// We'll get a different iterator later for the main pass.
962
const newChildren = iteratorFn.call(newChildrenIterable);
963
if (newChildren) {
964
- let knownKeys = null;
964
+ let knownKeys: Set<string> | null = null;
965
let step = newChildren.next();
966
for (; !step.done; step = newChildren.next()) {
967
const child = step.value;
packages/react-reconciler/src/ReactFiberBeginWork.js
+4
-4
@@ -1492,7 +1492,7 @@ function updateHostRoot(
1492
if (workInProgress.flags & ForceClientRender) {
1493
// Something errored during a previous attempt to hydrate the shell, so we
1494
// forced a client render.
1495
- const recoverableError = createCapturedValueAtFiber(
1495
+ const recoverableError = createCapturedValueAtFiber<mixed>(
1496
new Error(
1497
'There was an error while hydrating. Because the error happened outside ' +
1498
'of a Suspense boundary, the entire root will switch to ' +
@@ -1508,7 +1508,7 @@ function updateHostRoot(
1508
recoverableError,
1509
);
1510
} else if (nextChildren !== prevChildren) {
1511
- const recoverableError = createCapturedValueAtFiber(
1511
+ const recoverableError = createCapturedValueAtFiber<mixed>(
1512
new Error(
1513
'This root received an early update, before anything was able ' +
1514
'hydrate. Switched the entire root to client rendering.',
@@ -2820,7 +2820,7 @@ function updateDehydratedSuspenseComponent(
2820
);
2821
}
2822
(error: any).digest = digest;
2823
- const capturedValue = createCapturedValue(error, digest, stack);
2823
+ const capturedValue = createCapturedValue<mixed>(error, digest, stack);
2824
return retrySuspenseComponentWithoutHydrating(
2825
current,
2826
workInProgress,
@@ -2955,7 +2955,7 @@ function updateDehydratedSuspenseComponent(
2955
pushPrimaryTreeSuspenseHandler(workInProgress);
2956
2957
workInProgress.flags &= ~ForceClientRender;
2958
- const capturedValue = createCapturedValue(
2958
+ const capturedValue = createCapturedValue<mixed>(
2959
new Error(
2960
'There was an error while hydrating this Suspense boundary. ' +
2961
'Switched to client rendering.',
packages/react-reconciler/src/ReactFiberClassComponent.js
+10
-10
@@ -92,16 +92,16 @@ let didWarnAboutContextTypeAndContextTypes;
92
let didWarnAboutInvalidateContextType;
93
94
if (__DEV__) {
95
- didWarnAboutStateAssignmentForComponent = new Set();
96
- didWarnAboutUninitializedState = new Set();
97
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
98
- didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
99
- didWarnAboutDirectlyAssigningPropsToState = new Set();
100
- didWarnAboutUndefinedDerivedState = new Set();
101
- didWarnAboutContextTypeAndContextTypes = new Set();
102
- didWarnAboutInvalidateContextType = new Set();
103
-
104
- const didWarnOnInvalidCallback = new Set();
95
+ didWarnAboutStateAssignmentForComponent = new Set<string>();
96
+ didWarnAboutUninitializedState = new Set<string>();
97
+ didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set<string>();
98
+ didWarnAboutLegacyLifecyclesAndDerivedState = new Set<string>();
99
+ didWarnAboutDirectlyAssigningPropsToState = new Set<string>();
100
+ didWarnAboutUndefinedDerivedState = new Set<string>();
101
+ didWarnAboutContextTypeAndContextTypes = new Set<string>();
102
+ didWarnAboutInvalidateContextType = new Set<string>();
103
+
104
+ const didWarnOnInvalidCallback = new Set<string>();
105
106
warnOnInvalidCallback = function (callback: mixed, callerName: string) {
107
if (callback === null || typeof callback === 'function') {
packages/react-reconciler/src/ReactFiberClassUpdateQueue.js
+1
-1
@@ -536,7 +536,7 @@ export function processUpdateQueue<State>(
536
537
let newBaseState = null;
538
let newFirstBaseUpdate = null;
539
- let newLastBaseUpdate = null;
539
+ let newLastBaseUpdate: null | Update<State> = null;
540
541
let update: Update<State> = firstBaseUpdate;
542
do {
packages/react-reconciler/src/ReactFiberCompleteWork.js
+6
-1
@@ -204,7 +204,12 @@ function hadNoMutationsEffects(current: null | Fiber, completedWork: Fiber) {
204
return true;
205
}
206
207
-let appendAllChildren;
207
+let appendAllChildren: (
208
+ parent: Instance,
209
+ workInProgress: Fiber,
210
+ needsVisibilityToggle: boolean,
211
+ isHidden: boolean,
212
+) => void;
213
let updateHostContainer;
214
let updateHostComponent;
215
let updateHostText;
packages/react-reconciler/src/ReactFiberHooks.js
+3
-3
@@ -168,8 +168,8 @@ let didWarnAboutMismatchedHooksForComponent;
168
let didWarnUncachedGetSnapshot;
169
let didWarnAboutUseWrappedInTryCatch;
170
if (__DEV__) {
171
- didWarnAboutMismatchedHooksForComponent = new Set();
172
- didWarnAboutUseWrappedInTryCatch = new Set();
171
+ didWarnAboutMismatchedHooksForComponent = new Set<string | null>();
172
+ didWarnAboutUseWrappedInTryCatch = new Set<string | null>();
173
}
174
175
export type Hook = {
@@ -1112,7 +1112,7 @@ function updateReducer<S, I, A>(
1112
1113
let newBaseState = null;
1114
let newBaseQueueFirst = null;
1115
- let newBaseQueueLast = null;
1115
+ let newBaseQueueLast: Update<S, A> | null = null;
1116
let update = first;
1117
do {
1118
// An extra OffscreenLane bit is added to updates that were made to
packages/react-reconciler/src/ReactFiberHotReloading.js
+2
-2
@@ -274,7 +274,7 @@ function scheduleFibersWithFamiliesRecursively(
274
fiber: Fiber,
275
updatedFamilies: Set<Family>,
276
staleFamilies: Set<Family>,
277
-) {
277
+): void {
278
if (__DEV__) {
279
const {alternate, child, sibling, tag, type} = fiber;
280
@@ -353,7 +353,7 @@ export const findHostInstancesForRefresh: FindHostInstancesForRefresh = (
353
families: Array<Family>,
354
): Set<Instance> => {
355
if (__DEV__) {
356
- const hostInstances = new Set();
356
+ const hostInstances = new Set<Instance>();
357
const types = new Set(families.map(family => family.current));
358
findHostInstancesForMatchingFibersRecursively(
359
root.current,
packages/react-reconciler/src/ReactFiberReconciler.js
+3
-3
@@ -554,7 +554,7 @@ if (__DEV__) {
554
obj: Object | Array<any>,
555
path: Array<string | number>,
556
index: number,
557
- ) => {
557
+ ): $FlowFixMe => {
558
const key = path[index];
559
const updated = isArray(obj) ? obj.slice() : {...obj};
560
if (index + 1 === path.length) {
@@ -582,7 +582,7 @@ if (__DEV__) {
582
oldPath: Array<string | number>,
583
newPath: Array<string | number>,
584
index: number,
585
- ) => {
585
+ ): $FlowFixMe => {
586
const oldKey = oldPath[index];
587
const updated = isArray(obj) ? obj.slice() : {...obj};
588
if (index + 1 === oldPath.length) {
@@ -633,7 +633,7 @@ if (__DEV__) {
633
path: Array<string | number>,
634
index: number,
635
value: any,
636
- ) => {
636
+ ): $FlowFixMe => {
637
if (index >= path.length) {
638
return value;
639
}
packages/react-reconciler/src/ReactFiberTreeReflection.js
+2
-2
@@ -275,7 +275,7 @@ export function findCurrentHostFiber(parent: Fiber): Fiber | null {
275
: null;
276
}
277
278
-function findCurrentHostFiberImpl(node: Fiber) {
278
+function findCurrentHostFiberImpl(node: Fiber): Fiber | null {
279
// Next we'll drill down this component to find the first HostComponent/Text.
280
const tag = node.tag;
281
if (
@@ -306,7 +306,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
306
: null;
307
}
308
309
-function findCurrentHostFiberWithNoPortalsImpl(node: Fiber) {
309
+function findCurrentHostFiberWithNoPortalsImpl(node: Fiber): Fiber | null {
310
// Next we'll drill down this component to find the first HostComponent/Text.
311
const tag = node.tag;
312
if (
packages/react-reconciler/src/ReactFiberWorkLoop.js
+10
-5
@@ -404,7 +404,8 @@ export function addTransitionStartCallbackToPendingTransition(
404
}
405
406
if (currentPendingTransitionCallbacks.transitionStart === null) {
407
- currentPendingTransitionCallbacks.transitionStart = [];
407
+ currentPendingTransitionCallbacks.transitionStart =
408
+ ([]: Array<Transition>);
409
}
410
411
currentPendingTransitionCallbacks.transitionStart.push(transition);
@@ -537,7 +538,8 @@ export function addTransitionCompleteCallbackToPendingTransition(
538
}
539
540
if (currentPendingTransitionCallbacks.transitionComplete === null) {
540
- currentPendingTransitionCallbacks.transitionComplete = [];
541
+ currentPendingTransitionCallbacks.transitionComplete =
542
+ ([]: Array<Transition>);
543
}
544
545
currentPendingTransitionCallbacks.transitionComplete.push(transition);
@@ -1000,7 +1002,10 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
1002
1003
// This is the entry point for every concurrent task, i.e. anything that
1004
// goes through Scheduler.
1003
-function performConcurrentWorkOnRoot(root: FiberRoot, didTimeout: boolean) {
1005
+function performConcurrentWorkOnRoot(
1006
+ root: FiberRoot,
1007
+ didTimeout: boolean,
1008
+): $FlowFixMe {
1009
if (enableProfilerTimer && enableProfilerNestedUpdatePhase) {
1010
resetNestedUpdateFlag();
1011
}
@@ -3329,7 +3334,7 @@ export function attachPingListener(
3334
let threadIDs;
3335
if (pingCache === null) {
3336
pingCache = root.pingCache = new PossiblyWeakMap();
3332
- threadIDs = new Set();
3337
+ threadIDs = new Set<mixed>();
3338
pingCache.set(wakeable, threadIDs);
3339
} else {
3340
threadIDs = pingCache.get(wakeable);
@@ -3829,7 +3834,7 @@ if (__DEV__ && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
3834
let didWarnAboutUpdateInRender = false;
3835
let didWarnAboutUpdateInRenderForAnotherComponent;
3836
if (__DEV__) {
3832
- didWarnAboutUpdateInRenderForAnotherComponent = new Set();
3837
+ didWarnAboutUpdateInRenderForAnotherComponent = new Set<string>();
3838
}
3839
3840
function warnAboutRenderPhaseUpdatesInDEV(fiber: Fiber) {
packages/react-reconciler/src/ReactProfilerTimer.js
-1
@@ -122,7 +122,6 @@ function stopProfilerTimerIfRunningAndRecordDelta(
122
123
if (profilerStartTime >= 0) {
124
const elapsedTime = now() - profilerStartTime;
125
- // $FlowFixMe[unsafe-addition] addition with possible null/undefined value
125
fiber.actualDuration += elapsedTime;
126
if (overrideBaseTime) {
127
fiber.selfBaseDuration = elapsedTime;
packages/react-reconciler/src/ReactStrictModeWarnings.js
+9
-9
@@ -58,7 +58,7 @@ if (__DEV__) {
58
let pendingUNSAFE_ComponentWillUpdateWarnings: Array<Fiber> = [];
59
60
// Tracks components we have already warned about.
61
- const didWarnAboutUnsafeLifecycles = new Set();
61
+ const didWarnAboutUnsafeLifecycles = new Set<mixed>();
62
63
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = (
64
fiber: Fiber,
@@ -115,7 +115,7 @@ if (__DEV__) {
115
116
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = () => {
117
// We do an initial pass to gather component names
118
- const componentWillMountUniqueNames = new Set();
118
+ const componentWillMountUniqueNames = new Set<string>();
119
if (pendingComponentWillMountWarnings.length > 0) {
120
pendingComponentWillMountWarnings.forEach(fiber => {
121
componentWillMountUniqueNames.add(
@@ -126,7 +126,7 @@ if (__DEV__) {
126
pendingComponentWillMountWarnings = [];
127
}
128
129
- const UNSAFE_componentWillMountUniqueNames = new Set();
129
+ const UNSAFE_componentWillMountUniqueNames = new Set<string>();
130
if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
131
pendingUNSAFE_ComponentWillMountWarnings.forEach(fiber => {
132
UNSAFE_componentWillMountUniqueNames.add(
@@ -137,7 +137,7 @@ if (__DEV__) {
137
pendingUNSAFE_ComponentWillMountWarnings = [];
138
}
139
140
- const componentWillReceivePropsUniqueNames = new Set();
140
+ const componentWillReceivePropsUniqueNames = new Set<string>();
141
if (pendingComponentWillReceivePropsWarnings.length > 0) {
142
pendingComponentWillReceivePropsWarnings.forEach(fiber => {
143
componentWillReceivePropsUniqueNames.add(
@@ -149,7 +149,7 @@ if (__DEV__) {
149
pendingComponentWillReceivePropsWarnings = [];
150
}
151
152
- const UNSAFE_componentWillReceivePropsUniqueNames = new Set();
152
+ const UNSAFE_componentWillReceivePropsUniqueNames = new Set<string>();
153
if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
154
pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(fiber => {
155
UNSAFE_componentWillReceivePropsUniqueNames.add(
@@ -161,7 +161,7 @@ if (__DEV__) {
161
pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
162
}
163
164
- const componentWillUpdateUniqueNames = new Set();
164
+ const componentWillUpdateUniqueNames = new Set<string>();
165
if (pendingComponentWillUpdateWarnings.length > 0) {
166
pendingComponentWillUpdateWarnings.forEach(fiber => {
167
componentWillUpdateUniqueNames.add(
@@ -173,7 +173,7 @@ if (__DEV__) {
173
pendingComponentWillUpdateWarnings = [];
174
}
175
176
- const UNSAFE_componentWillUpdateUniqueNames = new Set();
176
+ const UNSAFE_componentWillUpdateUniqueNames = new Set<string>();
177
if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
178
pendingUNSAFE_ComponentWillUpdateWarnings.forEach(fiber => {
179
UNSAFE_componentWillUpdateUniqueNames.add(
@@ -288,7 +288,7 @@ if (__DEV__) {
288
let pendingLegacyContextWarning: FiberToFiberComponentsMap = new Map();
289
290
// Tracks components we have already warned about.
291
- const didWarnAboutLegacyContext = new Set();
291
+ const didWarnAboutLegacyContext = new Set<mixed>();
292
293
ReactStrictModeWarnings.recordLegacyContextWarning = (
294
fiber: Fiber,
@@ -331,7 +331,7 @@ if (__DEV__) {
331
}
332
const firstFiber = fiberArray[0];
333
334
- const uniqueNames = new Set();
334
+ const uniqueNames = new Set<string>();
335
fiberArray.forEach(fiber => {
336
uniqueNames.add(getComponentNameFromFiber(fiber) || 'Component');
337
didWarnAboutLegacyContext.add(fiber.type);
packages/react-refresh/src/ReactFreshRuntime.js
+5
-5
@@ -162,14 +162,14 @@ function resolveFamily(type: any) {
162
163
// If we didn't care about IE11, we could use new Map/Set(iterable).
164
function cloneMap<K, V>(map: Map<K, V>): Map<K, V> {
165
- const clone = new Map();
165
+ const clone = new Map<K, V>();
166
map.forEach((value, key) => {
167
clone.set(key, value);
168
});
169
return clone;
170
}
171
function cloneSet<T>(set: Set<T>): Set<T> {
172
- const clone = new Set();
172
+ const clone = new Set<T>();
173
set.forEach(value => {
174
clone.add(value);
175
});
@@ -201,8 +201,8 @@ export function performReactRefresh(): RefreshUpdate | null {
201
202
isPerformingRefresh = true;
203
try {
204
- const staleFamilies = new Set();
205
- const updatedFamilies = new Set();
204
+ const staleFamilies = new Set<Family>();
205
+ const updatedFamilies = new Set<Family>();
206
207
const updates = pendingUpdates;
208
pendingUpdates = [];
@@ -418,7 +418,7 @@ export function findAffectedHostInstances(
418
families: Array<Family>,
419
): Set<Instance> {
420
if (__DEV__) {
421
- const affectedInstances = new Set();
421
+ const affectedInstances = new Set<Instance>();
422
mountedRoots.forEach(root => {
423
const helpers = helpersByRoot.get(root);
424
if (helpers === undefined) {
packages/react-server-dom-relay/src/ReactFlightDOMRelayClientHostConfig.js
+7
-3
@@ -44,14 +44,18 @@ export function resolveClientReference<T>(
44
return resolveClientReferenceImpl(moduleData);
45
}
46
47
-// $FlowFixMe[missing-local-annot]
48
-function parseModelRecursively(response: Response, parentObj, key, value) {
47
+function parseModelRecursively(
48
+ response: Response,
49
+ parentObj: {+[key: string]: JSONValue} | $ReadOnlyArray<JSONValue>,
50
+ key: string,
51
+ value: JSONValue,
52
+): $FlowFixMe {
53
if (typeof value === 'string') {
54
return parseModelString(response, parentObj, key, value);
55
}
56
if (typeof value === 'object' && value !== null) {
57
if (isArray(value)) {
54
- const parsedValue = [];
58
+ const parsedValue: Array<$FlowFixMe> = [];
59
for (let i = 0; i < value.length; i++) {
60
(parsedValue: any)[i] = parseModelRecursively(
61
response,
packages/react-server-dom-webpack/src/ReactFlightDOMClient.js
+8
-1
@@ -31,7 +31,14 @@ function startReadingFromStream(
31
stream: ReadableStream,
32
): void {
33
const reader = stream.getReader();
34
- function progress({done, value}: {done: boolean, value: ?any, ...}) {
34
+ function progress({
35
+ done,
36
+ value,
37
+ }: {
38
+ done: boolean,
39
+ value: ?any,
40
+ ...
41
+ }): void | Promise<void> {
42
if (done) {
43
close(response);
44
return;
packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js
+7
-7
@@ -74,7 +74,11 @@ module.exports = function register() {
74
};
75
76
const proxyHandlers = {
77
- get: function (target: Function, name: string, receiver: Proxy<Function>) {
77
+ get: function (
78
+ target: Function,
79
+ name: string,
80
+ receiver: Proxy<Function>,
81
+ ): $FlowFixMe {
82
switch (name) {
83
// These names are read by the Flight runtime if you end up using the exports object.
84
case '$$typeof':
@@ -143,14 +147,10 @@ module.exports = function register() {
147
target.status = 'fulfilled';
148
target.value = proxy;
149
146
- // $FlowFixMe[missing-local-annot]
150
const then = (target.then = Object.defineProperties(
151
(function then(resolve, reject: any) {
152
// Expose to React.
150
- return Promise.resolve(
151
- // $FlowFixMe[incompatible-call] found when upgrading Flow
152
- resolve(proxy),
153
- );
153
+ return Promise.resolve(resolve(proxy));
154
}: any),
155
// If this is not used as a Promise but is treated as a reference to a `.then`
156
// export then we should treat it as a reference to that name.
@@ -200,7 +200,7 @@ module.exports = function register() {
200
// Pretend to be a Promise in case anyone asks.
201
return PROMISE_PROTOTYPE;
202
},
203
- set: function () {
203
+ set: function (): empty {
204
throw new Error('Cannot assign to a client module from a server module.');
205
},
206
};
packages/react-server-native-relay/src/ReactFlightNativeRelayClientHostConfig.js
+7
-3
@@ -44,14 +44,18 @@ export function resolveClientReference<T>(
44
return resolveClientReferenceImpl(moduleData);
45
}
46
47
-// $FlowFixMe[missing-local-annot]
48
-function parseModelRecursively(response: Response, parentObj, key, value) {
47
+function parseModelRecursively(
48
+ response: Response,
49
+ parentObj: {+[key: string]: JSONValue} | $ReadOnlyArray<JSONValue>,
50
+ key: string,
51
+ value: JSONValue,
52
+): $FlowFixMe {
53
if (typeof value === 'string') {
54
return parseModelString(response, parentObj, key, value);
55
}
56
if (typeof value === 'object' && value !== null) {
57
if (isArray(value)) {
54
- const parsedValue = [];
58
+ const parsedValue: Array<$FlowFixMe> = [];
59
for (let i = 0; i < value.length; i++) {
60
(parsedValue: any)[i] = parseModelRecursively(
61
response,
packages/react-server/src/ReactFizzClassComponent.js
+9
-9
@@ -31,15 +31,15 @@ let didWarnAboutContextTypeAndContextTypes;
31
let didWarnAboutInvalidateContextType;
32
33
if (__DEV__) {
34
- didWarnAboutUninitializedState = new Set();
35
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
36
- didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
37
- didWarnAboutDirectlyAssigningPropsToState = new Set();
38
- didWarnAboutUndefinedDerivedState = new Set();
39
- didWarnAboutContextTypeAndContextTypes = new Set();
40
- didWarnAboutInvalidateContextType = new Set();
41
-
42
- const didWarnOnInvalidCallback = new Set();
34
+ didWarnAboutUninitializedState = new Set<string>();
35
+ didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set<mixed>();
36
+ didWarnAboutLegacyLifecyclesAndDerivedState = new Set<string>();
37
+ didWarnAboutDirectlyAssigningPropsToState = new Set<string>();
38
+ didWarnAboutUndefinedDerivedState = new Set<string>();
39
+ didWarnAboutContextTypeAndContextTypes = new Set<mixed>();
40
+ didWarnAboutInvalidateContextType = new Set<mixed>();
41
+
42
+ const didWarnOnInvalidCallback = new Set<string>();
43
44
warnOnInvalidCallback = function (callback: mixed, callerName: string) {
45
if (callback === null || typeof callback === 'function') {
packages/react-server/src/ReactFizzHooks.js
+2
-2
@@ -461,7 +461,7 @@ function dispatchAction<A>(
461
componentIdentity: Object,
462
queue: UpdateQueue<A>,
463
action: A,
464
-) {
464
+): void {
465
if (numberOfReRenders >= RE_RENDER_LIMIT) {
466
throw new Error(
467
'Too many re-renders. React limits the number of renders to prevent ' +
@@ -615,7 +615,7 @@ function useCacheRefresh(): <T>(?() => T, ?T) => void {
615
}
616
617
function useMemoCache(size: number): Array<any> {
618
- const data = new Array(size);
618
+ const data = new Array<any>(size);
619
for (let i = 0; i < size; i++) {
620
data[i] = REACT_MEMO_CACHE_SENTINEL;
621
}
packages/react-server/src/ReactFizzServer.js
+7
-7
@@ -275,10 +275,10 @@ export function createRequest(
275
onShellError: void | ((error: mixed) => void),
276
onFatalError: void | ((error: mixed) => void),
277
): Request {
278
- const pingedTasks = [];
278
+ const pingedTasks: Array<Task> = [];
279
const abortSet: Set<Task> = new Set();
280
const resources: Resources = createResources();
281
- const request = {
281
+ const request: Request = {
282
destination: null,
283
responseState,
284
progressiveChunkSize:
@@ -294,11 +294,11 @@ export function createRequest(
294
completedRootSegment: null,
295
abortableTasks: abortSet,
296
pingedTasks: pingedTasks,
297
- clientRenderedBoundaries: ([]: Array<SuspenseBoundary>),
298
- completedBoundaries: ([]: Array<SuspenseBoundary>),
299
- partialBoundaries: ([]: Array<SuspenseBoundary>),
300
- preamble: ([]: Array<Chunk | PrecomputedChunk>),
301
- postamble: ([]: Array<Chunk | PrecomputedChunk>),
297
+ clientRenderedBoundaries: [],
298
+ completedBoundaries: [],
299
+ partialBoundaries: [],
300
+ preamble: [],
301
+ postamble: [],
302
onError: onError === undefined ? defaultErrorHandler : onError,
303
onAllReady: onAllReady === undefined ? noop : onAllReady,
304
onShellReady: onShellReady === undefined ? noop : onShellReady,
packages/react-server/src/ReactFlightHooks.js
+1
-1
@@ -94,7 +94,7 @@ export const HooksDispatcher: Dispatcher = {
94
return unsupportedRefresh;
95
},
96
useMemoCache(size: number): Array<any> {
97
- const data = new Array(size);
97
+ const data = new Array<any>(size);
98
for (let i = 0; i < size; i++) {
99
data[i] = REACT_MEMO_CACHE_SENTINEL;
100
}
packages/react-server/src/ReactFlightServer.js
+6
-6
@@ -171,8 +171,8 @@ export function createRequest(
171
ReactCurrentCache.current = DefaultCacheDispatcher;
172
173
const abortSet: Set<Task> = new Set();
174
- const pingedTasks = [];
175
- const request = {
174
+ const pingedTasks: Array<Task> = [];
175
+ const request: Request = {
176
status: OPEN,
177
fatalError: null,
178
destination: null,
@@ -182,9 +182,9 @@ export function createRequest(
182
pendingChunks: 0,
183
abortableTasks: abortSet,
184
pingedTasks: pingedTasks,
185
- completedModuleChunks: ([]: Array<Chunk>),
186
- completedJSONChunks: ([]: Array<Chunk>),
187
- completedErrorChunks: ([]: Array<Chunk>),
185
+ completedModuleChunks: [],
186
+ completedJSONChunks: [],
187
+ completedErrorChunks: [],
188
writtenSymbols: new Map(),
189
writtenModules: new Map(),
190
writtenProviders: new Map(),
@@ -485,7 +485,7 @@ function createTask(
485
abortSet: Set<Task>,
486
): Task {
487
const id = request.nextChunkId++;
488
- const task = {
488
+ const task: Task = {
489
id,
490
status: PENDING,
491
model,
packages/react-server/src/ReactServerStreamConfigNode.js
+1
-1
@@ -195,7 +195,7 @@ export function stringToChunk(content: string): Chunk {
195
return content;
196
}
197
198
-const precomputedChunkSet = __DEV__ ? new Set() : null;
198
+const precomputedChunkSet = __DEV__ ? new Set<PrecomputedChunk>() : null;
199
200
export function stringToPrecomputedChunk(content: string): PrecomputedChunk {
201
const precomputedChunk = textEncoder.encode(content);
packages/react-test-renderer/src/ReactTestHostConfig.js
+1
-1
@@ -51,7 +51,7 @@ export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
51
52
const NO_CONTEXT = {};
53
const UPDATE_SIGNAL = {};
54
-const nodeToInstanceMap = new WeakMap();
54
+const nodeToInstanceMap = new WeakMap<any, Instance>();
55
56
if (__DEV__) {
57
Object.freeze(NO_CONTEXT);
packages/react-test-renderer/src/ReactTestRenderer.js
+4
-5
@@ -133,8 +133,7 @@ function toJSON(inst: Instance | TextInstance): ReactTestRendererNode | null {
133
}
134
}
135
136
-// $FlowFixMe[missing-local-annot]
137
-function childrenToTree(node) {
136
+function childrenToTree(node: null | Fiber) {
137
if (!node) {
138
return null;
139
}
@@ -178,7 +177,7 @@ function flatten(arr) {
177
return result;
178
}
179
181
-function toTree(node: ?Fiber) {
180
+function toTree(node: null | Fiber): $FlowFixMe {
181
if (node == null) {
182
return null;
183
}
@@ -495,7 +494,7 @@ function create(
494
}
495
}
496
let container = {
498
- children: [],
497
+ children: ([]: Array<Instance | TextInstance>),
498
createNodeMock,
499
tag: 'CONTAINER',
500
};
@@ -615,7 +614,7 @@ function create(
614
return entry;
615
}
616
618
-const fiberToWrapper = new WeakMap();
617
+const fiberToWrapper = new WeakMap<Fiber, ReactTestInstance>();
618
function wrapFiber(fiber: Fiber): ReactTestInstance {
619
let wrapper = fiberToWrapper.get(fiber);
620
if (wrapper === undefined && fiber.alternate !== null) {
packages/react/src/ReactAct.js
+2
-2
@@ -106,7 +106,7 @@ export function act<T>(callback: () => T | Thenable<T>): Thenable<T> {
106
});
107
108
return {
109
- then(resolve, reject) {
109
+ then(resolve: T => mixed, reject: mixed => mixed) {
110
didAwaitActCall = true;
111
thenable.then(
112
returnValue => {
@@ -184,7 +184,7 @@ export function act<T>(callback: () => T | Thenable<T>): Thenable<T> {
184
ReactCurrentActQueue.current = null;
185
}
186
return {
187
- then(resolve, reject) {
187
+ then(resolve: T => mixed, reject: mixed => mixed) {
188
didAwaitActCall = true;
189
if (prevActScopeDepth === 0) {
190
// If the `act` call is awaited, restore the queue we were
packages/react/src/ReactCache.js
+3
-1
@@ -60,7 +60,9 @@ export function cache<A: Iterable<mixed>, T>(fn: (...A) => T): (...A) => T {
60
// $FlowFixMe: We don't want to use rest arguments since we transpile the code.
61
return fn.apply(null, arguments);
62
}
63
- const fnMap = dispatcher.getCacheForType(createCacheRoot);
63
+ const fnMap: WeakMap<any, CacheNode<T>> = dispatcher.getCacheForType(
64
+ createCacheRoot,
65
+ );
66
const fnNode = fnMap.get(fn);
67
let cacheNode: CacheNode<T>;
68
if (fnNode === undefined) {
packages/react/src/ReactHooks.js
-1
@@ -57,7 +57,6 @@ export function getCacheSignal(): AbortSignal {
57
'This CacheSignal was requested outside React which means that it is ' +
58
'immediately aborted.',
59
);
60
- // $FlowFixMe Flow doesn't yet know about this argument.
60
controller.abort(reason);
61
return controller.signal;
62
}
packages/shared/ReactComponentStackFrame.js
+1
-1
@@ -60,7 +60,7 @@ let reentry = false;
60
let componentFrameCache;
61
if (__DEV__) {
62
const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
63
- componentFrameCache = new PossiblyWeakMap();
63
+ componentFrameCache = new PossiblyWeakMap<Function, string>();
64
}
65
66
export function describeNativeComponentFrame(
packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js
+14
-2
@@ -24,12 +24,22 @@ export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
24
isEqual?: (a: Selection, b: Selection) => boolean,
25
): Selection {
26
// Use this to track the rendered snapshot.
27
- const instRef = useRef(null);
27
+ const instRef = useRef<
28
+ | {
29
+ hasValue: true,
30
+ value: Selection,
31
+ }
32
+ | {
33
+ hasValue: false,
34
+ value: null,
35
+ }
36
+ | null,
37
+ >(null);
38
let inst;
39
if (instRef.current === null) {
40
inst = {
41
hasValue: false,
32
- value: (null: Selection | null),
42
+ value: null,
43
};
44
instRef.current = inst;
45
} else {
@@ -108,7 +118,9 @@ export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
118
);
119
120
useEffect(() => {
121
+ // $FlowFixMe[incompatible-type] changing the variant using mutation isn't supported
122
inst.hasValue = true;
123
+ // $FlowFixMe[incompatible-type]
124
inst.value = value;
125
}, [value]);
126
scripts/flow/config/flowconfig
+2
-1
@@ -44,9 +44,10 @@ untyped-type-import=error
44
%CI_MAX_WORKERS%
45
exact_by_default=true
46
munge_underscores=false
47
+inference_mode=experimental.lti
48
49
# Substituted by createFlowConfig.js:
50
%REACT_RENDERER_FLOW_OPTIONS%
51
52
[version]
52
-^0.199.0
53
+^0.199.1
yarn.lock
+4
-4
@@ -8170,10 +8170,10 @@ flatted@^3.1.0:
8170
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
8171
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
8172
8173
-flow-bin@^0.199.0:
8174
- version "0.199.0"
8175
- resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.199.0.tgz#e710c0834d4e1032529a633e0cf32d89a102fcfb"
8176
- integrity sha512-8N8jn59ghgtDSogFoy1Ld1P8NlfdlVUcXSRADDf8WyX3SMMA6b1SbqraTRXxJDNn0F3WdVBHKdufdUg73y4Nhw==
8173
+flow-bin@^0.199.1:
8174
+ version "0.199.1"
8175
+ resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.199.1.tgz#678eac2303fa898227f4d103264b6ce49f4430c1"
8176
+ integrity sha512-Ic0Mp9iZ2exbH0mNj/XhzUWPZa9JylHb6uQARZnnYCTRwumOpjNOP0qwyRTltWrbCpfHjnWngNO9VLaVKHz2aQ==
8177
8178
flow-parser@^0.198.2:
8179
version "0.198.2"