-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation of readerFromStreamReader seems to have no direct replacement from Readable to Reader #4336
Comments
This is a valid use case for un-deprecating |
@iuioiua - Thanks for looking at this. However, this actually makes me wonder why the |
I was a bit puzzled by the deviation of As Deno 2.0 shifts towards web streams, it appears it will phase out Go-style buffers, suggesting a move away from utilities like Given no direct Web Streams equivalents, this raises questions about the migration path for these synchronous methods. It's unclear why a hybrid model allowing both If there's a misunderstanding on my part regarding the documentation or the migration strategy, please let me know. I'm eager to continue to stay up to date with Deno as it grows and evolves. Thanks, |
Interesting. I know a Deno started in go and has been influenced by go to varying degrees. I think most of the parts that show through in this regard are the good parts. It does still seem a bit odd that given the push to use JS web standards like the Streams API (a good thing imo), the underlying Deno primitives differ and don't seem to be compatible (e.g. Deno.Reader/Writer, stdlib Reader/Writer). As an end user of this, I don't feel like I should need to reach for a conversion function to adapt one to the other. I haven't tried going from Reader/Writer back to the Streams API, but don't recall seeing an inverse function from |
We once planned to deprecate and remove the entire Reader / Writer interfaces at some point in favor of Web Streams, but recently we think that the plan is not feasible regarding the ecosystem impact. Web Streams based APIs are still recommended way to perform most of I/O operations in Deno, but we don't remove existing read / write methods in Deno runtime, and utilities (including types, helper functions, etc) for them will be kept in |
Thanks for the explanation @kt3k!
Given the lead up and evolution of the
Agree. It seems required for some cases like the one raised in this issue. It would be nice if one didn't have to think about and/or know how to convert from one to another. I wonder how feasible it would be to have stdlib functions could be extended to also accept both the |
It's simpler to troubleshoot and use the corresponding function for a given type. |
Describe the bug
I'm unable to find a replacement for the deprecated
readerFromStreamReader
when trying to map a steams APIReadable
to a stdlibReader
Steps to Reproduce
Expected behavior
I should be able to go from an
Deno.FsFile
while using apipeThrough
to aReader
in order to use some of the stdlib APIs liketar
, etc.If there is a way to convert this without writing custom code, this should be documented. Otherwise we should re-consider deprecating
readerFromStreamReader
.Environment
The text was updated successfully, but these errors were encountered: