diff --git a/package.json b/package.json index b3c25420349d6..b8260ff5c0f4d 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "eslint-plugin-react-internal": "link:./scripts/eslint-rules", "fbjs-scripts": "1.2.0", "filesize": "^6.0.1", - "flow-bin": "^0.182.0", + "flow-bin": "^0.185.0", "glob": "^7.1.6", "glob-stream": "^6.1.0", "google-closure-compiler": "^20200517.0.0", diff --git a/packages/react-client/src/ReactFlightClient.js b/packages/react-client/src/ReactFlightClient.js index 44815dce4b5b9..33db1c494b2d9 100644 --- a/packages/react-client/src/ReactFlightClient.js +++ b/packages/react-client/src/ReactFlightClient.js @@ -321,6 +321,7 @@ function initializeModelChunk(chunk: ResolvedModelChunk): void { initializingChunkBlockedModel !== null && initializingChunkBlockedModel.deps > 0 ) { + // $FlowFixMe[incompatible-type]: found when upgrading Flow initializingChunkBlockedModel.value = value; // We discovered new dependencies on modules that are not yet resolved. // We have to go the BLOCKED state until they're resolved. diff --git a/packages/react-devtools-shell/src/app/InspectableElements/EdgeCaseObjects.js b/packages/react-devtools-shell/src/app/InspectableElements/EdgeCaseObjects.js index 5c3eb7e3d5f68..d2a73510aef4b 100644 --- a/packages/react-devtools-shell/src/app/InspectableElements/EdgeCaseObjects.js +++ b/packages/react-devtools-shell/src/app/InspectableElements/EdgeCaseObjects.js @@ -16,7 +16,9 @@ const objectWithModifiedHasOwnProperty = { }; const objectWithNullProto = Object.create(null); +// $FlowFixMe[prop-missing] found when upgrading Flow objectWithNullProto.foo = 'abc'; +// $FlowFixMe[prop-missing] found when upgrading Flow objectWithNullProto.bar = 123; export default function EdgeCaseObjects(): React.Node { diff --git a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js index dbe74440146fc..22a8a17fadf31 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js +++ b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js @@ -528,6 +528,7 @@ function createStyleResource( } else { const hint = preloadResources.get(href); if (hint) { + // $FlowFixMe[incompatible-type]: found when upgrading Flow resource.hint = hint; // If a preload for this style Resource already exists there are certain props we want to adopt // on the style Resource, primarily focussed on making sure the style network pathways utilize diff --git a/packages/react-native-renderer/src/ReactFabricEventEmitter.js b/packages/react-native-renderer/src/ReactFabricEventEmitter.js index 49f83b43758df..272d41208ccb7 100644 --- a/packages/react-native-renderer/src/ReactFabricEventEmitter.js +++ b/packages/react-native-renderer/src/ReactFabricEventEmitter.js @@ -117,6 +117,7 @@ export function dispatchEvent( const event = {eventName: topLevelType, nativeEvent}; // $FlowFixMe[class-object-subtyping] found when upgrading Flow RawEventEmitter.emit(topLevelType, event); + // $FlowFixMe[class-object-subtyping] found when upgrading Flow RawEventEmitter.emit('*', event); // Heritage plugin event system diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index c32c6bed13f0e..19a98052cd742 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition( ) { if (enableTransitionTracing) { if (currentPendingTransitionCallbacks === null) { - currentPendingTransitionCallbacks = { + currentPendingTransitionCallbacks = ({ transitionStart: null, transitionProgress: null, transitionComplete: null, markerProgress: new Map(), markerIncomplete: null, markerComplete: null, - }; + }: PendingTransitionCallbacks); } if (currentPendingTransitionCallbacks.markerProgress === null) { - // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-use] + // $FlowFixMe[incompatible-type] currentPendingTransitionCallbacks.markerProgress = new Map(); } @@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition( if (currentPendingTransitionCallbacks.markerIncomplete === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.markerIncomplete = new Map(); } @@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition( if (currentPendingTransitionCallbacks.markerComplete === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.markerComplete = new Map(); } @@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition( if (currentPendingTransitionCallbacks.transitionProgress === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.transitionProgress = new Map(); } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 339bee2ea0879..6b8efdba30695 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition( ) { if (enableTransitionTracing) { if (currentPendingTransitionCallbacks === null) { - currentPendingTransitionCallbacks = { + currentPendingTransitionCallbacks = ({ transitionStart: null, transitionProgress: null, transitionComplete: null, markerProgress: new Map(), markerIncomplete: null, markerComplete: null, - }; + }: PendingTransitionCallbacks); } if (currentPendingTransitionCallbacks.markerProgress === null) { - // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-use] + // $FlowFixMe[incompatible-type] currentPendingTransitionCallbacks.markerProgress = new Map(); } @@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition( if (currentPendingTransitionCallbacks.markerIncomplete === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.markerIncomplete = new Map(); } @@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition( if (currentPendingTransitionCallbacks.markerComplete === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.markerComplete = new Map(); } @@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition( if (currentPendingTransitionCallbacks.transitionProgress === null) { // $FlowFixMe[incompatible-use] found when upgrading Flow + // $FlowFixMe[incompatible-type] found when upgrading Flow currentPendingTransitionCallbacks.transitionProgress = new Map(); } diff --git a/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js b/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js index 0adff81020373..4c9b3447d028c 100644 --- a/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js +++ b/packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js @@ -101,6 +101,7 @@ module.exports = function register() { name: '*', // Represents the whole object instead of a particular import. async: false, }; + // $FlowFixMe[incompatible-call] found when upgrading Flow module.exports = new Proxy(moduleReference, proxyHandlers); }; diff --git a/scripts/flow/config/flowconfig b/scripts/flow/config/flowconfig index fadeb06f0bb75..7e0724cdcec47 100644 --- a/scripts/flow/config/flowconfig +++ b/scripts/flow/config/flowconfig @@ -43,9 +43,10 @@ untyped-type-import=error %CI_MAX_WORKERS% exact_by_default=true munge_underscores=false +inference_mode=classic # Substituted by createFlowConfig.js: %REACT_RENDERER_FLOW_OPTIONS% [version] -^0.182.0 +^0.185.0 diff --git a/yarn.lock b/yarn.lock index 696a20379ab4a..992fb5c4adfd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7912,10 +7912,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== -flow-bin@^0.182.0: - version "0.182.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.182.0.tgz#1dacbd72465743670412ada015d3182deda6f966" - integrity sha512-Ux90c2sMfoV/VVjOEFT2OHFJFnyfoIbTK/5AKAMnU4Skfru1G+FyS5YLu3XxQl0R6mpA9+rrFlPfYZq/5B+J3w== +flow-bin@^0.185.0: + version "0.185.2" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.2.tgz#b45a07d45cf641198e86e47848e35f64b0688c4c" + integrity sha512-Vphs8Z4Qo17dzlPKe/l8M85JvGn1Tf5NV6xESZLg8p9ktdIbNUYaxnq/WBQPoESiLrGdrC2v+rfezfh3tvxkvQ== fluent-syntax@0.13.0: version "0.13.0"