Implement textStream method in Blob interface#221
Conversation
Add textStream method to Blob interface for streaming text.
|
Corresponding to whatwg/fetch#1862 |
| ### The {{Blob/textStream()}} method ### {#text-stream-method-algo} | ||
|
|
||
| The <dfn method for=Blob>textStream()</dfn> method, when invoked, must return | ||
| the result of calling [=get stream=] on [=this=], [=pipe through|piped through=] a new {{TextDecoderStream}} object. |
There was a problem hiding this comment.
As per the Fetch PR we probably don't want to call this constructor directly.
There was a problem hiding this comment.
Yea will continue this once we resolve on how to do this for fetch.
| [NewObject] ReadableStream stream(); | ||
| [NewObject] Promise<USVString> text(); | ||
| [NewObject] Promise<ArrayBuffer> arrayBuffer(); | ||
| [NewObject] ReadableStream textStream(); |
There was a problem hiding this comment.
Is it a conscious decision not to do something like stream({ mode: "text" }) or such?
There was a problem hiding this comment.
What other modes do you envision we'd add?
There was a problem hiding this comment.
What other modes do you envision we'd add?
anything that's in a form of transform stream, like compression/decompression? Not pushing for it, just thinking if .stream().pipeThrough(new TextDecoderStream()) is too long, then logically that applies to other transform streams too.
But seems this was a conscious choice - I'm ok with it too.
There was a problem hiding this comment.
Note that Response (and Request) don't have a stream() method. In general I prefer individual methods over multiple method definitions packed in a dictionary.
Add textStream method to Blob interface for streaming text.
Part of whatwg/fetch#1861
For normative changes, the following tasks have been completed:
Implementation commitment:
Preview | Diff