Intent to Implement: TextEncoderStream and TextDecoderStream APIs

68 views
Skip to first unread message

Adam Rice

unread,
May 22, 2018, 5:57:07 AM5/22/18
to blink-dev
ri...@chromium.org, yhi...@chromium.org
Extensive discussion has taken place on the Encoding Standard repository: https://github.com/whatwg/encoding/issues/72
TAG review: https://github.com/w3ctag/design-reviews/issues/282 Integration of the Encoding Standard with the Stream Standard. This enables developers to easily convert streams of binary data to text and vice-versa. This is generally useful when working with streams of text, and fills a vital need when used with the Fetch API. Without these objects developers will be forced to roll their own. See the explainer for why this is problematic. Firefox: No public signals Edge: No public signals Safari: No public signals Web developers: No signals
Two new constructors will be added to the global object. This has been the conclusion of discussions on the Encoding Standard repository and has rough consensus from the participants there. The behaviour of the new objects is based on elements of the Encoding Standard and Stream Standard that are already stable, and so changes are unlikely to be required.

Very low. I am not aware of any existing use of these names in Javascript. None. Yes. https://bugs.chromium.org/p/chromium/issues/detail?id=845427 https://www.chromestatus.com/features/4881011259211776 No.

Yoav Weiss

unread,
May 24, 2018, 5:00:58 AM5/24/18
to Adam Rice, blink-dev
Happy to see this being worked on. This is a long-awaited feature, and can enable data reduction in multiple scenarios.

--
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_ixdx5m4gY61XXOvwDwvpxdHAXSCmznSe63PMPe2KhPHUrWA%40mail.gmail.com.

Harald Alvestrand

unread,
May 24, 2018, 9:24:13 AM5/24/18
to Yoav Weiss, Adam Rice, blink-dev
Sad to see the word "stream" used in yet another incompatible meaning, but the functionality seems extremely useful!


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEgAyng3uMYH9oWTvUc8wbxh0MFzqkTXbX9dtNrQt-VYdg%40mail.gmail.com.

Anne van Kesteren

unread,
May 24, 2018, 9:37:05 AM5/24/18
to Harald Alvestrand, Yoav Weiss, Adam Rice, blink-dev
On Thu, May 24, 2018 at 3:23 PM, 'Harald Alvestrand' via blink-dev
<blin...@chromium.org> wrote:
> Sad to see the word "stream" used in yet another incompatible meaning, but
> the functionality seems extremely useful!

Context?


--
https://annevankesteren.nl/

Harald Alvestrand

unread,
May 24, 2018, 9:43:09 AM5/24/18
to Anne van Kesteren, Yoav Weiss, Adam Rice, blink-dev
From explainer:

Non-goals

  • Unification of WHATWG Streams with the concept of a stream used in the Encoding Standard. Despite having the same name, they are different in functionality and purpose. Since the Encoding Standard's "stream" concept is just an internal piece of spec terminology, this has no impact on developers.

It's actually not clear from the explainer that the streams in this specification refer to WHATWG Streams. Adding a sentence saying that somewhere close to this paragraph would make it (even more) obvious.

Adam Rice

unread,
May 24, 2018, 10:28:49 AM5/24/18
to Harald Alvestrand, Anne van Kesteren, Yoav Weiss, blink-dev
Unification of WHATWG Streams with the concept of a stream used in the Encoding Standard. Despite having the same name, they are different in functionality and purpose. Since the Encoding Standard's "stream" concept is just an internal piece of spec terminology, this has no impact on developers.

We did discuss renaming the Encoding Standard's concept of a stream to something like "token sequence" to avoid this ambiguity, but it felt like a distraction from the more important work that needed doing.

It's actually not clear from the explainer that the streams in this specification refer to WHATWG Streams. Adding a sentence saying that somewhere close to this paragraph would make it (even more) obvious.

Thanks for the feedback. I will try to make it clearer.
 
Reply all
Reply to author
Forward
0 new messages