* 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>
* 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
* 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
* 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
* 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