0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-18 19:33:22 +00:00
Commit graph

5,683 commits

Author SHA1 Message Date
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
Dominik Dorfmeister
c376158afa
feat: add deprecation warnings
* feat: deprecate isDataEqual

* feat: deprecate contextSharing

* feat: deprecate custom loggers

* test: fix ssr-hydration tests

we need to compare against actual console.log here (and not our own logger), because react hydration mismatches are also logged to the console if they exist. This has surfaced another issue because of how we import react for react17/18 differential testing.

* fix: remove useEffect

that would wind up empty in production, and since this is just during development mode, we can just log during render

* test: adapt tests

we can remove most of these in v5

* chore: fix console.mock declaration

* feat: deprecate placeholder data function

* chore: scope test execution to src directories

if we do `pnpm test` locally, it first does typechecking, which produces output in `build` (including test files). Those will then be tested as well and the svelte tests fail with that.

* test: fix vue query test

* un-deprecate placeholderData function

we might still need it after all - to be discussed

* un-deprecate placeholderData function

* fix auto import
2022-11-01 11:55:49 +01:00
Dominik Dorfmeister
e152ea5c21
docs: prefer object syntax in docs (#4409)
* docs: useQuery to object syntax

* docs: invalidateQueries to object syntax

* docs: useMutation to object syntax

* docs: infinite query and other references to object syntax
2022-11-01 11:54:49 +01:00
Tanner Linsley
6178b56382 release: v4.13.7 2022-11-01 08:02:29 +00:00
Dominik Dorfmeister
1ce5616939 chore: fix test output in publish script v4.13.7 2022-11-01 08:58:53 +01:00
mc-petry
1a1012bf90
fix(react-query-devtools): Fix JSON formatting in detail view. (#4418)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-01 08:52:21 +01:00
Tanner Linsley
188453f2b1 release: v4.13.6 2022-11-01 07:15:24 +00:00
Prateek Surana
b65725cce7
perf(devtools): Memoize QueryRow (#4416) v4.13.6
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-11-01 08:11:51 +01:00
Dimitri Mitropoulos
66ab6b5193
docs(guides): minor fixes and typos (#4419)
* fix: consistent punctuation in list

two of these have periods and two don't... so I looked around at what is done elsewhere and took my best guess

* adds linkback to docs for refetchOnWindowFocus

at this point in the readthrough, this is the very first time I'm seeing anything about "options" and having a link to one is nice, just to quickly see what they look like and hop right back to this page.  I'd love to add some docs to the 4 that are mentioned in the next paragraph but they don't seem to have a way to link to them since they're contained in an unordered list on the useQuery page

* moves asides to be in context with attached bullets

I don't see how to run the docs site locally to test this, but at least on GitHub's markdown parser this would really help align the quote block with the associated bullet (as it is today is sorta hard to follow because some are global and some are attached to bullets, yet they're all at the same level).

feel free to drop this commit if it doesn't work for the actual markdown parser.

* adds missing inline codeblock for signal obj

* matches QueryFunctionContext types to source code

see 759aa0a89c/packages/query-core/src/types.ts (L24)

following the standard of https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes these types are subtly incorrect.

* fix multiple h1s on page (and this one pushing above)

check out https://tanstack.com/query/v4/docs/guides/background-fetching-indicators#displaying-global-background-fetching-loading-state

and see that the section that's an h1 at the bottom is pushed pretty hard up against the codeblock before it.  I think this is some kind of tailwind problem, but it's a win-win because a page having multiple h1 elements is an accessibility nit anyways
2022-11-01 07:59:23 +01:00
Roman Vasyliev
759aa0a89c
docs(guides/queries): fix typo (#4414) 2022-10-31 11:39:29 +01:00
Tanner Linsley
fae2718498 release: v4.13.5 2022-10-30 22:43:15 +00:00
Damian Osipiuk
fe67cb72bc
fix: unwrap queryKey in queryFn for overloads (#4410) v4.13.5 2022-10-30 23:38:20 +01:00
Michal Tecza
1fe93566c4
test: stabilize flaky tests (#4397)
* test: stabilize a flaky test for notifyOnChangeProps

* test: stabilize a flaky test for cacheTime 0 and rerendering

* test: add sleep to make sure no additional renders are happening after data is successfully fetched for the second time

* test: stabilize test for switching to a disabled query

* test: small improvements to a test for disabled query

* test: stabilize test for "previous data on disabled query when keepPreviousData is set"

* test: run prettier
2022-10-29 21:34:38 +02:00