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.
Low risk because the Streams API spec has already been standardised for a long time (since around 2014).
This will move us in line with the standard behaviour for WebIDL-defined classes that are part of the web platform. See https://heycam.github.io/webidl/#NoInterfaceObject and https://heycam.github.io/webidl/#Exposed. This should reduce developer surprise.
Developers can use this feature immediately, as it does not change the behaviour of existing code. The feature can be polyfilled with one line of JavaScript: new ReadableStream({start(controller) {self.ReadableStreamDefaultController = controller.constructor; }});
No special support needed.
Hi Yoav,The feature is essentially just exposing the ReadableStreamDefaultController on the global object. This means that evaluating 'ReadableStreamDefaultController' in window goes from false to true. Exposing it does not expose any new functionality, so 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 maybe 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.
I've also added this information to the 'Motivation' section to the ChromeStatus entry, so hopefully that helps provide some more clarity/context. Thank you!
--
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/CACj%3DBEgYDW-TV-pFXhqxvsAVeJdDxmPMbziMND%3D6KtZg-373KA%40mail.gmail.com.
LGTM3
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqGnkzE9oUd6RH5%3DsLSGuDy0eYK5%2B2KjnPNiMfGO%3DUYDUg%40mail.gmail.com.