Skip to content

Conversation

@jason4193
Copy link
Contributor

@jason4193 jason4193 commented Aug 2, 2025

Description 🧾

Installed FE library TanStack Query and TanStack Query Dev Tools
Constructed FE API directory structure with /route, /query, mutation for each /user and /timetable
Decided to use axios library for route calling, for more structural status handling.
Migrated use of AppContext for setting toggles to React Query
Implemented an ErrorBoundary to catch any status error or unknown computation errors.

In progress:

  • Whether use of axios instead of JS in-built fetch (Chosen to use axios for more structural Status Handling).
  • Migrating timetable contents from Local Storage to React Query. (Will be resolved from other issues)
  • Handling remaining value inside AppContext. Since every time any context value updated, whole App will be re-rendered.

Testing

Testing for Settings: Access the TanStack Query Dev Tool, when toggling the settings options, there are updates of [settings] query key, with corresponding FE changes.

Checklist

  • 📍 You have assigned yourself to this pull request.
  • 🔗 You have linked an issue to which this pull request closes.
  • 💭 Leave any relevant specific directions to reviewers.
  • 👀 No secrets in clear text in the pull request.
  • 🎟️ To categorise release notes, the pull request should be labelled with at least one of these labels:
    • feature: for application feature improvement or new features
    • bug: fixing something that previously wasn't working
    • dev: development-side related changes
    • docker: updates to the Docker code
    • setup: changes to the setup/infrastructure of the codebase
    • test: updates to internal testing

@jason4193 jason4193 self-assigned this Aug 2, 2025
@jason4193 jason4193 added the 🍀 feature 🪴 New feature or request label Aug 2, 2025
Copy link
Contributor

@lhvy lhvy left a comment

Choose a reason for hiding this comment

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

This is a solid start for moving us towards React Query. 🎉

@lhvy
Copy link
Contributor

lhvy commented Aug 2, 2025

Let's make this PR just for the settings migration. I'd like to see this roll out sooner rather than later to save an onslaught of merge conflicts. I also want to loop more people into this process - will be easier as multiple branches and PRs.

@jason4193 jason4193 changed the title Integrate tanstack query Settings Migrate to Tanstack Query Aug 5, 2025
@jason4193 jason4193 force-pushed the integrate-tanstack-query branch 2 times, most recently from 64d6c3c to 0d4f557 Compare August 8, 2025 11:21
@jason4193 jason4193 marked this pull request as ready for review August 18, 2025 08:08
@jason4193 jason4193 requested a review from a team as a code owner August 18, 2025 08:08
@jason4193 jason4193 force-pushed the integrate-tanstack-query branch from 257ae92 to 7a2ada4 Compare August 20, 2025 05:24
@jason4193 jason4193 linked an issue Aug 26, 2025 that may be closed by this pull request
Copy link
Contributor

@lhvy lhvy left a comment

Choose a reason for hiding this comment

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

Looks really good to me. Need to discuss and test further over call, plus wait for second review before merging.

Copy link
Contributor

@mark-trann mark-trann left a comment

Choose a reason for hiding this comment

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

looks really good! Very impressed on your changes - especially making Drag.ts changes

image

@lhvy lhvy changed the title Settings Migrate to Tanstack Query Migrate settings to Tanstack Query Aug 27, 2025
@lhvy lhvy merged commit a3e9ad5 into server-rewrite Aug 27, 2025
3 checks passed
@lhvy lhvy deleted the integrate-tanstack-query branch August 27, 2025 08:10
lhvy pushed a commit that referenced this pull request Aug 31, 2025
* Install TankStack library with corresponding devtool, integrate into App.tsx

* Integrate react query in to setting page

* Connect settings.useSquareEdge,useDarkMode,preferredTheme with FE components

* Remove use of QueryContext to direct suspense query calling to avoid re-rendering of whole App component

* Update all settings to use React Query

* Fix FE build error by removing removed AppContext states on components

* Remove redudant comments

* Add Error Boundary for handling unintented error, resolve packages version and dependecies issue

* Remove unwanted comments and resolve naming issues

* Resolve setting item destructing before used, and other dependecies issues

* Migrate JS fetch to Axios

* Remove unwanted library import

* Update ErrorBoundary to handle any unknown errors

* Resolve build error

* Rebase from server-rewrite

* Rebase from server-rewrite, with autofix eslint

* Refactor Settings component to fit the feat of profile picture

* Remove unneccssary commnets

* Resolved dropcard shadow logic with react query

* Resolve CI build error and lint warnings from drag.ts

* Resolve review errors from lucas

* Resolve use-prefix issue for settings parameter with minor changes

* Resolve review comments from mark

* Update the prisma schema for user settings

* Update the prisma schema for user settings

* Resolve naming error
fox-58 pushed a commit that referenced this pull request Sep 4, 2025
* Install TankStack library with corresponding devtool, integrate into App.tsx

* Integrate react query in to setting page

* Connect settings.useSquareEdge,useDarkMode,preferredTheme with FE components

* Remove use of QueryContext to direct suspense query calling to avoid re-rendering of whole App component

* Update all settings to use React Query

* Fix FE build error by removing removed AppContext states on components

* Remove redudant comments

* Add Error Boundary for handling unintented error, resolve packages version and dependecies issue

* Remove unwanted comments and resolve naming issues

* Resolve setting item destructing before used, and other dependecies issues

* Migrate JS fetch to Axios

* Remove unwanted library import

* Update ErrorBoundary to handle any unknown errors

* Resolve build error

* Rebase from server-rewrite

* Rebase from server-rewrite, with autofix eslint

* Refactor Settings component to fit the feat of profile picture

* Remove unneccssary commnets

* Resolved dropcard shadow logic with react query

* Resolve CI build error and lint warnings from drag.ts

* Resolve review errors from lucas

* Resolve use-prefix issue for settings parameter with minor changes

* Resolve review comments from mark

* Update the prisma schema for user settings

* Update the prisma schema for user settings

* Resolve naming error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍀 feature 🪴 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate User Setting to React Query(TanStack)

4 participants