Uh oh!
There was an error while loading. Please reload this page.
stream: utility consumers for web and node.js streams - #39594
Conversation
Could a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
344dba7 to
d0efbc0Compare
This comment has been minimized.
This comment has been minimized.
targos
commented
Aug 4, 2021
What happens if the functions are called on object streams? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
jasnell
commented
Aug 6, 2021
For |
Signed-off-by: James M Snell <jasnell@gmail.com>
d0efbc0 to
ac912f5Comparejasnell
commented
Aug 6, 2021
Landed in c524107 |
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #39594 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #39594 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
I wished that I'm a bit biased towards Buffer in general cuz it isn't cross env friendly. and it's bloated with stuff TextEncoder and DataView is suppose to solve for you when working with typed arrays |
jimmywarting
commented
Aug 20, 2021
Would it be optimizable if arrayBuffer() had a totalLength option too? There would not be pkg like this otherwise that don't need to take up twice the size when it's time to concatinate: |
targos
commented
Oct 9, 2021
Like #39134, this needs a volunteer to backport to v16.x-staging. |
Mesteery
commented
Oct 9, 2021
I'm willing to take care of it. |
Mesteery
commented
Oct 9, 2021
Isn't it already good? |
targos
commented
Oct 9, 2021
@Mesteery you're right, sorry. It looks like the backport-requested label was added by mistake |
@mcollina@ronag ... here's an alternative approach to the Body mixin stuff. Rather than providing the Body mixin directly, these introduce utility functions that can be used by the ecosystem to provide those basic methods, at least in part.
For a very rudimentary example...
These work with
ReadableStream,stream.Readable, and async interables.There's likely a bit more error handling that could be added but I wanted to at least open the PR to give a basic idea.