-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interest
Description
What problem are you trying to solve?
response.body
is a stream of Uint8Array
but often you want to deal with text. response.text()
decodes the response body as text and returns it, but all at once, not streaming.
What solutions exist today?
let response = await fetch('/');
let decoder = new TextDecoderStream();
response.body.pipeThrough(decoder);
How would you solve it?
A textStream()
helper that gives you a stream of decoded text chunks instead.
Anything else?
This is mainly motivated by whatwg/html#11669, where a ReadableStream
will needed. If it's as easy to get a string stream as a byte stream, then we could probably make those APIs only accept strings. (My current thinking was to bake text decoding into them to reduce boilerplate, but @noamr suggested a new method instead.)
noamr
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interest