-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: TanStack Query React integration #320
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
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Do we need to distinguish between the flavor of hooks to use here? (React, vs vue, etc) This may not necessarily work outside of a react context. |
|
@genu this PR is focusing on React, but because it is the first target being developed for v3, there is going to be some groundwork laid for the others. I think the common parts of the integration are going to be very similar to how it was in v2. |
|
Hey @sanny-io , I didn't know it was you on discord 🤣 . Thanks for the effort and can't wait to try it out! |
|
Just a heads up, I'm renaming "@zenstackhq/runtime" package to "@zenstackhq/orm". |
|
Quick update regarding this PR: good progress has been made on the type inference for mutations and queries, but I've been dealing with the intellisense becoming unacceptably slow because the compiler is struggling with the types. The unfortunate thing is that a lot of the types in this PR build on top of one another, so fixing the bottleneck is proving to be quite difficult. I'm closing this for now, but I'll keep experimenting to see if I can get it right. I know this is a much anticipated feature, so if anyone else wants to take a shot at it, I don't wanna be the holdup. My branch won't be deleted, and if anyone has any questions, I'm here to answer. |
Thanks for the update @sanny-io . No worries, and I appreciate your effort put into this. I'm about to finish migrating server adapters to v3 and then will probably look into tanstack query code. |
This uses type inference rather than code generation. Final implementation will look something like this: