-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
WIP - Cursor API #1301
Closed
Closed
WIP - Cursor API #1301
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for netlify-cms-www ready! Built with commit dcf6df7 |
Deploy preview for cms-demo ready! Built with commit dcf6df7 |
Excited to see this @Benaiah! Give a heads up when it's ready for a deep dive review. |
12 tasks
Make spinner appear while pages are requested Fix pagination alignment
Closing this as the commits are a subset of those for the GitLab backend (#1343). |
@Benaiah safe to delete the branch? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements a new cursor API that allows backends to implement pagination of folder-based collections for listing and search, without changing the code or behavior of existing backends (except
test-repo
, which has been modified to use the cursor API).Moves the code that bypasses backend methods when integrations are present for search and entries listing to
backend.js
. Now the only part of the integrations API exposed to code outside ofbackend.js
is the media library.Adds pagination UI - infinite scroll as used by the existing pagination system (only used for the Algolia integration) is still possible, but not yet implemented for cursor-based backends due to debugging and performance reasons (we need a solid method of avoiding having thousands of React components in the entries list if you scroll through the whole collection, and it's not immediately clear how
last
orfirst
would be implemented. (Note: the current infinite scroll UI doesn't work, as I still need to improve the UI code to detect when it needs to use the cursor function props or the oldonLoadMore
prop - this will be fixed before merge.)Todo before merge:
listAllEntries
performance can be improved by improving caching or allowing backends to implement it specifically and using different request strategies when listing everything as opposed to a single page.pagination
code, making all pagination use the same functions. (The UI issue described above will be solved by this.)Test plan
The
test-repo
backend has been modified to use cursors, as well as the GitLab PR (the PR hasn't yet been updated, but the branch implementing GitLab with cursors is at https://github.com/netlify/netlify-cms/tree/gitlab-benaiah-rebased-onto-cursor-api. Manual testing has been done on both of those, and some automated Redux tests will follow. (The planned development of a backend test suite that can run on any backend will improve the refactoring and new-backend-development experiences, but I expect this to be merged before that's done.)Description for the changelog
Implement cursor API supporting arbitrary backend pagination implementations.
- A picture of a cute animal (not mandatory but encouraged)