* test(vue-query): add type-check test for useInfiniteQuery with infiniteQueryOptions
* fix(vue-query): wrap useInfiniteQuery options in MaybeRefOrGetter
* remove type problem example
* test(vue-query): add test for plain options getter
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
Integrates TanStack Query for Angular with Angular's PendingTasks API to properly track
asynchronous operations, ensuring ApplicationRef.whenStable() waits for queries and
mutations to complete before resolving.
Features:
- Cross-version compatibility (Angular v16+ with graceful degradation)
- Tracks query fetchStatus and mutation isPending state
- Automatic cleanup on component destruction
- Comprehensive test coverage including edge cases
Benefits:
- Improved SSR: Server waits for data fetching before rendering
- Better testing: fixture.whenStable() properly waits for async operations
- Zoneless support: Correct change detection timing
initialData gives the guarantee that data cannot be undefined, but this falls short when you create a Query via prefetching, and then mount the observer that has initialData set.
That's because initialData is only doing something in the constructor of the Query, so if the Observer isn't the one who creates the Query, it does nothing
This fix makes sure that when new options are applied on a Query (which e.g. happens when an observer mounts), initialData is taken into account when the Query doesn't have any data yet
* add timeoutManager class
* add additional types & export functions
* convert all setTimeout/setInterval to managed versions
* tweaks
* add claude-generated tests
* tests
* revert changes in query-async-storage-persister: no path to import query-core
* re-export more types
* console.warn -> non-production console.error
* query-async-storage-persister: use query-core managedSetTimeout
* pdate pnpm-lock for new dependency edge
* sleep: always managedSetTimeout
* remove managed* functions, call method directly
* remove runtime coercion and accept unsafe any within TimeoutManager class
* cleanup; fix test after changes
* name is __TEST_ONLY__
* notifyManager: default scheduler === systemSetTimeoutZero
* Improve TimeoutCallback comment since ai was confused
* remove unnecessary timeoutManager-related exports
* prettier-ify index.ts (seems my editor messed with it already this pr?)
* continue to export defaultTimeoutProvider for tests
* oops missing import
* fix: export systemSetTimeoutZero from core
* ref: use notifyManager.schedule in createPersister
because it needs to work with whatever scheduleFn we have set there
* ref: move provider check behind env check
* docs
* doc tweaks
* doc tweaks
* docs: reference timeoutManager in discussion of 24 day setTimout limit
* Apply suggestion from @TkDodo
* Apply suggestion from @TkDodo
* chore: fix broken links
* docs: syntax fix
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat(query-core): add custom reducer support to streamedQuery
Replace maxChunks parameter with flexible reducer function that delegates
data aggregation to consumer code. This provides full control over how
streamed chunks are combined into the final data structure.
Add support for custom placeholderData that works seamlessly with the
reducer function, allowing initialization of complex data types beyond
simple arrays.
https://github.com/TanStack/query/discussions/9065
BREAKING CHANGE: The maxChunks parameter has been removed from streamedQuery.
Use a custom reducer function to control data aggregation behavior instead.
* ci: apply automated fixes
* feat(query-core): require initialValue when using custom reducer in streamedQuery
Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.
Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.
BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.
* feat(query-core): require initialValue when using custom reducer in streamedQuery
Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.
Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.
BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.
* feat(query-core): require initialValue when using custom reducer in streamedQuery
Add type safety by making initialValue mandatory when providing a custom
reducer function. This prevents runtime errors and ensures proper data
initialization for custom data structures beyond simple arrays.
Use conditional types to enforce the relationship between reducer and
initialValue parameters, maintaining backward compatibility for simple
array-based streaming while requiring explicit initialization for
custom reducers.
BREAKING CHANGE: When using a custom reducer function with streamedQuery,
the initialValue parameter is now required and must be provided.
* removed personal vscode workspace file
* updated documentation
* fix(docs): clarify reducer function description in streamedQuery documentation
* ci: apply automated fixes
* fix(tests): Code Review :: update streamedQuery tests to use correct initialValue type
---------
Co-authored-by: gobbimar <marco.gobbi@adidas.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(query-core): ensure combine re-executes after cache restoration with memoized combine
* fix(query-core): add error field to result change detection
* test(query-core): add test for QueriesObserver early return notification
* test(query-core): improve test for QueriesObserver early return notification
* refactor(query-core): use shallowEqualObjects for result comparison
* refactor(query-core): improve setQueries flow and fix persist/restore issue with memoized combine
* refactor(query-core): improve setQueries flow and remove log
* test(react-query): update useQueries expectations for metadata change detection
* test(react-query): fix test comments
* test(react-query): add test for stable combine optimization on unrelated re-renders
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* refactor(query-core): improve replaceEqualDeep performance
* try object.prototype that broke eslint in router
* no object flag
* improved version w/ more code
* ci: apply automated fixes
* less code, but still 2x faster
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>