Skip to content
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

Update React Query #2514

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Update React Query #2514

merged 1 commit into from
Oct 7, 2022

Conversation

AlanGreene
Copy link
Member

@AlanGreene AlanGreene commented Oct 7, 2022

Changes

React Query v4 switches to a new package name, so react-query is now @tanstack/react-query.

Breaking changes:

  • all query keys must be arrays, so for example 'properties' is now ['properties']
  • query data is read-only in the response from useQuery
  • disabled queries are 'loading' by default, need to switch to isInitialLoading flag to prevent blocking page in loading state in case of disabled queries, e.g. Pipeline resource on PipelineRun page when using an inline Pipeline spec as we never need to request a Pipeline resource in that case
  • setLogger removed, logger is now set as a property when defining the QueryClient
  • undefined is no longer a valid value for the data returned for a successful query

Package imports and most of the key updates were achieved using the provided codemods. Some manual changes required to address the rest.

Tests updated to match including fix for infrequent flake in App.test

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

See the contribution guide
for more details.

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 7, 2022
@AlanGreene AlanGreene removed the request for review from skaegi October 7, 2022 11:06
Copy link
Contributor

@briangleeson briangleeson left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 7, 2022
React Query v4 switches to a new package name, so `react-query`
is now `@tanstack/react-query`.

Breaking changes:
- all query keys must be arrays, so for example `'properties'` is
  now `['properties']`
- query data is read-only in the response from `useQuery`
- disabled queries are 'loading' by default, need to switch to
  `isInitialLoading` flag to prevent blocking page in loading state
  in case of disabled queries, e.g. Pipeline resource on PipelineRun
  page when using an inline Pipeline spec as we never need to request
  a Pipeline resource in that case
- `setLogger` removed, logger is now set as a property when defining
  the QueryClient
- `undefined` is no longer a valid value for the data returned for
  a successful query

Package imports and most of the key updates were achieved using the
provided codemods. Some manual changes required to address the rest.

Tests updated to match including fix for infrequent flake in App.test
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2022
Copy link
Contributor

@briangleeson briangleeson left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2022
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: briangleeson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit 4e5188c into tektoncd:main Oct 7, 2022
@AlanGreene AlanGreene deleted the react-query branch October 7, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants