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

fix(react-query-persist-client): remove unnecessary props spreading #8778

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

Conversation

manudeli
Copy link
Contributor

@manudeli manudeli commented Mar 8, 2025

image

Copy link

nx-cloud bot commented Mar 8, 2025

View your CI Pipeline Execution ↗ for commit bff41bd.

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

☁️ Nx Cloud last updated this comment at 2025-03-17 22:39:29 UTC

Copy link

pkg-pr-new bot commented Mar 8, 2025

Open in Stackblitz

More templates

@tanstack/angular-query-devtools-experimental

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

@tanstack/angular-query-experimental

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

@tanstack/query-async-storage-persister

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

@tanstack/eslint-plugin-query

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: bff41bd

Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ff788ac) to head (bff41bd).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             main     #8778       +/-   ##
============================================
+ Coverage   46.50%   100.00%   +53.49%     
============================================
  Files         199         1      -198     
  Lines        7560        17     -7543     
  Branches     1740         2     -1738     
============================================
- Hits         3516        17     -3499     
+ Misses       3668         0     -3668     
+ Partials      376         0      -376     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental ∅ <ø> (∅)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister ∅ <ø> (∅)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core ∅ <ø> (∅)
@tanstack/query-devtools ∅ <ø> (∅)
@tanstack/query-persist-client-core ∅ <ø> (∅)
@tanstack/query-sync-storage-persister ∅ <ø> (∅)
@tanstack/react-query ∅ <ø> (∅)
@tanstack/react-query-devtools ∅ <ø> (∅)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query ∅ <ø> (∅)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client ∅ <ø> (∅)
@tanstack/svelte-query ∅ <ø> (∅)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client ∅ <ø> (∅)
@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.

@@ -48,7 +47,7 @@ export const PersistQueryClientProvider = ({
}, [client, isRestoring])

return (
<QueryClientProvider client={client} {...props}>
<QueryClientProvider client={client}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The better fix would be to not destruct client, use props.client everywhere, then do <QueryClientProvider {...props}> here.

The idea is that if we add a new prop to QueryClientProvider, it will also work here. That’s why the PersistQueryClientProviderProps build on top of QueryClientProviderProps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I agree, I reflected your review in bef7878

@manudeli manudeli requested a review from TkDodo March 12, 2025 03:46
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.

2 participants