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

[WIP] Update Flow to 0.251.1 #3405

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
10 changes: 5 additions & 5 deletions flow-typed/npm/@floating-ui/react_v0.26.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ declare module '@floating-ui/react' {
};

declare export const FloatingFocusManager:
React.AbstractComponent<FloatingFocusManagerProps>;
component(...FloatingFocusManagerProps);

/*
* FloatingNode
Expand All @@ -321,7 +321,7 @@ declare module '@floating-ui/react' {
};

declare export const FloatingNode:
React.AbstractComponent<FloatingNodeProps>;
component(...FloatingNodeProps);

/*
* FloatingOverlay
Expand All @@ -334,7 +334,7 @@ declare module '@floating-ui/react' {
};

declare export const FloatingOverlay:
React.AbstractComponent<FloatingOverlayProps>;
component(...FloatingOverlayProps);

/*
* FloatingPortal
Expand All @@ -345,7 +345,7 @@ declare module '@floating-ui/react' {
};

declare export const FloatingPortal:
React.AbstractComponent<FloatingPortalProps>;
component(...FloatingPortalProps);

/*
* FloatingTree
Expand All @@ -355,5 +355,5 @@ declare module '@floating-ui/react' {
};

declare export const FloatingTree:
React.AbstractComponent<FloatingTreeProps>;
component(...FloatingTreeProps);
}
4 changes: 2 additions & 2 deletions flow-typed/npm/react-table_v7.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ declare module 'react-table' {
* `D` contravariant above.
*/
+accessor?: (D) => V,
+Cell?: React.AbstractComponent<CellRenderProps<D, V>, mixed>,
+Cell?: component(...CellRenderProps<D, V>),
+Header?: React.ComponentType<mixed> | React.Node,
+id?: string,
...
};

declare export type ColumnOptionsNoValue<-D> = {
+accessor?: (D) => mixed,
+Cell?: React.AbstractComponent<CellRenderProps<D, empty>, mixed>,
+Cell?: component(...CellRenderProps<D, empty>),
+Header?: React.ComponentType<mixed> | React.Node,
+id?: string,
...
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-simple-import-sort": "^7.0.0",
"flow-bin": "0.250.0",
"flow-bin": "0.256.0",
"gettext-parser": "4.2.0",
"globals": "15.9.0",
"hermes-eslint": "0.23.0",
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/account/components/ApplicationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ export type ApplicationFormPropsT = Props;
export default (hydrate<Props>(
'div.application-form',
ApplicationForm,
): React.AbstractComponent<Props, void>);
): React.ComponentType<Props>);
2 changes: 1 addition & 1 deletion root/static/scripts/account/components/EditProfileForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,5 @@ export type EditProfileFormPropsT = Props;

export default (
hydrate<Props>('div.edit-profile-form', EditProfileForm):
React.AbstractComponent<Props, void>
React.ComponentType<Props>
);
2 changes: 1 addition & 1 deletion root/static/scripts/account/components/PreferencesForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,4 @@ export type PreferencesFormPropsT = Props;
export default (hydrate<Props>(
'div.preferences-form',
PreferencesForm,
): React.AbstractComponent<Props, void>);
): React.ComponentType<Props>);
2 changes: 1 addition & 1 deletion root/static/scripts/account/components/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ component RegisterForm(captcha?: string, form: RegisterFormT) {
export default (hydrate<React.PropsOf<RegisterForm>>(
'div.register-form',
RegisterForm,
): React.AbstractComponent<React.PropsOf<RegisterForm>, void>);
): React.ComponentType<React.PropsOf<RegisterForm>>);
2 changes: 1 addition & 1 deletion root/static/scripts/alias/AliasEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@ const AliasEditForm = ({
export default (hydrate<Props>(
'div.alias-edit-form',
AliasEditForm,
): React.AbstractComponent<Props, void>);
): React.ComponentType<Props>);
2 changes: 1 addition & 1 deletion root/static/scripts/annotation/AnnotationHistoryTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ component AnnotationHistoryTable(
export default (hydrate<React.PropsOf<AnnotationHistoryTable>>(
'div.annotation-history-table',
AnnotationHistoryTable,
): React.AbstractComponent<React.PropsOf<AnnotationHistoryTable>>);
): React.ComponentType<React.PropsOf<AnnotationHistoryTable>>);
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ const ArtistCreditRenamer = ({
export default (hydrate<ArtistCreditRenamerPropsT>(
'div.artist-credit-renamer',
ArtistCreditRenamer,
): React.AbstractComponent<ArtistCreditRenamerPropsT, void>);
): React.ComponentType<ArtistCreditRenamerPropsT>);
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const CollaboratorsFormList = (hydrate<CollaboratorsFormListPropsT>(
</div>
);
}),
): React.AbstractComponent<CollaboratorsFormListPropsT, void>);
): React.ComponentType<CollaboratorsFormListPropsT>);

type CollaboratorRowPropsT = {
+collaborator: CollaboratorStateT,
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/AcoustIdCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,5 @@ export default (
hydrate<React.PropsOf<AcoustIdCell>>(
'div.acoustids',
AcoustIdCell,
): React.AbstractComponent<React.PropsOf<AcoustIdCell>>
): React.ComponentType<React.PropsOf<AcoustIdCell>>
);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/Annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ export default (hydrate<React.PropsOf<Annotation>>(
newProps.entity = newEntity;
return newProps;
},
): React.AbstractComponent<React.PropsOf<Annotation>>);
): React.ComponentType<React.PropsOf<Annotation>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/ArtistCreditLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ component _MpIcon(artistCredit: ArtistCreditT) {
export const MpIcon = (hydrate<React.PropsOf<_MpIcon>>(
'span.ac-mp',
_MpIcon,
): React.AbstractComponent<React.PropsOf<_MpIcon>>);
): React.ComponentType<React.PropsOf<_MpIcon>>);

component ArtistCreditLink(
artistCredit: ArtistCreditT,
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/ArtistRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ component ArtistRoles(relations: $ReadOnlyArray<RelationT>) {
export default (hydrate<React.PropsOf<ArtistRoles>>(
'div.artist-roles-container',
ArtistRoles,
): React.AbstractComponent<React.PropsOf<ArtistRoles>>);
): React.ComponentType<React.PropsOf<ArtistRoles>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/AttributeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ component AttributeList(
export default (hydrate<React.PropsOf<AttributeList>>(
'div.entity-attributes-container',
AttributeList,
): React.AbstractComponent<React.PropsOf<AttributeList>>);
): React.ComponentType<React.PropsOf<AttributeList>>);
4 changes: 2 additions & 2 deletions root/static/scripts/common/components/Autocomplete2.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,13 @@ component _Autocomplete2<T: EntityItemT>(...props: PropsT<T>) {
}

// $FlowIgnore[unclear-type]
const Autocomplete2: React.AbstractComponent<PropsT<any>, mixed> =
const Autocomplete2: React.ComponentType<PropsT<any>> =
React.memo(_Autocomplete2);

export default Autocomplete2;

// XXX Until Flow supports https://github.com/facebook/flow/issues/7672
export const ArtistAutocomplete:
React.AbstractComponent<PropsT<ArtistT>, void> =
React.ComponentType<PropsT<ArtistT>> =
// $FlowIgnore[unclear-type]
(Autocomplete2: any);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/CommonsImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ export default (hydrate<Props>(
'div.commons-image',
CommonsImage,
minimalEntity,
): React.AbstractComponent<Props, void>);
): React.ComponentType<Props>);
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ component CritiqueBrainzReview(review: CritiqueBrainzReviewT, title: string) {
export default (hydrate<React.PropsOf<CritiqueBrainzReview>>(
'div.critiquebrainz-review',
CritiqueBrainzReview,
): React.AbstractComponent<React.PropsOf<CritiqueBrainzReview>>);
): React.ComponentType<React.PropsOf<CritiqueBrainzReview>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ component Filter(ajaxFormUrl: string, initialFilterForm: ?FilterFormT) {

export default (
hydrate<React.PropsOf<Filter>>('div.filter', Filter):
React.AbstractComponent<React.PropsOf<Filter>>
React.ComponentType<React.PropsOf<Filter>>
);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/FingerprintTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ component FingerprintTable(recording: RecordingT) {
export default (hydrate<React.PropsOf<FingerprintTable>>(
'div.acoustid-fingerprints',
FingerprintTable,
): React.AbstractComponent<React.PropsOf<FingerprintTable>>);
): React.ComponentType<React.PropsOf<FingerprintTable>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/IsrcList.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ component IsrcList(
export default (hydrate<React.PropsOf<IsrcList>>(
'div.isrc-list-container',
IsrcList,
): React.AbstractComponent<React.PropsOf<IsrcList>>);
): React.ComponentType<React.PropsOf<IsrcList>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/IswcList.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ component IswcList(
export default (hydrate<React.PropsOf<IswcList>>(
'div.iswc-list-container',
IswcList,
): React.AbstractComponent<React.PropsOf<IswcList>>);
): React.ComponentType<React.PropsOf<IswcList>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/PostParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ component PostParameters(params: PostParametersT) {
export default (hydrate(
'div.post-parameters',
PostParameters,
): React.AbstractComponent<React.PropsOf<PostParameters>>);
): React.ComponentType<React.PropsOf<PostParameters>>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/Relationships.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ component _Relationship(
);
}

const Relationships: React.AbstractComponent<React.PropsOf<_Relationship>> =
const Relationships: React.ComponentType<React.PropsOf<_Relationship>> =
React.memo(_Relationship);

export default Relationships;
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/ReleaseEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ component ReleaseEvents(
export default (hydrate<React.PropsOf<ReleaseEvents>>(
'div.release-events-container',
ReleaseEvents,
): React.AbstractComponent<React.PropsOf<ReleaseEvents>>);
): React.ComponentType<React.PropsOf<ReleaseEvents>>);
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ component _StaticRelationshipsDisplay(
return tables;
}

const StaticRelationshipsDisplay: React.AbstractComponent<
const StaticRelationshipsDisplay: React.ComponentType<
React.PropsOf<_StaticRelationshipsDisplay>
> = React.memo(_StaticRelationshipsDisplay);

Expand Down
4 changes: 2 additions & 2 deletions root/static/scripts/common/components/TagEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export const MainTagEditor = (hydrate<TagEditorProps>(
}
},
minimalEntity,
): React.AbstractComponent<TagEditorProps, void>);
): React.ComponentType<TagEditorProps>);

export const SidebarTagEditor = (hydrate<TagEditorProps>(
'div.sidebar-tags',
Expand Down Expand Up @@ -703,7 +703,7 @@ export const SidebarTagEditor = (hydrate<TagEditorProps>(
}
},
minimalEntity,
): React.AbstractComponent<TagEditorProps, void>);
): React.ComponentType<TagEditorProps>);

function createInitialTagState(
aggregatedTags: $ReadOnlyArray<AggregatedTagT>,
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/TaggerIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ export default (
hydrate<React.PropsOf<TaggerIcon>>(
'span.tagger-icon',
TaggerIcon,
): React.AbstractComponent<React.PropsOf<TaggerIcon>, void>
): React.ComponentType<React.PropsOf<TaggerIcon>>
);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/WikipediaExtract.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ export default (hydrate<Props>(
'div.wikipedia-extract',
WikipediaExtract,
minimalEntity,
): React.AbstractComponent<Props, void>);
): React.ComponentType<Props>);
2 changes: 1 addition & 1 deletion root/static/scripts/common/components/WorkArtists.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ component WorkArtists(artists: ?$ReadOnlyArray<ArtistCreditT>) {
export default (hydrate<React.PropsOf<WorkArtists>>(
'div.work-artists-container',
WorkArtists,
): React.AbstractComponent<React.PropsOf<WorkArtists>, void>);
): React.ComponentType<React.PropsOf<WorkArtists>>);
2 changes: 1 addition & 1 deletion root/static/scripts/edit/components/ArtistCreditBubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ component _ArtistCreditBubble(
);
}

const ArtistCreditBubble: React.AbstractComponent<
const ArtistCreditBubble: React.ComponentType<
React.PropsOf<_ArtistCreditBubble>
> = React.memo(_ArtistCreditBubble);

Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/edit/components/ArtistCreditEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ component _ArtistCreditEditor(
);
}

const ArtistCreditEditor: React.AbstractComponent<
const ArtistCreditEditor: React.ComponentType<
React.PropsOf<_ArtistCreditEditor>
> = React.memo(_ArtistCreditEditor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ component _ArtistCreditNameEditor(
);
}

const ArtistCreditNameEditor: React.AbstractComponent<
const ArtistCreditNameEditor: React.ComponentType<
React.PropsOf<_ArtistCreditNameEditor>
> = React.memo(_ArtistCreditNameEditor);

Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/edit/components/DateRangeFieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ component _DateRangeFieldset(
);
}

const DateRangeFieldset: React.AbstractComponent<
const DateRangeFieldset: React.ComponentType<
React.PropsOf<_DateRangeFieldset>
> = React.memo(_DateRangeFieldset);

Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/edit/components/FormRowTextList.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ export component NonHydratedFormRowTextList(
export default (hydrate<React.PropsOf<FormRowTextList>>(
'div.row.form-row-text-list-container',
FormRowTextList,
): React.AbstractComponent<React.PropsOf<FormRowTextList>, void>);
): React.ComponentType<React.PropsOf<FormRowTextList>>);
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ component _GuessCaseOptionsPopover(
);
}

const GuessCaseOptionsPopover: React.AbstractComponent<
const GuessCaseOptionsPopover: React.ComponentType<
React.PropsOf<_GuessCaseOptionsPopover>
> = React.memo(_GuessCaseOptionsPopover);

Expand Down
12 changes: 6 additions & 6 deletions root/static/scripts/edit/components/Multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,15 @@ export function runReducer<
}
}

type MultiselectValueComponentT = React.AbstractComponent<
type MultiselectValueComponentT = React.ComponentType<
MultiselectValuePropsT<
AutocompleteEntityItemT,
MultiselectValueStateT<AutocompleteEntityItemT>,
>,
mixed,
>;

// $FlowIgnore[incompatible-type]
// $FlowIgnore[incompatible-type-arg]
export const MultiselectValue: MultiselectValueComponentT = React.memo(<
V: AutocompleteEntityItemT,
VS: MultiselectValueStateT<V>,
Expand Down Expand Up @@ -214,6 +215,7 @@ export const MultiselectValue: MultiselectValueComponentT = React.memo(<
);
});

// $FlowIgnore[incompatible-cast]
const Multiselect = (React.memo(<
V: AutocompleteEntityItemT,
VS: MultiselectValueStateT<V>,
Expand All @@ -236,9 +238,8 @@ const Multiselect = (React.memo(<
const GenericMultiselectValue = (
// $FlowIgnore[incompatible-cast]
MultiselectValue:
React.AbstractComponent<
React.ComponentType<
MultiselectValuePropsT<V, VS>,
mixed,
>
);

Expand All @@ -263,7 +264,7 @@ const Multiselect = (React.memo(<
) : null}
</>
);
}): React.AbstractComponent<
}): React.ComponentType<
MultiselectPropsT<
AutocompleteEntityItemT,
MultiselectValueStateT<AutocompleteEntityItemT>,
Expand All @@ -272,7 +273,6 @@ const Multiselect = (React.memo(<
MultiselectValueStateT<AutocompleteEntityItemT>,
>,
>,
mixed,
>);

export default Multiselect;
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export default (
hydrate<React.PropsOf<NewNotesAlertCheckbox>>(
'span.new-notes-alert-checkbox',
NewNotesAlertCheckbox,
): React.AbstractComponent<React.PropsOf<NewNotesAlertCheckbox>, void>
): React.ComponentType<React.PropsOf<NewNotesAlertCheckbox>>
);
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ component ReleaseMergeStrategy(
export default (hydrate<React.PropsOf<ReleaseMergeStrategy>>(
'div.release-merge-strategy',
ReleaseMergeStrategy,
): React.AbstractComponent<React.PropsOf<ReleaseMergeStrategy>, void>);
): React.ComponentType<React.PropsOf<ReleaseMergeStrategy>>);
Loading