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

Query Block - Reduce extra network requests #1622

Open
wants to merge 10 commits into
base: release/2.0.0
Choose a base branch
from

Conversation

iansvo
Copy link
Collaborator

@iansvo iansvo commented Dec 28, 2024

Relates to: #1616

In this branch, I add the QueryClientProvider to the plugin and pass the queryClient around so the consuming components can use it. This allows tanstack query to properly cache the queries and not have them happen so often.

Requires components PR: https://github.com/EDGE22-Studios/components/pull/18

@iansvo iansvo self-assigned this Dec 28, 2024
@iansvo iansvo changed the base branch from master to release/2.0.0 December 28, 2024 16:38
@tomusborne
Copy link
Owner

Noticed that this broke the user select.

broken-user.mp4

Fixed it easy enough, but should we worry about this if we forget to pass the query client? Could there be a backup perhaps?

@iansvo
Copy link
Collaborator Author

iansvo commented Jan 7, 2025

I'm not sure there's a way we could do a fallback that doesn't involve writing the whole fetching logic twice. There's only so many places these components are even used, so it shouldn't be hard to manage which props they need.

If anything, we could update the components to throw an error if queryClient is undefined, which they won't do now. this way we can obviously see we made a mistake while developing and fix it, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants