-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Description
Allow using a ReadableStream
in the body for fetch
. Ideally for both the request and response bodies
Specification
https://fetch.spec.whatwg.org/
web-feature
https://web-platform-dx.github.io/web-features-explorer/features/fetch-request-streams/
Test Links
No response
Additional Signals
I have personally run into the lack of this API as being burdensome as a maintainer of SvelteKit where we implemented "remote functions" (RPCs) and as a maintainer of Immich where we implemented progress tracking for uploads and downloads of photos. We've had to do workarounds using XMLHttpRequest
instead of fetch
as a result: https://github.com/immich-app/immich/blob/17bbcdf58418b3168f05b4b7aea5912129d86c54/web/src/lib/utils.ts#L85
The lack of this feature is a major driver for adoption of the axios data fetching library, so as a result more bytes get sent to the client as axios must be sent across the wire rather than relying on the platform.
Implemented in a number of platforms: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility
Missing from Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1387483
$15,000 bounty for the feature in webkit: WebKit/standards-positions#24 (comment)
A sample of representative StackOverflow posts on the topic:
- https://stackoverflow.com/questions/35711724/upload-progress-indicators-for-fetch
- https://stackoverflow.com/questions/40939857/fetch-with-readablestream-as-request-body/41222366
- https://stackoverflow.com/questions/47285198/fetch-api-download-progress-indicator
- https://stackoverflow.com/questions/52422662/how-to-get-file-upload-progress-with-fetch-and-whatwg-streams
A number of likes and responses here: https://bsky.app/profile/benmccann.com/post/3lxdgi2kb2s25
Metadata
Metadata
Assignees
Labels
Type
Projects
Status