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

5,395 commits

Author SHA1 Message Date
Dante
f65e7af10f
test: add useQueries with suspense tests (#4502)
* test: add useQueries with suspense tests

shouldn't unmount before all promises fetched
should suspend all queries in parallel - global configuration

* fix should suspend all queries in parallel - global configuration - remove query suspense option

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-13 10:33:18 +01:00
Tanner Linsley
409a684534 release: v4.16.0 2022-11-13 07:59:54 +00:00
Stefan Djokovic
d99d94e524
feat(devtools): add 'copy' button in devtools (#4468) v4.16.0
* feat(devtools): add copy object data explorer

* fix: address code comments

* fix: add logs to investigate iframe copy issue

* feat: add checkmark on copy

* add: error state

* add: test

* fix: test import

* fix: layouts and use superjson

* fix: test comment

* fix: typing and onclick only on nocopy

* prettier

* fix: test error react17

* fix: format test

* fix: test copy and add await

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-13 08:55:01 +01:00
Tanner Linsley
1883be39db release: v4.15.1 2022-11-13 07:54:27 +00:00
Dominik Dorfmeister
32b3aac537
fix: lock dependency of @tanstack/match-sorter-utils to 8.1.1 (#4501) v4.15.1
because the newer versions have trouble with esm and webpack4

RELEASE_ALL
2022-11-13 08:50:11 +01:00
Tanner Linsley
2bcc2a9280 release: v4.15.0 2022-11-12 07:32:04 +00:00
Dominik Dorfmeister
9d9aea5fb1
feat(react-query): suspense for useQueries (#4498) v4.15.0
* feat: suspense for useQueries

* generics for fetchOptimistic

* tests: useQueries suspense
2022-11-12 07:59:35 +01:00
Tanner Linsley
41e2af25e8 release: v4.14.8 2022-11-11 20:13:06 +00:00
Minami
d5bf345d98
fix(react-query-devtools): unset padding for resetting after closed (#4477) v4.14.8
* fix(devtools): unset padding for resetting after closed

* fix(devtools): restore inline padding styles after closed

* fix(devtools): undo unnecessary style tag

* fix(devtools): add test
2022-11-11 21:09:12 +01:00
SeanBarker182
54f16f69ff
docs: Adds a missing square bracket (#4488) 2022-11-11 13:06:07 +01:00
Tanner Linsley
f079297ff8 release: v4.14.7 2022-11-11 11:57:38 +00:00
Eliya Cohen
82adc95c24
fix(eslint-plugin-query): run exhaustive dep check on referenced query key (#4480) v4.14.7
* run exhaustive dep check on referenced query key

* fix various eslint issues
2022-11-11 12:53:15 +01:00
Abdullah Al Sadi
67ddf17b65
docs: Update disabling-queries.md (#4472)
fix a typo
2022-11-11 09:59:24 +01:00
Damian Osipiuk
58f3cec654
docs(vue-query): vue2, nuxt3 examples (#4384) 2022-11-11 09:58:57 +01:00
Tanner Linsley
3c1959d4a8 release: v4.14.6 2022-11-11 08:48:45 +00:00
Eliya Cohen
933cd410ae
fix(eslint-plugin): false positive for factory functions (#4497) v4.14.6
* fix false positive for factory functions

* add more test

* lint fix

* format

* remove unnecessary conditional

* empty commit (flaky test)

* empty commit (flaky test)
2022-11-11 09:43:30 +01:00
Minami
fa681126f9
docs(guides/prefetching): prefer object syntax (#4492) 2022-11-09 15:59:53 +01:00
Bennett Dams
b421e74ca2
docs(eslint-plugin-query): Prefer dev install (#4489)
This change adds the CLI flags to install the ESLint plugin as a dev dependency instead of a normal dependency.
2022-11-09 11:23:49 +01:00
Daniel Reinoso
74e0ee2ca2
docs: typo in "immutable" (#4486)
Fix typo in updates-from-mutation-responses.md
2022-11-08 15:46:07 +01:00
Dominik Dorfmeister
1f441b1427
docs: immutability 2022-11-08 12:07:27 +01:00
Dominik Dorfmeister
60f460f1af
docs: immutability 2022-11-08 12:06:29 +01:00
allcontributors[bot]
350aba5202
add balazsmatepetro as a contributor for code (#4482)
* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-11-08 11:40:59 +01:00
Dominik Dorfmeister
a0a8ada275 chore: fix allcontributors 2022-11-08 10:51:52 +01:00
박찬혁
6a6e2c1a68
docs: fix suspense link (#4481) 2022-11-08 08:06:02 +01:00
Tanner Linsley
c27dd7a2a6 release: v4.14.5 2022-11-06 15:46:01 +00:00
Michal Tecza
c45c1bfc4c
fix(query-core): make isRefetching false when fetching next/previous page in an infinite query (#4465) v4.14.5
* fix: make isRefetching false when fetching next/previous page in an infinite query

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

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* Apply suggestions from code review

* prettier

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-06 16:40:33 +01:00
Dominik Dorfmeister
4861200630
refactor(core): derive meta from options (#4463)
this simplifies code because we don't need to pass meta around manually; we can keep the same public interface with a getter
2022-11-06 16:26:34 +01:00
Michal Tecza
71144c7ed1
test: stabilize the test for notifying query cache when a query becomes stale (#4466)
* test: stabilize the test for notifying query cache when a query becomes stale

* test: stabilize the test for notifying query cache when a query becomes stale - attempt#2

* test: stabilize the test persisting data when enabled is changed to false

* test: stabilize the test for rendering with selected data

* test: stabilize the test for notifying query cache when a query becomes stale - attempt#3 (thanks TkDodo)

* test: stabilize the test for keeping the previous data when keepPreviousData is set
2022-11-06 16:13:01 +01:00
Tanner Linsley
97d9c131b5 release: v4.14.4 2022-11-05 18:39:07 +00:00
Eliya Cohen
fefb9518e5
fix(eslint-plugin): omit generics/types from dependencies (#4462) v4.14.4
* remove test only

* omit type identifiers from check
2022-11-05 19:29:22 +01:00
Dominik Dorfmeister
fc743a99ca
docs: link angular query (#4461) 2022-11-05 09:36:00 +01:00
Tanner Linsley
ade0757344 release: v4.14.3 2022-11-04 15:26:46 +00:00
Eliya Cohen
fd4938ec65
fix(eslint-plugin-query): get identifiers from unary, chain, and ts-non-null expressions (#4448) v4.14.3
* fix unary expression

* fix chain expression

* fix ts non null expression

* format

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-04 15:35:46 +01:00
Eliya Cohen
17c642d537
fix(eslint-plugin-query): handle first argument reference edge case (#4451) 2022-11-04 15:30:30 +01:00
Eliya Cohen
292cc54546
fix(eslint-plugin-query): change lint urls to the website (#4449) 2022-11-04 15:29:14 +01:00
Dominik Dorfmeister
c1b35596a4 chore: fix malformed json 2022-11-04 09:55:00 +01:00
Taylor Lodge
57ab5f6d29
docs(guides): correct typo (#4452) 2022-11-04 06:49:52 +01:00
Dimitri Mitropoulos
6cfbbedb40
docs(guides) some more minor fixes (#4446)
* makes consistent sentences

* makes query option data possible to read without horizontal scrolling

since the change to use the object syntax, a few of these fall off the codeblock at 100% zoom (whereas they didn't before).

* moves placeholder docs after initial-query docs

upon reading though top-to-bottom, since placeholder data's docs define themselves _in terms of_ initial query data, it may make sense to introduce initial query data first

* simplifies example

if the purpose of having a return is to really highlight that this can be a function and things can be done inside it maybe adding:

```
// do any work expensive work here
```

inside the curly braces before the return would do a better job?  not sure, but this seems reasonable.  just doing `initialData: getExpensiveTodos` doesn't immediately highlight that this is a function being called (rather than an array of objects or something) so makes sense to leave the noop closure.

* moves wrapping comments to be visible without horizontal scrolling
2022-11-03 16:42:23 +01:00
Suleman Tariq
a7e067c290
docs: Update useQuery.md (#4441)
Add missing bracket for object destructuring inside useQuery hook.
2022-11-03 15:54:07 +01:00
Beverly Cheak
af75ac82e9
docs: typo in mutations.md (#4436) 2022-11-03 07:11:58 +01:00
Michal Tecza
2e6dab1c48
test: stabilize another batch of flaky tests (#4428)
* test: stabilize test for selecting a part of the data with select

* test: stabilize test for resolving promises after reconnect

* test: stabilize test for throwing a CancelledError when a paused query is cancelled

* test: stabilize test for selecting a part of the data with select (object syntax)

* test: stabilize test for cancelling query when there are no more subscriptions

* test: apply formatting
2022-11-02 11:04:26 +01:00
Tanner Linsley
76bba6320c release: v4.14.2 2022-11-01 14:06:14 +00:00
Eliya Cohen
535027bd4b
fix(eslint-plugin): downgrade auto-fix to suggest (#4425) v4.14.2 2022-11-01 14:56:18 +01:00
Tanner Linsley
faabbd5362 release: v4.14.1 2022-11-01 11:32:23 +00:00
Dominik Dorfmeister
bb5657910f fix(eslint-plugin-query): build & publish the plugin v4.14.1
RELEASE_ALL
2022-11-01 12:28:38 +01:00
Tanner Linsley
3ce9786dfb release: v4.14.0 2022-11-01 11:07:49 +00:00
allcontributors[bot]
5c9b3c3a02
add Newbie012 as a contributor for code (#4424) v4.14.0
* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-01 12:02:59 +01:00
allcontributors[bot]
104815d2d1
add KubaJastrz as a contributor for code (#4423)
* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-11-01 12:01:25 +01:00
Eliya Cohen
5d5c0f0f80
feat: eslint-plugin-query
* add @tanstack/eslint-plugin-query

* fix .eslintrc rule name

* make rule compatible with babel parser

* fix script typo

* remove dedicated example in favor of the basic example

* align package version with the other packages

* align eslint-plugin-query version

* fix displayName

* remove typescript from package

* omit call expressions from keys without the need of whitelist

* lint queryKey instead of useQuery

* update pnpm-lock.yaml

* fix auto-fix suggestion for complex ast

* better inline query key

* fix typo

* update scripts

* restore .eslintrc

* update typescript-eslint packages

* support member expression keys

* format

* should not fix with duplicate keys

* format

* empty commit (flaky test)

* should ignore keys from callback

* Update packages/eslint-plugin-query/package.json

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* add prefer-query-object-syntax rule

* fix indention

* fix headline

* add rule description

* fix lint errors

* widen import check for all adapters

* add support for solid-query (createQuery)

* docs: add eslint plugin section

* prettier

* move docs

* EsLint -> ESLint

* fix typo

* add missing dep

* update lockfile

* give credit where credit is due

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-01 12:00:42 +01:00
Dominik Dorfmeister
1614c31f84
fix(core): initialData should take precedence over keepPreviousData (#4422)
previousData is data that we want to show from a previous observer if we don't have any good data in the cache already. InitialData is always considered good data, just as if it were data that has been fetched. It might be potentially stale, but that's something that can be controlled via staleTime and initialDataUpdatedAt.

So that means we shouldn't show previousData if we also have initialData
2022-11-01 11:57:53 +01:00