question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

suggestion: deprecate `readableStreamFromReader` and point to better alternatives

See original GitHub issue

Is your feature request related to a problem? Please describe.

Before I begin my rambling: I created this issue to start a discussion, not sure if this makes any sense at all.

Deno has been continuously moving away from using Deno.reader and (afaik) it is essentially replaced/supplemented in every part of the deno api with a ReadableStream<Uint8Array>. We should continue to push people away from using Deno.reader by deprecating and eventually removing readableStreamFromReader from the std.

To make sure I wasn’t completely insane, I did a quick GitHub search and found that almost every use of readableStreamFromReader was for reading files (which supports ReadableStream<Uint8Array>) and reading stdin/stderr (which also supports ReadableStream<Uint8Array>). We should be pushing people away from using these for those use cases.

The only thing that makes me hesitate a little bit is found in the optional options (autoClose, etc)

Describe the solution you’d like

We deprecate and eventually remove readableStreamFromReader

Describe alternatives you’ve considered

Because of the options, there may be an argument to keep it.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:3
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
crowlKatscommented, Dec 21, 2022

There also is #1986

2reactions
crowlKatscommented, Dec 19, 2022

readableStreamFromReader & its opposite, + the equivalents for writable streams should be deprecated imo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · denoland/deno_std - GitHub
suggestion : deprecate readableStreamFromReader and point to better alternatives. #3018 opened last week by lino-levan.
Read more >
Denoland Deno_std Statistics & Issues - Codesti
Issue Title State Comments Created Date Updated D... `http/server_test.ts` fails with the canary open 1 2022‑12‑21 2022‑12‑15 std/fs: Use original Error class for `walk` errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found