-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix: load first page of uploads list in provider #288
Conversation
rather than doing this in the headless component, do it in the provider so that hook users also get a page of results
weird timing issues occur when you try to do this in the provider - move it to the hook to get around them
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 df04d6f:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment is not a blocker, just maybe means we are due for a linter commit
next: async () => {}, | ||
reload: async () => {} | ||
next: async () => { }, | ||
reload: async () => { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we isolate white space changes to a code base wide pr?
I think it's better to have this in the provider so that anyone using this context gets a page of results previously I thought this wouldn't work, but that was just because I wasn't doing a good job with dependency management - now that it's configured to re-run the load any time the space or agent change, it seems to work as expected
just a heads up to reviewers that the churn between different solutions here is exactly the kind of thing that a nice test can help clarify and coincidentally I was just saying I want to write some tests before we cut a release - I'm gonna write some nice tests for this tonight or tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is what most use cases will want, so 👍
if folks need flexibility to not load the first page on first load then they'll tell us!
lol, innocent me upthread thinking a test for this would be simple - spent a bunch of time working out how to do this and made some progress, but decided to merge as-is and come back later with tests - mocking the service interaction and dealing with async functions running in the provider is extra spicy testing fun - doable, but will take a bit more work than I'd like to do before getting this in |
🤖 I have created a release *beep* *boop* --- ## [2.1.0](react-uploads-list-v2.0.1...react-uploads-list-v2.1.0) (2023-02-06) ### Features * "Headless" UI components ([#136](#136)) ([46583e0](46583e0) ### Bug Fixes * load first page of uploads list in provider ([#288](#288)) ([6778d6c](6778d6c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Travis Vachon <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [2.1.0](storacha/w3ui@react-uploads-list-v2.0.1...react-uploads-list-v2.1.0) (2023-02-06) ### Features * "Headless" UI components ([#136](storacha/w3ui#136)) ([b702889](storacha/w3ui@b702889) ### Bug Fixes * load first page of uploads list in provider ([storacha#288](storacha/w3ui#288)) ([8a79ad9](storacha/w3ui@8a79ad9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Travis Vachon <[email protected]>
rather than doing this in the headless component, do it in the hook so that hook users also get a page of results. originally had this in the provider but that had timing issues and only worked sometimes.