From 082e0928c43b2fc59d712a05410d003de519f7d0 Mon Sep 17 00:00:00 2001 From: Panos Vekris Date: Tue, 1 Dec 2026 14:56:27 -0800 Subject: [PATCH] Deploy 0.343.0 to xplat Summary: X-link: https://github.com/react/react-native/pull/60448 X-link: https://github.com/meta/relay/pull/5494 Deploy `flow-bin` 0.343.0 for React Native, Metro, and Relay, updating the OSS Flow version constraints, dependency lockfiles, and the shared Yarn offline mirror, with one generated suppression in `NewAppScreen.js`. Flow 0.343.0 merges library `declare module` blocks, so the second `declare export default` of `babel/generator` in the React Native and Metro `babel_v7.x.x.js` libdefs is now a `name-already-bound` error; it is suppressed. Flow 0.343.0 also gives `void` TypeScript semantics, so the Metro and Relay Jest libdefs type hook and `fit` callbacks as returning `void | Promise`, and Metro's types an unimplemented mock's `getMockImplementation` as `undefined`. Too few or too many arguments for a fixed-length tuple rest param are now reported as `incompatible-type` or `extra-arg` instead of `invalid-tuple-arity`, so `EventEmitter-flowtest.js` carries both codes while it is still also checked with 0.342. Changelog: [Internal] Differential Revision: D135458864 --- .flowconfig | 2 +- flow-typed/jest.js | 12 ++++++------ flow-typed/npm/babel_v7.x.x.js | 1 + package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.flowconfig b/.flowconfig index b70d0302f1..2a076031df 100644 --- a/.flowconfig +++ b/.flowconfig @@ -38,4 +38,4 @@ untyped-import untyped-type-import [version] -^0.342.0 +^0.343.0 diff --git a/flow-typed/jest.js b/flow-typed/jest.js index bd456b1998..613ecdbb25 100644 --- a/flow-typed/jest.js +++ b/flow-typed/jest.js @@ -71,7 +71,7 @@ type JestMockFn, TReturn> = { /** * Returns the current implementation, or undefined for an unimplemented mock. */ - getMockImplementation(): void | ((...args: TArguments) => TReturn), + getMockImplementation(): undefined | ((...args: TArguments) => TReturn), /** * Accepts a function that should be used as the implementation of the mock. * The mock itself will still record all calls that go into and instances @@ -1001,22 +1001,22 @@ type JestDoneFn = { /** Runs this function after every test inside this context */ declare function afterEach( - fn: (done: JestDoneFn) => ?Promise, + fn: (done: JestDoneFn) => void | Promise, timeout?: number, ): void; /** Runs this function before every test inside this context */ declare function beforeEach( - fn: (done: JestDoneFn) => ?Promise, + fn: (done: JestDoneFn) => void | Promise, timeout?: number, ): void; /** Runs this function after all tests have finished inside this context */ declare function afterAll( - fn: (done: JestDoneFn) => ?Promise, + fn: (done: JestDoneFn) => void | Promise, timeout?: number, ): void; /** Runs this function before any tests have started inside this context */ declare function beforeAll( - fn: (done: JestDoneFn) => ?Promise, + fn: (done: JestDoneFn) => void | Promise, timeout?: number, ): void; @@ -1148,7 +1148,7 @@ declare var it: { declare function fit( name: JestTestName, - fn: (done: JestDoneFn) => ?Promise, + fn: (done: JestDoneFn) => void | Promise, timeout?: number, ): void; /** An individual test unit */ diff --git a/flow-typed/npm/babel_v7.x.x.js b/flow-typed/npm/babel_v7.x.x.js index e835719a8c..5d728fb576 100644 --- a/flow-typed/npm/babel_v7.x.x.js +++ b/flow-typed/npm/babel_v7.x.x.js @@ -1255,6 +1255,7 @@ declare module '@babel/generator' { code?: string | {[filename: string]: string, ...}, ) => GeneratorResult; + // $FlowFixMe[name-already-bound] declare export default ( ast: BabelNode, options?: Options, diff --git a/package.json b/package.json index 2c43002fef..f8e17d2d84 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-relay": "^1.8.3", "flow-api-translator": "0.340.0", - "flow-bin": "^0.342.0", + "flow-bin": "^0.343.0", "flow-eslint": "0.340.0", "flow-estree": "0.340.0", "flow-parser": "0.340.0", diff --git a/yarn.lock b/yarn.lock index d72e7e0ca0..71008b5c61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3395,10 +3395,10 @@ flow-api-translator@0.340.0: flow-transform "0.340.0" typescript "5.3.2" -flow-bin@^0.342.0: - version "0.342.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.342.0.tgz#de211291165039f8cc83355575b75a931bd09793" - integrity sha512-/ha9+RAUGF+G9o5hnBzpKCP5iZXzms0tMVi1Dp4zNvPfWo3dUF6qE8S0Q2zJMugX3f5DPqE4h3BaFSpWYQjhUA== +flow-bin@^0.343.0: + version "0.343.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.343.0.tgz#2aabed58e14f89df207f31c20071460b228161d8" + integrity sha512-JNu0HcN40ffhgWr91AwxNIHMLaEtq6uny2ubdPhH2xXoMba21px930aFmIUw1c5ui9S5LFN/AW04S6RwUkUw6w== flow-enums-runtime@^0.0.6: version "0.0.6"