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

deprecation(streams): rework deprecations #4199

Closed
wants to merge 3 commits into from

Conversation

iuioiua
Copy link
Collaborator

@iuioiua iuioiua commented Jan 15, 2024

This change reworks std/streams deprecations for various reasons (see comments). I think it's reasonable to bring some of the removal versions forward because:

  1. Some of these APIs aren't heavily used.
  2. Their migrations aren't too involved.
  3. These APIs are still available through import version pinning.

@@ -35,7 +35,7 @@ export type { Reader, ReaderSync };
* }
* ```
*
* @deprecated (will be removed after 1.0.0) Use {@linkcode ReadableStream} instead.
* @deprecated (will be removed in 0.215.0) Use {@linkcode ReadableStream} instead.
*/
export async function* iterateReader(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reader is usually present alongside a ReadableStream, and therefor ReadableStreamDefaultReader.

@@ -20,7 +20,7 @@ import type { Reader } from "../io/types.ts";
* await copy(reader, file);
* ```
*
* @deprecated (will be removed after 1.0.0) Use {@linkcode ReadableStreamDefaultReader} directly.
* @deprecated (will be removed after 0.215.0) Use {@linkcode ReadableStreamDefaultReader} directly.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Streams API, when used with std/streams, has the same functionality as std/io. There shouldn't be a reason for someone to go from using streams to Reader/Writer interfaces.


/**
* Options for {@linkcode writableStreamFromWriter}.
*
* @deprecated (will be removed after 1.0.0) Use {@linkcode WritableStream} directly.
* @deprecated (will be removed in 0.215.0) Use
* {@linkcode https://deno.land/std/io/to_writable_stream.ts | toWritableStream}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply a correction of the deprecation notice + moving the version forward.

@iuioiua iuioiua marked this pull request as ready for review January 15, 2024 03:04
@iuioiua
Copy link
Collaborator Author

iuioiua commented Jan 15, 2024

I'll come back to this.

@iuioiua iuioiua closed this Jan 15, 2024
@iuioiua iuioiua deleted the rework-stream-deprecations branch January 15, 2024 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant