Issues
- support paging in stripes-connectSTRIPES-262Resolved issue: STRIPES-262Jason Skomorowski
- Better names for Redux actionsSTRIPES-199Resolved issue: STRIPES-199
- Support templated resource paths in mutatorsSTRIPES-196Resolved issue: STRIPES-196
- Update or replace redux-crudSTRIPES-187Resolved issue: STRIPES-187Niels Erik Nielsen
- Allow local resource substition to reference object properties.STRIPES-178Resolved issue: STRIPES-178Jason Skomorowski
- Make local state available for use in the stripes-connect manifestSTRIPES-123Resolved issue: STRIPES-123Jason Skomorowski
- Support templated resource paths in mutatorsSTRIPES-122Resolved issue: STRIPES-122Jason Skomorowski
- Parameters as a manifest object rather than after the ? in pathSTRIPES-121Resolved issue: STRIPES-121
- handle JWT-token in the UI clientSTRIPES-113Resolved issue: STRIPES-113Niels Erik Nielsen
- Mechanism to allow query parameters to be substituted into the manifestSTRIPES-91Resolved issue: STRIPES-91Jason Skomorowski
- Use Object.freeze() to secure data being passed in via stripes-connectSTRIPES-68Resolved issue: STRIPES-68Jason Skomorowski
- Explore using stripes-connect to implement pagingSTRIPES-67Resolved issue: STRIPES-67
- UI tests for stripes-connectSTRIPES-30Resolved issue: STRIPES-30Jason Skomorowski
- Document the API for standalone stripes-connectSTRIPES-22Resolved issue: STRIPES-22Mike Taylor
- status (and error, warn?) props for connected componentsSTCON-18Resolved issue: STCON-18Jason Skomorowski
- Replace redux-crud with our own actions and reducers.STCON-15Resolved issue: STCON-15Jason Skomorowski
support paging in stripes-connect
Description
Environment
Potential Workaround
blocks
is blocked by
is duplicated by
relates to
Checklist
hideTestRail: Results
Activity
Mike Taylor March 31, 2017 at 11:49 AM
I am not seeing how plays into this. We can do essentially the same thing using transitionToParams
– see https://github.com/folio-org/stripes-components/blob/master/util/README.md#thistransitiontoparamsparams
On keeping old results around or not: that surely is a matter for optimisation, and we may well want to tune it on an app-by-app basis. So we need to design this so that it works fine whether or not we retain old results. We should be fine so long as our metadata cleanly describes what we do and don't have, and is kept up to date. As you say, we need to avoid having to make assumptions.
Good spot on the re-rendering. However, avoiding that can be seen as a separate optimisation task. In practice it's likely to be pretty cheap, so we shouldn't let the main task be derailed by becoming over-conscious of this refinement.
The general approach sounds good to me.
(And, yes, we really do need to get rid of redux-crud.)
Jason Skomorowski March 30, 2017 at 11:01 PM
So, turns out paging is more involved than it might appear:
To add these parameters cleanly it would be really good to do , especially if we're comfortable requiring that paramters be split out.
It's tempting to want to keep the first page of results when pagedRecordsRequested is increased. After all, it's typically just that the user is moving on to the next page. However, we (will) have it cached and should instead react to this as with any other change to the manifest and start over again. This saves having to make assumptions about whatever happens to be in the state and needing to verify that nothing else salient changed.
We want to avoid re-rendering the component as each page comes in (which will happen if we put them directly in their ultimately home in the store).
Order matters. My first inkling was to do them in sequence for now but ultimately we want to be able to fire off all the requests.
It will be surprising if I don't somehow trip over redux-crud again trying to implement this.
Thought I could do something quick to handle this in the interim with a chain of promises but that rapidly became fiddly and involved hanging more state off of the resource object than I was comfortable with. So instead I'm looking at adding some extra Redux actions/reducers to handle satisfying all the pages and then dispatching redux-crud's success action at the end. Someone even wrote up a handy guide and associated module but given how long redux-crud has outlived its welcome (STRIPES-239) I think I'll just do a modest implementation of it and improve as needed rather than tow another dependency along for this.
Mike Taylor March 22, 2017 at 10:17 AM
Also: the first two thirds of that linked post is good: everything it says is obvious, but it's good to have it all laid out in one place. (The last third is eminently disposable, all about Relay.)
Mike Taylor March 22, 2017 at 9:29 AM
Jason's analysis seems spot on to me, especially his rejection of a fetchMore
method.
I am happy to relegate cursors to an indefinite future that may or may not ever happen.
Mike Taylor March 22, 2017 at 9:21 AM
Side-comment on the definition of "pageable": I wonder why the minimum value of limit
is 1? I can easily imagine wanting to set it to zero, to get a "pure search" with no retrieval – for example, if I want to determine how many of thing there are, without at that point caring what those individual things are.
The main usage scenario is the ability to "infinitely scroll" pageable (from=x&count=y) API responses in the Users (and eventually Items and others) list. The implementation should allow to easily hook up list-like components that require paging by wiring up selected events (e.g scroll) to the "next-page/more" backend request (and by default the backend is assumed to always support the pageable trait). Specifically for scroll we may need to consider certain optimization techniques (e.g fetching more than rendering), but those should be transparent to the stripes-connect client and initial implementation can come without them. If paging support can be more general so that wiring up against e.g a list with explicit paging controls is possible – great, if this is complicating the implementation, ignore.