Flow: upgrade to 0.132 (#25244)
Jan Kassens committed
Sep 12, 2022 at 14:36 UTC
ba7b6f4183dacb9ce332f715bcb84ce4cc7c2b8d
11 files changed
+28
-27
package.json
+1
-1
@@ -63,7 +63,7 @@
63
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
64
"fbjs-scripts": "1.2.0",
65
"filesize": "^6.0.1",
66
- "flow-bin": "^0.131",
66
+ "flow-bin": "^0.132",
67
"glob": "^7.1.6",
68
"glob-stream": "^6.1.0",
69
"google-closure-compiler": "^20200517.0.0",
packages/react-devtools-inline/src/backend.js
+5
-8
@@ -9,7 +9,7 @@ import setupNativeStyleEditor from 'react-devtools-shared/src/backend/NativeStyl
9
import type {BackendBridge} from 'react-devtools-shared/src/bridge';
10
import type {Wall} from 'react-devtools-shared/src/types';
11
12
-function startActivation(contentWindow: window, bridge: BackendBridge) {
12
+function startActivation(contentWindow: any, bridge: BackendBridge) {
13
const onSavedPreferences = data => {
14
// This is the only message we're listening for,
15
// so it's safe to cleanup after we've received it.
@@ -55,7 +55,7 @@ function startActivation(contentWindow: window, bridge: BackendBridge) {
55
bridge.send('getSavedPreferences');
56
}
57
58
-function finishActivation(contentWindow: window, bridge: BackendBridge) {
58
+function finishActivation(contentWindow: any, bridge: BackendBridge) {
59
const agent = new Agent(bridge);
60
61
const hook = contentWindow.__REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -75,7 +75,7 @@ function finishActivation(contentWindow: window, bridge: BackendBridge) {
75
}
76
77
export function activate(
78
- contentWindow: window,
78
+ contentWindow: any,
79
{
80
bridge,
81
}: {
@@ -89,10 +89,7 @@ export function activate(
89
startActivation(contentWindow, bridge);
90
}
91
92
-export function createBridge(
93
- contentWindow: window,
94
- wall?: Wall,
95
-): BackendBridge {
92
+export function createBridge(contentWindow: any, wall?: Wall): BackendBridge {
93
const {parent} = contentWindow;
94
95
if (wall == null) {
@@ -115,6 +112,6 @@ export function createBridge(
112
return (new Bridge(wall): BackendBridge);
113
}
114
118
-export function initialize(contentWindow: window): void {
115
+export function initialize(contentWindow: any): void {
116
installHook(contentWindow);
117
}
packages/react-devtools-inline/src/frontend.js
+2
-5
@@ -33,10 +33,7 @@ export function createStore(bridge: FrontendBridge, config?: Config): Store {
33
});
34
}
35
36
-export function createBridge(
37
- contentWindow: window,
38
- wall?: Wall,
39
-): FrontendBridge {
36
+export function createBridge(contentWindow: any, wall?: Wall): FrontendBridge {
37
if (wall == null) {
38
wall = {
39
listen(fn) {
@@ -58,7 +55,7 @@ export function createBridge(
55
}
56
57
export function initialize(
61
- contentWindow: window,
58
+ contentWindow: any,
59
{
60
bridge,
61
store,
packages/react-devtools-shared/src/backend/views/Highlighter/Overlay.js
+2
-2
@@ -148,8 +148,8 @@ class OverlayTip {
148
}
149
150
export default class Overlay {
151
- window: window;
152
- tipBoundsWindow: window;
151
+ window: any;
152
+ tipBoundsWindow: any;
153
container: HTMLElement;
154
tip: OverlayTip;
155
rects: Array<OverlayRect>;
packages/react-devtools-shared/src/hooks/astUtils.js
+7
-2
@@ -8,11 +8,16 @@
8
*/
9
10
import {withSyncPerfMeasurements} from 'react-devtools-shared/src/PerformanceLoggingUtils';
11
-import traverse, {NodePath, Node} from '@babel/traverse';
12
-import {File} from '@babel/types';
11
+import traverse from '@babel/traverse';
12
13
import type {HooksNode} from 'react-debug-tools/src/ReactDebugHooks';
14
15
+// Missing types in @babel/traverse
16
+type NodePath = any;
17
+type Node = any;
18
+// Missing types in @babel/types
19
+type File = any;
20
+
21
export type Position = {
22
line: number,
23
column: number,
packages/react-devtools-shared/src/hooks/generateHookMap.js
+3
-1
@@ -9,7 +9,9 @@
9
10
import {getHookNamesMappingFromAST} from './astUtils';
11
import {encode, decode} from 'sourcemap-codec';
12
-import {File} from '@babel/types';
12
+
13
+// Missing types in @babel/types
14
+type File = any;
15
16
export type HookMap = {
17
names: $ReadOnlyArray<string>,
packages/react-reconciler/src/ReactFiberCacheComponent.new.js
+1
-1
@@ -18,7 +18,7 @@ import * as Scheduler from 'scheduler';
18
19
// In environments without AbortController (e.g. tests)
20
// replace it with a lightweight shim that only has the features we use.
21
-const AbortControllerLocal = enableCache
21
+const AbortControllerLocal: typeof AbortController = enableCache
22
? typeof AbortController !== 'undefined'
23
? AbortController
24
: (function AbortControllerShim() {
packages/react-reconciler/src/ReactFiberCacheComponent.old.js
+1
-1
@@ -18,7 +18,7 @@ import * as Scheduler from 'scheduler';
18
19
// In environments without AbortController (e.g. tests)
20
// replace it with a lightweight shim that only has the features we use.
21
-const AbortControllerLocal = enableCache
21
+const AbortControllerLocal: typeof AbortController = enableCache
22
? typeof AbortController !== 'undefined'
23
? AbortController
24
: (function AbortControllerShim() {
packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js
+1
-1
@@ -327,7 +327,7 @@ export default class ReactFlightWebpackPlugin {
327
contextModuleFactory.resolveDependencies(
328
fs,
329
options,
330
- (err2: null | Error, deps: Array<ModuleDependency>) => {
330
+ (err2: null | Error, deps: Array<any /*ModuleDependency*/>) => {
331
if (err2) return cb(err2);
332
const clientRefDeps = deps.map(dep => {
333
// use userRequest instead of request. request always end with undefined which is wrong
scripts/flow/config/flowconfig
+1
-1
@@ -54,4 +54,4 @@ munge_underscores=false
54
%REACT_RENDERER_FLOW_OPTIONS%
55
56
[version]
57
-^0.131.0
57
+^0.132.0
yarn.lock
+4
-4
@@ -7914,10 +7914,10 @@ flatted@^2.0.0:
7914
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
7915
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
7916
7917
-flow-bin@^0.131:
7918
- version "0.131.0"
7919
- resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.131.0.tgz#d4228b6070afdf3b2a76acdee77a7f3f8e8f5133"
7920
- integrity sha512-fZmoIBcDrtLhy/NNMxwJysSYzMr1ksRcAOMi3AHSoYXfcuQqTvhGJx+wqjlIOqIwz8RRYm8J4V4JrSJbIKP+Xg==
7917
+flow-bin@^0.132:
7918
+ version "0.132.0"
7919
+ resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.132.0.tgz#8bf80a79630db24bd1422dc2cc4b5e97f97ccb98"
7920
+ integrity sha512-S1g/vnAyNaLUdajmuUHCMl30qqye12gS6mr4LVyswf1k+JDF4efs6SfKmptuvnpitF3LGCVf0TIffChP8ljwnw==
7921
7922
fluent-syntax@0.13.0:
7923
version "0.13.0"