Skip to content

Commit a5235e3

Browse files
committed
flow: Upgrade to Flow v0.141.0
This version fixes a bug I've noticed regularly, and am glad to see gone: Improved inference of chained generic method calls, such as `Array` methods. For example, given `[1, 2].map(a => a).forEach(b => b)`, Flow now infers that `b` is a `number` rather than `any | number`. https://github.com/facebook/flow/blob/main/Changelog.md#01400 This happens in a number of places in our codebase; the `userIds` local in `pmUnreadsKeyFromMessage` is the first one I find just now when I go look for one. I believe this hasn't been likely to conceal type errors (and indeed fixing it didn't reveal any.) That's because the `| number` means that anything consuming that data still needs to be prepared to handle a `number`. But it is disconcerting to have those `any`s showing up regularly when inspecting types in the IDE, and good to have that fixed.
1 parent faeda08 commit a5235e3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ module.file_ext=.ios.js
139139
exact_by_default=true
140140

141141
[version]
142-
^0.137.0
142+
^0.141.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"eslint-plugin-prettier": "^3.2.0",
9797
"eslint-plugin-react": "^7.24.0",
9898
"eslint-plugin-react-hooks": "^4.2.0",
99-
"flow-bin": "^0.137.0",
99+
"flow-bin": "^0.141.0",
100100
"flow-coverage-report": "^0.8.0",
101101
"flow-typed": "^3.3.1",
102102
"immutable-devtools": "^0.1.5",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5368,10 +5368,10 @@ flow-annotation-check@^1.8.1:
53685368
glob "7.1.6"
53695369
load-pkg "^4.0.0"
53705370

5371-
flow-bin@^0.137.0:
5372-
version "0.137.0"
5373-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.137.0.tgz#322a15b3744195af1e02bf1fec0a716296aee7d5"
5374-
integrity sha512-ytwUn68fPKK/VWVpCxJ4KNeNIjCC/uX0Ll6Z1E98sOXfMknB000WtgQjKYDdO6tOR8mvXBE0adzjgCrChVympw==
5371+
flow-bin@^0.141.0:
5372+
version "0.141.0"
5373+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.141.0.tgz#f9e33ad29392824823c97b6db7de5ab972c7f872"
5374+
integrity sha512-NxaECTjIWfs2Y91GuA1PlgPd5uCulZcqR9wiXRg6n7/AbmvVetM2ewoGxCKxJm7wIml3f0/5KXIZvZa/3msqXg==
53755375

53765376
flow-coverage-report@^0.8.0:
53775377
version "0.8.0"

0 commit comments

Comments
 (0)