Skip to content
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

suggestion: re-consider the deprecation of some IO-related APIs #4120

Closed
iuioiua opened this issue Jan 5, 2024 · 6 comments · Fixed by #4128
Closed

suggestion: re-consider the deprecation of some IO-related APIs #4120

iuioiua opened this issue Jan 5, 2024 · 6 comments · Fixed by #4128

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Jan 5, 2024

std/io is being deprecated because the Deno.Reader interface and friends are being deprecated from the runtime. However, their read(), write(), and other methods on I/O-related APIs, such as Deno.FsFile and Deno.Conn, are here to stay. These methods staying around justify keeping some IO-related APIs within the Standard Library instead of deprecating them.

To keep the Standard Library and its maintenance lean, I suggest we keep APIs that allow converting Readers and Writers to streams. This will need some more review, but, at first glance, I think we should un-deprecate:

  • readAll()
  • readableStreamFromReader()
  • writeAll()
  • writableStreamFromWriter()

CC @bartlomieju, @piscisaureus and @kt3k

@kt3k
Copy link
Member

kt3k commented Jan 8, 2024

This makes sense to me as Web Stream doesn't completely cover what Reader(Sync)/Writer(Sync)/Closer does.

@kt3k
Copy link
Member

kt3k commented Jan 8, 2024

@ry What do you think?

@iuioiua
Copy link
Contributor Author

iuioiua commented Jan 8, 2024

I've created #4128 to see what this could look like.

@bartlomieju
Copy link
Member

Discussed with the CLI team and everyone agrees that it makes sense to keep these APIs in deno_std.

@kt3k
Copy link
Member

kt3k commented Jan 12, 2024

I often saw people find BufReader BufWriter useful (I haven't used them though). Maybe those are also worth re-introduced?

@iuioiua
Copy link
Contributor Author

iuioiua commented Jan 12, 2024

I think there's an argument for Buffer, which, IIUC, is more general-purpose with read and write capabilities.

Doing so, I think, would cover all the most basic modalities for these I/O interfaces and methods (read, write, copy and store).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants