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

Port RecentListens to Typescript #791

Merged
merged 3 commits into from
Apr 12, 2020

Conversation

ishaanshah
Copy link
Collaborator

Description

We're moving over to Typescript for our frontend code. This pull request migrates the profile.jsx file to typescript.

We also do some linting fixes here.

Problem

The LB frontend code is very hard to read or modify because it's complex and javascript provides no guarantee of what is available where etc.

Solution

Use typescript instead, which helps us have types on react components and functions and catch errors at compile time.

The linter has also caught a few actual bugs too.

@ishaanshah ishaanshah marked this pull request as draft April 11, 2020 15:57
@ishaanshah ishaanshah force-pushed the recent-listen-port branch 2 times, most recently from c699938 to ff4d969 Compare April 12, 2020 09:24
@ishaanshah ishaanshah changed the title [WIP] Port RecentListens to Typescript Port RecentListens to Typescript Apr 12, 2020
@ishaanshah ishaanshah marked this pull request as ready for review April 12, 2020 09:26
@@ -141,7 +141,6 @@ export default class SpotifyPlayer extends React.Component<
}
this.handleWarning("Could not find track on Spotify");
this.playNextTrack();
return;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Extra return statements, removed by the linter. I checked if player was working as expected and the alert bug didn't appear. This should be safe to remove.

Copy link
Collaborator

@paramsingh paramsingh left a comment

Choose a reason for hiding this comment

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

Looks good, I'm assuming we'll add the snapshot tests in a future pull request?

@paramsingh paramsingh merged commit fc290d6 into metabrainz:master Apr 12, 2020
@ishaanshah ishaanshah deleted the recent-listen-port branch May 3, 2020 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants