Skip to content

Commit 34464fb

Browse files
authored
Upgrade to Flow 0.196.3 (#25974)
After the previous changes these upgrade are easy. - removes config options that were removed - object index access now requires an indexer key in the type, this cause a handful of errors that were fixed - undefined keys error in all places, this needed a few extra suppressions for repeated undefined identifiers. Flow's [CHANGELOG.md](https://github.com/facebook/flow/blob/main/Changelog.md).
1 parent e2424f3 commit 34464fb

File tree

8 files changed

+17
-12
lines changed

8 files changed

+17
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6262
"fbjs-scripts": "1.2.0",
6363
"filesize": "^6.0.1",
64-
"flow-bin": "^0.190.0",
64+
"flow-bin": "^0.196.3",
6565
"flow-remove-types": "^2.196.1",
6666
"glob": "^7.1.6",
6767
"glob-stream": "^6.1.0",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,6 +3271,7 @@ export function attach(
32713271
for (const method in console) {
32723272
try {
32733273
originalConsoleMethods[method] = console[method];
3274+
// $FlowFixMe[prop-missing]
32743275
console[method] = () => {};
32753276
} catch (error) {}
32763277
}
@@ -3285,6 +3286,7 @@ export function attach(
32853286
// Restore original console functionality.
32863287
for (const method in originalConsoleMethods) {
32873288
try {
3289+
// $FlowFixMe[prop-missing]
32883290
console[method] = originalConsoleMethods[method];
32893291
} catch (error) {}
32903292
}

packages/react-devtools-shared/src/hydration.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ export function dehydrate(
248248
// Other types (e.g. typed arrays, Sets) will not spread correctly.
249249
Array.from(data).forEach(
250250
(item, i) =>
251+
// $FlowFixMe[prop-missing] Unserializable doesn't have an index signature
251252
(unserializableValue[i] = dehydrate(
252253
item,
253254
cleaned,

packages/react-devtools-shell/src/app/console.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function ignoreStrings(
1111
methodName: string,
1212
stringsToIgnore: Array<string>,
1313
): void {
14+
// $FlowFixMe[prop-missing] index access only allowed for objects with index keys
1415
console[methodName] = (...args) => {
1516
const maybeString = args[0];
1617
if (typeof maybeString === 'string') {

packages/react-reconciler/src/ReactFiberAct.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
2323
// to false.
2424

2525
const isReactActEnvironmentGlobal =
26-
// $FlowFixMe Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
26+
// $FlowFixMe[cannot-resolve-name] Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
2727
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
28-
? IS_REACT_ACT_ENVIRONMENT
28+
? // $FlowFixMe[cannot-resolve-name]
29+
IS_REACT_ACT_ENVIRONMENT
2930
: undefined;
3031

3132
// $FlowFixMe - Flow doesn't know about jest
@@ -40,8 +41,10 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
4041
export function isConcurrentActEnvironment(): void | boolean {
4142
if (__DEV__) {
4243
const isReactActEnvironmentGlobal =
44+
// $FlowFixMe[cannot-resolve-name] Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
4345
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
44-
? IS_REACT_ACT_ENVIRONMENT
46+
? // $FlowFixMe[cannot-resolve-name]
47+
IS_REACT_ACT_ENVIRONMENT
4548
: undefined;
4649

4750
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {

packages/react-reconciler/src/ReactFiberFlags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const MountPassiveDev = /* */ 0b100000000000000000000000000;
6767
// Groups of flags that are used in the commit phase to skip over trees that
6868
// don't contain effects, by checking subtreeFlags.
6969

70-
export const BeforeMutationMask =
70+
export const BeforeMutationMask: number =
7171
// TODO: Remove Update flag from before mutation phase by re-landing Visibility
7272
// flag logic (see #20043)
7373
Update |

scripts/flow/config/flowconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ untyped-type-import=error
4343
%CI_MAX_WORKERS%
4444
exact_by_default=true
4545
munge_underscores=false
46-
enforce_local_inference_annotations=true
47-
exact_empty_objects=true
4846

4947
# Substituted by createFlowConfig.js:
5048
%REACT_RENDERER_FLOW_OPTIONS%
5149

5250
[version]
53-
^0.190.0
51+
^0.196.3

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7915,10 +7915,10 @@ flatted@^3.1.0:
79157915
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
79167916
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
79177917

7918-
flow-bin@^0.190.0:
7919-
version "0.190.0"
7920-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.190.0.tgz#cfc50e1474facf8150232a6c498fe66a6bb75969"
7921-
integrity sha512-Qo3bvN3cmGFXsq63ZxcHFZXQDvgx84fCuq8cXuKk5xbvuebBGwMqS+ku/rH+gEkciRrcTYrXqoSzb9b6ShcoJg==
7918+
flow-bin@^0.196.3:
7919+
version "0.196.3"
7920+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.196.3.tgz#b6df48986a2629f2c6a26fb79d73fc07c8056af0"
7921+
integrity sha512-pmvjlksi1CvkSnDHpcfhDFj/KC3hwSgE2OpzvugW57dfgqfHzqX1UfZIcScGWM5AmP/IeOsQCW383k3zIbEnrA==
79227922

79237923
flow-parser@^0.196.1:
79247924
version "0.196.1"

0 commit comments

Comments
 (0)