- From: Dan Clark <notifications@github.com>
- Date: Tue, 07 Jul 2026 14:18:13 -0700
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/1236/4909101302@github.com>
dandclark left a comment (w3ctag/design-reviews#1236) Thanks for filing this. We did see a few other places where something like this API could be useful. - [WebSerial's SerialPort](https://wicg.github.io/serial/#dom-serialport) has a property returning `ReadableStream?`. Examples in the spec even show that being piped through a `TextDecoderStream`. So a `readableTextStream` property directly returning the decoded stream could make sense there. - [WebTransport](https://w3c.github.io/webtransport/#web-transport) also has [examples](https://w3c.github.io/webtransport/#example-sending-stream) using `TextDecoderStream`. A similar method could be useful there as well. - We [agree](https://github.com/whatwg/fetch/issues/1861#issuecomment-3361177425) that isn't needed for [PushMessageData](https://w3c.github.io/push-api/#pushmessagedata-interface). There might be an argument from [consistency](https://w3ctag.github.io/design-principles/#consistency) that it should be added there, but `PushMessageData` doesn't have a `stream()` method either, and one can just do `pushMessageData.blob().textStream()` getting essentially the same ergonomics. But thinking more holistically, is there any reason to not just add this convenience to `ReadableStream` itself? Then instead of peppering utility methods throughout APIs like WebSerial, instead you'd just have `serialPort.readable?.asText()` etc. (Regardless of whether this is done though we think `textStream()` still makes sense on `Blob` and `Body` as an additional shortcut). -- Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/1236#issuecomment-4909101302 You are receiving this because you are subscribed to this thread. Message ID: <w3ctag/design-reviews/issues/1236/4909101302@github.com>
Received on Tuesday, 7 July 2026 21:18:18 UTC