-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[frontend] upgrade to react-query v5 #14346
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Ignored Deployments
|
williamrobertson13
force-pushed
the
wrobertson/v5_query
branch
from
October 19, 2023 15:30
5d0d152
to
277b6bc
Compare
williamrobertson13
changed the title
[apps/dapp-kit] upgrade to react-query v5
[frontend] upgrade to react-query v5
Oct 19, 2023
williamrobertson13
changed the title
[frontend] upgrade to react-query v5
[frontend][wip] upgrade to react-query v5
Oct 24, 2023
williamrobertson13
changed the title
[frontend][wip] upgrade to react-query v5
[frontend] upgrade to react-query v5
Oct 24, 2023
jonas-lj
pushed a commit
to jonas-lj/sui
that referenced
this pull request
Nov 2, 2023
## Description This PR upgrades our codebase and frontend SDKs to use react-query v5 which was released yesterday. @Jordan-Mysten did 98% of the work here (thx bud), but to cover the migration list/changes here: https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5 - Explicitly set `initialPageParam` to null for all infinite queries (this starts us at the first page) - Modified typings for `useSuiClientQuery` and `useSuiClientInfiniteQuery` to support data transformations via `select` - Removed onSuccess, onError, onSettled callbacks on `useQuery` in favor of side effects - Renamed `isLoading` -> `isPending` which would be equivalent in the pre-v5 world - Replaced deprecated `isInitialLoading` with `isLoading` which is now equivalent - Replaced `keepPreviousData` property with `placeholderData: keepPreviousData` - Replaced `dehydrateQueries` with `shouldDehydrateQuery` - Renamed `cacheTime` -> `gcTime` As a side note, the whole `isPending` vs `isLoading` concept is pretty confusing to wrap your ahead around. I didn't change anything functionality-wise, but that isn't to say that we're using the correct status field everywhere in our codebase: `isPending` = no data is available (e.g. the query is disabled) `isLoading` = we're actively fetching data ## Test Plan - Going to manually test all of our applications and core flows work as expected just in case we missed something - Won't land this until next week when we've done said testing ^ - Existing tests - CI --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes --------- Co-authored-by: Jordan Gensler <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR upgrades our codebase and frontend SDKs to use react-query v5 which was released yesterday. @Jordan-Mysten did 98% of the work here (thx bud), but to cover the migration list/changes here:
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5
initialPageParam
to null for all infinite queries (this starts us at the first page)useSuiClientQuery
anduseSuiClientInfiniteQuery
to support data transformations viaselect
useQuery
in favor of side effectsisLoading
->isPending
which would be equivalent in the pre-v5 worldisInitialLoading
withisLoading
which is now equivalentkeepPreviousData
property withplaceholderData: keepPreviousData
dehydrateQueries
withshouldDehydrateQuery
cacheTime
->gcTime
As a side note, the whole
isPending
vsisLoading
concept is pretty confusing to wrap your ahead around. I didn't change anything functionality-wise, but that isn't to say that we're using the correct status field everywhere in our codebase:isPending
= no data is available (e.g. the query is disabled)isLoading
= we're actively fetching dataTest Plan
If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)
Release notes