Skip to content

Commit 45d61cf

Browse files
authored
[flow] upgrade to 0.225.1 (facebook#27871)
This Flow upgrade includes 2 fixes: - Remove `React$StatelessFunctionalComponent` as that was replaced by just `React$AbstractComponent` as Flow doesn't make any guarantees, see the Flow change here: facebook/flow@521317c - Flow no longer allows `number` type indexing into objects which discovered an incorrect type that is actually an array of the data. Used this command to upgrade ``` yarn add -W flow-bin flow-remove-types hermes-parser hermes-eslint ``` and ran `yarn flow-ci` to check for errors in different configurations.
1 parent c5b9375 commit 45d61cf

File tree

7 files changed

+36
-41
lines changed

7 files changed

+36
-41
lines changed

.eslintrc.js

-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ module.exports = {
504504
React$Node: 'readonly',
505505
React$Portal: 'readonly',
506506
React$Ref: 'readonly',
507-
React$StatelessFunctionalComponent: 'readonly',
508507
ReadableStreamController: 'readonly',
509508
RequestInfo: 'readonly',
510509
RequestOptions: 'readonly',

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6363
"fbjs-scripts": "^3.0.1",
6464
"filesize": "^6.0.1",
65-
"flow-bin": "^0.223.2",
66-
"flow-remove-types": "^2.223.2",
65+
"flow-bin": "^0.225.1",
66+
"flow-remove-types": "^2.225.1",
6767
"glob": "^7.1.6",
6868
"glob-stream": "^6.1.0",
6969
"google-closure-compiler": "^20230206.0.0",
7070
"gzip-size": "^5.1.1",
71-
"hermes-eslint": "^0.18.0",
72-
"hermes-parser": "^0.18.0",
71+
"hermes-eslint": "^0.18.2",
72+
"hermes-parser": "^0.18.2",
7373
"jest": "^29.4.2",
7474
"jest-cli": "^29.4.2",
7575
"jest-diff": "^29.4.2",

packages/react-devtools-shared/src/devtools/views/Components/Components.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,4 @@ function setResizeCSSVariable(
259259
}
260260
}
261261

262-
export default (portaledContent(
263-
Components,
264-
): React$StatelessFunctionalComponent<{}>);
262+
export default (portaledContent(Components): React$AbstractComponent<{}>);

packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotCommitList.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type ItemData = {
3333
};
3434

3535
type Props = {
36-
commitData: CommitDataFrontend,
36+
commitData: $ReadOnlyArray<CommitDataFrontend>,
3737
commitTimes: Array<number>,
3838
filteredCommitIndices: Array<number>,
3939
selectedCommitIndex: number | null,
@@ -71,7 +71,7 @@ export default function SnapshotCommitList({
7171
}
7272

7373
type ListProps = {
74-
commitData: CommitDataFrontend,
74+
commitData: $ReadOnlyArray<CommitDataFrontend>,
7575
commitTimes: Array<number>,
7676
height: number,
7777
filteredCommitIndices: Array<number>,

packages/react-devtools-shared/src/devtools/views/portaledContent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import ThemeProvider from './ThemeProvider';
1717
export type Props = {portalContainer?: Element, ...};
1818

1919
export default function portaledContent(
20-
Component: React$StatelessFunctionalComponent<any>,
21-
): React$StatelessFunctionalComponent<any> {
20+
Component: React$AbstractComponent<any>,
21+
): React$AbstractComponent<any> {
2222
return function PortaledContent({portalContainer, ...rest}: Props) {
2323
const store = useContext(StoreContext);
2424

packages/react/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
*/
99

1010
// Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
11-
export type StatelessFunctionalComponent<P> =
12-
React$StatelessFunctionalComponent<P>;
1311
export type ComponentType<-P> = React$ComponentType<P>;
1412
export type AbstractComponent<
1513
-Config,

yarn.lock

+27-27
Original file line numberDiff line numberDiff line change
@@ -7862,17 +7862,17 @@ flatted@^3.1.0:
78627862
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
78637863
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
78647864

7865-
flow-bin@^0.223.2:
7866-
version "0.223.2"
7867-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.223.2.tgz#2c39f40c4a821bdeac7d340eda61738f0c142706"
7868-
integrity sha512-wqNNzsVdgS/6sC/anloAzEiWGHEYBcANftU7rrDNRyTI9plBAYAu8xVZ/5RtymRuO2GvYWO1DR8hfEunAhdvWA==
7865+
flow-bin@^0.225.1:
7866+
version "0.225.1"
7867+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.225.1.tgz#ffc3d6f0bfa321cf5dd63439537953dc93e9971d"
7868+
integrity sha512-nsYTF1Hh6FWNKFmbe45G7gdgUMBX2CYEfoAvdLJ9oFq43vafe8sA+EWlnXV7cY9LGjdavRsjv4dhEA2M15Rehg==
78697869

7870-
flow-remove-types@^2.223.2:
7871-
version "2.223.2"
7872-
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.223.2.tgz#f034bbd00aabf7b700d4d9eca1ca7f101b23513b"
7873-
integrity sha512-w49sqmIs86Qofh1Ip4eWmuEv5e7oAAUQzDQVPddjvGErn5GxtGBy0JAymPGyRj3Q2kS5/ta5q+9v5+a8858gWw==
7870+
flow-remove-types@^2.225.1:
7871+
version "2.225.1"
7872+
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.225.1.tgz#2de188480ffe54397891ff922d2695eb5a27e9e9"
7873+
integrity sha512-UZj78nVIq3JGJcet2MzAUMPhu3ag9IawRt+kuA9JSuLH2aQYN0wmYhcLVbyyKpj6qgjVXBR+EXIO9XRprY0g2g==
78747874
dependencies:
7875-
hermes-parser "0.17.1"
7875+
hermes-parser "0.18.0"
78767876
pirates "^3.0.2"
78777877
vlq "^0.2.1"
78787878

@@ -8602,39 +8602,39 @@ has@^1.0.1, has@^1.0.3:
86028602
dependencies:
86038603
function-bind "^1.1.1"
86048604

8605-
hermes-eslint@^0.18.0:
8606-
version "0.18.0"
8607-
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.18.0.tgz#16e7d5c7742f709d814d6a5a5d955803e81b328d"
8608-
integrity sha512-NIh8Utqk32+voL1b4ngCRnMQ0XCRzFbon7IG25lhnSYCTezX5besIK+79pUHw1YEDZVGrVrMxeIYxXiamLzcUQ==
8605+
hermes-eslint@^0.18.2:
8606+
version "0.18.2"
8607+
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.18.2.tgz#af09ea1700eb32502caf135b181ffed6091ccb72"
8608+
integrity sha512-FWKVoHyHaXRjOfjoTgoc4OTkC+KThYdhLFyggoXIYLMDHF9hkg5yHSih3cyK3hT73te6+aaGHePzwaOai69uoA==
86098609
dependencies:
86108610
esrecurse "^4.3.0"
8611-
hermes-estree "0.18.0"
8612-
hermes-parser "0.18.0"
8613-
8614-
hermes-estree@0.17.1:
8615-
version "0.17.1"
8616-
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.17.1.tgz#902806a900c185720424ffcf958027821d23c051"
8617-
integrity sha512-EdUJms+eRE40OQxysFlPr1mPpvUbbMi7uDAKlScBw8o3tQY22BZ5yx56OYyp1bVaBm+7Cjc3NQz24sJEFXkPxg==
8611+
hermes-estree "0.18.2"
8612+
hermes-parser "0.18.2"
86188613

86198614
hermes-estree@0.18.0:
86208615
version "0.18.0"
86218616
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.18.0.tgz#6c202d8c78ddefadf3eb595a584dfa55b51a0508"
86228617
integrity sha512-WaIudIVKo5QWFqz1ta53HqSDuVxYST/MUuP9X7dqUpbHse3E2gzJq/7hEtgx84hh2XSNWN1AhYho3ThOA85uCA==
86238618

8624-
hermes-parser@0.17.1:
8625-
version "0.17.1"
8626-
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.17.1.tgz#8b5cbaff235fed28487812ad718f9c7182d0db0f"
8627-
integrity sha512-yErtFLMEL6490fFJPurNn23OI2ciGAtaUfKUg9VPdcde9CmItCjOVQkJt1Xzawv5kuRzeIx0RE2E2Q9TbIgdzA==
8628-
dependencies:
8629-
hermes-estree "0.17.1"
8619+
hermes-estree@0.18.2:
8620+
version "0.18.2"
8621+
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.18.2.tgz#fd450fa1659cf074ceaa2ddeeb21674f3b2342f3"
8622+
integrity sha512-KoLsoWXJ5o81nit1wSyEZnWUGy9cBna9iYMZBR7skKh7okYAYKqQ9/OczwpMHn/cH0hKDyblulGsJ7FknlfVxQ==
86308623

8631-
hermes-parser@0.18.0, hermes-parser@^0.18.0:
8624+
hermes-parser@0.18.0:
86328625
version "0.18.0"
86338626
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.18.0.tgz#dd9878f70e9ca2570e7626181ae0465115f7f78d"
86348627
integrity sha512-DIIM6vsy30BU5hNkOXh6MR2r4ZAxVhbfyTnmfo/rqUf3KySlNWn9fWiOcpuGAdDN2o5sdPCpu6cep3a23d1Klw==
86358628
dependencies:
86368629
hermes-estree "0.18.0"
86378630

8631+
hermes-parser@0.18.2, hermes-parser@^0.18.2:
8632+
version "0.18.2"
8633+
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.18.2.tgz#50f15e2fcd559a48c68cd7af259d4292298bd14d"
8634+
integrity sha512-1eQfvib+VPpgBZ2zYKQhpuOjw1tH+Emuib6QmjkJWJMhyjM8xnXMvA+76o9LhF0zOAJDZgPfQhg43cyXEyl5Ew==
8635+
dependencies:
8636+
hermes-estree "0.18.2"
8637+
86388638
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
86398639
version "1.0.3"
86408640
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"

0 commit comments

Comments
 (0)