-
Notifications
You must be signed in to change notification settings - Fork 63
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(verified-fetch): improve UX #286
Conversation
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.
self review
@@ -1,25 +1,182 @@ | |||
import { useCallback, useState } from 'react' | |||
// import { verifiedFetch, createVerifiedFetch } from '@helia/verified-fetch' |
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.
when ipfs/helia#423 is merged, we should switch the auto content type button to use the contentTypeParser
option.
const handleVideoType = useCallback(async (resp: Response) => { | ||
try { | ||
setLoading('Waiting for full video data...') | ||
const blob = await resp.blob() |
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.
At some point, I'd love to dig into streaming the video, but I think we might have to do that in a service worker because there isn't an easy way to just pass a stream into a video element.
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.
Thanks for all of that. Not sure why I still can't get this to run locally (same error with verified-fetch looking for process). But all changes look reasonable to me. Merging.
* feat: add helia/verified-fetch browser example * feat(verified-fetch): improve UX (#286) * Update examples/helia-browser-react-verified-fetch/package.json Co-authored-by: Alex Potsides <[email protected]> * refactor: clean up code and reduce deps * chore: rename folder * chore: add test * chore: fix linting * chore: add test to verified fetch example (#290) * chore: add test to verified fetch example Adds a test for JSON-codec data * chore: test verified fetch during ci * chore: add tests for other types * fix: improve rendering of cids on narrow viewports * fix: improve auto content detection * chore: fix tests * chore: upgrade verified-fetch * feat: add link to the repo * chore: bump verified fetch version * fix: add aborting functionality * fix: handle abort error * feat: add ability to fetch as dag-json * chore: update deps * chore: remove comment * chore: address feedback and simplify code * chore: reduce code duplication and add docs * feat: add links to api docs and source * fix: linting error --------- Co-authored-by: Daniel N <[email protected]> Co-authored-by: Russell Dempsey <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
Slightly modifies the code from #285 to have better UX.
Also implements the previously unimplemented
onFetchImage
andonFetchFile
functions.Better error messaging and loading messages.
Adds
fetch-auto
functionality to attempt to automatically determine content-type for proper rendering.2024-02-07.at.13.58.27.-.Amethyst.Stork.mp4