Adam Rice

Results 271 comments of Adam Rice
trafficstars

A related issue that makes me even more uncomfortable is that if you call `controller.close()` from inside `size()` with no chunks queued then the stream will be closed but the...

We have the semantic that if a read() is in progress then size() isn't called at all. I was initially surprised by this, but it makes sense. However, it means...

Chromium's implementation of pipeTo() is also affected, as it performs the first read synchronously. See https://github.com/w3c/web-platform-tests/pull/8163. Although the reference implementation and Chromium are observably different here, I don't think either...

I've written some ReadableStream tests at https://github.com/w3c/web-platform-tests/pull/8166. I'm not sure I've covered every possible case where things can go wrong. As far as I can tell there is no way...

I think we've decided to live with this rather than change it. Having said that, I will leave the issue open in case any implementers have problems with it.

Sorry for the slow response. I think as a performance-oriented API, this has a high bar to meet. We need to show that it unlocks performance gains that would be...

The main motivating example is this from the [CompressionStream explainer](https://github.com/ricea/compressstream-explainer/blob/master/README.md#example-code): ```javascript async function compressArrayBuffer(in) { const cs = new CompressionStream('deflate'); const writer = cs.writable.getWriter(); writer.write(in); writer.close(); const out = [];...

I just realised that ```javascript ReadableStream.from([in]).pipeTo(cs.writable); ``` would also work, is only two more characters, and requires less DWIM.

> It would behave the same as `Array.from(uint8array)`. Perhaps we should add `ReadableStream.of(...chunks)` to mirror `Array.of(...elements)`? I prefer this to making `rs.from(uint8array)` a special-case. If we special case buffer source...

> Looks like [a variadic operation](https://heycam.github.io/webidl/#dfn-variadic) is a thing in WebIDL, so yes. Thanks!