Skip to content

Rename cacheTime to gcTime #4829

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
merged 5 commits into from
Jan 20, 2023
Merged

Rename cacheTime to gcTime #4829

merged 5 commits into from
Jan 20, 2023

Conversation

Mamoanwar97
Copy link

closes #4678

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 16, 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 8161892:

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

Copy link
Collaborator

@TkDodo TkDodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you ❤️ . Just some minor comments from my side:

@TkDodo TkDodo merged commit 65af42c into TanStack:v5 Jan 20, 2023
@Mamoanwar97 Mamoanwar97 deleted the rename-cacheTime branch January 20, 2023 11:04
dhess added a commit to hackworthltd/primer-app that referenced this pull request Apr 10, 2024
This version has some fairly major changes, but most of it is hidden
from us thanks to Orval. We have made the following notable changes,
however:

* `cacheTime` has been renamed to `gcTime`. As far as I can tell,
there are no behavioral changes and this is simply a rename to reduce
confusion. Therefore, this change should be purely cosmetic. (See
TanStack/query#4678,
TanStack/query#1217, and
TanStack/query#4829 for reference.)

* Use object-style parameters to query methods where necessary. These
changes should be purely cosmetic.

* React Query v5 is written in TypeScript, so we can take advantage of
better types. The one place we currently do that is in the `Edit`
component's `useGetProgram` return types. Note that we also use
`isPending` rather than `isLoading`. The docs are a bit confusing on
this point as to whether they're equivalent; see
https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#status-loading-has-been-changed-to-status-pending-and-isloading-has-been-changed-to-ispending-and-isinitialloading-has-now-been-renamed-to-isloading.
Initially I used `isLoading` when porting to v5, but TypeScript was
not able to narrow the `data` value to non-nil unless I use
`isPending`, so I've gone with `isPending` in the end. As far as I can
tell, it works the same as before.

* v5's dev tools are significantly improved, including the UI, which
lets you choose via a nice drop-down menu where to locate the tool
pop-up. This doesn't play well with our own "dev tools" checkbox UI,
so I've temporarily disabled those `DevOptions`, as the UI for them
will need to be rethought. I think adding another button to the canvas
is probably the way to go, but I'll leave that work for later.

FYI, the migration guide is here, and it informed most of these
changes:

https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5

Signed-off-by: Drew Hess <[email protected]>
dhess added a commit to hackworthltd/primer-app that referenced this pull request Apr 10, 2024
This version has some fairly major changes, but most of it is hidden
from us thanks to Orval. We have made the following notable changes,
however:

* `cacheTime` has been renamed to `gcTime`. As far as I can tell,
there are no behavioral changes and this is simply a rename to reduce
confusion. Therefore, this change should be purely cosmetic. (See
TanStack/query#4678,
TanStack/query#1217, and
TanStack/query#4829 for reference.)

* Use object-style parameters to query methods where necessary. These
changes should be purely cosmetic.

* React Query v5 is written in TypeScript, so we can take advantage of
better types. The one place we currently do that is in the `Edit`
component's `useGetProgram` return types. Note that we also use
`isPending` rather than `isLoading`. The docs are a bit confusing on
this point as to whether they're equivalent; see
https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#status-loading-has-been-changed-to-status-pending-and-isloading-has-been-changed-to-ispending-and-isinitialloading-has-now-been-renamed-to-isloading.
Initially I used `isLoading` when porting to v5, but TypeScript was
not able to narrow the `data` value to non-nil unless I use
`isPending`, so I've gone with `isPending` in the end. As far as I can
tell, it works the same as before.

* v5's dev tools are significantly improved, including the UI, which
lets you choose via a nice drop-down menu where to locate the tool
pop-up. This doesn't play well with our own "dev tools" checkbox UI,
so I've temporarily disabled those `DevOptions`, as the UI for them
will need to be rethought. I think adding another button to the canvas
is probably the way to go, but I'll leave that work for later.

FYI, the migration guide is here, and it informed most of these
changes:

https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5

Signed-off-by: Drew Hess <[email protected]>
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.

2 participants