-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[FEAT] React-Query v5 compatibility #5370
Comments
Thanks for the issue @bombillazo. Migration looks straightforward, other than callbacks. @aliemir had the idea of providing these callbacks as a polyfill with the current v4 version of refine. This means we could still accept |
Yeah! I think that would be the best approach for backward compatibility; in fact, I think (if I remember correctly from the RQ maintainers) that is what RQ is doing internally for those callbacks. |
Would migrating to v5 allow us to take advantage of the react query suspense features? |
yea suspense would be great |
any update on this? |
Just wanted to give my +1 for this request. (I'm having a "brownfield" project, which is already using react-query@5 and I tried using refine there. It looks like the missing support for the new version of react-query sadly blocks me from adopting refine.) Also: Huge "thank you" for this fantastic project 🙂! |
@BatuhanW could you please specify what needs to be done in preparation before migration to react-query v5? |
Hey @zernie the main refactor should be replacing removed onXXX calbacks with useEffect for notifications in internal logic. Also, since these callbacks might be used by current Refine users, we also need to keep these types and trigger them with useEffect. Other thing is we need to check react-query's new types and make sure there is no breaking change with current Refine types. We are open to contributions for this issue, if anyone wants to work on this. |
Was anyone able to look into this? The Refine source is pretty daunting and internally has lots of file/usage of RQ, perhaps identifying where the changes are required will motivate others to take the challenge? |
Is your feature request related to a problem? Please describe.
We've created a branch to migrate our application code to RQ v5, but have refrained since Refine uses RQ under the hood and want to avoid breaking any dependencies.
Describe alternatives you've considered
Keep using RQ v4 for the time being.
Additional context
https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5
The migration process is relatively straightforward. They did remove the query callbacks, and the new paradigm for reacting to queries is doing so with
useEffect
hooks. One can still set global callbacks for queries, which refine uses for the notifications context, so the migration for Refine will likely center around that for their custom useQuery hooks.They've also standardized the query function signatures only to accept objects. The typing should auto-alert the internal refine code.
Describe the thing to improve
Having the ability to use React Query v5 in our refine project.
The text was updated successfully, but these errors were encountered: