Skip to content

Commit

Permalink
[WIP] Update Flow to 0.251.1
Browse files Browse the repository at this point in the history
https://github.com/facebook/flow/releases/tag/v0.251.0
https://github.com/facebook/flow/releases/tag/v0.251.1

Most changes are due to the deprecation of React.AbstractComponent
which needs to be replaced with component types.
  • Loading branch information
reosarevok committed Nov 4, 2024
1 parent 7cc03f9 commit 4bf317b
Show file tree
Hide file tree
Showing 77 changed files with 165 additions and 166 deletions.
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.251.1",
"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>);
): component(...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>
component(...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>);
): component(...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>);
): component(...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>);
): component(...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>>);
): component(...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>);
): component(...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>);
): component(...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>>
): component(...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>>);
): component(...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>>);
): component(...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>>);
): component(...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>>);
): component(...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: component(...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> =
component(...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>);
): component(...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>>);
): component(...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>>
component(...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>>);
): component(...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>>);
): component(...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>>);
): component(...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>>);
): component(...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: component(...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>>);
): component(...React.PropsOf<ReleaseEvents>));
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ component _StaticRelationshipsDisplay(
return tables;
}

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

export default StaticRelationshipsDisplay;
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>);
): component(...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>);
): component(...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>
): component(...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>);
): component(...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>);
): component(...React.PropsOf<WorkArtists>));
6 changes: 3 additions & 3 deletions root/static/scripts/edit/components/ArtistCreditBubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ component _ArtistCreditBubble(
);
}

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

export default ArtistCreditBubble;
6 changes: 3 additions & 3 deletions root/static/scripts/edit/components/ArtistCreditEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@ component _ArtistCreditEditor(
);
}

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

export default ArtistCreditEditor;
6 changes: 3 additions & 3 deletions root/static/scripts/edit/components/ArtistCreditNameEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ component _ArtistCreditNameEditor(
);
}

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

export default ArtistCreditNameEditor;
6 changes: 3 additions & 3 deletions root/static/scripts/edit/components/DateRangeFieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ component _DateRangeFieldset(
);
}

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

export default DateRangeFieldset;
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>);
): component(...React.PropsOf<FormRowTextList>));
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ component _GuessCaseOptionsPopover(
);
}

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

export default GuessCaseOptionsPopover;
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>
): component(...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>);
): component(...React.PropsOf<ReleaseMergeStrategy>));
6 changes: 3 additions & 3 deletions root/static/scripts/edit/components/edit/RelationshipDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ component _RelationshipDiff(
);
}

const RelationshipDiff: React.AbstractComponent<
React.PropsOf<_RelationshipDiff>
> = React.memo(_RelationshipDiff);
const RelationshipDiff: component(
...React.PropsOf<_RelationshipDiff>
) = React.memo(_RelationshipDiff);

export default RelationshipDiff;
2 changes: 1 addition & 1 deletion root/static/scripts/event/components/EventEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,4 @@ component EventEditForm(
export default (hydrate<React.PropsOf<EventEditForm>>(
'div.event-edit-form',
EventEditForm,
): React.AbstractComponent<React.PropsOf<EventEditForm>>);
): component(...React.PropsOf<EventEditForm>));
2 changes: 1 addition & 1 deletion root/static/scripts/genre/components/GenreEditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ component GenreEditForm(form as initialForm: GenreFormT) {
export default (hydrate<React.PropsOf<GenreEditForm>>(
'div.genre-edit-form',
GenreEditForm,
): React.AbstractComponent<React.PropsOf<GenreEditForm>, void>);
): component(...React.PropsOf<GenreEditForm>));
2 changes: 1 addition & 1 deletion root/static/scripts/main/components/ConfirmSeedButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ component ConfirmSeedButtons(autoSubmit: boolean) {
export default (hydrate(
'span.buttons.confirm-seed',
ConfirmSeedButtons,
): React.AbstractComponent<React.PropsOf<ConfirmSeedButtons>, void>);
): component(...React.PropsOf<ConfirmSeedButtons>));
2 changes: 1 addition & 1 deletion root/static/scripts/recording/RecordingName.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ export component RecordingName(
export default (hydrate<React.PropsOf<RecordingName>>(
'div.recording-name',
RecordingName,
): React.AbstractComponent<React.PropsOf<RecordingName>, void>);
): component(...React.PropsOf<RecordingName>));
Loading

0 comments on commit 4bf317b

Please sign in to comment.