Re: [w3ctag/design-reviews] CompressStream (#410)

> There is an example of some boilerplate code to compress an ArrayBuffer into a Uint8Array, I agree having that (probably as a static method on the class) would be convenient and prevent a lot of repetition.

I've filed https://github.com/ricea/compression-streams/issues/8 for this.

> If there are more than just compression cases (e.g. I can imagine stuff like streamed crypto) where you want to throw in non-stream data, feels like that mechanism could/should be provided as a infrastructure API.

I filed issues against the streams standard to discuss these APIs: https://github.com/whatwg/streams/issues/1018 and https://github.com/whatwg/streams/issues/1019. If we implemented these, the boilerplate would reduce to

```javascript
const output = await ReadableStream.from(input).pipeThrough(new CompressionStream('gzip')).arrayBuffer();
```

Although there's no reason why we can't do both.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/410#issuecomment-542045502

Received on Tuesday, 15 October 2019 05:38:47 UTC