Intent to Ship: TextEncoderStream and TextDecoderStream APIs

142 views
Skip to first unread message

Adam Rice

unread,
Sep 3, 2018, 10:21:19 PM9/3/18
to blink-dev
WHATWG Standard: https://encoding.spec.whatwg.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: Public support Edge: Public support Safari: No public signals Web developers: Supportive
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 Yes.

Yoav Weiss

unread,
Sep 4, 2018, 3:15:01 AM9/4/18
to Adam Rice, blink-dev
Thanks for making streamed text encoding/decoding possible! :)

On Tue, Sep 4, 2018 at 4:21 AM Adam Rice <ri...@chromium.org> wrote:
WHATWG Standard: https://encoding.spec.whatwg.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: Public support Edge: Public support Safari: No public signals Web developers: Supportive

Can you link to public support from Firefox and Edge? Have you tried to reach out to Safari/WebKit folks?
 

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

Looking at the "intent" template, I'm missing some sections here:
* Can you elaborate on the ergonomics and activation risks, if any?
* Debuggability - will this require specific support from dev tools?
* WPT - does this feature have a WPT test suite?

Yes.

--
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_ixdyh1-9Hqp%2Bq5BAQvGZgVUyuyr%3D_j6PwHOTPPnEFLXrXmw%40mail.gmail.com.

Adam Rice

unread,
Sep 4, 2018, 3:59:03 AM9/4/18
to Yoav Weiss, blink-dev
Can you link to public support from Firefox and Edge? Have you tried to reach out to Safari/WebKit folks?

Both from the PR to the encoding standard: https://github.com/whatwg/encoding/pull/149#issuecomment-412876950 and https://github.com/whatwg/encoding/pull/149#issuecomment-415103236. Strictly speaking it's support for the standard change rather than any kind of promise to implement.

I filed a WebKit issue at https://bugs.webkit.org/show_bug.cgi?id=189066. No response so far.

Looking at the "intent" template, I'm missing some sections here:

I copied it from the I2I, which I think I originally got from chromestatus.com. Sorry I missed some sections.



Ergonomics
This integrates with the Streams APIs, particularly the pipeThrough() method of ReadableStream. TextDecoderStream will be widely used to decode the body stream of a Fetch Response.

Default usage of the API will not cause problems for Chrome's performance.

Activation
Developers can immediately use the feature. A polyfill is available at https://github.com/GoogleChromeLabs/text-encode-transform-polyfill.

Debuggability
As a normal JS API, no special debugging support is needed.

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

Link to "Intent to Implement" blink-dev discussion

Yoav Weiss

unread,
Sep 4, 2018, 4:44:10 AM9/4/18
to Adam Rice, blink-dev
LGTM1

On Tue, Sep 4, 2018 at 9:59 AM Adam Rice <ri...@chromium.org> wrote:
Can you link to public support from Firefox and Edge? Have you tried to reach out to Safari/WebKit folks?

Both from the PR to the encoding standard: https://github.com/whatwg/encoding/pull/149#issuecomment-412876950 and https://github.com/whatwg/encoding/pull/149#issuecomment-415103236. Strictly speaking it's support for the standard change rather than any kind of promise to implement.

Thanks! No timelines, but it does seem like they are supportive of the feature.
 

I filed a WebKit issue at https://bugs.webkit.org/show_bug.cgi?id=189066. No response so far.

Looking at the "intent" template, I'm missing some sections here:

I copied it from the I2I, which I think I originally got from chromestatus.com. Sorry I missed some sections.

Seems like this is a common issue.

Chris Harrelson

unread,
Sep 4, 2018, 11:46:37 AM9/4/18
to Yoav Weiss, Adam Rice, blink-dev

Philip Jägenstedt

unread,
Sep 6, 2018, 11:26:44 AM9/6/18
to Chris Harrelson, Yoav Weiss, Adam Rice, blink-dev
Reply all
Reply to author
Forward
0 new messages