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

feat: prefetch on queries #103

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

brenoliradev
Copy link

@brenoliradev brenoliradev commented Nov 12, 2024

Hey. This is a draft PR heavily inspired on: https://github.com/TanStack/query/blob/f56fc8415904d79a4658167e01a8dbbcf842bd8f/packages/query-core/src/queryClient.ts#L357

Aims to solve: #6

I tried to mimic the behavior but using queryCache.

Ps: The idea behind this PR is to start a discussion about if it's viable to prefetch in this way or not.

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for funny-banoffee-0afb46 canceled.

Name Link
🔨 Latest commit a4b2535
🔍 Latest deploy log https://app.netlify.com/sites/funny-banoffee-0afb46/deploys/673a430827c176000804818a

@brenoliradev brenoliradev marked this pull request as draft November 12, 2024 15:24
@brenoliradev brenoliradev changed the title feat: prefetch on useQuery feat: prefetch on queries Nov 12, 2024
@brenoliradev brenoliradev marked this pull request as ready for review November 16, 2024 20:21
@brenoliradev
Copy link
Author

@posva Hey! I think it's good to go for a first review.

Copy link
Owner

@posva posva left a comment

Choose a reason for hiding this comment

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

Thanks, it's looking good!
I still need to look at this from the practical perspective of using it with data loaders before going further so it might take a few weeks to merge

src/query-store.ts Outdated Show resolved Hide resolved
src/use-query.spec.ts Show resolved Hide resolved
src/use-query.spec.ts Outdated Show resolved Hide resolved
src/use-query.spec.ts Outdated Show resolved Hide resolved
src/use-query.spec.ts Outdated Show resolved Hide resolved
Copy link

pkg-pr-new bot commented Nov 16, 2024

Open in Stackblitz

@pinia/colada

pnpm add https://pkg.pr.new/@pinia/colada@103

@pinia/colada-nuxt

pnpm add https://pkg.pr.new/@pinia/colada-nuxt@103

@pinia/colada-plugin-auto-invalidate

pnpm add https://pkg.pr.new/@pinia/colada-plugin-auto-invalidate@103

@pinia/colada-plugin-debug

pnpm add https://pkg.pr.new/@pinia/colada-plugin-debug@103

@pinia/colada-plugin-delay

pnpm add https://pkg.pr.new/@pinia/colada-plugin-delay@103

@pinia/colada-plugin-cache-persister

pnpm add https://pkg.pr.new/@pinia/colada-plugin-cache-persister@103

@pinia/colada-plugin-retry

pnpm add https://pkg.pr.new/@pinia/colada-plugin-retry@103

commit: e43825f

brenoliradev and others added 4 commits November 17, 2024 00:11
Co-authored-by: Eduardo San Martin Morote <[email protected]>
Co-authored-by: Eduardo San Martin Morote <[email protected]>
Co-authored-by: Eduardo San Martin Morote <[email protected]>
@brenoliradev
Copy link
Author

@posva I think everything is fixed!

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

Successfully merging this pull request may close these issues.

2 participants