Skip to content

Commit aed33a4

Browse files
committed
Flow upgrade to 0.185
ghstack-source-id: 8104710c9643aa54961a02546f253dc99d70dd5d Pull Request resolved: #25420
1 parent f02a5f5 commit aed33a4

File tree

10 files changed

+27
-12
lines changed

10 files changed

+27
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6464
"fbjs-scripts": "1.2.0",
6565
"filesize": "^6.0.1",
66-
"flow-bin": "^0.182.0",
66+
"flow-bin": "^0.185.0",
6767
"glob": "^7.1.6",
6868
"glob-stream": "^6.1.0",
6969
"google-closure-compiler": "^20200517.0.0",

packages/react-client/src/ReactFlightClient.js

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
321321
initializingChunkBlockedModel !== null &&
322322
initializingChunkBlockedModel.deps > 0
323323
) {
324+
// $FlowFixMe[incompatible-type]: found when upgrading Flow
324325
initializingChunkBlockedModel.value = value;
325326
// We discovered new dependencies on modules that are not yet resolved.
326327
// We have to go the BLOCKED state until they're resolved.

packages/react-devtools-shell/src/app/InspectableElements/EdgeCaseObjects.js

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ const objectWithModifiedHasOwnProperty = {
1616
};
1717

1818
const objectWithNullProto = Object.create(null);
19+
// $FlowFixMe[prop-missing] found when upgrading Flow
1920
objectWithNullProto.foo = 'abc';
21+
// $FlowFixMe[prop-missing] found when upgrading Flow
2022
objectWithNullProto.bar = 123;
2123

2224
export default function EdgeCaseObjects(): React.Node {

packages/react-dom-bindings/src/client/ReactDOMFloatClient.js

+1
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ function createStyleResource(
528528
} else {
529529
const hint = preloadResources.get(href);
530530
if (hint) {
531+
// $FlowFixMe[incompatible-type]: found when upgrading Flow
531532
resource.hint = hint;
532533
// If a preload for this style Resource already exists there are certain props we want to adopt
533534
// on the style Resource, primarily focussed on making sure the style network pathways utilize

packages/react-native-renderer/src/ReactFabricEventEmitter.js

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export function dispatchEvent(
117117
const event = {eventName: topLevelType, nativeEvent};
118118
// $FlowFixMe[class-object-subtyping] found when upgrading Flow
119119
RawEventEmitter.emit(topLevelType, event);
120+
// $FlowFixMe[class-object-subtyping] found when upgrading Flow
120121
RawEventEmitter.emit('*', event);
121122

122123
// Heritage plugin event system

packages/react-reconciler/src/ReactFiberWorkLoop.new.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition(
404404
) {
405405
if (enableTransitionTracing) {
406406
if (currentPendingTransitionCallbacks === null) {
407-
currentPendingTransitionCallbacks = {
407+
currentPendingTransitionCallbacks = ({
408408
transitionStart: null,
409409
transitionProgress: null,
410410
transitionComplete: null,
411411
markerProgress: new Map(),
412412
markerIncomplete: null,
413413
markerComplete: null,
414-
};
414+
}: PendingTransitionCallbacks);
415415
}
416416

417417
if (currentPendingTransitionCallbacks.markerProgress === null) {
418-
// $FlowFixMe[incompatible-use] found when upgrading Flow
418+
// $FlowFixMe[incompatible-use]
419+
// $FlowFixMe[incompatible-type]
419420
currentPendingTransitionCallbacks.markerProgress = new Map();
420421
}
421422

@@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition(
445446

446447
if (currentPendingTransitionCallbacks.markerIncomplete === null) {
447448
// $FlowFixMe[incompatible-use] found when upgrading Flow
449+
// $FlowFixMe[incompatible-type] found when upgrading Flow
448450
currentPendingTransitionCallbacks.markerIncomplete = new Map();
449451
}
450452

@@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition(
473475

474476
if (currentPendingTransitionCallbacks.markerComplete === null) {
475477
// $FlowFixMe[incompatible-use] found when upgrading Flow
478+
// $FlowFixMe[incompatible-type] found when upgrading Flow
476479
currentPendingTransitionCallbacks.markerComplete = new Map();
477480
}
478481

@@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition(
501504

502505
if (currentPendingTransitionCallbacks.transitionProgress === null) {
503506
// $FlowFixMe[incompatible-use] found when upgrading Flow
507+
// $FlowFixMe[incompatible-type] found when upgrading Flow
504508
currentPendingTransitionCallbacks.transitionProgress = new Map();
505509
}
506510

packages/react-reconciler/src/ReactFiberWorkLoop.old.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition(
404404
) {
405405
if (enableTransitionTracing) {
406406
if (currentPendingTransitionCallbacks === null) {
407-
currentPendingTransitionCallbacks = {
407+
currentPendingTransitionCallbacks = ({
408408
transitionStart: null,
409409
transitionProgress: null,
410410
transitionComplete: null,
411411
markerProgress: new Map(),
412412
markerIncomplete: null,
413413
markerComplete: null,
414-
};
414+
}: PendingTransitionCallbacks);
415415
}
416416

417417
if (currentPendingTransitionCallbacks.markerProgress === null) {
418-
// $FlowFixMe[incompatible-use] found when upgrading Flow
418+
// $FlowFixMe[incompatible-use]
419+
// $FlowFixMe[incompatible-type]
419420
currentPendingTransitionCallbacks.markerProgress = new Map();
420421
}
421422

@@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition(
445446

446447
if (currentPendingTransitionCallbacks.markerIncomplete === null) {
447448
// $FlowFixMe[incompatible-use] found when upgrading Flow
449+
// $FlowFixMe[incompatible-type] found when upgrading Flow
448450
currentPendingTransitionCallbacks.markerIncomplete = new Map();
449451
}
450452

@@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition(
473475

474476
if (currentPendingTransitionCallbacks.markerComplete === null) {
475477
// $FlowFixMe[incompatible-use] found when upgrading Flow
478+
// $FlowFixMe[incompatible-type] found when upgrading Flow
476479
currentPendingTransitionCallbacks.markerComplete = new Map();
477480
}
478481

@@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition(
501504

502505
if (currentPendingTransitionCallbacks.transitionProgress === null) {
503506
// $FlowFixMe[incompatible-use] found when upgrading Flow
507+
// $FlowFixMe[incompatible-type] found when upgrading Flow
504508
currentPendingTransitionCallbacks.transitionProgress = new Map();
505509
}
506510

packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ module.exports = function register() {
101101
name: '*', // Represents the whole object instead of a particular import.
102102
async: false,
103103
};
104+
// $FlowFixMe[incompatible-call] found when upgrading Flow
104105
module.exports = new Proxy(moduleReference, proxyHandlers);
105106
};
106107

scripts/flow/config/flowconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ untyped-type-import=error
4343
%CI_MAX_WORKERS%
4444
exact_by_default=true
4545
munge_underscores=false
46+
inference_mode=classic
4647

4748
# Substituted by createFlowConfig.js:
4849
%REACT_RENDERER_FLOW_OPTIONS%
4950

5051
[version]
51-
^0.182.0
52+
^0.185.0

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -7912,10 +7912,10 @@ flatted@^2.0.0:
79127912
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
79137913
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
79147914

7915-
flow-bin@^0.182.0:
7916-
version "0.182.0"
7917-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.182.0.tgz#1dacbd72465743670412ada015d3182deda6f966"
7918-
integrity sha512-Ux90c2sMfoV/VVjOEFT2OHFJFnyfoIbTK/5AKAMnU4Skfru1G+FyS5YLu3XxQl0R6mpA9+rrFlPfYZq/5B+J3w==
7915+
flow-bin@^0.185.0:
7916+
version "0.185.2"
7917+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.2.tgz#b45a07d45cf641198e86e47848e35f64b0688c4c"
7918+
integrity sha512-Vphs8Z4Qo17dzlPKe/l8M85JvGn1Tf5NV6xESZLg8p9ktdIbNUYaxnq/WBQPoESiLrGdrC2v+rfezfh3tvxkvQ==
79197919

79207920
79217921
version "0.13.0"

0 commit comments

Comments
 (0)