* fix(query-core): allow function value of `notifyOnChangeProps` query option to return `undefined`
`undefined` is a valid return value for the function value of `notifyOnChangeProps`. See linked issue for more details.
Fixes#7426.
* docs(react-query): update signature of `useQuery`'s `notifyOnChangeProps` option
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* chore: update Streaming with Server Components docs to reflect correct usage
* chore: update Streaming with Server Components to show moving the getQueryClient function
* chore: fix prettier styling
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* Add possibility to pass a callback to enabled.
* Refactor into using the same pattern as resolving staletime, with the use of a resolveEnabled util function
* Update tests for enabled option as a callback
* update docs
* remove typo
* Update enabled type in docs
* remove duplicated test case
* Fix eslint errors
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: John Pettersson <john.pettersson@carnegie.se>
* feat: usePrefetchQuery
* refactor: switch to actual prefetching
* refactor: remove ensureInfiniteQueryData function
will do in a separate PR
* chore: add tests for usePrefetchQuery and usePrefetchInfiniteQuery (#7586)
* chore: add tests for usePrefetchQuery and usePrefetchInfiniteQuery
* chore: update tests to assert the alternative spy is not called
* chore: add some new tests
* chore: remove it.only whoops
* chore: call mockClear after fetching
* chore: improve waterfall test by asserting fallback calls instead of loading node query
* chore: improve code repetition
* chore: add some generics to helper functions
* usePrefetchQuery type tests and docs (#7592)
* chore: add type tests and docs
* chore: update hooks to use FetchQueryOptions and FetchInfiniteQueryOptions
* chore: update tests
* chore: update docs
* chore: remove .md extension from link
* chore: add unknown default value to TQueryFnData
* Apply suggestions from code review
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* Apply suggestions from code review
Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com>
* chore: fix types in tests
* chore: add new tests (#7614)
* chore: add new tests
* Apply suggestions from code review
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
---------
Co-authored-by: Bruno Lopes <88719327+brunolopesr@users.noreply.github.com>
Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com>
Installation commands for various framework includes prompt symbol.
On execution of same commands IDE throws error
as IDEs by default includes prompt symbol.
This commit resolve this issue
* docs: use isServer on ssr guides
* refactor: use isServer on nextjs examples
* refactor(react-query-next-experimental): use isServer instead of typeof window
* chore(docs): fix prettier
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat: allow to dehydrate and restore promises
* fix: retries with initialPromise, but without queryFn
* fix: retries for infinite queries
this could use some reconciliation
* refactor: streamline the way we get the queryFn between Query and InfiniteQuery
* fix: only dehydrate query.promise for pending queries
* feat: allow setting hydration and dehydration defaultOptions on the QueryClient
* test: global defaultOptions for hydrate / dehydrate
* tests: hydration of promises
* feat: next15 integration test
* docs: app directory prefetching example
* docs: global hydrate and dehydrate options
* feat: use streaming
* docs: prefetching
* test: useQuery with initialPromise
* fix: do not leak server errors to the client
* docs: typo
* fix: ignore next in sherif
because we test against multiple versions of next
* test: await promise before clearing client to avoid error
* feat: always respect the `promise` passed to hydrate, even if we already have a cached entry.
* Update docs/framework/react/guides/advanced-ssr.md
Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com>
* Update docs/framework/react/guides/advanced-ssr.md
Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com>
* chore: remove leftover 'use client'
* oops
* docs: better text
* chore: better error messages
* update note
* chore: fix lock file
---------
Co-authored-by: Fredrik Höglund <fredrik.hoglund@gmail.com>
* bug(codemods): rename CommonJS files to .cjs
Rename CommonJS files in codemods to distinguish them from ES module
files otherwise used in this project.
Resolve an issue occuring since package.json in codemods is removed when
publishing causing module type data to be lost.
Fix issue #7154
* Fix knip errors
* Add file extension to tests
* Update migration doc
---------
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>