https://github.com/whatwg/streams/blob/main/readable-stream-async-iteration-explainer.md
https://streams.spec.whatwg.org/#rs-asynciterator
The streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. This change adds support for the async iterable protocol to the ReadableStream API, enabling readable streams to be used as the source of for await...of loops.
To consume a ReadableStream, developers currently acquire a reader and repeatedly call read(). By adding support for the async iterable protocol, web developers will be able to use the much simpler for await...of syntax to loop over all chunks of a ReadableStream.
Web developers are already using polyfills to async-iterate over a ReadableStream. These polyfills usually work fine, but might not handle all edge cases correctly (such as when the stream errors during a read, or releasing the reader's lock when breaking out of a for await...of loop).
None
None
Not applicable. (This is a small feature with a mature specification that's already shipping in Firefox.)
Low risk. The Streams API has already been standardised for a long time. Async iteration is already supported in one other browser (Firefox) and several JavaScript runtimes (Node.js, Deno, bun).
Gecko: Shipped/Shipping (https://bugzilla.mozilla.org/show_bug.cgi?id=1525852) Shipped in Firefox 110
WebKit: No signal (https://github.com/WebKit/standards-positions/issues/319)
Web developers: Positive (https://github.com/whatwg/streams/issues/778) Developers already expect this to work, and often use a polyfill.
Other signals:
Async iteration can be feature detected by checking the existence of `ReadableStream.prototype.values`. Various polyfills already exist in the wild. (e.g. https://jakearchibald.com/2017/async-iterators-and-generators/)
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
No special support needed. The JavaScript debugger is already sufficiently capable of handling for await...of loops.
Yes
https://wpt.fyi/results/streams/readable-streams/async-iterator.any.html
None
ReadableStreamAsyncIterable
False
https://issues.chromium.org/issues/40612900
No milestones specified
https://chromestatus.com/feature/5143121161879552
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/b1438dfd-ec71-4e18-b34d-0213aff6250cn%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOmohS%2B%3DFoQs%3DtGNQWLaeqjbrJmjB-C_A%3D%2BY6Grwps%2Bik92xoA%40mail.gmail.com.
Thanks Chris, they're all blue now.Op woensdag 21 februari 2024 om 18:09:55 UTC+1 schreef chri...@google.com:
Hi,
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw-YT%3DXY7xKC5htG%2B1yqqhYmpvXUxQ8qVX_zqdsVYXrHiw%40mail.gmail.com.