0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

5,036 commits

Author SHA1 Message Date
Anton Jeppsson
2aca521a88
fix(codemods): Use .cjs extension for CommonJS files (#7333)
* 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>
2024-04-25 17:06:14 +10:00
Tanner Linsley
2ffd9fbd84 release: v5.32.0 v5.32.0 2024-04-23 07:33:00 +00:00
Dominik Dorfmeister
e3240f0233
feat(core): make observers on Query a public property (#7326) 2024-04-23 09:29:43 +02:00
Dominik Dorfmeister
f025a7c2e6 chore(docs): fix prettier 2024-04-23 09:09:48 +02:00
Kushagra Mehta
b92fb043af
docs: fix pages breaking due to diff in markdown (#7321) 2024-04-22 13:16:54 +02:00
fuko
8fa82653dd
docs: fix broken internal links in the query docs (#7247)
* wip - 1

* Fix more links

* Fix one more link

* Another one

* Update a link

* Fix the broken links in the Angular docs

* Fix the broken links in the Vue docs

* Fix the Svelte links in the docs

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-22 10:38:13 +02:00
Tanner Linsley
5b6c67f581 release: v5.31.0 v5.31.0 2024-04-22 06:43:01 +00:00
Dominik Dorfmeister
24f1d45cbd
feat: scoped mutations (#7312)
* refactor: add scope to mutationCache internally

* refactor: remove unused defaultOptions on mutation

this private field is a leftover from v4

* feat: make sure to not run mutations if there is already one running in the scope of this mutation

* feat: make sure mutations in the same scope can run in serial

* fix: find a _lot_ better way to determine if a mutation can run

* test: widen test scenario to include scopes

* fix: there is a difference between starting and continuing

when starting, we need to check the networkMode differently than when continuing, because of how offlineFirst works (can start, but can't continue)

* refactor: switch to a scope object with `id`

* feat: dehydrate and hydrate mutation scope

* fix: initiate the mutationCache with a random number

since we use the mutationId to create the default scope, and the mutationId is merely incremented, we risk colliding scopes when hydrating mutations into an existing cache. That's because the mutationId itself is never dehydrated. When a mutation gets hydrated, it gets re-built, thus getting a new id. At this point, its id and the scope can differ. That per se isn't a problem. But if a mutation was dehydrated with scope:1, it would put into the same scope with another mutation from the new cache that might also have the scope:1.

To avoid that, we can initialize the mutationId with Date.now(). It will make sure (or at least very likely) that there is no collision

In the future, we should just be able to use `Crypto.randomUUID()` to generate a unique scope, but our promised compatibility doesn't allow for using this function

* test: hydration

* test: those tests actually fail because resumePausedMutations is still wrongly implemented

* fix: simplify and fix resumePausedMutations

we can fire off all mutations at the same time - only the first one in each scope will actually fire, the others have to stay paused until their time has come. mutation.continue handles this internally.

but, we get back all the retryer promises, so resumePausedMutations will wait until the whole chain is done

* test: more tests

* refactor: scopeFor doesn't use anything of the mutationCache class

* docs: scoped mutations
2024-04-22 08:39:11 +02:00
Tanner Linsley
7368bd0f62 release: v5.30.6 v5.30.6 2024-04-18 18:54:27 +00:00
Aryan Deora
6e5a4a84ad
fix(solid-query): Allow disabled queries to be SSR'd (#7300) 2024-04-18 14:50:25 -04:00
Tanner Linsley
405135d02c release: v5.30.5 v5.30.5 2024-04-18 15:19:12 +00:00
Aryan Deora
23c4661790
fix(solid-query): Trigger refetch when query changes before hydration (#7299) 2024-04-18 11:15:23 -04:00
Aryan Deora
69d37f33bd
docs(solid-query): Add Astro Example (#7292) 2024-04-17 00:38:52 -04:00
Tanner Linsley
e197965940 release: v5.30.4 v5.30.4 2024-04-16 23:45:14 +00:00
Aryan Deora
d9473a80ec
fix(solid-query): Simplify SSR Hydration Strategy (#7291) 2024-04-16 19:41:17 -04:00
Aryan Deora
536965176f
docs(solid-query): Update SolidStart Example to RC version (#7283) 2024-04-15 16:03:29 -04:00
Naveen Yadav
727eb557ed
docs: Update spelling in devtools.md (#7269) 2024-04-15 10:59:05 +02:00
Tanner Linsley
eee8ab157e release: v5.30.3 v5.30.3 2024-04-15 04:25:51 +00:00
Aryan Deora
d384cacced
fix(solid-query): Resolve resource before unmounting query (#7279) 2024-04-15 00:22:11 -04:00
Tanner Linsley
8469951141 release: v5.30.2 v5.30.2 2024-04-14 16:21:48 +00:00
Aryan Deora
6c1af4e858
fix(solid-query): Fix reconciliation strategy for createBaseQuery (#7277) 2024-04-14 12:17:55 -04:00
Tanner Linsley
4ce55099c7 release: v5.30.1 v5.30.1 2024-04-13 16:14:04 +00:00
Aryan Deora
841d9f70c3
fix(solid-query): throwOnError now throws to EB where data is accessed (#7273)
* fix(solid-query): throwOnError now throws to EB where data is accessed
2024-04-13 12:10:10 -04:00
Tanner Linsley
b6567cbeb3 release: v5.30.0 v5.30.0 2024-04-13 06:17:10 +00:00
Aryan Deora
a122e7cca5
feat(solid-query): Rework internals of createBaseQuery (#7272)
* feat(solid-query): Rework internals of createBaseQuery

This change aims to simplify and enhance the internals of `createBaseQuery`.
This change is a precursor to fix a couple of pressing issues in solid-query mentioned in
#7079 
#7083 
#7173 
#7036
#6620 
#6373
PRs for which are coming soon.

A key few highlights coming with this change:
1. Removal of `mutate` and `refetch` branches in `createClientSubscriber`: We had two different ways of resolving a query resource. The `mutate` option that optimistically updated a resource proved to be a problem with error queries. A query that has `placeholder` data and fails for any reason would see a flash of blank content before yielding to the ErrorBoundary. Using `refetch` for all query resolutions gives us a nice and simple way to transition to error boundaries
2. Removal of batched calls with `notifyManager`: With the new approach we dont need to batch anything. Everything is taken care of automatically. This removes all sideEffects from solid-query as a nice plus
3. Central place to update state: The new `setStateWithReconciliation` function provides a nice and easy way to make the `reconcile` option way more powerful
4. Only accessing the `data` property now would trigger Suspense boundary. Previously any property accessed on a query would trigger the suspense boundary. This was not intentional and has been fixed now
5. Proxied `data` doesn't jump between different values in most cases
2024-04-13 02:13:07 -04:00
Arnoud
a4ad0e157a
chore(angular-query): update Analog.js Angular Vite plugin (#7261) 2024-04-11 22:57:51 +02:00
Tanner Linsley
18e13d60d9 release: v5.29.3 v5.29.3 2024-04-11 14:26:15 +00:00
Aryan Deora
020a0a3760
fix(solid-query): Correct error handling after SSR error (#7266) 2024-04-11 10:20:52 -04:00
Tanner Linsley
5ace1bc109 release: v5.29.2 v5.29.2 2024-04-11 09:22:38 +00:00
ienrum
03048e3776
fix(react-query): reorder query function declarations (#7260)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-11 11:17:42 +02:00
Anthony Gonzales
a9fa5f4e9b
docs: Remove references to React.FC (#7259)
React.FC was removed from the create-react-app template in
facebook/create-react-app#8177 and is no longer recommended.
2024-04-11 11:16:39 +02:00
Dominik Dorfmeister
78b594de53 chore: no idea why that fails now
> @tanstack/eslint-plugin-query@5.28.11 build /tmp/8bb98984/packages/eslint-plugin-query> vite build "--exclude=integrations/**"file:///tmp/8bb98984/node_modules/.pnpm/vite@5.2.8_@types+node@18.19.3/node_modules/vite/dist/node/cli.js:442          throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
2024-04-11 11:11:50 +02:00
Christopher Ehrlich
fca5e7df77
docs: correct useQuery status type (#7252) 2024-04-09 18:07:17 +02:00
Jonghyeon Ko
3fa532369a
types(react-query): rename useSuspenseQueries, useQueries internal type name intuitively (#7216) 2024-04-09 14:36:27 +02:00
Nick S. Khan
565a241bb6
docs: Fix typos in render-optimizations.md (#7246) 2024-04-08 22:02:20 +02:00
Tanner Linsley
b9179d36b4 release: v5.29.1 v5.29.1 2024-04-08 07:46:01 +00:00
Amine Ben hammou
39909c49b3
perf(asyncThrottle): Improve performance (#7224)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-08 09:42:54 +02:00
protogenesis
e03cc3acc4
docs(query): update the documentation of dependent queries in Vue section (#7243)
The documentation is confusing and not clear about how to use dependent queries in Vue. This PR updates the documentation to make it clear and easy to understand.

discussion: https://github.com/TanStack/query/discussions/7220
2024-04-08 09:32:55 +02:00
Arnoud
7487ce0512
chore: update vite and vitest (#7241) 2024-04-08 07:07:08 +02:00
Chris J. Lee
26e1a95a4a
docs: Update render-optimizations.md - (#7235)
Typo
2024-04-06 08:16:17 +02:00
Dominik Dorfmeister
e707c13ce3
docs: render optimizations (#7234)
* docs: render optimizations

* docs: further reading
2024-04-05 20:06:06 +02:00
Tanner Linsley
51dea300ff release: v5.29.0 v5.29.0 2024-04-05 17:59:45 +00:00
Dominik Dorfmeister
3c31124ddb
feat(core): memoize result of combine (#7233)
* feat(core): memoize result of combine

this PR makes sure to only re-run the combine function if the function itself changed referentially or any of the inputs changed

* docs: combine memoization

* Update docs/framework/react/reference/useQueries.md
2024-04-05 19:56:40 +02:00
Arnoud
4d37cfc733
chore(angular-query): update to angular 17.3 (#7225)
* chore(angular-query): update to angular 17.3

* remove obsolete stackblitz fix
2024-04-04 23:05:01 +02:00
Tanner Linsley
0b9f971e41 docs: fix quickstart 2024-04-02 23:21:55 -06:00
Tanner Linsley
754640a3e5
docs: migrate docs to use path-based navigation instead of route-based (#7211)
TanStack Router uses path-based navigation instead of route-based navigation, so many of the relative documentation links will be invalid after migration. This fixes that.
2024-04-02 16:46:31 -06:00
Tanner Linsley
0a2b1ba185 release: v5.28.14 v5.28.14 2024-04-02 15:25:19 +00:00
Andrew Kogut
f585bfead0
fix(react-query): useSuspenseQueries type not compatible with queryOption (#7194)
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2024-04-02 17:20:48 +02:00
Gioele Vuaran
0123c8094d
docs: gcTime max value (#7190) 2024-04-02 17:15:08 +02:00
Tanner Linsley
9e70983cd8 release: v5.28.13 v5.28.13 2024-04-02 15:05:36 +00:00