@samitouri / QOS-React-2 / commits / 4bbac04cd3

Upgrade Flow to 0.201 (#26326)

Small Flow upgrade to keep us current.

Jan Kassens committed Mar 6, 2023 at 10:33 UTC 4bbac04cd3624962900bb7800ba4f9609d3a1fd3
9 files changed +27 -26
package.json
+2 -2
@@ -65,8 +65,8 @@
65 "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
66 "fbjs-scripts": "^3.0.1",
67 "filesize": "^6.0.1",
68 - "flow-bin": "^0.199.1",
69 - "flow-remove-types": "^2.198.2",
68 + "flow-bin": "^0.201.0",
69 + "flow-remove-types": "^2.201.0",
70 "glob": "^7.1.6",
71 "glob-stream": "^6.1.0",
72 "google-closure-compiler": "^20230206.0.0",
packages/react-devtools-extensions/src/backend.js
+1 -1
@@ -54,7 +54,7 @@ function setup(hook: any) {
54 const setupNativeStyleEditor =
55 require('react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor').default;
56
57 - const bridge = new Bridge({
57 + const bridge = new Bridge<$FlowFixMe, $FlowFixMe>({
58 listen(fn) {
59 const listener = (event: $FlowFixMe) => {
60 if (
packages/react-devtools-shell/src/app/console.js
+1 -1
@@ -12,7 +12,7 @@ function ignoreStrings(
12 stringsToIgnore: Array<string>,
13 ): void {
14 // $FlowFixMe[prop-missing] index access only allowed for objects with index keys
15 - console[methodName] = (...args) => {
15 + console[methodName] = (...args: $ReadOnlyArray<mixed>) => {
16 const maybeString = args[0];
17 if (typeof maybeString === 'string') {
18 for (let i = 0; i < stringsToIgnore.length; i++) {
packages/react-reconciler/src/ReactFiberClassUpdateQueue.js
+1 -2
@@ -161,7 +161,7 @@ export const CaptureUpdate = 3;
161 let hasForceUpdate = false;
162
163 let didWarnUpdateInsideUpdate;
164 -let currentlyProcessingQueue;
164 +let currentlyProcessingQueue: ?SharedQueue<$FlowFixMe>;
165 export let resetCurrentlyProcessingQueue: () => void;
166 if (__DEV__) {
167 didWarnUpdateInsideUpdate = false;
@@ -475,7 +475,6 @@ export function processUpdateQueue<State>(
475 hasForceUpdate = false;
476
477 if (__DEV__) {
478 - // $FlowFixMe[escaped-generic] discovered when updating Flow
478 currentlyProcessingQueue = queue.shared;
479 }
480
packages/react-reconciler/src/ReactFiberHooks.js
+1 -1
@@ -165,7 +165,7 @@ export type UpdateQueue<S, A> = {
165 };
166
167 let didWarnAboutMismatchedHooksForComponent;
168 -let didWarnUncachedGetSnapshot;
168 +let didWarnUncachedGetSnapshot: void | true;
169 let didWarnAboutUseWrappedInTryCatch;
170 if (__DEV__) {
171 didWarnAboutMismatchedHooksForComponent = new Set<string | null>();
packages/react-refresh/src/ReactFreshRuntime.js
+2 -2
@@ -642,8 +642,8 @@ export function createSignatureFunctionForTransform(): <T>(
642 getCustomHooks?: () => Array<Function>,
643 ) => T | void {
644 if (__DEV__) {
645 - let savedType;
646 - let hasCustomHooks;
645 + let savedType: mixed;
646 + let hasCustomHooks: boolean;
647 let didCollectHooks = false;
648 return function <T>(
649 type: T,
packages/react-server/src/ReactFlightServerConfigStream.js
+2
@@ -126,6 +126,7 @@ export function processModelChunk(
126 id: number,
127 model: ReactModel,
128 ): Chunk {
129 + // $FlowFixMe[incompatible-type] stringify can return null
130 const json: string = stringify(model, request.toJSON);
131 const row = id.toString(16) + ':' + json + '\n';
132 return stringToChunk(row);
@@ -146,6 +147,7 @@ export function processImportChunk(
147 id: number,
148 clientReferenceMetadata: ReactModel,
149 ): Chunk {
150 + // $FlowFixMe[incompatible-type] stringify can return null
151 const json: string = stringify(clientReferenceMetadata);
152 const row = serializeRowHeader('I', id) + json + '\n';
153 return stringToChunk(row);
scripts/flow/config/flowconfig
+1 -1
@@ -44,4 +44,4 @@ inference_mode=experimental.lti
44 %REACT_RENDERER_FLOW_OPTIONS%
45
46 [version]
47 -^0.199.1
47 +^0.201.0
yarn.lock
+16 -16
@@ -8180,22 +8180,22 @@ flatted@^3.1.0:
8180 resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
8181 integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
8182
8183 -flow-bin@^0.199.1:
8184 - version "0.199.1"
8185 - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.199.1.tgz#678eac2303fa898227f4d103264b6ce49f4430c1"
8186 - integrity sha512-Ic0Mp9iZ2exbH0mNj/XhzUWPZa9JylHb6uQARZnnYCTRwumOpjNOP0qwyRTltWrbCpfHjnWngNO9VLaVKHz2aQ==
8187 -
8188 -flow-parser@^0.198.2:
8189 - version "0.198.2"
8190 - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.198.2.tgz#4c225995896b6be75943e9358e606a4fd86c87d9"
8191 - integrity sha512-tCQzqXbRAz0ZadIhAXGwdp/xsusADo8IK9idgc/2qCK5RmazbKDGedyykfRtzWgy7Klt4f4NZxq0o/wFUg6plQ==
8192 -
8193 -flow-remove-types@^2.198.2:
8194 - version "2.198.2"
8195 - resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.198.2.tgz#1b9e0e32eead4554f0d325391bbeb0c7a2a2993f"
8196 - integrity sha512-l7ua9FnZwI0HUUUu2Khj3pYnGSlkY5vOE60bgG1ajPJ9P+KzRgXIjpCaS4iTbUEpu6olzRrAVJtJ5N8kxmvpiQ==
8197 - dependencies:
8198 - flow-parser "^0.198.2"
8183 +flow-bin@^0.201.0:
8184 + version "0.201.0"
8185 + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.201.0.tgz#bc8d7c3687526313d7a24dd920873a0273148d81"
8186 + integrity sha512-fqx6CMOhX9Xm4mN+tq/c7sqcm8aHFV1ipbLz2ZCzoNcPuUNZPoSVYm4p0qZqH0HyzMMEP1OWlU7dIkuSJ02cpg==
8187 +
8188 +flow-parser@^0.201.0:
8189 + version "0.201.0"
8190 + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.201.0.tgz#d2005d4dae6fddf60d30f9ae0fb49a13c9c51cfe"
8191 + integrity sha512-G4oeDNpNGyIrweF9EnoHatncAihMT0tQgV6NMdyM5I7fhrz9Pr13PJ2KLQ673O4wj9KooTdBpeeYHdDNAQoyyw==
8192 +
8193 +flow-remove-types@^2.201.0:
8194 + version "2.201.0"
8195 + resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.201.0.tgz#d02d8a3ff3cb17d23da35c9786b02cdccc0ef9b8"
8196 + integrity sha512-EaS6Q0ApEjFdwD/JtBC1Hm+0j6mMsHeV5FR6MP+UI1RdTeNMdadMITt0Vb3XPBANLXZufaNzs6EMwpGNPzwwoA==
8197 + dependencies:
8198 + flow-parser "^0.201.0"
8199 pirates "^3.0.2"
8200 vlq "^0.2.1"
8201