-
Notifications
You must be signed in to change notification settings - Fork 0
fix(query-core): allow partial query keys in QueryFilters
#11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…yTimeAsync' (TanStack#9320) Co-authored-by: Jonghyeon Ko <[email protected]>
….waitFor' (TanStack#9319) Co-authored-by: Jonghyeon Ko <[email protected]>
* chore: add typescript-eslint/require-await rule * reflect feedback * Update eslint.config.js * test(angular-query-experimental): remove unnecessary async * test(*): remove unnecessary async * remove(query-codemods): remove unnecessary import * chore(query-codemods): remove typescript-eslint/require-await off rule --------- Co-authored-by: Dominik Dorfmeister <[email protected]> Co-authored-by: Jonghyeon Ko <[email protected]>
…eTimersByTimeAsync' (TanStack#9329) Co-authored-by: Jonghyeon Ko <[email protected]>
…anceTimersByTimeAsync' (TanStack#9327) Co-authored-by: Jonghyeon Ko <[email protected]>
…ryBehavior' in test name (TanStack#9331) Co-authored-by: Jonghyeon Ko <[email protected]>
…ve 'vi.waitFor' (TanStack#9326) Co-authored-by: Jonghyeon Ko <[email protected]>
…ack#9276) * type(vue-query): ensure type of vue-query definition matches its implementation * type(vue-query): update type
…ryObserver' and fix grammar in test names (TanStack#9332) Co-authored-by: Jonghyeon Ko <[email protected]>
…imersByTimeAsync' (TanStack#9343) Co-authored-by: Jonghyeon Ko <[email protected]>
…eTimersByTimeAsync' (TanStack#9342) Co-authored-by: Jonghyeon Ko <[email protected]>
…add 'advanceTimersByTimeAsync' (TanStack#9333) Co-authored-by: Jonghyeon Ko <[email protected]>
…r' and add 'advanceTimersByTimeAsync' (TanStack#9341) Co-authored-by: Jonghyeon Ko <[email protected]>
…rsByTimeAsync' (TanStack#9340) Co-authored-by: Jonghyeon Ko <[email protected]>
…imersByTimeAsync' (TanStack#9339) Co-authored-by: Jonghyeon Ko <[email protected]>
…th 'advanceTimersByTime' (TanStack#9337) Co-authored-by: Jonghyeon Ko <[email protected]>
… 'advanceTimersByTimeAsync' (TanStack#9344)
…nceTimersByTimeAsync' (TanStack#9353) Co-authored-by: Jonghyeon Ko <[email protected]>
… consistency (TanStack#9348) Co-authored-by: Jonghyeon Ko <[email protected]>
…ersByTimeAsync' and replace 'findByText' with 'getByText' (TanStack#9358) Co-authored-by: Jonghyeon Ko <[email protected]>
…dvanceTimersByTimeAsync' (TanStack#9345) Co-authored-by: Jonghyeon Ko <[email protected]>
… 'waitFor' with 'vi.waitFor' (TanStack#9359) Co-authored-by: Jonghyeon Ko <[email protected]>
… 'waitFor' with 'vi.waitFor' (TanStack#9357) Co-authored-by: Jonghyeon Ko <[email protected]>
…replace 'waitFor' with 'vi.waitFor' (TanStack#9349) Co-authored-by: Jonghyeon Ko <[email protected]>
…move 'waitFor' and add 'advanceTimersByTimeAsync' (TanStack#9354) Co-authored-by: Jonghyeon Ko <[email protected]>
…d 'advanceTimersByTimeAsync' (TanStack#9365) Co-authored-by: Jonghyeon Ko <[email protected]>
…#9270) * feat(angular-query-devtools): move devtools to conditional sub-paths, improves tree shaking and dependency injection * Fix compatibility with moduleResolution node * ci: apply automated fixes * fix preview release for angular-query * Fix angular-query preview release * Revert some changes made obsolete by better Vite based alternative * Update export paths * Fix production exports and publishconfig * knip config * remove postpack * Generate API reference docs * type declarations in correct directory * Update documentation * knip config * Optional core devtools dependency * ci: apply automated fixes * regenerate api reference docs * ci: apply automated fixes * ci: apply automated fixes (attempt 2/3) * regenerate api reference docs * formatting * apply coderabbit suggestions * Improve unit tests * docs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…a071bc9 (TanStack#9627) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…Stack#9615) * feat(query-core): add context to mutationfn Co-Authored-By: travikk <[email protected]> * fix(query-core): mutation onSuccess scope param should also be undefined Co-Authored-By: travikk <[email protected]> * feat: add scope deprecate context on mutation state * feat(query-core): add mutation context to all mutation callbacks * chore: pr amends Co-Authored-By: Dominik Dorfmeister <[email protected]> * test(unit): update to handle context in mutation callbacks * chore: rename to onMutateResult * chore: revert context deprecation on MutationState --------- Co-authored-by: travikk <[email protected]> Co-authored-by: Dominik Dorfmeister <[email protected]> Co-authored-by: Dominik Dorfmeister <[email protected]>
* fix(angular-query-experimental): typings for injectQueries should now behave properly * fix(angular-query-experimental): behaviors of injectQuery now work at runtime Mostly * ci: apply automated fixes * add signal proxy * ci: apply automated fixes * update @testing-library/angular * fix build * rename test file * ci: apply automated fixes * fix type error * apply corerabbit suggestions --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Arnoud de Vries <[email protected]>
* Enhance partner logos with responsive images * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
…nStable() support (TanStack#9666) 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
* chore: update workspace config * Update more deps * Fix issues
…fd19551 (TanStack#9674) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…anStack#9634) * 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 <[email protected]>
…anStack#9677) * fix(types): onMutateResult is always defined in onSuccess callback this is guaranteed because if onMutate fails or rejects, onSuccess is never called. if onMutate is not present, the type will be unknown * chore: fix tests
…#9668) * fix(solid-query): add missing generic error type * refactor(solid-query): remove unused generic type * test(solid-query): add case for error tag --------- Co-authored-by: Dominik Dorfmeister <[email protected]>
…tionFilters` Add a type to match tuple prefixes to match partial query keys in `QueryFilters` and `MutationFilters` Fixes TanStack#9680
…ilters` add tests to verify that the new partial QueryKey matching for `QueryFilters` does match partial query keys, and also doesn't allow invalid query keys.
prevent tuple helper types from getting exported, and showing up in the public api
* ci: introduce changesets * Avoid using changesets/action * Remove PR permission * Update PR template * Update link
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @visz11, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on improving the developer experience and type safety within the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a great improvement to type safety by allowing partial query keys in QueryFilters and MutationFilters. The implementation of TuplePrefix is clever and the added tests confirm the new behavior. The PR also includes a massive amount of documentation updates, dependency bumps, and refactoring across the examples and docs, which is a huge effort. My main feedback is a suggestion to further improve the type safety of filters by using a discriminated union, as you've also hinted at in the PR description.
🎯 Changes
Add a type to match tuple prefixes to match partial query keys in
QueryFiltersandMutationFiltersFixes TanStack#9680
It's worth noting, there may be a case where it makes sense to turn
QueryFilters(andMutationFiltersinto a discriminated union on theexactfield, so that we only allow partial query filter types in the case whereexactis false (or unspecified), but it's possible there are cases where one would want partial query key matching even in theexact: truecase, and I'm not sure the added constraint adds much benefit. If you'd like me to add that, let me know.✅ Checklist
pnpm test:pr.🚀 Release Impact
Summary by CodeRabbit
New Features
Tests
Chores