The Streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. We will expose the ReadableStreamDefaultController interface on the global object, as with the other ReadableStream-related classes. This will align Blink with the current version of the Streams API Standard and consensus among the developer community. See https://github.com/whatwg/streams/issues/963.

Motivation

WebIDL does not permit a type to have a constructor while not being exposed on the global object, according to https://heycam.github.io/webidl/#NoInterfaceObject. Hence, the feature is essentially to expose ReadableStreamDefaultController on the global object. What is looks like is that evaluating 'ReadableStreamDefaultController' in window goes from false to true. Exposing this symbol does not expose any new functionality, and hence developers are not really affected in any way. Currently, developers need to write: new ReadableStream({start(controller) { self.ReadableStreamDefaultController = controller.constructor; }}); to call the ReadableStreamDefaultController constructor. However, most do not use this anyway, except for in web platform tests, or if they want to wrap the methods for debugging purposes for example. By exposing the interface globally, there is no need to explicitly write this one line of Javascript code anymore.

Specification

Specification link


Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form

Status in Chromium

Blink>Network>StreamsAPI


Enabled by default (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No signal
  • No signal
  • No signal
  • No signals

Owners

Last updated on 2021-04-09