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

5,014 commits

Author SHA1 Message Date
Richard Ejem
c6d5f53b6a
docs: Fix example hook cleanup if window is undefined (#6372)
If window is undefined, we'd skip initialization of the event,
but window.removeEventListener would still be attempted
to be called upon cleanup and fail with error due to undefined
window.
2023-11-14 15:44:39 +01:00
Tanner Linsley
2fb759fda8 release: v5.8.3 v5.8.3 2023-11-13 08:50:40 +00:00
Dominik Dorfmeister
02c95f98eb
chore: trigger release
RELEASE_ALL
2023-11-13 09:42:31 +01:00
Florian De la comble
f29f0e7097
docs(community): adding http-wizard (#6360) 2023-11-12 11:38:37 +01:00
Aryan Deora
73e339624b
fix(query-core): Show correct placeholderData when request in cache (#6357) v5.8.2 5.8.2
* fix(query-core): Show correct placeholderData when reuest in cache

* Fix formatting

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-11 21:57:36 +01:00
Bene
7c87c3d7b7
fix(types): pass TError, TQueryData and TQueryKey to PlaceholderDataFunction (#6349)
* fix: pass TError, TQueryData and TQueryKey to PlaceholderDataFunction

* test: add types test for placeholderData function

* style: format

---------

Co-authored-by: Benedikt Viebahn <benedikt.viebahn@live-eo.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: Benedikt Viebahn <bviebahn@pm.me>
2023-11-11 21:47:07 +01:00
Jonghyeon Ko
8b7cc4313f
chore(query-core): rename sleep param as ms (#6358)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-11 21:42:41 +01:00
Jonghyeon Ko
6df2ae1d11
chore(query-core): resolve prettier error (#6359) 2023-11-11 21:38:42 +01:00
Aldrin
2d42f2bbc4
docs: add in editor-docs for gcTime key (#6339)
* chore: add in editor-docs for gcTime key

* chore: add in editor-docs for gcTime key

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

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-11 16:19:53 +01:00
Lachlan Collins
3f82dc8588
chore: Fix monorepo issues reported by Sherif (#6354) 2023-11-11 12:27:07 +11:00
krisko4
4d2d4856be
docs(examples-react-suspense): add font-awesone dependency to display Spinner correctly (#6345)
Spinner is not visible in the Suspense example due to missing font-awesome dependency.
2023-11-10 10:39:34 +01:00
Dominik Dorfmeister
0eccfbfeca docs: suspense api docs 2023-11-10 10:39:12 +01:00
Tanner Linsley
5b9be1e299 release: v5.8.1 v5.8.1 2023-11-08 08:05:09 +00:00
Dominik Dorfmeister
4774f03046
fix(core): make sure queries that re-subscribe will have the correct result (#6334) 2023-11-08 08:59:24 +01:00
Daniel Roe
4266f0b77c
docs(vue-query): import nuxt composables from #imports (#6329)
* fix: import nuxt composables from #imports

* chore: also import `defineNuxtPlugin`
2023-11-08 00:41:47 +01:00
Mihai Crisan
e3a00034bd
docs(QueryClient.md): fix typo immuatable → immutable (#6330)
I made a [PR for this before] (https://github.com/TanStack/query/pull/6328) but turns out that change was for v4 only. This is for latest
2023-11-07 22:57:00 +01:00
wildOrlik
55d70c74a6
test(asyncThrottle): migrated to useFakeTimers (#6324) 2023-11-07 17:16:33 +01:00
Emmanuel DEMEY
b384c4e26f
docs: add missing useQueryClient to the documentation (#6322) 2023-11-07 10:12:37 +01:00
Tanner Linsley
b5c0d76ea0 release: v5.8.0 v5.8.0 2023-11-07 08:45:42 +00:00
Damian Osipiuk
634b6dac32
feat(vue-query): component based vue devtools - Vue3 only (#6255) 2023-11-07 09:41:53 +01:00
Tanner Linsley
9b19eaa9c9 release: v5.7.4 v5.7.4 2023-11-07 04:30:11 +00:00
Aryan Deora
60bd38ca6c
fix(query-devtools): Add styleNonce prop to devtools components (#6320) 2023-11-06 23:27:00 -05:00
Tanner Linsley
4445d72b47 release: v5.7.3 v5.7.3 2023-11-06 20:59:06 +00:00
Damian Osipiuk
7699dd3f18
fix(vue-query): queryClient overloads compat with queryOptions (#6319) 2023-11-06 21:57:15 +01:00
Marty Powell
e31087cf9f
docs: fix link to community Query Key Factory Package (#6316) 2023-11-06 14:23:37 +01:00
Bennett Dams
43e2656752
docs(paginated-queries): Add import statements (#6315) 2023-11-06 14:22:43 +01:00
Tanner Linsley
603a346d4f release: v5.7.2 v5.7.2 2023-11-05 15:34:51 +00:00
Dominik Dorfmeister
6ee06719ae
fix(types): remove suspense from defaultOptions (#6301)
we don't want to be able to set `suspense: true` globally like this anymore: React has `useSuspenseQuery` and other frameworks don't need it either
2023-11-05 16:19:29 +01:00
callmedukey
ecdd927c84
docs: Update devtools.md (#5950)
installing it as a regular dependency doesn't work during development with next 13 app dir. Import trace errors thrown all around.
2023-11-05 15:55:01 +01:00
Tanner Linsley
f484d7e708 release: v5.7.1 v5.7.1 2023-11-05 11:04:58 +00:00
Maciej Baruch
e4138ecda1
fix(react-query): non continuous suspense with useSuspenseQueries (#6298) (#6303)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-05 12:01:34 +01:00
Lachlan Collins
fe49dd3523
docs: Fix svelte playground example reactivity (#6311)
* docs: Fix svelte playground example reactivity

* Rename next-js-app to react-next

* Update pnpm lock

* Fix prettier
2023-11-05 16:35:32 +11:00
cje
d90dc8f754
docs: changed import path in react prefetching example (#6307) 2023-11-04 17:11:58 +01:00
Tanner Linsley
b98f5469b9 release: v5.7.0 v5.7.0 2023-11-04 15:40:21 +00:00
GLabat
8a86182c7e
feat(react-query): better error in development mode to identify bad useQuery calls (#6288)
* refactor(query-core): export isPlainObject

* refactor(useBaseQuery): dev error in case of bad argument

Mainly for project without TS. This helps tracking bad signature when migrating from v4 to v5.

* refactor(useQueryClient): dev error in case of bad queryClient

Mainly for project without TS. Make sure the queryClient passed as parameter is really a query. With the change of signature introduced by v5, queryOptions from useQuery could end up as queryClient due to how useBaseQuery works.

* revert: "refactor(useQueryClient): dev error in case of bad queryClient"

This reverts commit 9bedf21782.

* refactor(useQuery): manual test to avoid export from query-core.

* refactor(useQuery test): TS ignore invalid call

---------

Co-authored-by: Guillaume Labat <guillaume.labat+git@imagino.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-04 16:35:05 +01:00
Tanner Linsley
196cced55f release: v5.6.1 v5.6.1 2023-11-04 11:35:45 +00:00
softgrip
291f4ec77f
fix(svelte-query): Add try/catch to getIsRestoringContext (#6193)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2023-11-04 22:32:49 +11:00
Tanner Linsley
4a298156af release: v5.6.0 v5.6.0 2023-11-04 08:32:03 +00:00
Li-Lun Lin
d77d9d852a
feat(eslint-plugin): add no-rest-destructuring rule (#6265) (#6302)
* feat(eslint-plugin): add no-rest-destructuring rule (#6265)

* chore: format test case code

* test: add null array element testcase

* test: add non-tanstack-query hooks testcase

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-04 09:29:48 +01:00
George Flinn
47449b73c6
docs: Update eslint-plugin-query.md (#6306)
TK Mentioned that the docs would be easier to change if the recommended config was above the alternative config.
2023-11-04 07:38:33 +01:00
Balázs Máté Petró
b3c7dbae48
fix(codemod): improve the keep previous data codemod (#6283)
* chore(codemod): add named examples to the `keep-previous-data` codemod, because these were missing

* chore(codemod): remove the unnecessary `return` statement

* feat(codemod): cover the `setQueryDefaults` method usages on the `QueryClient` instance with the codemod

For further details see: https://github.com/TanStack/query/pull/6196#discussion_r1377371519

* chore(codemod): rename the `isKeepPreviousDataInUse` to `shouldAddKeepPreviousDataImport`

The new name describes better the purpose of this variable.

* feat(codemod): cover the `QueryClient` class instantiations with the codemod

For further details see: https://github.com/TanStack/query/pull/6196#discussion_r1377371519

* chore(codemod): fix `eslint` issues within the `keep-previous-data` codemod

* chore(codemod): fix the `prettier` issues within the `keep-previous-data` codemod README file

* chore(codemod): turn off the `sort-imports` ESLint rule in case of the codemods

Since the codemods might not respect the import order, it's easier to turn off the `sort-imports` ESLint rule.

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-11-03 17:01:41 +01:00
Balázs Máté Petró
41e093885d
fix(codemod): add the packageName parameter to the locateImports function (#6285)
It's necessary, because before this change the above-mentioned function was looking for imports from the `react-query` package, but the package was renamed in the version 4 release. In case of the older codemods the `react-query` is still a valid package name, but for the current and future codemods we have to locate imports from the `@tanstack/react-query` package.
2023-11-03 16:42:09 +01:00
taisei-13046
7153c5732a
docs: fix isPending boolean about dependent queries (#6294)
Co-authored-by: 安井大晟 <taisei_yasui@yasui-taiseiMacBook-Air.local>
2023-11-03 10:21:25 +01:00
Dnyaneshwar Ware
20bd90585a
docs: add information about error while retry attempts (#6276)
- I noticed this while I was trying to use useQuery and trying to capture the error property.
I think this is something which can be added as extra information for those who will be using it for first time.
2023-11-01 08:26:08 +01:00
Dana Woodman
17661f6e37
Simplify load method, fix syntax highlighting (#5844)
* Simplify load method, fix syntax highlighting

SvelteKit now automatically infers the type of an exported load method, so no need to manually define it.

Also, Github has an ongoing issue with the Svelte syntax highlighting so using `html` is a good fallback.

* Change back to using svelte for code blocks

---------

Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2023-11-01 11:03:16 +10:00
Balázs Máté Petró
d4c9f420b3
feat: placeholderData codemod (#6196)
* feat(codemod): add initial implementation of the `placeholderData` codemod

* chore(codemod): remove the parameter from the `placeholderData` function examples

It was a request by @TkDodo, since in `v4` the `placeholderData` function didn't have a parameter.

For further details see: https://github.com/TanStack/query/pull/6196#discussion_r1366618334

* chore(codemod): add an example where the `placeholderData` property is not a function

It was a request by @TkDodo, see: https://github.com/TanStack/query/pull/6196#discussion_r1366618334

* refactor(codemod): transform the usage only when the `keepPreviousData` has value `true`

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-10-31 11:25:40 +01:00
Sander Goossens
2760f75bec
docs: Update typescript.md for registering types (#6272)
To ensure comprehensive documentation, I have included the import declaration to ensure that everyone is aware that the import is necessary for the module augmentation to function properly.

If you omit the import, you will overwrite the entire react-query declaration.
2023-10-31 10:35:40 +01:00
Agilan
a320b43010
chore: Update GitHub Actions workflows (#6203)
* chore: clean up github action workflows

* chore: remove ci-v3.yml

* fix: add rc branch back to branches list in ci.yml

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2023-10-30 14:44:51 +01:00
Tanner Linsley
7cb82a7268 release: v5.5.0 v5.5.0 2023-10-30 13:37:52 +00:00
Kenta Iwasaki
e3a5974ba2
feat: support nextjs v14 (#6259) 2023-10-30 14:29:10 +01:00