Skip to content

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

Merged

Conversation

ecyrbe
Copy link
Contributor

@ecyrbe ecyrbe commented Feb 26, 2023

This one is a breaking change in the interface of UseInfiniteQueryResult to not have InfiniteData backed in.
Indeed, before, this change, returning data was contrained to be of the shape of an InfiniteData, now it is infered from select.

@vercel
Copy link

vercel bot commented Feb 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
query ⬜️ Ignored (Inspect) Feb 26, 2023 at 5:21PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 26, 2023

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:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2023

Codecov Report

Base: 90.41% // Head: 90.41% // No change to project coverage 👍

Coverage data is based on head (942c584) compared to base (9b1df18).
Patch has no changes to coverable lines.

📣 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           
Impacted Files Coverage Δ
packages/query-core/src/infiniteQueryObserver.ts 88.46% <ø> (ø)
packages/react-query/src/useInfiniteQuery.ts 100.00% <ø> (ø)
packages/solid-query/src/createInfiniteQuery.ts 100.00% <ø> (ø)
packages/svelte-query/src/createInfiniteQuery.ts 0.00% <ø> (ø)
packages/vue-query/src/useInfiniteQuery.ts 100.00% <ø> (ø)

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TkDodo TkDodo merged commit 267ee5e into TanStack:feature/infinite-queries Feb 26, 2023
TkDodo added a commit that referenced this pull request Feb 27, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants