battlecode / galaxy

MIT License
10 stars 3 forks source link

React Query #707

Closed lowtorola closed 7 months ago

lowtorola commented 9 months ago

Adds React Query as frontend2's async state manager! Plus, restructures our api!

New API structure:

lowtorola commented 9 months ago

Just noting that generated files are currently duplicated but that will be fixed once everything runs from src/api 😎

lowtorola commented 9 months ago

@acrantel Could you please take a look at EligibilitySettings.tsx, ScrimmageSettings.tsx, and MyTeam.tsx to address some of the ideas I left behind while tearing out TeamContext? We can also take a look at this during our hack session, but I think if you can take a look at this then I can finish this PR this week (with UserContext updated as well 😎).

lowtorola commented 9 months ago

Huge progress on react querifying! Next step is fixing Eligibility/Scrim Settings sections. Then, I think I can tackle React Router loaders on this PR. Only problem is, I think that will make it necessary to refactor the queryKey/queryFn pairs for each hook to reuse on the loader functions. Also, I think I will refactor a prefetchNextPage function that many of our use<Model>List hooks use! So we will see how I feel after fixing UIs (whether things are on this/other PR). Maybe will depend on timing of user pages, etc.

lowtorola commented 9 months ago

@acrantel Progress update: I finished reworking EligibilitySettings, ScrimmageSettings, and MyTeam as well as implementing the useTeam and useCompete hooks across the FE. Once the useUser hooks are in from your side I think we can do a mega-test on this and merge!! 🎉

lowtorola commented 7 months ago

Going to yeet the test files that are breaking CI 😢 maybe we will add real unit tests someday lol

lowtorola commented 7 months ago

WHOOOO 🎉 🎉 🎉