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

Add client-side pagination #2327

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Conversation

AlanGreene
Copy link
Member

@AlanGreene AlanGreene commented Mar 18, 2022

Changes

#2324

Add client-side pagination to all list pages via the ListPageLayout
container. Update the children prop to expect a function so we can
use the render props pattern to allow the ListPageLayout component
to handle all of the pagination logic required.

Consuming pages pass their raw resources to ListPageLayout and it
passes back the correct slice for the current pagination settings
which the consumer then formats / renders as needed.

Although we're still loading and storing the full list of resources
from the API this does have significant performance benefits in the
client, especially with larger number of resources. Notably, this
addresses freezing reported by a number of users on the PipelineRuns
and TaskRuns pages with busy clusters.

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 18, 2022
@AlanGreene AlanGreene force-pushed the pagination branch 2 times, most recently from 4cde12b to e78d06d Compare March 22, 2022 21:41
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 22, 2022
@AlanGreene AlanGreene requested review from briangleeson and removed request for skaegi and steveodonovan April 22, 2022 14:41
@AlanGreene AlanGreene changed the title Add client-side pagination to TaskRuns page Add client-side pagination Apr 22, 2022
@AlanGreene AlanGreene marked this pull request as ready for review April 26, 2022 10:35
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 26, 2022
Add client-side pagination to all list pages via the `ListPageLayout`
container. Update the `children` prop to expect a function so we can
use the render props pattern to allow the `ListPageLayout` component
to handle all of the pagination logic required.

Consuming pages pass their raw resources to `ListPageLayout` and it
passes back the correct slice for the current pagination settings
which the consumer then formats / renders as needed.

Although we're still loading and storing the full list of resources
from the API this does have significant performance benefits in the
client, especially with larger number of resources. Notably, this
addresses freezing reported by a number of users on the PipelineRuns
and TaskRuns pages with busy clusters.
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
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 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 Apr 26, 2022
@tekton-robot tekton-robot merged commit 14cce74 into tektoncd:main Apr 26, 2022
@AlanGreene AlanGreene deleted the pagination branch April 26, 2022 12:08
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants