Re: [whatwg/streams] ReadableStream.prototype.arrayBuffer() (#1019)

It looks like we have a plan here, and we just need someone to do the work. I don't have time to commit to this in the near future, but if someone has time to draft a PR, I'd be happy to look at it.

I believe we have rough consensus on the following issues:
1. Chunks should be of the same types as accepted by the [Blob constructor](https://w3c.github.io/FileAPI/#constructorParams). As an implementer, I'm a little unhappy with implementing Blob chunks because reading it is async and will make my life hard, but I can live with it. I also have some ergonomics concerns that accepting `USVString` will result in a lot of `[object Object]` in the output, but people have been living with that with Blob and it isn't the end of the world.
2. We should only handle UTF-8 for input and output. [`TextDecoderStream`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoderStream) already exists for people who need more encoding support.
3. `text()`, `arrayBuffer()` and `blob()` seem uncontroversial. `json()` is easy to do if we spec it as parsing at the end [like fetch does](https://fetch.spec.whatwg.org/#dom-body-json) but maybe there isn't much demand? Other methods seem to require further discussion.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1019#issuecomment-2017426417
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1019/2017426417@github.com>

Received on Monday, 25 March 2024 08:06:53 UTC