* 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>
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
* 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
* docs: useQuery to object syntax
* docs: invalidateQueries to object syntax
* docs: useMutation to object syntax
* docs: infinite query and other references to object syntax
* 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
* 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
* 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
* feat(query-core): await global mutation cache callbacks
global mutation cache callbacks are always invoked, just like the callbacks on useMutation; however, they were not awaited, so you couldn't really do invalidations in them
* feat(query-core): await global mutation cache callbacks
add tests
* docs: document global mutation callback changes
* chore: get rit of rescript
* chore: solid-query doesn't need jscodeshift
* chore: move react dependencies to react packages
* chore: move react dependencies to react packages
* chore: add descriptions
* chore: remove special lint tsconfigs
we want to use the same tsconfigs for linting as for everything else
* chore: make all tests run in parallel with pnpm
* chore: chunk ci pipeline
* chore: move react specific test setup into react packages
* chore: remove jest configs from tsconfig.json
because they live outside of the root dir (src)
* chore: fix weird type errors in solid tests
* chore: fix running the lint task
* chore: run the typecheck task in parallel
* chore: add a clean task
* Revert "chore: run the typecheck task in parallel"
This reverts commit 53573f5b13.
* chore: no idea why this is errors
* chore: fix codecov upload
* chore: add runInBand
* Revert "chore: add runInBand"
This reverts commit 568e12c41b.
* chore: make jest tests temporarily exit with 0
so that we can test code-coverage
* chore: only run test jests
* Revert "chore: make jest tests temporarily exit with 0"
This reverts commit ad099006f8.
* chore: fix solid-query tests with a custom transform
* chore: use checkout v3
* chore: fix node-version for Test React 17 pipeline
* chore: fix watch mode
we cannot run jest:dev anymore because streaming watch mode to multiple packages is not a thing; you'd need to go into a separate package and watch those tests there
* chore: repair `watch` command in the main package.json
* docs: describe a way to run examples using local builds of packages without linking with yalc