Skip to content

Commit 5fe0f58

Browse files
committed
Update Flow to 0.267
Changes to type inference require some more annotations.
1 parent b09c495 commit 5fe0f58

File tree

13 files changed

+26
-26
lines changed

13 files changed

+26
-26
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
7575
"fbjs-scripts": "^3.0.1",
7676
"filesize": "^6.0.1",
77-
"flow-bin": "^0.266",
78-
"flow-remove-types": "^2.266",
77+
"flow-bin": "^0.267",
78+
"flow-remove-types": "^2.267",
7979
"flow-typed": "^4.1.1",
8080
"glob": "^7.1.6",
8181
"glob-stream": "^6.1.0",

packages/react-devtools-shared/src/backend/fiber/renderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,9 +1317,9 @@ export function attach(
13171317
if (componentLogsEntry === undefined) {
13181318
componentLogsEntry = {
13191319
errors: new Map(),
1320-
errorsCount: 0,
1320+
errorsCount: 0 as number,
13211321
warnings: new Map(),
1322-
warningsCount: 0,
1322+
warningsCount: 0 as number,
13231323
};
13241324
fiberToComponentLogsMap.set(fiber, componentLogsEntry);
13251325
}

packages/react-devtools-shared/src/backend/flight/renderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ export function attach(
118118
if (componentLogsEntry === undefined) {
119119
componentLogsEntry = {
120120
errors: new Map(),
121-
errorsCount: 0,
121+
errorsCount: 0 as number,
122122
warnings: new Map(),
123-
warningsCount: 0,
123+
warningsCount: 0 as number,
124124
};
125125
componentInfoToComponentLogsMap.set(componentInfo, componentLogsEntry);
126126
}

packages/react-reconciler/src/ReactFiberApplyGesture.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ function recursivelyInsertNewFiber(
488488
const viewTransitionState: ViewTransitionState = finishedWork.stateNode;
489489
// TODO: If this was already cloned by a previous pass we can reuse those clones.
490490
viewTransitionState.clones = null;
491-
let nextPhase;
491+
let nextPhase: VisitPhase;
492492
if (visitPhase === INSERT_EXIT) {
493493
// This was an Enter of a ViewTransition. We now move onto inserting the inner
494494
// HostComponents and finding inner pairs.
@@ -637,7 +637,7 @@ function recursivelyInsertClonesFromExistingTree(
637637
// So we need it to be cleared before we do that.
638638
// TODO: Use some other temporary state to track this.
639639
child.flags &= ~Update;
640-
let nextPhase;
640+
let nextPhase: VisitPhase;
641641
if (visitPhase === CLONE_EXIT) {
642642
// This was an Enter of a ViewTransition. We now move onto unhiding the inner
643643
// HostComponents and finding inner pairs.
@@ -894,7 +894,7 @@ function insertDestinationClonesOfFiber(
894894
// Only insert clones if this tree is going to be visible. No need to
895895
// clone invisible content.
896896
// TODO: If this is visible but detached it should still be cloned.
897-
let nextPhase;
897+
let nextPhase: VisitPhase;
898898
if (visitPhase === CLONE_UPDATE && (flags & Visibility) !== NoFlags) {
899899
// This is the root of an appear. We need to trigger Enter transitions.
900900
nextPhase = CLONE_EXIT;
@@ -922,7 +922,7 @@ function insertDestinationClonesOfFiber(
922922
const viewTransitionState: ViewTransitionState = finishedWork.stateNode;
923923
// TODO: If this was already cloned by a previous pass we can reuse those clones.
924924
viewTransitionState.clones = null;
925-
let nextPhase;
925+
let nextPhase: VisitPhase;
926926
if (visitPhase === CLONE_EXIT) {
927927
// This was an Enter of a ViewTransition. We now move onto unhiding the inner
928928
// HostComponents and finding inner pairs.

packages/react-reconciler/src/ReactFiberCacheComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const AbortControllerLocal: typeof AbortController =
2525
function AbortControllerShim() {
2626
const listeners = [];
2727
const signal = (this.signal = {
28-
aborted: false,
28+
aborted: false as boolean,
2929
addEventListener: (type, listener) => {
3030
listeners.push(listener);
3131
},

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ function useMemoCache(size: number): Array<mixed> {
12081208
? currentMemoCache.data
12091209
: // Clone the memo cache before each render (copy-on-write)
12101210
currentMemoCache.data.map(array => array.slice()),
1211-
index: 0,
1211+
index: 0 as number,
12121212
};
12131213
}
12141214
}
@@ -1218,7 +1218,7 @@ function useMemoCache(size: number): Array<mixed> {
12181218
if (memoCache == null) {
12191219
memoCache = {
12201220
data: [],
1221-
index: 0,
1221+
index: 0 as number,
12221222
};
12231223
}
12241224
if (updateQueue === null) {

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ export function performWorkOnRoot(
10601060
// even for regular pings.
10611061
checkIfRootIsPrerendering(root, lanes);
10621062

1063-
let exitStatus = shouldTimeSlice
1063+
let exitStatus: RootExitStatus = shouldTimeSlice
10641064
? renderRootConcurrent(root, lanes)
10651065
: renderRootSync(root, lanes, true);
10661066

@@ -1212,7 +1212,7 @@ function recoverFromConcurrentError(
12121212
root: FiberRoot,
12131213
originallyAttemptedLanes: Lanes,
12141214
errorRetryLanes: Lanes,
1215-
) {
1215+
): RootExitStatus {
12161216
// If an error occurred during hydration, discard server response and fall
12171217
// back to client side render.
12181218

@@ -2520,7 +2520,7 @@ function workLoopSync() {
25202520
}
25212521
}
25222522

2523-
function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
2523+
function renderRootConcurrent(root: FiberRoot, lanes: Lanes): RootExitStatus {
25242524
const prevExecutionContext = executionContext;
25252525
executionContext |= RenderContext;
25262526
const prevDispatcher = pushDispatcher(root.containerInfo);

packages/react-server/src/ReactFlightReplyServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ function createModelResolver<T>(
556556
}
557557
} else {
558558
blocked = initializingChunkBlockedModel = {
559-
deps: cyclic ? 0 : 1,
559+
deps: (cyclic ? 0 : 1) as number,
560560
value: (null: any),
561561
};
562562
}

packages/scheduler/src/forks/Scheduler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function unstable_runWithPriority<T>(
283283
}
284284

285285
function unstable_next<T>(eventHandler: () => T): T {
286-
var priorityLevel;
286+
var priorityLevel: PriorityLevel;
287287
switch (currentPriorityLevel) {
288288
case ImmediatePriority:
289289
case UserBlockingPriority:

packages/scheduler/src/forks/SchedulerMock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function unstable_runWithPriority<T>(
286286
}
287287

288288
function unstable_next<T>(eventHandler: () => T): T {
289-
var priorityLevel;
289+
var priorityLevel: PriorityLevel;
290290
switch (currentPriorityLevel) {
291291
case ImmediatePriority:
292292
case UserBlockingPriority:

0 commit comments

Comments
 (0)