Skip to content
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

chore: Update react query version #2240

Merged
merged 6 commits into from Aug 8, 2022
Merged

chore: Update react query version #2240

merged 6 commits into from Aug 8, 2022

Conversation

dyaa
Copy link
Contributor

@dyaa dyaa commented Jul 17, 2022

Closes #2352

@dyaa dyaa added the ⬆️ dependencies Pull requests that update a dependency file label Jul 17, 2022
@dyaa dyaa self-assigned this Jul 17, 2022
@vercel
Copy link

vercel bot commented Jul 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
next-prisma-starter ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 2:19PM (UTC)
www ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 2:19PM (UTC)

@dyaa
Copy link
Contributor Author

dyaa commented Jul 18, 2022

So I've made some quick investigations, and I found out the following:

  1. setLogger has been removed in the latest beta version, and instead, a custom logger can be passed to QueryClient's constructor.
  2. There will be type mismatches with @trpc/react package since it's using an older version of react-query.

Next:

  1. I'll make a full upgrade to the react-query package to their beta version and update all internal packages to use the beta version.
  2. I'll remove the dependency on the env variable REACT_QUERY_VERSION.

Any other suggestions are welcome.

CC @KATT

@KATT
Copy link
Member

KATT commented Jul 18, 2022

  1. setLogger has been removed in the latest beta version, and instead, a custom logger can be passed to QueryClient's constructor.

Feel free to remove our use of setLogger everywhere.

  1. There will be type mismatches with @trpc/react package since it's using an older version of react-query.

What sort of stuff? Will it be impossible to support both?

Next:

  1. I'll make a full upgrade to the react-query package to their beta version and update all internal packages to use the beta version.
  2. I'll remove the dependency on the env variable REACT_QUERY_VERSION.

Will it be impossible to support both versions?

@dyaa
Copy link
Contributor Author

dyaa commented Jul 18, 2022

I don't think that's possible without having @trpc/react using the same version for react-query.

@KATT
Copy link
Member

KATT commented Jul 18, 2022

cc @dyaa update to main which doesn't try to make this cross-compatible anymore. Will be a lot easier to fix the issues then.

@KATT
Copy link
Member

KATT commented Jul 18, 2022

also please get github sponsors working so I can send you money for it :) #1599

@KATT
Copy link
Member

KATT commented Jul 20, 2022

I'll send some more money if you fix it, just sent you a fiver for a beer or a coffee now 🍻

@kodiakhq kodiakhq bot removed the ⬆️ dependencies Pull requests that update a dependency file label Jul 21, 2022
@kodiakhq
Copy link
Contributor

kodiakhq bot commented Jul 21, 2022

This PR currently has a merge conflict. Please resolve this and then re-add the ['🚀 merge', '⬆️ dependencies'] label.

@KATT KATT closed this Jul 21, 2022
@KATT KATT deleted the chore/update-react-query branch July 21, 2022 20:28
@KATT KATT restored the chore/update-react-query branch July 21, 2022 20:28
@KATT KATT reopened this Jul 21, 2022
@KATT
Copy link
Member

KATT commented Jul 21, 2022

Oops, I closed the wrong PR!

@KATT
Copy link
Member

KATT commented Aug 8, 2022

I'm bumping the version now to see if it fixes it :)

Copy link
Member

@KATT KATT left a comment

Choose a reason for hiding this comment

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

Lovely, I just want to get some feedback from @trpc/trpc-core in regards to the requestContext property

@@ -82,7 +82,7 @@ export interface TRPCRequestOptions {
/**
* Pass additional context to links
*/
context?: OperationContext;
requestContext?: OperationContext;
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a note of this in https://alpha.trpc.io/docs/migrate-from-v9-to-v10 anywhere? I'll clean it up later.

@sachinraja @jlalmes what do you think we should do here now that the context keyword is taken?

Some options:

  • Put all trpc option under trpc - quite annoying for the 99% use-case but also nice to have a distinct place for "our" versus "theirs" in options
  • Call it trpcContext? Potentially prefix all our vars with trpc?
  • operationContext?
  • opContext?
  • callContext?

Copy link
Member

@KATT KATT Aug 8, 2022

Choose a reason for hiding this comment

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

Moved to #2395.

Will merge this one and we can iterate as it's still alpha.

@KATT
Copy link
Member

KATT commented Aug 8, 2022

@all-contributors add @dyaa for code, test

@allcontributors
Copy link
Contributor

@KATT

I've put up a pull request to add @dyaa! 🎉

@KATT KATT merged commit 88c98f4 into next Aug 8, 2022
@KATT KATT deleted the chore/update-react-query branch August 8, 2022 14:26
@github-actions
Copy link

github-actions bot commented Oct 4, 2022

This pull request has been locked because it had no new activity for 30 days. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⬆️ dependencies Pull requests that update a dependency file 🙋‍♂️ help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

~React~ TanStack Query 4 support Make v9 support react-query 4?
2 participants