Skip to content

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

Closed

Description

@iuioiua

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

Activity

  1. kt3k commented on Jan 8, 2024

    @kt3k
    Contributor

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

  2. kt3k commented on Jan 8, 2024

    @kt3k
    Contributor

    @ry What do you think?

  3. iuioiua commented on Jan 8, 2024

    @iuioiua
    ContributorAuthor

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

  4. bartlomieju commented on Jan 9, 2024

    @bartlomieju
    Member

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

  5. kt3k commented on Jan 12, 2024

    @kt3k
    Contributor

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

  6. iuioiua commented on Jan 12, 2024

    @iuioiua
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions