-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(select): defer TData inference #5040
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
feat(select): defer TData inference #5040
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 942c584:
|
Codecov ReportBase: 90.41% // Head: 90.41% // No change to project coverage 👍
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## feature/infinite-queries #5040 +/- ##
=========================================================
Coverage 90.41% 90.41%
=========================================================
Files 104 104
Lines 3788 3788
Branches 948 948
=========================================================
Hits 3425 3425
Misses 330 330
Partials 33 33
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
* feat: remove manual mode for infinite queries * refactor: simplify checking for next / previous fetch * types: better typings for fetchMeta.direction * refactor: fix hasNextPage / hasPreviousPage we should always return a boolean here, and according to the docs and the implementation in infiniteQueryBehaviour, we will only stop fetching if we return `undefined` from `getNextPageParam` or `getPreviousPageParam`. The checks for `false` or `null` on this boolean were likely wrong * fix: hasNextPage / hasPreviousPage is now always a boolean * feat: defaultPageParam * types: defaultPageParam is mandatory * fix: we also need `defaultPageParam` for `fetchInfiniteQuery` now * test: fix some assertions that relied on `undefined` being in `pageParams` * add some failing tests to show the problem with pageParam typings * feat: add PageParam typing (#5005) * feat: add PageParam typing * feat(infinite-query): more typing * feat(infinite-query): make pageParam never by defaukt * feat(infinite-query): PageParam type unknown for infinite queries * fix(infinite-query): fix tests * feat(infinite-query): add previous end next return TPageParam type * revert changes to pnpm-lock.yaml * types: add TPageParam to other framework adapters * fix(vue-query): correct generic typing * types: rename InfiniteQueryOptions to InfiniteQueryPageParamsOptions because it might be mistaken for a full set of options, which it is not * types: add failing select tests * fix formatting (new prettier version on v5) * types: add types for FetchMeta everywhere * feat(select): defer TData inference (#5040) * feat(select): defer TData inference * test(select): restore test * fix(select): change InfiniteQuery Observer definition * fix(infinite-queries): fix solid type inference select * fix(infinite-queries): fix solid type inference select * chore(infinite-queries): fix prettier * fix(infinite-queries): fix vue and svelte types * fix(infinite-queries): fix react type inference select * chore(infinite-queries): fix imports * style: fix prettier warnings * docs: docs for new infinite query features * docs: examples use new syntax --------- Co-authored-by: ecyrbe <ecyrbe@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
This one is a breaking change in the interface of
UseInfiniteQueryResult
to not haveInfiniteData
backed in.Indeed, before, this change, returning data was contrained to be of the shape of an
InfiniteData
, now it is infered from select.