Re: [whatwg/streams] Revisiting ReadableStream.from(syncIter) and ReadableStream.from(str) (Issue #1376)

jasnell left a comment (whatwg/streams#1376)

> Just for clarity: you can already pass any sync iterable (expect for strings) to ReadableStream.from(). That was always supported and remains supported ...

Yep. Honestly, I think my ask here would mostly just be an editorial note that makes that clearer. I've had folks try to report bugs because the spec webidl says the argument is `asyncIterable` and there's only a small easy to miss statement in the streams spec that it can be `iterable` or `asyncIterable`

But you're right, the bigger question is handling single chunks. I already have an implementation that handles `string` and `BufferSource` specially, so very aware that's possible here.

I guess I'm really looking to make the most ergonomic choice (`ReadableStream.from(singleChunk)` rather than `ReadableStream.from([singleChunk])` reasonably possible, given how absolutely common the `start(c) { c.enqueue(singleChunk); c.close(); }` pattern is in practice.

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

Message ID: <whatwg/streams/issues/1376/4987771707@github.com>

Received on Thursday, 16 July 2026 03:11:19 UTC