* fix(angular-query): missing exports InitialDataInfiniteOptions types
Add missing @public js-doc comments in infinite-query-options.ts to fix type exports
* add infinite query option types to public api
---------
Co-authored-by: Arnoud de Vries <6420061+arnoud-dv@users.noreply.github.com>
* types(query-core): add number, symbol as safe key for OmitKeyof for safely
* test(query-core): add type test case for number key, symbol key
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat(angular-query-experimental): support injection in injectQuery callback
Before, when creating a query with injectQuery, if you injected dependencies (Like `inject(HttpClient)`) those injections would fail on subsequence changes of dependent signals. That change makes it easier to use `injectQuery` (especially together with `queryOptions` because the query can define its own dependencies.
No breaking changes, any code that worked before should work now as well.
---------
Co-authored-by: Arnoud <6420061+arnoud-dv@users.noreply.github.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>
* 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>
* 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