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
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
Charly POLY
7f7e759f05
doc(graphql): update "Type-Safety and Code Generation" section (#4371)
* doc(graphql): update "Type-Safety and Code Generation" section

* Update docs/graphql.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-10-29 15:10:35 +02:00
Tanner Linsley
9fc79d6b6c release: v4.13.4 2022-10-29 08:07:50 +00:00
Dominik Dorfmeister
9495006ed7
fix(queryObserver): always structurally share placeholderData (#4402) v4.13.4 2022-10-29 10:04:03 +02:00
Michal Tecza
fc98d3109f
test: stabilize a flaky test for isFetchedAfterMount (#4381) 2022-10-28 11:54:17 +02:00
Michal Tecza
f6023ff0fb
test: stabilize some flaky tests (#4395)
* test: stabilize a flaky test for CancelledError

* test: stabilize a flaky test for batching re-renders
2022-10-28 11:53:40 +02:00
Tanner Linsley
541cbbff95 release: v4.13.3 2022-10-25 21:36:27 +00:00
Damian Osipiuk
c3f9b1e3ab
fix(vue-query): proper function types in MaybeRefDeep (#4382) v4.13.3 2022-10-25 23:31:40 +02:00
Tanner Linsley
99119a5814 release: v4.13.2 2022-10-23 19:09:32 +00:00
Matthew Hausman
a7972eb733
fix(vue-query): properly unref useMutation parameters (#4363) v4.13.2
* update

* Update useMutation.test.ts

* Update useMutation.ts

* Update useMutation.test.ts

* Update utils.ts

* Update useMutation.test.ts

* Update useMutation.test.ts

* Update useMutation.test.ts

* Update useMutation.test.ts
2022-10-23 11:44:11 +02:00
allcontributors[bot]
f9840ddda2
add matthewhausman as a contributor for code (#4362)
* update README.md [skip ci]

* update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-10-23 07:57:52 +02:00
Tanner Linsley
22f7253aba release: v4.13.1 2022-10-22 23:20:26 +00:00
Matthew Hausman
915d5e95c2
fix(vue-query): improve useMutation reactivity, allow params to be refs (#4339) v4.13.1
* update

* Update utils.ts

* Update types.ts

* potentail fix to parseArgs typing

* change name of maybeRefArgs

* Update useMutation.ts

* update

* revert some stuff

* Update types.ts

* Update types.ts

* update

* Update types.ts

* Update types.ts

* Update useMutation.ts

* update

* update

* Update useMutation.ts

* Update useMutation.ts

* PR feedback

* Update useMutation.ts

* Update types.ts

* Update useMutation.ts

* Update types.ts

* Update types.ts

* Update useMutation.ts

* Update types.ts

* Update useMutation.ts

* update

* update fn names

* change subscribe to const

* Update types.ts

* Update useMutation.ts

* wrong arg passed in useMutation, unnecessary changes in testing files potentially

* update

* update

* Update useMutation.test.ts

* Update useMutation.test.ts

* update

* Update useMutation.test.ts

* Update useMutation.test.ts
2022-10-23 01:16:07 +02:00
Tanner Linsley
30ac34f1f9 release: v4.13.0 2022-10-22 10:02:13 +00:00
Jonas Kugelmann
07c96311a5
feat(query-core): Expose retry error as failureReason (#4315) v4.13.0
* feat(query-core): Expose retry error as `failureReason`

* feat: Add `failureReason` to mutation as well

* fix: mutation `failureCount` not being reset to `0` on success

* chore: Add tests for mutation loading state reset

* fix: linting + tests
2022-10-22 11:58:27 +02:00
Arnas Savickas
d026e41711
docs(testing): fix infinite query example (#4328) 2022-10-22 11:56:14 +02:00
김의진
65e965afd5
docs(QueryClient): fix setQueryData updater type (#4357) 2022-10-22 11:55:35 +02:00
Dominik Dorfmeister
52764b0d46
Update FUNDING.yml 2022-10-17 10:13:55 +02:00
liaoliao666
51913558a2
docs: add ReactQueryKit link (#4325)
forgot to add the link😓
2022-10-15 07:36:06 +02:00
Ty Mick
30f068399d
docs(useQueryClient): add context option (#4326) 2022-10-15 07:35:31 +02:00