Open bnb opened 1 year ago
Even better, could this transformation be done automatically? There’s really only one reasonable thing to do when passing a WriteStream to something that expects a WritableStream.
We have some docs in https://nodejs.org/api/stream.html#streamwritabletowebstreamwritable
@MrJithil yes, that's the problem. It's only documented in one place, which is notably not the place you'd be looking for context on WebStreams.
going to add the https://github.com/nodejs/node/labels/good%20first%20issue label to this because it's a relatively minor change - about a paragraph or so - and doesn't need any domain specific knowledge. If any collaborators want to remove that because they disagree with me, feel free.
Hey, @bnb, I Just wanted to ask where the details about .toWeb
and .fromWeb()
will go? I'm assuming they go under Class: ReadableStream
, Class: WritableStream
and Class: TransformStream
each. Also, should it just be a small description like how it is here or will it be good to add some implementation to it? Thanks! (PS: if the above sounds good, please assign this issue to me)
@7suyash7 I'd probably either just at the top under the overview section or as you noted in each of those sections. Either is a valid approach IMO, though PR reviewers might disagree with me. I would recommend just having whatever is implemented as a note that links to the actual API docs for those methods, rather than having code examples. However if you also want to improve those API docs, that's of course welcome as well 😊
@bnb PTAL. Thanks!
Hey, @bnb! Kindly review this fix #50255 for issue #45381 Thanks!
Affected URL(s)
https://nodejs.org/api/webstreams.html
Description of the problem
currently, there's no indication on the webstreams docs that
.toWeb()
and.fromWeb()
exist. Noting that they exist somewhere on the webstreams docs would probably be a good idea. I just watched two very capable engineers spend longer than they should have figure out that these features existed while trying to usefetch
and streams because they weren't in the webstreams docs - if they're tripping over this, I very much imagine it will be something that comes up again for others.