Flow upgrade to 0.182
ghstack-source-id: b9bb8c1560e8ac6baf424deea2015c00629fb353 Pull Request resolved: https://github.com/facebook/react/pull/25419
Jan Kassens committed
Oct 4, 2022 at 13:25 UTC
f02a5f5c79eed4a200afe477452b6b7a680c16af
22 files changed
+39
-62
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.176.0",
66
+ "flow-bin": "^0.182.0",
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
+1
@@ -80,6 +80,7 @@ export function activate(
80
bridge,
81
}: {
82
bridge?: BackendBridge,
83
+ // $FlowFixMe[incompatible-exact]
84
} = {},
85
): void {
86
if (bridge == null) {
packages/react-devtools-inline/src/frontend.js
+1
@@ -62,6 +62,7 @@ export function initialize(
62
}: {
63
bridge?: FrontendBridge,
64
store?: Store,
65
+ // $FlowFixMe[incompatible-exact]
66
} = {},
67
): React.AbstractComponent<Props, mixed> {
68
if (bridge == null) {
packages/react-devtools-shared/src/config/DevToolsFeatureFlags.core-fb.js
+2
-4
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
29
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
30
import typeof * as ExportsType from './DevToolsFeatureFlags.core-fb';
31
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
+2
-4
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
29
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
30
import typeof * as ExportsType from './DevToolsFeatureFlags.core-oss';
31
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
+2
-4
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
29
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
30
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-fb';
31
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
+2
-4
@@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
29
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
30
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-oss';
31
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
+1
@@ -82,6 +82,7 @@ function SettingsModalImpl(_: {}) {
82
case 'components':
83
view = <ComponentsSettings />;
84
break;
85
+ // $FlowFixMe[incompatible-type] is this missing in TabID?
86
case 'debugging':
87
view = <DebuggingSettings />;
88
break;
packages/react-dom-bindings/src/client/ReactDOMFloatClient.js
+1
@@ -657,6 +657,7 @@ function acquireStyleResource(resource: StyleResource): Instance {
657
}
658
}
659
resource.count++;
660
+ // $FlowFixMe[incompatible-return] found when upgrading Flow
661
return resource.instance;
662
}
663
packages/react-dom-bindings/src/events/forks/EventListener-www.js
+1
-4
@@ -66,7 +66,4 @@ export function removeEventListener(
66
}
67
68
// 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
+3
@@ -26,7 +26,9 @@ export function startTransition(
26
27
if (enableTransitionTracing) {
28
if (options !== undefined && options.name !== undefined) {
29
+ // $FlowFixMe[incompatible-use] found when upgrading Flow
30
ReactCurrentBatchConfig.transition.name = options.name;
31
+ // $FlowFixMe[incompatible-use] found when upgrading Flow
32
ReactCurrentBatchConfig.transition.startTime = -1;
33
}
34
}
@@ -46,6 +48,7 @@ export function startTransition(
48
'Otherwise concurrent mode guarantees are off the table.',
49
);
50
}
51
+ // $FlowFixMe[incompatible-use] found when upgrading Flow
52
currentTransition._updatedFibers.clear();
53
}
54
}
packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
+1
-4
@@ -23,7 +23,4 @@
23
// update the test configuration.
24
25
// // 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
+2
-4
@@ -86,8 +86,6 @@ export const enableTransitionTracing = false;
86
export const enableFloat = false;
87
88
export const useModernStrictMode = false;
89
+
90
// 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
+2
-4
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
75
export const enableFloat = false;
76
77
export const useModernStrictMode = false;
78
+
79
// 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
+2
-4
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
75
export const enableFloat = false;
76
77
export const useModernStrictMode = false;
78
+
79
// 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
+2
-4
@@ -73,8 +73,6 @@ export const enableTransitionTracing = false;
73
export const enableFloat = false;
74
75
export const useModernStrictMode = false;
76
+
77
// 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
+2
-4
@@ -77,8 +77,6 @@ export const enableTransitionTracing = false;
77
export const enableFloat = false;
78
79
export const useModernStrictMode = false;
80
+
81
// 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
+2
-4
@@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
75
export const enableFloat = false;
76
77
export const useModernStrictMode = false;
78
+
79
// 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
+2
-4
@@ -76,8 +76,6 @@ export const enableTransitionTracing = false;
76
export const enableFloat = false;
77
78
export const useModernStrictMode = false;
79
+
80
// 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
+2
-4
@@ -112,8 +112,6 @@ export const enableUseMutableSource = true;
112
export const enableCustomElementPropertySupport = __EXPERIMENTAL__;
113
114
export const useModernStrictMode = false;
115
+
116
// 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
+1
-1
@@ -48,4 +48,4 @@ munge_underscores=false
48
%REACT_RENDERER_FLOW_OPTIONS%
49
50
[version]
51
-^0.176.0
51
+^0.182.0
yarn.lock
+4
-4
@@ -7912,10 +7912,10 @@ flatted@^2.0.0:
7912
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
7913
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
7914
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==
7919
7920
fluent-syntax@0.13.0:
7921
version "0.13.0"