Skip to content

Commit f02a5f5

Browse files
committed
Flow upgrade to 0.182
ghstack-source-id: b9bb8c1 Pull Request resolved: #25419
1 parent 72593f0 commit f02a5f5

22 files changed

+39
-62
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.176.0",
66+
"flow-bin": "^0.182.0",
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function activate(
8080
bridge,
8181
}: {
8282
bridge?: BackendBridge,
83+
// $FlowFixMe[incompatible-exact]
8384
} = {},
8485
): void {
8586
if (bridge == null) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function initialize(
6262
}: {
6363
bridge?: FrontendBridge,
6464
store?: Store,
65+
// $FlowFixMe[incompatible-exact]
6566
} = {},
6667
): React.AbstractComponent<Props, mixed> {
6768
if (bridge == null) {

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.core-fb.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
2929
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
3030
import typeof * as ExportsType from './DevToolsFeatureFlags.core-fb';
3131

32-
// eslint-disable-next-line no-unused-vars
33-
type Check<_X, Y: _X, X: Y = _X> = null;
34-
// eslint-disable-next-line no-unused-expressions
35-
(null: Check<ExportsType, FeatureFlagsType>);
32+
// Flow magic to verify the exports of this file match the original version.
33+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.core-oss.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
2929
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
3030
import typeof * as ExportsType from './DevToolsFeatureFlags.core-oss';
3131

32-
// eslint-disable-next-line no-unused-vars
33-
type Check<_X, Y: _X, X: Y = _X> = null;
34-
// eslint-disable-next-line no-unused-expressions
35-
(null: Check<ExportsType, FeatureFlagsType>);
32+
// Flow magic to verify the exports of this file match the original version.
33+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension-fb.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
2929
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
3030
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-fb';
3131

32-
// eslint-disable-next-line no-unused-vars
33-
type Check<_X, Y: _X, X: Y = _X> = null;
34-
// eslint-disable-next-line no-unused-expressions
35-
(null: Check<ExportsType, FeatureFlagsType>);
32+
// Flow magic to verify the exports of this file match the original version.
33+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/react-devtools-shared/src/config/DevToolsFeatureFlags.extension-oss.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
2929
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
3030
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-oss';
3131

32-
// eslint-disable-next-line no-unused-vars
33-
type Check<_X, Y: _X, X: Y = _X> = null;
34-
// eslint-disable-next-line no-unused-expressions
35-
(null: Check<ExportsType, FeatureFlagsType>);
32+
// Flow magic to verify the exports of this file match the original version.
33+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/react-devtools-shared/src/devtools/views/Settings/SettingsModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function SettingsModalImpl(_: {}) {
8282
case 'components':
8383
view = <ComponentsSettings />;
8484
break;
85+
// $FlowFixMe[incompatible-type] is this missing in TabID?
8586
case 'debugging':
8687
view = <DebuggingSettings />;
8788
break;

packages/react-dom-bindings/src/client/ReactDOMFloatClient.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ function acquireStyleResource(resource: StyleResource): Instance {
657657
}
658658
}
659659
resource.count++;
660+
// $FlowFixMe[incompatible-return] found when upgrading Flow
660661
return resource.instance;
661662
}
662663

packages/react-dom-bindings/src/events/forks/EventListener-www.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,4 @@ export function removeEventListener(
6666
}
6767

6868
// Flow magic to verify the exports of this file match the original version.
69-
// eslint-disable-next-line no-unused-vars
70-
type Check<_X, Y: _X, X: Y = _X> = null;
71-
// eslint-disable-next-line no-unused-expressions
72-
(null: Check<EventListenerShimType, EventListenerType>);
69+
((((null: any): EventListenerType): EventListenerShimType): EventListenerType);

packages/react/src/ReactStartTransition.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export function startTransition(
2626

2727
if (enableTransitionTracing) {
2828
if (options !== undefined && options.name !== undefined) {
29+
// $FlowFixMe[incompatible-use] found when upgrading Flow
2930
ReactCurrentBatchConfig.transition.name = options.name;
31+
// $FlowFixMe[incompatible-use] found when upgrading Flow
3032
ReactCurrentBatchConfig.transition.startTime = -1;
3133
}
3234
}
@@ -46,6 +48,7 @@ export function startTransition(
4648
'Otherwise concurrent mode guarantees are off the table.',
4749
);
4850
}
51+
// $FlowFixMe[incompatible-use] found when upgrading Flow
4952
currentTransition._updatedFibers.clear();
5053
}
5154
}

packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,4 @@
2323
// update the test configuration.
2424

2525
// // Flow magic to verify the exports of this file match the original version.
26-
// // eslint-disable-next-line no-unused-vars
27-
// type Check<_X, Y: _X, X: Y = _X> = null;
28-
// // eslint-disable-next-line no-unused-expressions
29-
// (null: Check<ExportsType, DynamicFlagsType>);
26+
// ((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ export const enableTransitionTracing = false;
8686
export const enableFloat = false;
8787

8888
export const useModernStrictMode = false;
89+
8990
// Flow magic to verify the exports of this file match the original version.
90-
// eslint-disable-next-line no-unused-vars
91-
type Check<_X, Y: _X, X: Y = _X> = null;
92-
// eslint-disable-next-line no-unused-expressions
93-
(null: Check<ExportsType, FeatureFlagsType>);
91+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
7575
export const enableFloat = false;
7676

7777
export const useModernStrictMode = false;
78+
7879
// Flow magic to verify the exports of this file match the original version.
79-
// eslint-disable-next-line no-unused-vars
80-
type Check<_X, Y: _X, X: Y = _X> = null;
81-
// eslint-disable-next-line no-unused-expressions
82-
(null: Check<ExportsType, FeatureFlagsType>);
80+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
7575
export const enableFloat = false;
7676

7777
export const useModernStrictMode = false;
78+
7879
// Flow magic to verify the exports of this file match the original version.
79-
// eslint-disable-next-line no-unused-vars
80-
type Check<_X, Y: _X, X: Y = _X> = null;
81-
// eslint-disable-next-line no-unused-expressions
82-
(null: Check<ExportsType, FeatureFlagsType>);
80+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ export const enableTransitionTracing = false;
7373
export const enableFloat = false;
7474

7575
export const useModernStrictMode = false;
76+
7677
// Flow magic to verify the exports of this file match the original version.
77-
// eslint-disable-next-line no-unused-vars
78-
type Check<_X, Y: _X, X: Y = _X> = null;
79-
// eslint-disable-next-line no-unused-expressions
80-
(null: Check<ExportsType, FeatureFlagsType>);
78+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export const enableTransitionTracing = false;
7777
export const enableFloat = false;
7878

7979
export const useModernStrictMode = false;
80+
8081
// Flow magic to verify the exports of this file match the original version.
81-
// eslint-disable-next-line no-unused-vars
82-
type Check<_X, Y: _X, X: Y = _X> = null;
83-
// eslint-disable-next-line no-unused-expressions
84-
(null: Check<ExportsType, FeatureFlagsType>);
82+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.testing.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
7575
export const enableFloat = false;
7676

7777
export const useModernStrictMode = false;
78+
7879
// Flow magic to verify the exports of this file match the original version.
79-
// eslint-disable-next-line no-unused-vars
80-
type Check<_X, Y: _X, X: Y = _X> = null;
81-
// eslint-disable-next-line no-unused-expressions
82-
(null: Check<ExportsType, FeatureFlagsType>);
80+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.testing.www.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ export const enableTransitionTracing = false;
7676
export const enableFloat = false;
7777

7878
export const useModernStrictMode = false;
79+
7980
// Flow magic to verify the exports of this file match the original version.
80-
// eslint-disable-next-line no-unused-vars
81-
type Check<_X, Y: _X, X: Y = _X> = null;
82-
// eslint-disable-next-line no-unused-expressions
83-
(null: Check<ExportsType, FeatureFlagsType>);
81+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export const enableUseMutableSource = true;
112112
export const enableCustomElementPropertySupport = __EXPERIMENTAL__;
113113

114114
export const useModernStrictMode = false;
115+
115116
// Flow magic to verify the exports of this file match the original version.
116-
// eslint-disable-next-line no-unused-vars
117-
type Check<_X, Y: _X, X: Y = _X> = null;
118-
// eslint-disable-next-line no-unused-expressions
119-
(null: Check<ExportsType, FeatureFlagsType>);
117+
((((null: any): ExportsType): FeatureFlagsType): ExportsType);

scripts/flow/config/flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ munge_underscores=false
4848
%REACT_RENDERER_FLOW_OPTIONS%
4949

5050
[version]
51-
^0.176.0
51+
^0.182.0

yarn.lock

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

7915-
flow-bin@^0.176.0:
7916-
version "0.176.3"
7917-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.176.3.tgz#d32de04e044ab474afe543b9fd245608bb6a6ac8"
7918-
integrity sha512-lbNqgjr2GlGLAEVp5+dhG4LdnFE7ekbvVNifAdlvTx58/nE8GrCOMiUwEQy4dLnfL2NIRMk2dbEVTrugeQJ3mA==
7915+
flow-bin@^0.182.0:
7916+
version "0.182.0"
7917+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.182.0.tgz#1dacbd72465743670412ada015d3182deda6f966"
7918+
integrity sha512-Ux90c2sMfoV/VVjOEFT2OHFJFnyfoIbTK/5AKAMnU4Skfru1G+FyS5YLu3XxQl0R6mpA9+rrFlPfYZq/5B+J3w==
79197919

79207920
79217921
version "0.13.0"

0 commit comments

Comments
 (0)