Re: [whatwg/streams] Allow other specifications to create readable byte streams (#1130)

Seems to work. There's a bit of boilerplate if you, like the Web Serial and Fetch specs, already have a byte sequence on hand. Then you need to branch as to whether there's a BYOB request (and, in the case of Fetch, whether the byte sequence fits). I considered adding a helper for this, which would put us back to "enqueue bytes given a byte sequence", but I think it's OK to be more explicit. In particular it's more obviously optimizable by reading the spec in question, instead of having to go to Streams.

Still, to leave open the door for such a helper in the future, I'll rename the operation from "enqueue bytes" to "enqueue view".

Any final reviews, of either this, https://github.com/WICG/serial/pull/137, or https://github.com/whatwg/fetch/pull/1246 would be appreciated. If there aren't any, I'll merge this tomorrow-ish.

-- 
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/streams/pull/1130#issuecomment-878494825

Received on Monday, 12 July 2021 18:22:47 UTC