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

create a document from a stream #520

Closed
Mouvedia opened this issue Sep 20, 2016 · 8 comments
Closed

create a document from a stream #520

Mouvedia opened this issue Sep 20, 2016 · 8 comments

Comments

@Mouvedia
Copy link

Mouvedia commented Sep 20, 2016

cf whatwg/fetch#16 (comment) by @annevk

references:
whatwg/fetch#151
whatwg/fetch#16
node-fetch/node-fetch#113
JakeChampion/fetch#204
w3c/ServiceWorker#462

@domenic
Copy link
Member

domenic commented Sep 20, 2016

No, this is out of scope for the streams specification, sorry you never got a response. The streams specification defines streams; it does not deal with how to create them from specific web platform objects.

@domenic domenic closed this as completed Sep 20, 2016
@Mouvedia
Copy link
Author

Mouvedia commented Sep 20, 2016

@domenic could you tell me on which repo this request belongs?

The timeout property and the document response type are missing from fetch to be on par with XMLHttpRequest. timeout is covered by whatwg/fetch#179.

@annevk
Copy link
Member

annevk commented Sep 20, 2016

@Mouvedia not sure if @domenic agrees, but I guess arguably you could request a streaming parser for HTML in whatwg/html... But taking a step back, this idea is known, but what needs to happen is a whole bunch of work to figure things out.

@Mouvedia
Copy link
Author

Mouvedia commented Sep 20, 2016

@annevk I have referenced 5 different issues on 4 repositories*; the community has spoken, something is missing. Could you fill the issue yourself? In layman's terms we need a builtin document or xml method on Response. I am sure you will be able to reformulate that in a sensible way.

* #520 (comment)

@annevk
Copy link
Member

annevk commented Sep 20, 2016

Response won't get such a method. If that is all you need, use DOMParser on response.text().

@Mouvedia
Copy link
Author

Mouvedia commented Sep 20, 2016

@annevk that means that users will have to handle response of type document in a separate path or extend Response with a custom method of their own. Is that really the best we can do? Even if json has clearly won the battle over xml in terms of usage, it doesn't mean that a dedicated method is not necessary. The parity with XHR should be of utmost importance IMHO. This common use case shouldn't involve hacks: it should be consistent.

@annevk
Copy link
Member

annevk commented Sep 20, 2016

I guess we disagree on that.

@Mouvedia
Copy link
Author

Mouvedia commented Oct 24, 2016

It's really hard to believe you. Who would want fetch to be lacking stuff that XHR could do?
Parity is one of the most essential goal for fetch() so that it could be considered a serious alternative for all use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants