Skip to content

Conversation

rklomp
Copy link
Contributor

@rklomp rklomp commented Jun 1, 2025

Rename persisterRestoreAll to restoreQueries and add filter options to allow restoring all queries or a filtered set of queries from the persister.

In my situation the persisterRestoreAll will restore too much data and I want to restore only a subset of my data on app start.

Copy link

nx-cloud bot commented Jun 1, 2025

View your CI Pipeline Execution ↗ for commit 0bfb4c2.

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

☁️ Nx Cloud last updated this comment at 2025-06-01 14:13:20 UTC

Copy link

pkg-pr-new bot commented Jun 1, 2025

More templates

@tanstack/angular-query-devtools-experimental

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

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 0bfb4c2

@rklomp rklomp changed the title fix(experimental_createQueryPersister): Add persisterRestoreByKey feat(experimental_createQueryPersister): Add persisterRestoreByKey Jun 1, 2025
Copy link

codecov bot commented Jun 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.69%. Comparing base (b475d21) to head (0bfb4c2).
Report is 25 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #9230       +/-   ##
===========================================
+ Coverage   45.30%   59.69%   +14.38%     
===========================================
  Files         209      138       -71     
  Lines        8257     5503     -2754     
  Branches     1856     1484      -372     
===========================================
- Hits         3741     3285      -456     
+ Misses       4076     1921     -2155     
+ Partials      440      297      -143     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental 85.04% <ø> (ø)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister 43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental 24.39% <ø> (ø)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core 98.13% <ø> (ø)
@tanstack/query-devtools 3.56% <ø> (ø)
@tanstack/query-persist-client-core 79.47% <100.00%> (+1.14%) ⬆️
@tanstack/query-sync-storage-persister 84.61% <ø> (ø)
@tanstack/query-test-utils ∅ <ø> (∅)
@tanstack/react-query 96.02% <ø> (ø)
@tanstack/react-query-devtools 10.00% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query 78.20% <ø> (ø)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query 88.15% <ø> (ø)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client 100.00% <ø> (ø)
@tanstack/vue-query 70.85% <ø> (ø)
@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 github-actions bot added the documentation Improvements or additions to documentation label Jun 1, 2025
@rklomp rklomp marked this pull request as ready for review June 1, 2025 10:24
@rklomp
Copy link
Contributor Author

rklomp commented Jun 1, 2025

I would also suggest to rename the fn and gc functions. Can be done in a different pull request.

persisterFn => fn
persisterGc => garbageCollect

This will prevent repetitive 'persister'.
For example persister.persisterFn would become the more logical persister.fn

@rklomp rklomp changed the title feat(experimental_createQueryPersister): Add persisterRestoreByKey feat(experimental_createQueryPersister): Change persisterRestoreAll to restoreQueries Jun 1, 2025
@DamianOsipiuk
Copy link
Contributor

I would also suggest to rename the fn and gc functions. Can be done in a different pull request.

persisterFn => fn persisterGc => garbageCollect

This will prevent repetitive 'persister'. For example persister.persisterFn would become the more logical persister.fn

I'm fine with persisterGc => garbageCollect and persisterRestoreAll => restoreQueries

But i would prefer a better name than just fn.

@TkDodo
Copy link
Collaborator

TkDodo commented Jun 4, 2025

persisterFn is pretty close to queryFn and mutationFn, and persisterGc aligns well with persisterFn and gcTime that we also have. Not sure I’d prefer the rename here.

@DamianOsipiuk DamianOsipiuk merged commit 9e0e60c into TanStack:main Jun 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants