Skip to content

Commit ba7b6f4

Browse files
authored
Flow: upgrade to 0.132 (#25244)
1 parent 9328988 commit ba7b6f4

File tree

11 files changed

+28
-27
lines changed

11 files changed

+28
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6464
"fbjs-scripts": "1.2.0",
6565
"filesize": "^6.0.1",
66-
"flow-bin": "^0.131",
66+
"flow-bin": "^0.132",
6767
"glob": "^7.1.6",
6868
"glob-stream": "^6.1.0",
6969
"google-closure-compiler": "^20200517.0.0",

packages/react-devtools-inline/src/backend.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import setupNativeStyleEditor from 'react-devtools-shared/src/backend/NativeStyl
99
import type {BackendBridge} from 'react-devtools-shared/src/bridge';
1010
import type {Wall} from 'react-devtools-shared/src/types';
1111

12-
function startActivation(contentWindow: window, bridge: BackendBridge) {
12+
function startActivation(contentWindow: any, bridge: BackendBridge) {
1313
const onSavedPreferences = data => {
1414
// This is the only message we're listening for,
1515
// so it's safe to cleanup after we've received it.
@@ -55,7 +55,7 @@ function startActivation(contentWindow: window, bridge: BackendBridge) {
5555
bridge.send('getSavedPreferences');
5656
}
5757

58-
function finishActivation(contentWindow: window, bridge: BackendBridge) {
58+
function finishActivation(contentWindow: any, bridge: BackendBridge) {
5959
const agent = new Agent(bridge);
6060

6161
const hook = contentWindow.__REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -75,7 +75,7 @@ function finishActivation(contentWindow: window, bridge: BackendBridge) {
7575
}
7676

7777
export function activate(
78-
contentWindow: window,
78+
contentWindow: any,
7979
{
8080
bridge,
8181
}: {
@@ -89,10 +89,7 @@ export function activate(
8989
startActivation(contentWindow, bridge);
9090
}
9191

92-
export function createBridge(
93-
contentWindow: window,
94-
wall?: Wall,
95-
): BackendBridge {
92+
export function createBridge(contentWindow: any, wall?: Wall): BackendBridge {
9693
const {parent} = contentWindow;
9794

9895
if (wall == null) {
@@ -115,6 +112,6 @@ export function createBridge(
115112
return (new Bridge(wall): BackendBridge);
116113
}
117114

118-
export function initialize(contentWindow: window): void {
115+
export function initialize(contentWindow: any): void {
119116
installHook(contentWindow);
120117
}

packages/react-devtools-inline/src/frontend.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ export function createStore(bridge: FrontendBridge, config?: Config): Store {
3333
});
3434
}
3535

36-
export function createBridge(
37-
contentWindow: window,
38-
wall?: Wall,
39-
): FrontendBridge {
36+
export function createBridge(contentWindow: any, wall?: Wall): FrontendBridge {
4037
if (wall == null) {
4138
wall = {
4239
listen(fn) {
@@ -58,7 +55,7 @@ export function createBridge(
5855
}
5956

6057
export function initialize(
61-
contentWindow: window,
58+
contentWindow: any,
6259
{
6360
bridge,
6461
store,

packages/react-devtools-shared/src/backend/views/Highlighter/Overlay.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class OverlayTip {
148148
}
149149

150150
export default class Overlay {
151-
window: window;
152-
tipBoundsWindow: window;
151+
window: any;
152+
tipBoundsWindow: any;
153153
container: HTMLElement;
154154
tip: OverlayTip;
155155
rects: Array<OverlayRect>;

packages/react-devtools-shared/src/hooks/astUtils.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
*/
99

1010
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';
1312

1413
import type {HooksNode} from 'react-debug-tools/src/ReactDebugHooks';
1514

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+
1621
export type Position = {
1722
line: number,
1823
column: number,

packages/react-devtools-shared/src/hooks/generateHookMap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
import {getHookNamesMappingFromAST} from './astUtils';
1111
import {encode, decode} from 'sourcemap-codec';
12-
import {File} from '@babel/types';
12+
13+
// Missing types in @babel/types
14+
type File = any;
1315

1416
export type HookMap = {
1517
names: $ReadOnlyArray<string>,

packages/react-reconciler/src/ReactFiberCacheComponent.new.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import * as Scheduler from 'scheduler';
1818

1919
// In environments without AbortController (e.g. tests)
2020
// replace it with a lightweight shim that only has the features we use.
21-
const AbortControllerLocal = enableCache
21+
const AbortControllerLocal: typeof AbortController = enableCache
2222
? typeof AbortController !== 'undefined'
2323
? AbortController
2424
: (function AbortControllerShim() {

packages/react-reconciler/src/ReactFiberCacheComponent.old.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import * as Scheduler from 'scheduler';
1818

1919
// In environments without AbortController (e.g. tests)
2020
// replace it with a lightweight shim that only has the features we use.
21-
const AbortControllerLocal = enableCache
21+
const AbortControllerLocal: typeof AbortController = enableCache
2222
? typeof AbortController !== 'undefined'
2323
? AbortController
2424
: (function AbortControllerShim() {

packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default class ReactFlightWebpackPlugin {
327327
contextModuleFactory.resolveDependencies(
328328
fs,
329329
options,
330-
(err2: null | Error, deps: Array<ModuleDependency>) => {
330+
(err2: null | Error, deps: Array<any /*ModuleDependency*/>) => {
331331
if (err2) return cb(err2);
332332
const clientRefDeps = deps.map(dep => {
333333
// use userRequest instead of request. request always end with undefined which is wrong

scripts/flow/config/flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ munge_underscores=false
5454
%REACT_RENDERER_FLOW_OPTIONS%
5555

5656
[version]
57-
^0.131.0
57+
^0.132.0

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7914,10 +7914,10 @@ flatted@^2.0.0:
79147914
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
79157915
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
79167916

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==
79217921

79227922
79237923
version "0.13.0"

0 commit comments

Comments
 (0)