Skip to content

Conversation

@DamianOsipiuk
Copy link
Contributor

@DamianOsipiuk DamianOsipiuk commented Sep 16, 2024

Restructure plugin to expose more utilities useful in user-land.

Returned utilities:

  • persisterFn - main persister function that can be passed to useQuery
  • persistQueryByKey - persist query to persister storage. Ex call it just after setQueryData
  • retrieveQuery - retrieve one query from persister storage
  • persisterGc - gc pass for the persister storage to clean up unusable entries
  • persisterRestoreAll - restore are persisted queries from storage

TODO:

  • tests

@nx-cloud
Copy link

nx-cloud bot commented Sep 16, 2024

View your CI Pipeline Execution ↗ for commit ec6573e.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 45s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 55s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-13 21:37:54 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 16, 2024

More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8062

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@8062

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@8062

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@8062

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8062

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@8062

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@8062

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@8062

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@8062

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@8062

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@8062

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@8062

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@8062

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@8062

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@8062

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@8062

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@8062

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@8062

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@8062

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@8062

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@8062

commit: ec6573e

@DamianOsipiuk DamianOsipiuk force-pushed the do/persister-client-set-get branch from 95dad65 to 33ff831 Compare December 6, 2024 21:39
@github-actions github-actions bot added documentation Improvements or additions to documentation package: react-query labels Dec 6, 2024
@codecov
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 92.53731% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.83%. Comparing base (c89c6a0) to head (ec6573e).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #8062       +/-   ##
===========================================
+ Coverage   44.40%   80.83%   +36.42%     
===========================================
  Files         206       36      -170     
  Lines        8174      668     -7506     
  Branches     1822      182     -1640     
===========================================
- Hits         3630      540     -3090     
+ Misses       4100      111     -3989     
+ Partials      444       17      -427     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental ∅ <ø> (∅)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister 43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core ∅ <ø> (∅)
@tanstack/query-devtools ∅ <ø> (∅)
@tanstack/query-persist-client-core 78.32% <92.53%> (+4.85%) ⬆️
@tanstack/query-sync-storage-persister 84.61% <ø> (ø)
@tanstack/query-test-utils ∅ <ø> (∅)
@tanstack/react-query 95.34% <ø> (ø)
@tanstack/react-query-devtools 10.00% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query ∅ <ø> (∅)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query ∅ <ø> (∅)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client 100.00% <ø> (ø)
@tanstack/vue-query ∅ <ø> (∅)
@tanstack/vue-query-devtools ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2025

Sizes for commit ec6573e:

Branch Bundle Size
Main
This PR

@DamianOsipiuk DamianOsipiuk force-pushed the do/persister-client-set-get branch from aa5bf2c to 47dff57 Compare May 13, 2025 21:19
@DamianOsipiuk DamianOsipiuk marked this pull request as ready for review May 13, 2025 21:23
@DamianOsipiuk DamianOsipiuk merged commit 65ef198 into main May 13, 2025
7 checks passed
@DamianOsipiuk DamianOsipiuk deleted the do/persister-client-set-get branch May 13, 2025 21:39
@frederikhors
Copy link
Contributor

@DamianOsipiuk thank you very much for this!

@TkDodo
Copy link
Collaborator

TkDodo commented May 14, 2025

does this close any of the open issues around createPersister ?

@DamianOsipiuk
Copy link
Contributor Author

does this close any of the open issues around createPersister ?

This should close #6310.
It exposes utilities to do persistence on demand in user-land.
And if i recall correctly we decided that we do not want to put more code to make that work out-of-the-box into the core.

@TkDodo
Copy link
Collaborator

TkDodo commented May 14, 2025

yeah if we want more utilities, they should come from the persister package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants