Re: [whatwg/encoding] Add Streams support (#72)

I'm sympathetic to the idea that users might be able to avoid cognitive overload by using the same construction method whether they want the standalone API or the transform stream.

But if so, I'd prefer we buy into that hypothesis wholeheartedly, and not add otherwise-unnecessary hooks to the transform stream in order to save users from themselves if they mix usages.

So I'd prefer one of:

- `new TextEncoder()` and if you mix usages weird things happen
  - Maybe we don't even prevent decode/encode usage based on locked status at all? They're just two totally separate APIs, which don't impact each other in the slightest, that live on the same object.
- `TextEncoder.stream()` and things are clearly separate

WDYT?

> From the point of view of the standard text, we need to somehow delegate to the TextDecoder constructor, passing on the arguments. It seems awkward.

I don't think so. We'd just use the underlying algorithms that the TextDecoder spec text currently uses, passing along the appropriate flags.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/72#issuecomment-368647722

Received on Monday, 26 February 2018 20:58:16 UTC