Skip to content

Commit 22277c5

Browse files
committed
[flow] Bump flow and migrate away from legacy syntax
1 parent 27d3be2 commit 22277c5

9 files changed

Lines changed: 119 additions & 404 deletions

File tree

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"react": {
44
"pragma": "React",
55
"version": "19.0",
6-
"flowVersion": "0.270.0" // Flow version
6+
"flowVersion": "0.314.0" // Flow version
77
}
88
},
99
// babel parser to support ES6/7 features

.flowconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[version]
2-
0.307.1
2+
0.314.0
33

44
[ignore]
55
.*/malformed_package_json/.*
@@ -18,7 +18,7 @@ module.system.node.resolve_dirname=flow_modules
1818
module.system.node.resolve_dirname=node_modules
1919
react.runtime=automatic
2020

21-
experimental.ts_utility_syntax=true
21+
experimental.allow_variance_keywords=true
2222
experimental.deprecated_utilities='$ReadOnlyArray' -> '<PROJECT_ROOT>/'
2323
experimental.deprecated_utilities='$NonMaybeType' -> '<PROJECT_ROOT>/'
2424
experimental.deprecated_utilities='$ReadOnly' -> '<PROJECT_ROOT>/'

package-lock.json

Lines changed: 103 additions & 390 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
"@babel/preset-flow": "^7.27.1",
2727
"@babel/preset-react": "^7.27.1",
2828
"babel-jest": "^29.7.0",
29-
"babel-plugin-syntax-hermes-parser": "^0.25.1",
29+
"babel-plugin-syntax-hermes-parser": "^0.36.1",
3030
"del-cli": "^5.0.0",
3131
"eslint": "^8.57.0",
3232
"eslint-config-prettier": "^8.9.0",
3333
"eslint-plugin-ft-flow": "^3.0.7",
3434
"eslint-plugin-promise": "^6.0.0",
3535
"eslint-plugin-react": "^7.33.1",
3636
"eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613",
37-
"flow-api-translator": "^0.32.1",
38-
"flow-bin": "^0.307.1",
37+
"flow-api-translator": "^0.36.1",
38+
"flow-bin": "^0.314.0",
3939
"glob": "^11.1.0",
40-
"hermes-eslint": "^0.32.0",
40+
"hermes-eslint": "^0.36.1",
4141
"husky": "^8.0.0",
4242
"jest": "^29.7.0",
4343
"jest-environment-jsdom": "^29.7.0",
@@ -46,11 +46,11 @@
4646
"npm-run-all": "^4.1.3",
4747
"patch-package": "^8.0.0",
4848
"prettier": "^3.3.3",
49-
"prettier-plugin-hermes-parser": "0.25.0",
49+
"prettier-plugin-hermes-parser": "0.36.1",
5050
"yargs": "17.7.2"
5151
},
5252
"engines": {
53-
"node": ">=20.11.0",
53+
"node": ">=20.19.0",
5454
"npm": ">=10.0.0"
5555
},
5656
"workspaces": [

packages/react-strict-dom/src/types/Utilities.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
* @flow strict
88
*/
99

10-
export type ReactRef<T> = { -current: T | null, ... } | ((T | null) => unknown);
10+
export type ReactRef<T> =
11+
| { writeonly current: T | null, ... }
12+
| ((T | null) => unknown);

packages/react-strict-dom/src/types/react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
import * as React from 'react';
1111

1212
export type CallbackRef<T> = (node: T | null) => unknown;
13-
export type ObjectRef<T> = { -current: T, ... };
13+
export type ObjectRef<T> = { writeonly current: T, ... };
1414
export type Ref<T> = CallbackRef<T> | ObjectRef<T | null> | React.RefObject<T>;

packages/react-strict-dom/src/types/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import typeof * as TStyleX from '@stylexjs/stylex';
2020
export type Style = InlineStyles;
2121

2222
export type Styles = StyleXArray<
23-
StyleXStyles<> | Theme<VarGroup<{ +[string]: unknown }>>
23+
StyleXStyles<> | Theme<VarGroup<{ readonly [string]: unknown }>>
2424
>;
2525

2626
export type IStyleX = Readonly<{

packages/react-strict-dom/src/web/css/merge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type InlineStyle = Readonly<{
2121
[key: string]: string
2222
}>;
2323

24-
type StylesArray<+T> = T | ReadonlyArray<StylesArray<T>>;
24+
type StylesArray<out T> = T | ReadonlyArray<StylesArray<T>>;
2525

2626
type Props = Readonly<{
2727
className?: string,

packages/scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"generate-types": "./generate-types.js"
99
},
1010
"dependencies": {
11-
"flow-api-translator": "^0.25.0",
11+
"flow-api-translator": "^0.36.1",
1212
"yargs": "17.7.2"
1313
}
1414
}

0 commit comments

Comments
 (0)