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

Typescript refactor #2685

Merged
merged 169 commits into from
Dec 2, 2023
Merged

Typescript refactor #2685

merged 169 commits into from
Dec 2, 2023

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Mar 20, 2023

üWave does some pretty complex stuff to maintain playlist state and reuse components with different data, and that sometimes goes wrong at runtime. I'm working on adding typechecking so we can solve some issues, eg. statically check that the media list implementation can actually be used with playlist items, search results, and history entries.

Some of the patterns in the client are not really friendly to typescript. Especially the HTTP request redux middleware I can't really get to work well, but that is one of the most beneficial things to get types from, because it lets us check that we're handling API responses correctly. I'm moving some of that stuff to SWR. I think there's an opportunity to simplify a lot that way as well as about half of our redux complexity is just about maintaining a client-side cache of server-side state, which SWR can do much more easily.

Not totally sure where this will end up, will just do bits and pieces whenever I want, but that's the current status

Todos before merge:

  • The settings menu doesn't close with the X button
  • Playlist fails to load if you added a media to it without having loaded it before
  • Playlist shows loading state on re-fetch even if it already had media
  • The currently playing media uses global artist/title instead of edited
  • Remove the media item merging

@goto-bus-stop
Copy link
Member Author

Going to merge as i'm avoiding merging other things while this is in flight--it's mostly usable but todos factored out to new issues:

#2768
#2769
#2770
#2771

@goto-bus-stop goto-bus-stop merged commit 724edd2 into default Dec 2, 2023
13 checks passed
@goto-bus-stop goto-bus-stop deleted the typescript branch December 2, 2023 21:11
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.

1 participant