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

fix: load first page of uploads list in provider #288

Merged
merged 6 commits into from
Jan 25, 2023
Merged

Conversation

travis
Copy link
Member

@travis travis commented Jan 20, 2023

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.

rather than doing this in the headless component, do it in the provider so that hook users also
get a page of results
@travis travis requested review from olizilla and alanshaw January 20, 2023 22:58
weird timing issues occur when you try to do this in the provider - move it to the hook to get around them
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 20, 2023

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:

Sandbox Source
@w3ui/example-react-file-upload Configuration
@w3ui/example-react-sign-up-in Configuration
@w3ui/example-react-uploads-list Configuration
@w3ui/example-solid-file-upload Configuration
@w3ui/example-solid-sign-up-in Configuration
@w3ui/example-solid-uploads-list Configuration
@w3ui/example-vue-file-upload Configuration
@w3ui/example-vue-sign-up-in Configuration
@w3ui/example-vue-uploads-list Configuration

Copy link
Contributor

@jchris jchris left a 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 () => { }
Copy link
Contributor

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
@travis
Copy link
Member Author

travis commented Jan 24, 2023

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

Copy link
Contributor

@olizilla olizilla left a 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!

@travis
Copy link
Member Author

travis commented Jan 25, 2023

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

@travis travis merged commit 6778d6c into main Jan 25, 2023
@travis travis deleted the load-uploads-in-hook branch January 25, 2023 22:04
travis added a commit that referenced this pull request Feb 8, 2023
🤖 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]>
Peeja pushed a commit to storacha/upload-service that referenced this pull request Jan 29, 2025
🤖 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants