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

feat: upload progress #499

Merged
merged 21 commits into from
May 3, 2023
Merged

feat: upload progress #499

merged 21 commits into from
May 3, 2023

Conversation

travis
Copy link
Member

@travis travis commented Apr 5, 2023

Use the new onUploadProgress callback in @web3-storage/upload-client to add upload progress bars to w3console and the example apps.

This PR also includes a decent amount of bugfixing in the example apps to get them working.

Screen.Recording.2023-04-04.at.3.35.44.PM.mov

This PR now also incorporates #513 because I was having issues with pnpm locally without that.

travis and others added 10 commits March 30, 2023 11:05
pushing this mostly to trigger a new production build, but I think it's better to be consistent here
use this to add a progress widget to w3console
if lengthComputable === false we won't get total and loaded numbers that let us render a progress bar, so just show a nice pair of spinning arrows
For large files or multi-file uploads we'll get ProgressStatus events for each shard interleaved with events for other shards.

This adds a React implementation, Solid and Vue coming shortly.
this is mostly updates for the loader, but also has some fixes to:

1) persist account email to local storage on email and load on load
2) generally get solid uploads working
also move vue provider over to new prefered auth function
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 5, 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.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

@travis travis marked this pull request as ready for review April 5, 2023 19:49
Copy link
Contributor

@gobengo gobengo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to have a review from @olizilla to weigh in on
whether its important this work in environments without the DOM API (e.g. node.js v18 LTS where using window will ReferenceError)

export type { CARMetadata, Service }
export type { CARMetadata, Service, ProgressFn, ProgressStatus, FetchOptions }

export type ProgressStatuses = Record<string, ProgressStatus>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In practice, are there any expectations about what this key string should be?
(e.g. is it any string, or does it have some semantic relation to the ProgressStatus value?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the perspective of this library, I don't really think so - in practice it's usually going to be the URL of the upload whose progress is being reported, but all we care about is that it uniquely identifies a particular upload so that it can be distinguished from other uploads we are getting progress reports on...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export type ProgressStatuses = Record<string, ProgressStatus>
/**
* Upload identifier that can be used to distinguish it from other uploads in progress.
* In practice this will be an upload URL if it is unique per upload.
*/
export type UploadID = string
/**
* Mapping of upload identifiers to corresponding upload status.
*/
export type ProgressStatuses = Record<UploadID, ProgressStatus>

Given the comments above I suggest above changes

examples/react/multi-file-upload/src/components/Loader.jsx Outdated Show resolved Hide resolved
@travis
Copy link
Member Author

travis commented Apr 7, 2023

whether its important this work in environments without the DOM API

per my comment above I don't think this is ever going to be possible - createContext is basically the core of what these libraries do (ie, maintain client-side w3up state) and that doesn't work on the server (because it doesn't make sense to manage client-side state on the server in this way)

@travis travis linked an issue Apr 11, 2023 that may be closed by this pull request
travis added 3 commits April 28, 2023 17:00
since we deprecated and removed the `@w3ui/react` project it doesn't make sense to keep playground around - it was mainly there to help develop and test the "customizable" components that we're no longer using
@travis travis merged commit 6c9de97 into main May 3, 2023
@travis travis deleted the feat/upload-client-progress branch May 3, 2023 21:14
travis pushed a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.2.0](keyring-core-v4.1.1...keyring-core-v4.2.0)
(2023-05-08)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([#503](#503))
([d3b0bba](d3b0bba))

---
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>
travis pushed a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[5.1.0](uploader-core-v5.0.0...uploader-core-v5.1.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))

---
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>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](react-uploader-v4.0.1...react-uploader-v4.1.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[5.2.0](react-keyring-v5.1.1...react-keyring-v5.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([#503](#503))
([d3b0bba](d3b0bba))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.5.0](w3console-v1.4.1...w3console-v1.5.0)
(2023-05-09)


### Features

* add warnings about the public and permanent nature of w3up uploads
([#502](#502))
([6cc58f8](6cc58f8)),
closes [#464](#464)
* get w3console looking acceptable on mobile
([#500](#500))
([118cb22](118cb22))
* remove space creator from sidebar
([#509](#509))
([40bc621](40bc621))
* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.2.0](vue-keyring-v4.1.1...vue-keyring-v4.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([#503](#503))
([d3b0bba](d3b0bba))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](vue-uploader-v4.0.0...vue-uploader-v4.1.0)
(2023-05-09)


### Features

* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))


### Bug Fixes

* tweak READMEs for packages that release-please didn't release right
([#440](#440))
([845a6b6](845a6b6))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.2.0](solid-keyring-v4.1.0...solid-keyring-v4.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([#514](#514))
([e1ee301](e1ee301))
* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))


### Bug Fixes

* more email type
([#494](#494))
([355e794](355e794))
* update @web3-storage/access dep to fix email + issue
([#503](#503))
([d3b0bba](d3b0bba))

---
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]>
travis added a commit that referenced this pull request May 9, 2023
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](solid-uploader-v4.0.0...solid-uploader-v4.1.0)
(2023-05-09)


### Features

* upload progress
([#499](#499))
([6c9de97](6c9de97))
* w3console cleanup and updates to packages to support it
([#507](#507))
([78aee2a](78aee2a))


### Bug Fixes

* tweak READMEs for packages that release-please didn't release right
([#440](#440))
([845a6b6](845a6b6))

---
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*
---


##
[4.2.0](storacha/w3ui@keyring-core-v4.1.1...keyring-core-v4.2.0)
(2023-05-08)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([storacha#503](storacha/w3ui#503))
([19b2c0a](storacha/w3ui@19b2c0a))

---
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>
Peeja pushed a commit to storacha/upload-service that referenced this pull request Jan 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[5.1.0](storacha/w3ui@uploader-core-v5.0.0...uploader-core-v5.1.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))

---
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>
Peeja pushed a commit to storacha/upload-service that referenced this pull request Jan 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](storacha/w3ui@react-uploader-v4.0.1...react-uploader-v4.1.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))

---
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*
---


##
[5.2.0](storacha/w3ui@react-keyring-v5.1.1...react-keyring-v5.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([storacha#503](storacha/w3ui#503))
([19b2c0a](storacha/w3ui@19b2c0a))

---
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*
---


##
[1.5.0](storacha/w3ui@w3console-v1.4.1...w3console-v1.5.0)
(2023-05-09)


### Features

* add warnings about the public and permanent nature of w3up uploads
([storacha#502](storacha/w3ui#502))
([ad0632c](storacha/w3ui@ad0632c)),
closes [storacha#464](storacha/w3ui#464)
* get w3console looking acceptable on mobile
([storacha#500](storacha/w3ui#500))
([3e512df](storacha/w3ui@3e512df))
* remove space creator from sidebar
([storacha#509](storacha/w3ui#509))
([d5f5536](storacha/w3ui@d5f5536))
* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))

---
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*
---


##
[4.2.0](storacha/w3ui@vue-keyring-v4.1.1...vue-keyring-v4.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))


### Bug Fixes

* update @web3-storage/access dep to fix email + issue
([storacha#503](storacha/w3ui#503))
([19b2c0a](storacha/w3ui@19b2c0a))

---
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*
---


##
[4.1.0](storacha/w3ui@vue-uploader-v4.0.0...vue-uploader-v4.1.0)
(2023-05-09)


### Features

* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))


### Bug Fixes

* tweak READMEs for packages that release-please didn't release right
([storacha#440](storacha/w3ui#440))
([9b8a9c8](storacha/w3ui@9b8a9c8))

---
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*
---


##
[4.2.0](storacha/w3ui@solid-keyring-v4.1.0...solid-keyring-v4.2.0)
(2023-05-09)


### Features

* update to latest version of ucanto and
[@web3-storage](https://github.com/web3-storage) libraries
([storacha#514](storacha/w3ui#514))
([f70ca5f](storacha/w3ui@f70ca5f))
* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))


### Bug Fixes

* more email type
([storacha#494](storacha/w3ui#494))
([1c0db4f](storacha/w3ui@1c0db4f))
* update @web3-storage/access dep to fix email + issue
([storacha#503](storacha/w3ui#503))
([19b2c0a](storacha/w3ui@19b2c0a))

---
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*
---


##
[4.1.0](storacha/w3ui@solid-uploader-v4.0.0...solid-uploader-v4.1.0)
(2023-05-09)


### Features

* upload progress
([storacha#499](storacha/w3ui#499))
([81ae196](storacha/w3ui@81ae196))
* w3console cleanup and updates to packages to support it
([storacha#507](storacha/w3ui#507))
([f6fdf8e](storacha/w3ui@f6fdf8e))


### Bug Fixes

* tweak READMEs for packages that release-please didn't release right
([storacha#440](storacha/w3ui#440))
([9b8a9c8](storacha/w3ui@9b8a9c8))

---
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.

Showing upload progress
3 participants