Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow upgrade to 0.182 #25419

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "1.2.0",
"filesize": "^6.0.1",
"flow-bin": "^0.176.0",
"flow-bin": "^0.182.0",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20200517.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-inline/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function activate(
bridge,
}: {
bridge?: BackendBridge,
// $FlowFixMe[incompatible-exact]
} = {},
): void {
if (bridge == null) {
Expand Down
1 change: 1 addition & 0 deletions packages/react-devtools-inline/src/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function initialize(
}: {
bridge?: FrontendBridge,
store?: Store,
// $FlowFixMe[incompatible-exact]
} = {},
): React.AbstractComponent<Props, mixed> {
if (bridge == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
import typeof * as ExportsType from './DevToolsFeatureFlags.core-fb';

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified this still does what it's supposed to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed one export type and it showed an error.

The idea is that A can be casted into B and B can be casted into A, which I think implies that A = B.

((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
import typeof * as ExportsType from './DevToolsFeatureFlags.core-oss';

// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-fb';

// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ export const enableProfilerComponentTree = true;
import typeof * as FeatureFlagsType from './DevToolsFeatureFlags.default';
import typeof * as ExportsType from './DevToolsFeatureFlags.extension-oss';

// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function SettingsModalImpl(_: {}) {
case 'components':
view = <ComponentsSettings />;
break;
// $FlowFixMe[incompatible-type] is this missing in TabID?
case 'debugging':
view = <DebuggingSettings />;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ function acquireStyleResource(resource: StyleResource): Instance {
}
}
resource.count++;
// $FlowFixMe[incompatible-return] found when upgrading Flow
return resource.instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,4 @@ export function removeEventListener(
}

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<EventListenerShimType, EventListenerType>);
((((null: any): EventListenerType): EventListenerShimType): EventListenerType);
3 changes: 3 additions & 0 deletions packages/react/src/ReactStartTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function startTransition(

if (enableTransitionTracing) {
if (options !== undefined && options.name !== undefined) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
ReactCurrentBatchConfig.transition.name = options.name;
// $FlowFixMe[incompatible-use] found when upgrading Flow
ReactCurrentBatchConfig.transition.startTime = -1;
}
}
Expand All @@ -46,6 +48,7 @@ export function startTransition(
'Otherwise concurrent mode guarantees are off the table.',
);
}
// $FlowFixMe[incompatible-use] found when upgrading Flow
currentTransition._updatedFibers.clear();
}
}
Expand Down
5 changes: 1 addition & 4 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@
// update the test configuration.

// // Flow magic to verify the exports of this file match the original version.
// // eslint-disable-next-line no-unused-vars
// type Check<_X, Y: _X, X: Y = _X> = null;
// // eslint-disable-next-line no-unused-expressions
// (null: Check<ExportsType, DynamicFlagsType>);
// ((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.testing.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export const enableTransitionTracing = false;
export const enableFloat = false;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
6 changes: 2 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export const enableUseMutableSource = true;
export const enableCustomElementPropertySupport = __EXPERIMENTAL__;

export const useModernStrictMode = false;

// Flow magic to verify the exports of this file match the original version.
// eslint-disable-next-line no-unused-vars
type Check<_X, Y: _X, X: Y = _X> = null;
// eslint-disable-next-line no-unused-expressions
(null: Check<ExportsType, FeatureFlagsType>);
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
2 changes: 1 addition & 1 deletion scripts/flow/config/flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ munge_underscores=false
%REACT_RENDERER_FLOW_OPTIONS%

[version]
^0.176.0
^0.182.0
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7912,10 +7912,10 @@ flatted@^2.0.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==

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

fluent-syntax@0.13.0:
version "0.13.0"
Expand Down