Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Feature detect streaming and fall back to regular request/response reading if not available #2848

Closed
pcowgill opened this issue Jan 11, 2020 · 1 comment
Assignees
Labels
kind/resolved-in-helia pkg:http-client Issues related only to ipfs-http-client status/ready Ready to be worked

Comments

@pcowgill
Copy link
Contributor

pcowgill commented Jan 11, 2020

Feature detect streaming and fall back to regular request/response reading if not available.

This would involve using a helper lib with the response that handles the case where res.body is undefined and instead parses the JSON from a vanilla, non-streaming response and transforms it to an iterable in another way rather than through toIterable, which assumes a ReadableStream from the fetch spec as an input.

React Native is one such environment where res.body is undefined.

In the long run, hopefully React Native will implement a spec-compatible fetch natively rather than using a polyfill on top of XHR, but in the meantime it would be nice not to gate potential users of this lib.

Related discussion here JakeChampion/fetch#746 (comment) cc @MattiasBuelens

@achingbrain achingbrain transferred this issue from ipfs-inactive/js-ipfs-http-client Mar 9, 2020
@achingbrain achingbrain added the pkg:http-client Issues related only to ipfs-http-client label Mar 9, 2020
@jacobheun jacobheun added the status/ready Ready to be worked label Jun 25, 2020
@SgtPooki SgtPooki self-assigned this May 17, 2023
@SgtPooki SgtPooki moved this to 🥞 Todo in js-ipfs deprecation May 17, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterwards (see #4336).

I believe this issue should be resolved in Helia.

@github-project-automation github-project-automation bot moved this from 🥞 Todo to ✅ Done in js-ipfs deprecation May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/resolved-in-helia pkg:http-client Issues related only to ipfs-http-client status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants