Summary
The streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. A natural thing to do with a stream is to pass it to a web worker. This provides a fluent primitive for offloading work to another thread. Transferable streams add this capability by allowing ReadableStream, WritableStream, and TransformStream objects to be passed as arguments to postMessage().Link to “Intent to Prototype” blink-dev discussion
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/P97xJm1TFj4/PA0FKwLhBwAJRisks
Interoperability and Compatibility
Interoperability risk is low as the feature adds no new API surface, instead enhancing the existing postMessage() functionality to support transfer of streams. postMessage() will throw an exception in browsers where it is not implemented, making it easy to test for.
Gecko: No signal (https://github.com/mozilla/standards-positions/issues/430)
WebKit: No signal (https://www.mail-archive.com/webki...@lists.webkit.org/msg29629.html)
Web developers: Positive (https://github.com/whatwg/streams/pull/956#issuecomment-428540655) Most users of WebRTC Insertable Streams have also adopted transferable streams. I haven't been able to find any negative opinions.Ergonomics
This is always used with postMessage(). In the current iteration, objects read or written to the stream are always cloned. The overhead hasn't been observed to be a problem so far in practice.Activation
The feature is impossible to polyfill. However, feature detection is easy. Early-adopters may need to maintain two code paths.Security
Data can be passed between different render processes. This means the deserialisation code in particular needs to be written with care to account for the fact that the other render process may be compromised. Mostly we're using existing methods for this, so the incremental security risk is not too high.Debuggability
No specific debugging facility is required. Ordinary JavaScript debugging works as well as can be expected given the cross-realm nature of the feature.Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes. This feature is purely implemented in Blink and so cross-platform support is automatic.Is this feature fully tested by web-platform-tests?
Extensive web platform tests are under review at https://github.com/web-platform-tests/wpt/pull/24546.Tracking bug
https://crbug.com/894838Demo links
https://github.com/whatwg/streams/blob/master/transferable-streams-explainer.mdLink to entry on the Chrome Platform Status
https://chromestatus.com/feature/5298733486964736This 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/CAC_ixdyr9icisrjJiP7zja7MAGOjdCaY7GrVSvnpHBB0Vc_Y2A%40mail.gmail.com.
On Tue, Aug 18, 2020 at 11:32 AM Adam Rice <ri...@chromium.org> wrote:Gecko: No signal (https://github.com/mozilla/standards-positions/issues/430)
WebKit: No signal (https://www.mail-archive.com/webki...@lists.webkit.org/msg29629.html)Those requests are fairly recent. At the same time, since this is now part of a WHATWG spec, I'm assuming that there was multi-engine interest. Is that a correct assumption?
Aside: Would be good to highlight the bits directly related to transferable streams in the explainer. As is, it's hard for someone unfamiliar with Streams to understand the examples from the explainer alone.
It's unclear what's the feature detection story here.
Would the code examples work in browsers that haven't yet shipped transferable streams? (I'm guessing no, but want to confirm)
Can developers know that the feature is not supported?
Would they need to care in the future when transferable streams enable zero copy object transfers? (e.g. maybe transfer large objects only when no copy is involved)
Those requests are fairly recent. At the same time, since this is now part of a WHATWG spec, I'm assuming that there was multi-engine interest. Is that a correct assumption?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdzwik4bGjH8fo%3DnF28dCrxvJRYL69cxSCATf1K_m9tDvw%40mail.gmail.com.
This seems like an early review. Did a more thorough review happen?
Hi Adam, did you have a response on this question also? Thanks.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdzF2_XbPWYE1nqC6k05D1-XEQ1VVVgytKbdUaZayiZczQ%40mail.gmail.com.