SIGN IN SIGN UP
TanStack / query UNCLAIMED

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

48981 0 0 TypeScript
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
---
id: useInfiniteQuery
title: useInfiniteQuery
---
```tsx
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
const {
fetchNextPage,
fetchPreviousPage,
hasNextPage,
hasPreviousPage,
isFetchingNextPage,
isFetchingPreviousPage,
feat: add support for `React.use()` (#7988) * let’s do it again * fix test group * maybe * mkay * cool * rm console.logs * mkay * mkay * fix(vue-query): invalidate queries immediately after calling `invalidateQueries` (#7930) * fix(vue-query): invalidate queries immediately after call `invalidateQueries` * chore: recovery code comments * release: v5.53.2 * docs(vue-query): update SSR guide for nuxt2 (#8001) * docs: update SSR guide for nuxt2 * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * thenable * mkay * Update packages/react-query/src/__tests__/useQuery.test.tsx * mkay * mkay * faster and more consistent * mkay * mkay * mkay * mkay * mkay * fix unhandled rejections * more * more * mkay * fix more * fixy * cool * Update packages/react-query/package.json * fix: track data property if `promise` is tracked if users use the `promise` returned from useQuery, they are actually interested in the `data` it unwraps to. Since the promise doesn't change when data resolves, we would likely miss a re-render * Revert "fix: track data property if `promise` is tracked" This reverts commit d1184babd1ba570da09798cad0e8613b7c5b69c8. * add test case that @tkdodo was concerned about * tweak * mkay * add `useInfiniteQuery()` test * consistent testing * better test * rm comment * test resetting errror boundary * better test * cool * cool * more test * mv cleanup * mkay * some more things * add fixme * fix types * wat * fixes * revert * fix * colocating doesn’t workkk * mkay * mkay * might work * more test * cool * i don’t know hwat i’m doing * mocky * lint * space * rm log * setIsServer * mkay * ffs * remove unnecessary stufffff * tweak more * just naming and comments * tweak * fix: use fetchOptimistic util instead of observer.fetchOptimistic * refactor: make sure to only trigger fetching during render if we really have no cache entry yet * fix: move the `isNewCacheEntry` check before observer creation * chore: avoid rect key warnings * fix: add an `updateResult` for all observers to finalize currentThenable * chore: logs during suspense errors * fix: empty catch * feature flag * add comment * simplify * omit from suspense * feat flag * more tests * test: scope experimental_promise to useQuery().promise tests * refactor: rename to experimental_prefetchInRender * test: more tests * test: more cancelation * fix cancellation * make it work * tweak comment * Update packages/react-query/src/useBaseQuery.ts * simplify code a bit * Update packages/query-core/src/queryObserver.ts * refactor: move experimental_prefetchInRender check until after the early bail-out * fix: when cancelled, the promise should stay pending * test: disabled case * chore: no idea what's going on * refactor: delete unnecessary check * revert refactor i did for cancellation when we wanted it to `throw` * add docs * align * tweak * Update docs/reference/QueryClient.md * Update docs/framework/react/reference/queryOptions.md --------- Co-authored-by: Alex Liu <dsa1314@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-01 11:39:37 -04:00
promise,
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
...result
} = useInfiniteQuery({
queryKey,
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
queryFn: ({ pageParam }) => fetchPage(pageParam),
initialPageParam: 1,
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
...options,
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) =>
lastPage.nextCursor,
getPreviousPageParam: (firstPage, allPages, firstPageParam, allPageParams) =>
firstPage.prevCursor,
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
})
```
**Options**
The options for `useInfiniteQuery` are identical to the [`useQuery` hook](../../reference/useQuery.md) with the addition of the following:
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- `queryFn: (context: QueryFunctionContext) => Promise<TData>`
- **Required, but only if no default query function has been defined** [`defaultQueryFn`](../../guides/default-query-function.md)
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- The function that the query will use to request data.
- Receives a [QueryFunctionContext](../../guides/query-functions.md#queryfunctioncontext)
2021-04-30 11:32:46 +02:00
- Must return a promise that will either resolve data or throw an error.
- `initialPageParam: TPageParam`
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
- **Required**
- The default page param to use when fetching the first page.
- `getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | undefined | null`
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
- **Required**
- When new data is received for this query, this function receives both the last page of the infinite list of data and the full array of all pages, as well as pageParam information.
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- It should return a **single variable** that will be passed as the last optional parameter to your query function.
- Return `undefined` or `null` to indicate there is no next page available.
- `getPreviousPageParam: (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | undefined | null`
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
- When new data is received for this query, this function receives both the first page of the infinite list of data and the full array of all pages, as well as pageParam information.
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- It should return a **single variable** that will be passed as the last optional parameter to your query function.
- Return `undefined` or `null`to indicate there is no previous page available.
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
- `maxPages: number | undefined`
- The maximum number of pages to store in the infinite query data.
- When the maximum number of pages is reached, fetching a new page will result in the removal of either the first or last page from the pages array, depending on the specified direction.
- If `undefined` or equals `0`, the number of pages is unlimited
- Default value is `undefined`
- `getNextPageParam` and `getPreviousPageParam` must be properly defined if `maxPages` value is greater than `0` to allow fetching a page in both directions when needed.
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
**Returns**
The returned properties for `useInfiniteQuery` are identical to the [`useQuery` hook](../../reference/useQuery.md), with the addition of the following properties and a small difference in `isRefetching` and `isRefetchError`:
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- `data.pages: TData[]`
- Array containing all pages.
- `data.pageParams: unknown[]`
- Array containing all page params.
- `isFetchingNextPage: boolean`
- Will be `true` while fetching the next page with `fetchNextPage`.
- `isFetchingPreviousPage: boolean`
- Will be `true` while fetching the previous page with `fetchPreviousPage`.
- `fetchNextPage: (options?: FetchNextPageOptions) => Promise<UseInfiniteQueryResult>`
- This function allows you to fetch the next "page" of results.
- `options.cancelRefetch: boolean` if set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time, whether the previous
invocation has resolved or not. Also, the result from previous invocations will be ignored. If set to `false`, calling `fetchNextPage`
repeatedly won't have any effect until the first invocation has resolved. Default is `true`.
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- `fetchPreviousPage: (options?: FetchPreviousPageOptions) => Promise<UseInfiniteQueryResult>`
- This function allows you to fetch the previous "page" of results.
- `options.cancelRefetch: boolean` same as for `fetchNextPage`.
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- `hasNextPage: boolean`
- Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).
v3 (#1360) * feat: initial v3 changes (#1079) * force website deploy * docs: v3 updates * docs: More documentation improvements * docs: update query filters page * docs: update query keys * docs: more updates * docs: updates * feat: support multiple subscribers in observers * docs: useMutation updates * fix: mutate argument types and state update order * fix: remove cache argument in cache callback * fix: move optimistic fetching state into query observer * fix: make sure default options can be overridden * fix: type improvements * feat: memoize select function result * fix: only suspend when mounting * docs: refactor to top level pages and multiple api reference pages per export * test: add remove query test * feat: add filters client isFetching and useIsFetching hook * docs: temp move docs back to docs directory * docs: solve conflicts * docs: fix queryClient reference * docs: reorg directory structure * docs: fix queryClient reference * docs: fix links * docs: better phrasing * docs: force docs build * docs: update examples * fix: use updatedAt to check for existing data * feat: add structural sharing to select result * refactor: update hashing terminology * test: add ability to wrap react query updates with React act * refactor: replace console with logger implementation * docs: add migration page to navigation * docs: update installation docs * refactor: reduce file size * docs: update examples * fix: always compare query keys as arrays * refactor: mark observers as private * test: update timings in hydration cache time test * docs: Update queries.md (#1134) * feat: split mutate into mutate and mutateAsync (#1130) * feat: split mutate into mutate and mutateAsync * docs: Update docs/src/pages/guides/mutations.md Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com> * feat: add bi-directional infinite query support (#1135) * refactor: reduce file size * feat: revert to previous state on cancellation * fix: wait for all queries to cancel * docs: update cancellation docs * build: force * build: add beta build * build: add beta build * docs: update comparison * fix: support infinite cache time when hydrating * refactor: explicitly mark package side effects * docs: update comparison * docs: update comparison * fix: remove excess exports * feat: add support for default options when hydrating * docs: fix links * feat: add options to setQueryData * fix: align notify terminology * feat: Major semver bump BREAKING CHANGE: Increment Major Version * fix: always try to fetch if enabled * feat: bump version * fix: refetch should create new query when removed * chore: do not publish beta until we figure this out * make beta prerelease * dry run releases * fix: test dry run semantic release * release beta releases for realzies * test: add eslint rule * docs(useQuery): change manual to enabled (#1167) * feat: move mutations into the core (#1162) * feat: tree shake infinite query and support manual updates * docs: update comparison * refactor: remove observer factory * refactor: add subscribable * refactor: move hasListeners * refactor: optimize bundle * fix: add status bools to use mutation result * feat: api update * fix: add defaults to UseMutationOptions type * docs: add pages * fix: cleanup * refactor: use queryCache property directly * docs: Add placeholder data guide * docs: fix typo * fix: keep previous query status when fetching * fix: stop retry when observers unmount * feat: add additional notify flags * fix: only keep notify on stale option * refactor: only batch react callbacks * test: update timings * refactor: also batch in suspense * feat: add hydration support for mutations * fix: remove query immediately if cacheTime is 0 * fix: prevent infinite fetch loop * refactor: move refetch logic into observer * fix: match query key correctly when setting defaults * test: add query defaults test * fix: re-add useMutation callback composition * feat: use set defaults also for observers * test: add enabled assertion * feat: add ability to manually control the online and focus state * docs: update onlineManager documentation * feat: add discriminated unions for query results (#1247) * fix: only set state in listeners when provided * docs: add testing page * feat: add query function context (#1261) * feat: add errorUpdatedAt property * fix: only trigger suspense when loading for the first time * fix: make sure suspense is always triggered when loading a query * fix: add ability to type the query key in the query function context * refactor: make isDataEqual type more specific * docs: update react native focus code * fix: make sure to remove the correct query from cache * test: remove only * feat: add granular component re-render control * fix: make sure component re-render when they should * feat: throw error when QueryClientProvider has not been used to set a query client (#1309) Also updated docs * test: add invalidateQueries test * fix: prevent state update after mutation unmounted * fix: add defaults to setQueryData * fix: cancellations for useInfiniteQuery (#1359) * chore: update TypeScript version (#1314) * Merge branch 'master' into beta * fix(hydration): set fetchMeta to null by default to make it serializable (#1371) * fix(hasPageParam): look for (undefined | null | false) values * chore: fix linting * fix: cross-bundle/version query client context * docs: Update Examples * docs: update example deps * docs: keepPreviousData not set in paginated queries docs (#1376) * docs: typo infinite instead of ininite (#1379) * feat: devtools are now native to the core repo/npm-package * feat(persist-localstorage-experimental): temporarily persist cache to disk * tests: fix linting * chore: attempt codesandbox import fix * chore: revert codesandbox fix * fix(persist-localstorage): add ssr-safety * docs: fix typos in migration and queries guide (#1387) Fix typos in guides/migrating-to-react-query-3 and guides/queries. Fixes #1378 * docs(typos): fix typos in mutations guide (#1392) * docs: update migration guide * docs: update comparison * chore: remove vercel.json * docs: update comparison * Update logo.sketch * feat: reset query utils (#1375) * feat: reset query utils * Update queryClient.ts * Reset query docs and tests (#1393) * docs: Add resetQueries * test: Add resetQueries tests * remove unnecessary queryCache.reset methods Co-authored-by: Aaron Jensen <aaronjensen@gmail.com> * types: fix mutation context type * fix: isFetched and isFetchedAfterMount should include failed fetches * docs: Persist localstorage plugin * feat: resetQueries refetches active queries (#1397) Co-authored-by: Niek Bosch <just.niek@gmail.com> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: JP Angelle <jp@angelle.me> Co-authored-by: Jake Ginnivan <jake@ginnivan.net> Co-authored-by: Tom Klaver <tomklav@gmail.com> Co-authored-by: Dmitry Ivanov <liseniss@gmail.com> Co-authored-by: Corentin Leruth <tinencor@gmail.com> Co-authored-by: ConneXNL <contact@ivia-solutions.com> Co-authored-by: Rubén Moya <rmoyarodriguez@gmail.com> Co-authored-by: Pascal Wegner <p.wegner1992@gmail.com> Co-authored-by: Amen SOUISSI <48829921+amen-souissi@users.noreply.github.com> Co-authored-by: Aaron Jensen <aaronjensen@gmail.com>
2020-12-13 19:34:19 -07:00
- `hasPreviousPage: boolean`
- Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).
- `isFetchNextPageError: boolean`
- Will be `true` if the query failed while fetching the next page.
- `isFetchPreviousPageError: boolean`
- Will be `true` if the query failed while fetching the previous page.
- `isRefetching: boolean`
- Will be `true` whenever a background refetch is in-flight, which _does not_ include initial `pending` or fetching of next or previous page
feat: beta release (#5771) * release: v5.0.0-alpha.11 * refactor(core): unify hydration options (#5131) * refactor: unify hydration options * docs: update hydration docs * migration guide * refactor: use shouldDehydrate... syntax * Update docs/react/guides/migrating-to-v5.md Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * Apply suggestions from code review * chore: fix tests * chore: fix tests * Update docs/react/reference/hydration.md --------- Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> * release: v5.0.0-alpha.12 * release: v5.0.0-alpha.13 * chore: remove unused devDependencies (#5211) * refactor(react-query-devtools): move devtools components in files (#5150) * refactor(react-query-devtools): move QueryStatusCount header to subdirectory * refactor(react-query-devtools): move QueryRow to subdirectory * refactor(react-query-devtools): move ActiveQuery to subdirectory * refactor(react-query-devtools): move Cache Panel to subdirectory * lint * refactor: add display names * fix: typo * release: v5.0.0-alpha.14 * fix(solid-query): SSR fixes - Inconsistent state (#5093) * fix(solid-query): do not call unsubscribe on the server * fix(solid-query): prefer val from queryResource if it is available there * chore: add hydration debugger to solid ssr example * bump minimum solid-js version * chore: pnpm i * chore: fix rollup babel typings Result of this change upstream that types the “targets” property -> https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63927/files#diff-a4da813bfdc10bbb7d4d9ee9b811309e7e2a16c0484b9a334752db84be4b0f31 Signed-off-by: marbemac <marbemac@gmail.com> * replace void 0 Signed-off-by: marbemac <marbemac@gmail.com> * chore: remove uncessary onMount Signed-off-by: marbemac <marbemac@gmail.com> * chore: skip this onComputed on first render Signed-off-by: marbemac <marbemac@gmail.com> * fix: copy state properties over for ssr hydration Signed-off-by: marbemac <marbemac@gmail.com> --------- Signed-off-by: marbemac <marbemac@gmail.com> * release: v5.0.0-alpha.15 * fix(solid-query): Fix non hydrating queries (#5229) * release: v5.0.0-alpha.16 * release: v5.0.0-alpha.17 * docs(react): fix typo in TypeScript.md (#5239) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> * fix: do not mutate input (#5240) * fix: do not mutate input params passed to function from consumers should be treated as readonly and thus shouldn't be modified * test: remove unexpected `exact` props from find methods --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * release: v5.0.0-alpha.18 * docs: update migrating-to-v5 (#5274) I think the rocket emoji is causing a visual bug too but since I edited this through GitHub's UI, I couldn't confirm. * fix(query-core): correct placeholderData prevData value with select fn (#5227) * fix(query-core): correct placeholderData prevData * fix(query-core): preserves correct prevQueryResult This commit preserves the correct previous result between rerenders. * test(react-query): Test with placeholder & select * fix(query-core): Add lastDefinedQueryData property * fix(query-core): Remove console.log * fix(query-core): Add react-query test * release: v5.0.0-alpha.19 * feat(solid-query): Add `reconcile` option (#5287) * feat(solid-query): Add `reconcile` option * feat(solid-query): Add `reconcile` callback test * release: v5.0.0-alpha.20 * chore: adapt tests to v5 syntax after merge * feat: remove callbacks from QueryObserver (#5282) * feat: remove callbacks from QueryObserver types are passing now * test: remove some more callback related tests * docs: migration guide for removed callbacks * chore: fix broken lock file * chore: remove unused variables those were only needed on main for keepPreviousData, which doesn't exist anymore * release: v5.0.0-alpha.21 * fix(solid-query): Remove unserializable values (#5326) * release: v5.0.0-alpha.22 * feat: rename throwErrors to throwOnError (#5318) * feat: rename throwErrors to throwOnError to be aligned with the options we already have on imperative methods, like `invalidateQueries` * docs: fix outdated code reference * chore: rename type * fix: let the refetchInterval function also return undefined and fall back to false if it does * release: v5.0.0-alpha.23 * docs: remove duplicated `isInitialLoading` (#5327) * fix: make sure codemods are included in react-query (#5340) * chore: fix pr pipeline (#5345) * chore: remove unneeded script * chore: fix syntax error after merging * Empty-Commit * chore: update to node18 to hopefully fix CI issues see: https://github.com/vitest-dev/vitest/issues/1191#issuecomment-1192798501 * chore: don't throw error if build dir already exists * release: v5.0.0-alpha.24 * feat: queryOptions helper function (#5153) * feat: queryOptions helper function so that we can define and share options outside of useQuery, but still get the type inference * docs: queryOptions * docs: remove reference to onError * docs: update migration guide * release: v5.0.0-alpha.25 * chore: remove createStore option (#5352) having the option to customize the internal store sound nice, but the problem is that the store holds Query instances, not data. So, the setter is only called once, not on every data update. This makes it relatively useless - every time we thought we could leverage createStore, it fell short of our requirements because of this. The better way is usually to subscribe to the QueryCache directly * docs: remove callbacks from useQuery * fix(core): make sure refetching multiple queries imperatively works offline (#5249) * fix(core): make sure refetching multiple queries imperatively works offline * test: add another test for different networkMode * fix: always catch promises even if we don't return them because we are offline * release: v5.0.0-alpha.26 * chore: svelte-query tests, validatePackages changes * feat(devtools): Add framework agnostic devtools (#5347) * feat(devtools): Add framework agnostic devtools draft * Fix test * Move query-devtools build before react-query-devtools * Fix dimensions bug & add isInitialOpen props * Fix isOpen state * Add devtools cutom errorTypes option * Add explicit close button * Add keyboard focus for tooltips * Add query-core to query-devtools peerDependencies * Update pnpm lock file * Add overflow hidden to hide filters on top view * Revert overflow hidden - causing other issues * Update documentation * Fix validate-packages script --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(query-devtools): Add query-core to devDependencies (#5360) * fix(query-devtools): Add query-core to devDependencies * Fix pnpm-lock.yaml * release: v5.0.0-alpha.27 * feat(solid-query): `queryOptions` helper for solid-query (#5355) * feat: queryOptions helper for solid-query * add tests * fix imports * release: v5.0.0-alpha.28 * feat(svelte-query-devtools): Svelte Adapter for new Devtools (#5362) * Implement working devtools component * Fix pnpm-lock.yaml * Update workspace config * Always a prettier error * Fix eslint error * Fix test:types * Add svelte-query to deps * Use esm-env to block loading in prod * Remove example changes * Simpler export * Allow dynamically editing props * Run prettier * fix(devtools): Update ESM export extension (#5364) * fix(devtools): Update ESM export extension * Update Svelte devtools types error * Fix svelte-query-devtools types error * release: v5.0.0-alpha.29 * feat(devtools): Make queryclient reactive (#5366) * release: v5.0.0-alpha.30 * Revert changes to svelte-query build * fix(svelte-query-devtools): Fix tsconfig paths * fix(svelte-query-devtools): Fix issue parsing JSX (#5372) * feat(query-core): Add previousQuery to placeholderFn (#5358) * feat(query-core): Add previousQuery to placeholderFn * Add query-core and react-query tests * Remove unused query type --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v5.0.0-alpha.31 * docs: Update dependent-queries.md (#5391) I believe `isLoading` has been renamed to `isPending` * refactor: unwrap listeners * chore: relax eslint for tests * release: v5.0.0-alpha.32 * docs: new docs for placeholderData * feat(useQueries): combine (#5219) * attempt at adding combine on observer level (doesn't work) * feat(useQueries): combine adapt getOptimisticResult to return both the result array and a combined result getter * feat(useQueries): combine make sure combinedResult stays in sync with result * feat(vue-query): combine results for useQueries hook * Add new options to svelte-query * Add new options to solid-query * fix: enable property tracking for useQueries * fix: move property tracking to react layer * chore: remove logging * chore: remove unnecessary type assertion * test: tests for combined data * docs: combine --------- Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: Aryan Deora <adeora@iu.edu> * docs: combine * chore: setup fallback base to origin/main if we trigger a release manually via github, this value might not be filled * release: v5.0.0-alpha.34 * docs: update installation * chore: Improve eslint/tsconfig setup in svelte packages (#5438) * fix(types): fix TError generic on queryOptions * release: v5.0.0-alpha.35 * release: v5.0.0-alpha.36 * chore: Bump eslint version to 8.34.0 (#5439) * feat(svelte-query): Simplify types (#5442) * release: v5.0.0-alpha.37 * chore: Update dev dependencies (#5466) * chore: Replace cp with cpy-cli (#5441) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Update typescript-eslint (#5467) * release: v5.0.0-alpha.38 * chore: More package updates (#5468) * chore: Link examples to workspace packages (#5469) * feat(svelte-query): Switch to moduleResolution bundler (#5471) * fix: Downgrade chalk to v4 (#5472) * release: v5.0.0-alpha.39 * docs: change Hydrate->HydrationBoundary (#5455) * updated docs on SSR Hydrate -> HydrationBoundary * docs(ssr): change Hydrate->HydrationBoundary change Hydrate->HydrationBoundary to remove deprecated component * docs(ssr): rename all Hydrate->HydrationBoundary rename all Hydrate instances ->HydrationBoundary for consistency * feat(react-query-persist-client): await onuccess (#5473) * fix: have `onSuccess` return a promise too so that we can await it that way, invalidation or mutations that run in onSuccess will still keep isRestoring to be false, which avoids race conditions * test: test for awaiting onSuccess * docs: onSuccess * release: v5.0.0-alpha.40 * release: v5.0.0-alpha.41 * chore: Regenerate alpha lockfile (#5477) * docs(solid-query): Fix API signature in overview.md (#5470) * docs(svelte-query): Add svelte-query-devtools to examples (#5478) * chore: Clean-up eslint config (#5481) * chore: More eslint improvements (#5482) * feat: Convert rollup config to ESM (#5484) * chore: Migrate scripts to ESM (#5486) * feat: Split rollup config for Nx caching (#5487) * fix: Fix CJS/ESM issue with @commitlint/parse I can't believe these issues still exist, see https://github.com/evanw/esbuild/issues/1719 * chore: Update prettier, eslint, rollup, scripts (#5490) * chore: Fix prettierignore * release: v5.0.0-alpha.42 * fix: Update @commitlint/parse (#5491) See https://github.com/conventional-changelog/commitlint/pull/3614 * release: v5.0.0-alpha.43 * chore: Add eslint-plugin-compat (#5495) * Fix workspace links * Add eslint-plugin-compat * Update nx.json * fix: Improve workspace tsconfig (#5497) * release: v5.0.0-alpha.44 * fix: Move deps/devDeps/peerDeps to appropriate location (#5498) * chore: Extend base tsconfig for svelte packages (#5501) * release: v5.0.0-alpha.45 * chore: Make test:types have no Nx output (#5500) * feat: Remove svelte field from package.json (#5504) * release: v5.0.0-alpha.46 * feat: Add explicit package.json `type` field (#5505) * release: v5.0.0-alpha.47 * chore: Fix nx affected (#5509) * fix: Fix ESLint warnings (#5510) * release: v5.0.0-alpha.48 * chore: Update to Nx 16.3.1 (#5514) * chore: Update to nx 16.3.1 * Update pnpm-lock.yaml * chore: Update Nx cloud workflow (#5515) * feat: Drop legacy webpack v4 support (#5507) * release: v5.0.0-alpha.49 * feat: Remove UMD build output (#5517) * release: v5.0.0-alpha.50 * chore: Rework rollup externals (#5519) * feat: Refactor package exports (#5520) * chore: Remove publint error temporarily * release: v5.0.0-alpha.51 * fix: Publint error in solid-query (#5522) * release: v5.0.0-alpha.52 * fix: Simplify exports in solidjs packages (#5523) * release: v5.0.0-alpha.53 * chore: Improve Nx task separation (#5524) * Fix ci workflow nx run-many doesn't use --base * feat(query-devtools): Lazyload Query Devtools Core (#5527) * release: v5.0.0-alpha.54 * fix(query-devtools): Broken package.json exports (#5528) * Make publint throw errors * Rewrite CJS files to use .cjs extension * Add concurrency option to PR workflow * Fix export extensions * release: v5.0.0-alpha.55 * chore: Re-enable Nx Distributed Task Execution (#5518) * fix(query-devtools): inform onlineManager when offline mode is simulated (#5534) * release: v5.0.0-alpha.56 * docs: make returning a promise for optimistic updates more explicit (#5485) * fix(codemod): do not mark the `buildMessage` method as private (#5546) * fix(codemod): do not mark the `buildMessage` method as private It might fail because of the lack of support. * chore(codemod): add missing `filePath` parameter to the docblock * release: v5.0.0-alpha.57 * fix(query-devtools): Fix getSidedProp bug (#5551) * release: v5.0.0-alpha.58 * chore: Update publish script (#5559) * fix(query-devtools): Add chunkFileNames option (#5560) * release: v5.0.0-alpha.59 * fix: Change `svelte-package` output directory (#5561) * release: v5.0.0-alpha.60 * release: v5.0.0-alpha.61 * chore: try to stabilize test * fix(solid-query): Use rollup-preset-solid (#5565) * release: v5.0.0-alpha.62 * feat: Add legacy rollup builds (#5570) * release: v5.0.0-alpha.63 * docs: Add `"private": true` to examples (#5578) * release: v5.0.0-alpha.64 * fix(useIsMutating): fix vue warning (#5453) onScopeDispose() is called when there is no active effect scope to be associated with * release: v5.0.0-alpha.65 * feat(infiniteQuery): allow prefetching arbitrary amounts of pages (#5440) * refactor: combine fetching first page with refetching as it's the same condition * feat(infiniteQuery): allow prefetching arbitrary amounts of pages * test prefetching * fix: make sure that pages and getNextPageParam are passed in tandem to (pre)fetchInfiniteQuery * docs: prefetching * chore: try to stabilize test * docs: migration guide * release: v5.0.0-alpha.66 * refactor: move queryOptions to its own file (#5480) * refactor: remove 'use client' from non-components * refactor: move queryOptions to its own file where we don't have a 'use client' directive, because we can call this function on the server as well * Revert "refactor: remove 'use client' from non-components" This reverts commit 8ecac6688b01197c4c4010d3e240dfbca1895d50. * refactor: rename isRestoring file * chore: fix import * release: v5.0.0-alpha.67 * fix: Update eslint-plugin-query build config (#5601) * fix: Use pnpm workspace protocol (#5600) * release: v5.0.0-alpha.68 * chore: Use nx watch command (#5605) * fix(solid-query): revert package.json typo (#5615) * release: v5.0.0-alpha.69 * release: v5.0.0-alpha.70 * release: v5.0.0-alpha.71 * chore: Fix Nx parallelisation for vue-query tests (#5635) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix(devtools): padding for action buttons (#5608) global `button` styles would otherwise affect buttons * release: v5.0.0-alpha.72 * feat: Support Svelte v4 (#5659) * feat: Support svelte v4 * Downgrade @testing-library/svelte * Upgrade @testing-library/svelte to 4.0.3 * Refactor onMount dynamic import * release: v5.0.0-alpha.73 * fix(eslint-plugin-query): Use tsup to generate types (#5666) * release: v5.0.0-alpha.74 * fix: Skip queryClient context lookup if client passed directly (#5669) * release: v5.0.0-alpha.75 * feat: Accept all svelte stores as options (#5672) * refactor: Accept stores other than writable * Cleanup Readable type import * Add tests * Stricter isSvelteStore check * Update docs * Fix input bind * Add testing-library cleanup * release: v5.0.0-alpha.76 * fix(svelte-query): Fix staleTime reactivity bug (#5682) * release: v5.0.0-alpha.77 * chore(svelte-query): Update reactivity docs and tests (#5683) * fix(query-devtools): Bundle all dependencies (#5684) * release: v5.0.0-alpha.78 * release: v5.0.0-alpha.79 * feat: react-query-next-experimental package (#5598) * chore: fix a copy-paste error * chore: bootstrap package * chore: setup package * chore: allow passing with no tests * fix: remove 'use client' from index bundle * chore: cleanup copy/paste error * chore: fix prettier * refactor: replace ref with direct props access * fix: do not write to refs during render * refactor: inline function into useEffect to avoid useCallback * fix: eslint no-shadow * refactor: namespace id * refactor: removed pointless check * fix: set to empty array on cleanup * fix: adapt for v5 changes * chore: fix build * docs: add streaming example * chore: fix outdated lockfile * chore: fix prettier * refactor: remove isSubscribed ref * refactor: re-arrange comment * chore: remove comments * chore: fix broken lock file * feat: allow customization of hydrate / dehydrate options and make sure we fall back to the defaultShouldDehydrate function, which only dehydrates successful queries * release: v5.0.0-alpha.80 * docs: fix nextjs-streaming example * fix(core) : sync Observer 'current' properties when optimistic reading occurs (#5611) * fix-5538 : sync Observer 'current' properties when optimistic reading occurs * Flip test on currentResult with placeholderData's order & add test * Fix tests using the same queryKey * remove options.placeHolderData from deciding whether to assign observer current properties, use equalitycheck on v5 * maybe fix for vue reactivity cbs * test(vue-query): test persister with useQuery * Force line terminator to \\n on codemods tests * Revert " Force line terminator to \\n on codemods tests" This reverts commit 6f0a469f51e162052ea3245b4ef3da7c6febc9c3. --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> * chore: Force line terminator to \\n on codemods tests (#5664) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: stabilize a flaky test * release: v5.0.0-alpha.81 * docs: remove devtools from example because they currently don't work * fix(query-devtools): Force publish package (#5715) * release: v5.0.0-alpha.82 * docs: re-enable devtools * fix: Update dev dependencies (#5718) * release: v5.0.0-alpha.83 * chore: Add vite to root package.json (#5722) * refactor: Add new eslint sorting from main (#5723) * release: v5.0.0-alpha.84 * chore: Update vite and vitest (#5724) * chore: Remove eslint-plugin-compat (#5732) * feat: include meta in query and mutation hydration (#5733) * feat: include `meta` in query and mutation hydration * test: tests for meta hydration * chore: stabilize a flaky test * chore: stabilize another flaky test * release: v5.0.0-alpha.85 * fix(onlineManager): always initialize with `online: true` (#5714) * fix(onlineManager): always initialize with `online: true` instead of relying on navigator.onLine, because that indicator is broken AF in chrome https://bugs.chromium.org/p/chromium/issues/list?q=navigator.online * docs: document subscribe methods * docs * test: fix types in tests setting to undefined is now illegal, so we have to reset to `true`, which is the default now * fix(tests): switch from mocking navigator.onLine to mocking onlineManager.isOnline * fix: offline toggle in devtools it should now be enough to set online to true / false, without firing the event, because we always set & respect that value. we don't override the event handler, so real online / offline events might interfere here * chore: fix tests with the implementation of onlineManager, where we default to `true`, we need an explicit `'offline'` event to get it to false; otherwise, switching back to true doesn't change the state, so subscribers are not informed * chore: prettier write * chore: fix eslint * chore: delete an old, flaky test that doesn't test much * release: v5.0.0-alpha.86 * docs: use bundlejs for bundle-size * docs: fix link * feat: Replace rollup with tsup/esbuild (#5597) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Aryan Deora <adeora@iu.edu> * release: v5.0.0-alpha.87 * chore: Simplify tsconfig (#5745) * fix: Simplify devDependencies (#5747) * fix: Fix tsconfig "include" setting (#5750) * release: v5.0.0-alpha.88 * docs: fix potential typo (#5748) * fix potential typo * Update docs/react/guides/queries.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * fix: Add missing extensions to ESM imports (#5751) * chore: Bundler integration tests (#5756) * Add react-cra5 test * Add react-cra4 test * Add react-vite test * Add svelte-vite test * Add solid-vite test * Run prettier * Rename script to test:bundle * Add vue-vite test * Run prettier * fix(query-devtools): Fix Devtools Build Issues (#5768) * release: v5.0.0-alpha.89 * feat(codemod): add codemod that renames the `Hydrate` component usages to `HydrationBoundary` usages (#5761) * feat(codemod): add codemod that renames the `cacheTime` and `useErrorBoundary` object properties and TypeScript property signatures (#5765) * feat(react-query): useSuspenseQuery (#5739) * feat: useSuspenseQuery * feat: infiniteQueryOptions * fix: add exports * feat: useSuspenseInfiniteQuery * feat: initialData overloads for useInfiniteQuery * fix: types * chore: stabilize test we sometimes get failureCount: 2, but it doesn't matter here (timing issue) * fix: types for useSuspenseQuery (#5755) * docs: suspense * docs: api reference * docs: useSuspenseQuery in examples * fix: types for useSuspenseInfiniteQuery (#5766) --------- Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com> * release: v5.0.0-alpha.90 * chore: fix prettier * chore: fix tests * release: v5.0.0-alpha.91 --------- Signed-off-by: marbemac <marbemac@gmail.com> Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com> Co-authored-by: Gabriel Pichot <gabriel.pichot@gmail.com> Co-authored-by: Marc MacLeod <marbemac@gmail.com> Co-authored-by: Aryan Deora <adeora@iu.edu> Co-authored-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Arthur Denner <arthurdenner7@gmail.com> Co-authored-by: Ilya <marchukilya@gmail.com> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Co-authored-by: OrJDev <91349014+OrJDev@users.noreply.github.com> Co-authored-by: Enguerrand des Vaux <enguerrand@des-vaux.fr> Co-authored-by: Dennis kinuthia <denniskinuthiaw@gmail.com> Co-authored-by: Yuji Sugiura <leader22@users.noreply.github.com> Co-authored-by: Yaroslav Lapin <jlarky@gmail.com> Co-authored-by: Balázs Máté Petró <petrobalazsmate@gmail.com> Co-authored-by: Aleksandr Semenov <juvirez@gmail.com> Co-authored-by: Matthew Salsamendi <matthewsalsamendi@gmail.com> Co-authored-by: Speros Kokenes <skokenes@users.noreply.github.com> Co-authored-by: EL AYADI Mohamed <moh.el.ayadi@gmail.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
2023-07-24 11:59:07 +02:00
- Is the same as `isFetching && !isPending && !isFetchingNextPage && !isFetchingPreviousPage`
- `isRefetchError: boolean`
- Will be `true` if the query failed while refetching a page.
feat: add support for `React.use()` (#7988) * let’s do it again * fix test group * maybe * mkay * cool * rm console.logs * mkay * mkay * fix(vue-query): invalidate queries immediately after calling `invalidateQueries` (#7930) * fix(vue-query): invalidate queries immediately after call `invalidateQueries` * chore: recovery code comments * release: v5.53.2 * docs(vue-query): update SSR guide for nuxt2 (#8001) * docs: update SSR guide for nuxt2 * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * thenable * mkay * Update packages/react-query/src/__tests__/useQuery.test.tsx * mkay * mkay * faster and more consistent * mkay * mkay * mkay * mkay * mkay * fix unhandled rejections * more * more * mkay * fix more * fixy * cool * Update packages/react-query/package.json * fix: track data property if `promise` is tracked if users use the `promise` returned from useQuery, they are actually interested in the `data` it unwraps to. Since the promise doesn't change when data resolves, we would likely miss a re-render * Revert "fix: track data property if `promise` is tracked" This reverts commit d1184babd1ba570da09798cad0e8613b7c5b69c8. * add test case that @tkdodo was concerned about * tweak * mkay * add `useInfiniteQuery()` test * consistent testing * better test * rm comment * test resetting errror boundary * better test * cool * cool * more test * mv cleanup * mkay * some more things * add fixme * fix types * wat * fixes * revert * fix * colocating doesn’t workkk * mkay * mkay * might work * more test * cool * i don’t know hwat i’m doing * mocky * lint * space * rm log * setIsServer * mkay * ffs * remove unnecessary stufffff * tweak more * just naming and comments * tweak * fix: use fetchOptimistic util instead of observer.fetchOptimistic * refactor: make sure to only trigger fetching during render if we really have no cache entry yet * fix: move the `isNewCacheEntry` check before observer creation * chore: avoid rect key warnings * fix: add an `updateResult` for all observers to finalize currentThenable * chore: logs during suspense errors * fix: empty catch * feature flag * add comment * simplify * omit from suspense * feat flag * more tests * test: scope experimental_promise to useQuery().promise tests * refactor: rename to experimental_prefetchInRender * test: more tests * test: more cancelation * fix cancellation * make it work * tweak comment * Update packages/react-query/src/useBaseQuery.ts * simplify code a bit * Update packages/query-core/src/queryObserver.ts * refactor: move experimental_prefetchInRender check until after the early bail-out * fix: when cancelled, the promise should stay pending * test: disabled case * chore: no idea what's going on * refactor: delete unnecessary check * revert refactor i did for cancellation when we wanted it to `throw` * add docs * align * tweak * Update docs/reference/QueryClient.md * Update docs/framework/react/reference/queryOptions.md --------- Co-authored-by: Alex Liu <dsa1314@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-10-01 11:39:37 -04:00
- `promise: Promise<TData>`
- A stable promise that resolves to the query result.
- This can be used with `React.use()` to fetch data
- Requires the `experimental_prefetchInRender` feature flag to be enabled on the `QueryClient`.
Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default refetch behaviour, resulting in outdated data. Make sure to call these functions only in response to user actions, or add conditions like `hasNextPage && !isFetching`.