Skip to content

Commit 4cd31d2

Browse files
panagosg7meta-codesync[bot]
authored andcommitted
Upgrade Flow to 0.337.0 (#59326)
Summary: X-link: facebook/relay#5432 Upgrade Flow to 0.337.0 across Metro, React Native, and Relay. Flow 0.337 no longer special-cases `invariant`, so give `invariant` an `asserts` signature in the Metro and Relay Flow configs, matching React Native. Add targeted suppressions for the remaining new Flow 0.337 errors. Pull Request resolved: #59326 X-link: react/metro#2086 [changelog](https://github.com/facebook/flow/blob/main/Changelog.md) Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D126755886
1 parent ba0b3db commit 4cd31d2

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎.flowconfig‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ experimental.multi_platform=true
5353
experimental.multi_platform.extensions=.ios
5454
experimental.multi_platform.extensions=.android
5555

56-
experimental.assertion_functions=true
57-
experimental.disable_invariant_special_casing=true
58-
5956
munge_underscores=true
6057

6158
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
@@ -100,4 +97,4 @@ untyped-import
10097
untyped-type-import
10198

10299
[version]
103-
^0.336.0
100+
^0.337.0

‎flow-typed/npm/rxjs_v6.x.x.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ declare class rxjs$Subject<T>
297297
hasError: boolean;
298298
thrownError: any;
299299
constructor(): void;
300+
// $FlowFixMe[incompatible-type] Flow 0.337
300301
static create: Function;
301302
lift<R>(operator: rxjs$Operator<T, R>): rxjs$Observable<R>;
302303
next(value?: T): void;

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"eslint-plugin-relay": "^1.8.3",
9797
"fb-dotslash": "0.5.8",
9898
"flow-api-translator": "0.336.0",
99-
"flow-bin": "^0.336.0",
99+
"flow-bin": "^0.337.0",
100100
"flow-eslint": "0.336.0",
101101
"flow-parser": "0.336.0",
102102
"flow-transform": "0.336.0",

‎packages/react-native/src/private/animated/__tests__/AnimatedNative-test.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe('Native Animated', () => {
9797
await create(<Animated.View ref={ref} style={{opacity}} />);
9898

9999
expect(ref.current).not.toBeNull();
100+
// $FlowFixMe[incompatible-type] Flow 0.337
100101
jest.spyOn(ref.current, 'setNativeProps');
101102

102103
opacity.setValue(0.5);

‎yarn.lock‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4855,10 +4855,10 @@ flow-api-translator@0.336.0:
48554855
flow-transform "0.336.0"
48564856
typescript "5.3.2"
48574857

4858-
flow-bin@^0.336.0:
4859-
version "0.336.0"
4860-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.336.0.tgz#ac946f9cdf134b83ab4f7a98a0de34324f6b94f4"
4861-
integrity sha512-I5sPg/GISpXH4W14eGWgiIsrDKY0uvvvXjlEDOI2t0pguEwbMgpnaYzMMMBoHZcYYtNJIF/0eGsbPnN7uP2zOQ==
4858+
flow-bin@^0.337.0:
4859+
version "0.337.0"
4860+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.337.0.tgz#419252403924033308160351e95f723bcf42597c"
4861+
integrity sha512-rpr+WvY30RdXPNHbioErMM8tLKUOKJ8/neXPpsDYRBp9z7WDkl4bpTBUMZiqh9ozfdcDWEACBTXwIl94h/ZA0A==
48624862

48634863
flow-enums-runtime@^0.0.6:
48644864
version "0.0.6"

0 commit comments

Comments
 (0)