0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

5,550 commits

Author SHA1 Message Date
renovate[bot]
08a568dbbc chore(deps): update dependency vite to v5.3.6 [security] 2024-10-04 16:48:29 +00:00
Tanner Linsley
8cec02a106 release: v5.59.1 v5.59.1 2024-10-04 12:03:48 +00:00
Sol Lee
bb8278d4c5
fix(eslint-plugin-query): update deprecated getSourceCode() method (#8117)
* fix(eslint-plugin-query): update deprecated `getSourceCode()` method

* chore: add eslint-disable

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-04 14:01:04 +02:00
Arnoud
05924f4696
docs(angular-query): fix pagination example double devtools (#8125) 2024-10-04 00:04:44 +02:00
Arnoud
a9b3eaf9d0
docs(angular-query): add pagination example (#8124)
* docs(angular-query): add pagination example

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-03 23:50:41 +02:00
Jongchan
69476f0ce5
test(vue-query): add test and improve typing (#8103)
* test(vue-query): add test for clone getters returning values in queryKey

* fix(vue-query): improve typing in vueQueryPlugin.test.ts to resolve errors on tsc

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-01 20:26:37 +02:00
Jérémy Barbet
71c5f8801d
docs: sentence wording (#8106) 2024-10-01 20:09:09 +02:00
Sagar Ghimire
b6633831f0
docs: Update mutations.md (#8105) 2024-10-01 20:08:45 +02:00
Tanner Linsley
0ccd60aaba release: v5.59.0 v5.59.0 2024-10-01 15:45:29 +00:00
Alex / KATT
18953be6f6
feat: add support for React.use() (#7988)
* let’s do it again

* fix test group

* maybe

* mkay

* cool

* rm console.logs

* mkay

* mkay

* fix(vue-query): invalidate queries immediately after calling `invalidateQueries` (#7930)

* fix(vue-query): invalidate queries immediately after call `invalidateQueries`

* chore: recovery code comments

* release: v5.53.2

* docs(vue-query): update SSR guide for nuxt2 (#8001)

* docs: update SSR guide for nuxt2

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* thenable

* mkay

* Update packages/react-query/src/__tests__/useQuery.test.tsx

* mkay

* mkay

* faster and more consistent

* mkay

* mkay

* mkay

* mkay

* mkay

* fix unhandled rejections

* more

* more

* mkay

* fix more

* fixy

* cool

* Update packages/react-query/package.json

* fix: track data property if `promise` is tracked

if users use the `promise` returned from useQuery, they are actually interested in the `data` it unwraps to. Since the promise doesn't change when data resolves, we would likely miss a re-render

* Revert "fix: track data property if `promise` is tracked"

This reverts commit d1184babd1.

* add test case that @tkdodo was concerned about

* tweak

* mkay

* add `useInfiniteQuery()` test

* consistent testing

* better test

* rm comment

* test resetting errror boundary

* better test

* cool

* cool

* more test

* mv cleanup

* mkay

* some more things

* add fixme

* fix types

* wat

* fixes

* revert

* fix

* colocating doesn’t workkk

* mkay

* mkay

* might work

* more test

* cool

* i don’t know hwat i’m doing

* mocky

* lint

* space

* rm log

* setIsServer

* mkay

* ffs

* remove unnecessary stufffff

* tweak more

* just naming and comments

* tweak

* fix: use fetchOptimistic util instead of observer.fetchOptimistic

* refactor: make sure to only trigger fetching during render if we really have no cache entry yet

* fix: move the `isNewCacheEntry` check before observer creation

* chore: avoid rect key warnings

* fix: add an `updateResult` for all observers to finalize currentThenable

* chore: logs during suspense errors

* fix: empty catch

* feature flag

* add comment

* simplify

* omit from suspense

* feat flag

* more tests

* test: scope experimental_promise to useQuery().promise tests

* refactor: rename to experimental_prefetchInRender

* test: more tests

* test: more cancelation

* fix cancellation

* make it work

* tweak comment

* Update packages/react-query/src/useBaseQuery.ts

* simplify code a bit

* Update packages/query-core/src/queryObserver.ts

* refactor: move experimental_prefetchInRender check until after the early bail-out

* fix: when cancelled, the promise should stay pending

* test: disabled case

* chore: no idea what's going on

* refactor: delete unnecessary check

* revert refactor i did for cancellation when we wanted it to `throw`

* add docs

* align

* tweak

* Update docs/reference/QueryClient.md

* Update docs/framework/react/reference/queryOptions.md

---------

Co-authored-by: Alex Liu <dsa1314@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-01 17:39:37 +02:00
Gaurav Kumar
55a6155cdf
docs(react-query): Fix broken route on eslint-plugin-query.md (#8113) 2024-10-01 13:10:08 +02:00
Morteza
9227fd3a6a
docs(react-query): fix a typo in guides/ssr.md (#8086) 2024-09-30 10:58:34 +02:00
lami (laurent lahmy)
c12587a19a
Update useQueries.md (#8097)
fix typo
2024-09-30 10:53:21 +02:00
Arnoud
68ca717124
docs(angular-query): add rxjs example (#8108) 2024-09-29 00:37:01 +02:00
Tanner Linsley
8727d978ed release: v5.58.1 v5.58.1 2024-09-27 07:59:05 +00:00
Lachlan Collins
ade6283944
fix(eslint-plugin): fix legacy recommended config (#8104) 2024-09-27 17:56:50 +10:00
thilllon
a9e83a4678
docs: missing code format (#8102) 2024-09-26 19:04:33 +02:00
Tanner Linsley
78cfcfe4d6 release: v5.58.0 v5.58.0 2024-09-25 01:40:39 +00:00
Aryan Deora
f7a82c4fd2
feat(query-devtools): Add bulk edit option for simple objects and arrays (#8095) 2024-09-24 21:35:47 -04:00
Tanner Linsley
be44da3c9a release: v5.57.2 v5.57.2 2024-09-24 18:13:36 +00:00
Manuel Schiller
f1aab708cf
fix(eslint-plugin-query): correctly handle call-expression spread (#8090) 2024-09-24 20:10:38 +02:00
baeharam
9da00d610a
docs(react-query): fix queryClient description of useMutation and use… (#8077)
* docs(react-query): fix queryClient description of useMutation and useQuery

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-21 15:52:41 +02:00
Peter Bengtsson
1104948728
docs: Don't use $ prefix in Bash examples (#8067)
On https://tanstack.com/query/latest/docs/framework/react/installation for example, the Bash snippets do *not* have a leading `$` character. So you can click the clipboard and then paste these into your terminal. 
Doesn't work if there's a `$ ` prefix on the bash command.
2024-09-21 11:35:33 +02:00
Tanner Linsley
034eb524ae release: v5.57.1 v5.57.1 2024-09-21 09:16:08 +00:00
Manuel Schiller
1793e06446
fix(eslint-plugin-query): relax property order rule to ignore relative order of getPreviousPageParam and getNextPageParam (#8074) 2024-09-21 11:11:54 +02:00
Tanner Linsley
1d851dda80 release: v5.57.0 v5.57.0 2024-09-20 19:50:42 +00:00
Manuel Schiller
f8d65fb5de
feat(eslint-plugin-query): add rule to ensure property order of infinite query functions (#8072)
* feat(eslint-plugin-query): add rule to ensure property order of infinite query functions

* remove outdated comment

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-20 21:45:40 +02:00
Stephen Brown-Bourne
ca9e3c4fa8
docs: add missing </Show> closing tag to Solid docs (#8068)
* add missing </Show> closing tag

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-20 21:26:39 +02:00
Tanner Linsley
763abd1628 release: v5.56.2 v5.56.2 2024-09-12 18:06:08 +00:00
Dominik Dorfmeister
7624785d31
fix(core): make sure infiniteQuery always fetches the first page (#8051)
The pageParam == null bailout is meant for fetching further pages, where users can return null/undefined from getNextPageParam to stop fetching; However, after the latest refactoring, we also did this for the initial fetch. This stops fetching from working at all if the initialPageParam was set to null/undefined, which I didn't think anyone would do, but here we are.
2024-09-12 20:03:59 +02:00
Tanner Linsley
666c8b2e39 release: v5.56.1 v5.56.1 2024-09-12 14:39:05 +00:00
Dominik Dorfmeister
6a17069643
chore: trigger release
RELEASE_ALL
2024-09-12 16:36:07 +02:00
EL AYADI Mohamed
a106d631af
fix(core): retry for infinite queries (issue #8046) (#8049)
* Add reproduction test for infinite loop retries (issue #8046)

* ci: apply automated fixes

* fix: retry for infinite queries

The retryer lives above the fetchFn, and it re-runs the fetchFn whenever a retry happens. Usually, the fetchFn is a thin wrapper around the actual queryFn passed by the user. However, for infinite queries, it fetches all pages in a loop.
The retryer breaks out of this loop if an error occurs on e.g. the second page, and then retries by running the fetchFn - which will re-set the loop

This fix hoists the currentPage counter out of the fetchFn - into the closure created by onFetch. The outer closure is created from running `query.fetch` once, so it won't be re-set between retries.
The fix also re-writes the fetch loop to always take the `currentPage` into account, where it was previously treating the first page differently

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-12 16:18:23 +02:00
Tanner Linsley
d29c37a224 release: v5.56.0 v5.56.0 2024-09-12 09:56:44 +00:00
Dominik Dorfmeister
edec4a64c0
feat(core): ensureInfiniteQueryData (#8048)
* feat(core): ensureInfiniteQueryData

* docs: ensureInfiniteQueryData

* feat(types): make sure we can't pass infiniteQueryOptions to non-infinite query functions like fetchQuery
2024-09-12 11:53:29 +02:00
Ciarán Curley
9608f80056
docs(react-query): recommend against throwing errors in select (#8041)
Explaining why you should not thow errors in the select function

Closes #8039
2024-09-11 15:23:08 +02:00
Tanner Linsley
acb5d37f5c release: v5.55.4 v5.55.4 2024-09-09 06:38:24 +00:00
Jonghyeon Ko
2c1be7bed5
fix(query-core): jsdoc of notifyManager (#8031)
* fix(query-core): jsdoc of notifyManager

* chore: update

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-09 08:32:57 +02:00
Tanner Linsley
4cc4bd2665 release: v5.55.3 v5.55.3 2024-09-09 06:16:58 +00:00
jxom
1bffc78634
fix: replace JSON.stringify with replaceDeepEqual in structural sharing integrity check (#8030)
* feat: throw when `replaceDeepEqual` contains circular references

* ci: apply automated fixes

* chore: up test

* chore: review changes

* ci: apply automated fixes

* chore: add return

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-09 08:12:08 +02:00
Arnoud
d58cf08eb1
chore(angular-query): remove redundant dependencies (#8032)
* chore(angular-query): remove redundant dependencies

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-08 20:45:10 +02:00
Cyril Leclercq
9b78527934
docs(react-query): Update React Suspens Link in README.md (#8020) 2024-09-08 18:12:05 +02:00
Tanner Linsley
643abc07c0 release: v5.55.2 v5.55.2 2024-09-08 16:10:27 +00:00
Jonghyeon Ko
f0c5022162
refactor(query-core): move Override type to core (#7916)
* type(react-query, svelte-query): remove unnecessary Override type

* feat(query-core): add Override

Co-authored-by: Lee HyunJae (whale) <71202076+2-NOW@users.noreply.github.com>

* chore: update

* chore: update

---------

Co-authored-by: Lee HyunJae (whale) <71202076+2-NOW@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-08 18:05:10 +02:00
Tanner Linsley
4df469a257 release: v5.55.1 v5.55.1 2024-09-08 13:19:36 +00:00
Jonghyeon Ko
42715e7079
refactor(react-query): split prefetch.ts (#8028)
* fix(react-query): split prefetch.ts

* chore: update

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-08 15:14:37 +02:00
Torleif Berger
5cb0bd4fc0
fix(query-devtools): Added missing type="button" on DevTools-button (#8016)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-08 15:14:19 +02:00
Boby Tiwari
49bfe686da
docs: Update advanced-ssr.md (#8021)
typescript was yelling
2024-09-08 13:52:43 +02:00
Tanner Linsley
353e4ad729 release: v5.55.0 v5.55.0 2024-09-06 05:58:33 +00:00
Jonghyeon Ko
48702e4586
feat(react-query): add optional queryClient parameter to usePrefetchQuery (#8014)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-09-06 07:53:54 +02:00