Intent to Ship: Streams API: Byte Streams

191 views
Skip to first unread message

Nidhi Jaju

unread,
Dec 11, 2020, 12:56:59 AM12/11/20
to blink-dev, Adam Rice, Yutaka Hirano

Contact emails

nidh...@google.comri...@chromium.orgyhi...@chromium.org

Explainer

https://github.com/whatwg/streams/blob/master/byte-streams-explainer.md

Specification

https://streams.spec.whatwg.org/

API spec

Yes

Design docs

https://docs.google.com/document/d/1rvKpGjppeqRSWntokY-ft_hU2i2us8gis6zgrrLWSTI/view

Summary

The streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. For streams representing bytes, an extended version of the readable stream is provided to handle bytes efficiently, in particular by minimizing copies.


Blink component

Blink>Network>StreamsAPI

TAG review

https://github.com/w3ctag/design-reviews/issues/567

TAG review status

Pending

Risks

Interoperability and Compatibility

Low risk because it has already been standardised for a long time (since around 2014). Other browsers have implemented other parts of the standard, and they will most likely also adapt byte streams as well soon.


Gecko: No signal (https://github.com/mozilla/standards-positions/issues/457)
WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2020-November/031597.html)
Web developers: No signals

Ergonomics

A lot of design efforts have been made into making the streams API easy to use. Additionally, this byte streams API is similar to the existing streams API that developers are used to.


Activation

It is difficult to polyfill just byte streams, without polyfilling the rest of readable streams. Hence, developers may need to wait for other browsers to also implement byte streams, or maintain two code paths.


Debuggability

No special support needed.


Is this feature fully tested by web-platform-tests?

Yes

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=614302

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4535319661641728

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/Q8Qgu1ZdJ44

Nidhi Jaju

unread,
Dec 11, 2020, 2:57:18 AM12/11/20
to blink-dev, Adam Rice, Yutaka Hirano
Update: Mozilla has marked Readable Byte Streams as "Worth Prototyping" now.

Reilly Grant

unread,
Dec 11, 2020, 1:26:34 PM12/11/20
to Nidhi Jaju, blink-dev, Adam Rice, Yutaka Hirano
Once Readable Byte Streams are available in Chromium I would like to declare the readable property of the SerialPort interface to return a byte stream rather than a normal stream. Are there any compatibility issues you foresee for existing specifications that already use Uint8Array as the chunk type in upgrading their streams?
Reilly Grant | Software Engineer | rei...@chromium.org | Google Chrome


--
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/CAHARgnJ%2BR9E%2BL%2B-v-rLRFMVX5uVAeaQR%3DqpsJObH3nBjuxBWQw%40mail.gmail.com.

Adam Rice

unread,
Dec 11, 2020, 6:35:01 PM12/11/20
to Reilly Grant, Nidhi Jaju, blink-dev, Yutaka Hirano
There are no known compatibility issues with replacing a platform provided Uint8Array stream with a byte stream. It's intended to work. The Fetch spec already permits the body to be a byte stream, although I don't think anyone has implemented this.

Alex Russell

unread,
Dec 15, 2020, 1:18:19 AM12/15/20
to Adam Rice, Nidhi Jaju, Reilly Grant, Yutaka Hirano, blink-dev

Yoav Weiss

unread,
Dec 15, 2020, 1:42:05 AM12/15/20
to Alex Russell, Adam Rice, Nidhi Jaju, Reilly Grant, Yutaka Hirano, blink-dev

TAMURA, Kent

unread,
Dec 15, 2020, 2:31:24 AM12/15/20
to Nidhi Jaju, blink-dev, Adam Rice, Yutaka Hirano
On Fri, Dec 11, 2020 at 4:57 PM 'Nidhi Jaju' via blink-dev <blin...@chromium.org> wrote:
Update: Mozilla has marked Readable Byte Streams as "Worth Prototyping" now.

It's a good signal.  LGTM3.
 
--
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/CAHARgnJ%2BR9E%2BL%2B-v-rLRFMVX5uVAeaQR%3DqpsJObH3nBjuxBWQw%40mail.gmail.com.


--
TAMURA Kent
Software Engineer, Google


Reply all
Reply to author
Forward
0 new messages