@samitouri / QOS-React-1 / commits / 45d61cf7ef

[flow] upgrade to 0.225.1 (#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: https://github.com/facebook/flow/commit/521317c48f44ffb5eac072a7b2548a72b0745095 - 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.

Jan Kassens committed Jan 2, 2024 at 14:39 UTC 45d61cf7effdba6bbd9835bb427c99c95beb7e17
7 files changed +36 -41
.eslintrc.js
-1
@@ -504,7 +504,6 @@ module.exports = {
504 React$Node: 'readonly',
505 React$Portal: 'readonly',
506 React$Ref: 'readonly',
507 - React$StatelessFunctionalComponent: 'readonly',
507 ReadableStreamController: 'readonly',
508 RequestInfo: 'readonly',
509 RequestOptions: 'readonly',
package.json
+4 -4
@@ -62,14 +62,14 @@
62 "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
63 "fbjs-scripts": "^3.0.1",
64 "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",
67 "glob": "^7.1.6",
68 "glob-stream": "^6.1.0",
69 "google-closure-compiler": "^20230206.0.0",
70 "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",
73 "jest": "^29.4.2",
74 "jest-cli": "^29.4.2",
75 "jest-diff": "^29.4.2",
packages/react-devtools-shared/src/devtools/views/Components/Components.js
+1 -3
@@ -259,6 +259,4 @@ function setResizeCSSVariable(
259 }
260 }
261
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
@@ -33,7 +33,7 @@ export type ItemData = {
33 };
34
35 type Props = {
36 - commitData: CommitDataFrontend,
36 + commitData: $ReadOnlyArray<CommitDataFrontend>,
37 commitTimes: Array<number>,
38 filteredCommitIndices: Array<number>,
39 selectedCommitIndex: number | null,
@@ -71,7 +71,7 @@ export default function SnapshotCommitList({
71 }
72
73 type ListProps = {
74 - commitData: CommitDataFrontend,
74 + commitData: $ReadOnlyArray<CommitDataFrontend>,
75 commitTimes: Array<number>,
76 height: number,
77 filteredCommitIndices: Array<number>,
packages/react-devtools-shared/src/devtools/views/portaledContent.js
+2 -2
@@ -17,8 +17,8 @@ import ThemeProvider from './ThemeProvider';
17 export type Props = {portalContainer?: Element, ...};
18
19 export default function portaledContent(
20 - Component: React$StatelessFunctionalComponent<any>,
21 -): React$StatelessFunctionalComponent<any> {
20 + Component: React$AbstractComponent<any>,
21 +): React$AbstractComponent<any> {
22 return function PortaledContent({portalContainer, ...rest}: Props) {
23 const store = useContext(StoreContext);
24
packages/react/index.js
-2
@@ -8,8 +8,6 @@
8 */
9
10 // Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
11 -export type StatelessFunctionalComponent<P> =
12 - React$StatelessFunctionalComponent<P>;
11 export type ComponentType<-P> = React$ComponentType<P>;
12 export type AbstractComponent<
13 -Config,
yarn.lock
+27 -27
@@ -7862,17 +7862,17 @@ flatted@^3.1.0:
7862 resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
7863 integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
7864
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==
7869
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==
7874 dependencies:
7875 - hermes-parser "0.17.1"
7875 + hermes-parser "0.18.0"
7876 pirates "^3.0.2"
7877 vlq "^0.2.1"
7878
@@ -8602,39 +8602,39 @@ has@^1.0.1, has@^1.0.3:
8602 dependencies:
8603 function-bind "^1.1.1"
8604
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==
8609 dependencies:
8610 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"
8613
8614 hermes-estree@0.18.0:
8615 version "0.18.0"
8616 resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.18.0.tgz#6c202d8c78ddefadf3eb595a584dfa55b51a0508"
8617 integrity sha512-WaIudIVKo5QWFqz1ta53HqSDuVxYST/MUuP9X7dqUpbHse3E2gzJq/7hEtgx84hh2XSNWN1AhYho3ThOA85uCA==
8618
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==
8623
8631 -hermes-parser@0.18.0, hermes-parser@^0.18.0:
8624 +hermes-parser@0.18.0:
8625 version "0.18.0"
8626 resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.18.0.tgz#dd9878f70e9ca2570e7626181ae0465115f7f78d"
8627 integrity sha512-DIIM6vsy30BU5hNkOXh6MR2r4ZAxVhbfyTnmfo/rqUf3KySlNWn9fWiOcpuGAdDN2o5sdPCpu6cep3a23d1Klw==
8628 dependencies:
8629 hermes-estree "0.18.0"
8630
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 +
8638 homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
8639 version "1.0.3"
8640 resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"