Upgrade Flow to 0.340.0 (#59961)

Summary:
X-link: https://github.com/meta/relay/pull/5447


X-link: https://github.com/react/metro/pull/2222

Upgrade the Flow typechecker to 0.340.0 in React Native, Metro, and Relay.

Update version constraints and dependency lockfiles, keep the shared Node.js declarations synchronized, and preserve compatibility with the new checker. Runtime behavior and public API signatures are unchanged.

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)

Changelog: [Internal]

@public

Reviewed By: javache

Differential Revision: D131463913

Pull Request resolved: https://github.com/react/react-native/pull/59961
This commit is contained in:
George Zahariev authored and GitHub committed 2026-11-12 20:44:30 +00:00
1 parent de7e643aa3
commit 6d587e8736
6 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -97,4 +97,4 @@ untyped-import
untyped-type-import
[version]
^0.338.0
^0.340.0
+5 -7
View File
@@ -3747,6 +3747,7 @@ type duplexStreamOptions = writableStreamOptions &
writableHighWaterMark?: number,
...
};
// prettier-ignore
declare class stream$Duplex extends stream$Readable mixins stream$Writable {
// This is an unusual class at runtime, per the docs it "prototypally extends from Readable,
// and then parasitically from Writable." Its static methods have incompatible signatures
@@ -3755,13 +3756,10 @@ declare class stream$Duplex extends stream$Readable mixins stream$Writable {
// $FlowFixMe[incompatible-exact] See above
// $FlowFixMe[incompatible-type] See above
static fromWeb(
pair: Readonly<{
readable: ReadableStream,
writable: WritableStream,
}>,
options?: duplexStreamOptions,
): this;
static fromWeb(pair: Readonly<{
readable: ReadableStream,
writable: WritableStream,
}>, options?: duplexStreamOptions): this;
// $FlowFixMe[incompatible-type] See above
static toWeb(streamDuplex: stream$Duplex): {
+1 -1
View File
@@ -98,7 +98,7 @@
"eslint-plugin-relay": "^1.8.3",
"fb-dotslash": "0.5.8",
"flow-api-translator": "0.336.0",
"flow-bin": "^0.338.0",
"flow-bin": "^0.340.0",
"flow-eslint": "0.336.0",
"flow-parser": "0.336.0",
"flow-transform": "0.336.0",
@@ -254,6 +254,7 @@ const UIManagerOverrides = {
// $FlowFixMe[incompatible-type] Flow cannot infer properties from descriptors.
const UIManager: UIManagerJSInterface = Object.create(
Object.getPrototypeOf(UIManagerImpl),
// $FlowFixMe[cannot-spread-interface]
{
...Object.getOwnPropertyDescriptors(
// $FlowFixMe[class-object-subtyping] UIManagerImpl is a runtime object.
@@ -30,5 +30,6 @@ export function hasNativeConstructor(
expectedName: string,
): boolean {
const con = Object.getPrototypeOf(o).constructor;
// $FlowFixMe[incompatible-type]
return con.name === expectedName && isNativeFunction(con);
}
+4 -4
View File
@@ -4855,10 +4855,10 @@ flow-api-translator@0.336.0:
flow-transform "0.336.0"
typescript "5.3.2"
flow-bin@^0.338.0:
version "0.338.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.338.0.tgz#6c0ca72133b54d89681f13c0b742c1b6b01a51cd"
integrity sha512-Ksy1gAdQd8l3//HvNrL8J5A6h3yxSMqvKStokgRKXCXEqsq8apKY0yyupGrO3nYEimd2/xjlJBd2wFuBKpMzwA==
flow-bin@^0.340.0:
version "0.340.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.340.0.tgz#f3edbe6f235c9bc9ff735e5cae1dc8b0a96d55f7"
integrity sha512-XourZh2487go6B2RTIssruf5iH1rVATg7IdE8CGfMbey/93RJR5HTsqQEgVK33lmGhew8fTRLZmeSEyMVubMpw==
flow-enums-runtime@^0.0.6:
version "0.0.6"