From 300eeb343efa00d9572d3befa47ca88fb51c7ac6 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Thu, 25 Jan 2024 06:09:49 +1100 Subject: feat: deprecate `Deno.{stdin,stdout,stderr}.rid` (#22073) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For removal in Deno v2. There are two issues: 1. Any script being run causes the output of `warnOnDeprecatedApi()` to be printed, even when none of the `rid` properties are called. 2. `.rid` of these classes is used in multiple tests. I'm not sure how to account for that. I thought of having `STDIN_RID`, and friends, constants, whose values can be shared between the tests and the classes themselves. Should we go with that or do something else? --------- Co-authored-by: Bartek IwaƄczuk --- cli/tsc/dts/lib.deno.ns.d.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'cli/tsc/dts/lib.deno.ns.d.ts') diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 743152442..1ac86db98 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -2727,8 +2727,13 @@ declare namespace Deno { * @category I/O */ export const stdin: Reader & ReaderSync & Closer & { - /** The resource ID assigned to `stdin`. This can be used with the discreet - * I/O functions in the `Deno` namespace. */ + /** + * The resource ID assigned to `stdin`. This can be used with the discreet + * I/O functions in the `Deno` namespace. + * + * @deprecated Use {@linkcode Deno.stdin} instance methods instead. + * {@linkcode Deno.stdin.rid} will be removed in Deno 2.0. + */ readonly rid: number; /** A readable stream interface to `stdin`. */ readonly readable: ReadableStream; @@ -2769,8 +2774,13 @@ declare namespace Deno { * @category I/O */ export const stdout: Writer & WriterSync & Closer & { - /** The resource ID assigned to `stdout`. This can be used with the discreet - * I/O functions in the `Deno` namespace. */ + /** + * The resource ID assigned to `stdout`. This can be used with the discreet + * I/O functions in the `Deno` namespace. + * + * @deprecated Use {@linkcode Deno.stdout} instance methods instead. + * {@linkcode Deno.stdout.rid} will be removed in Deno 2.0. + */ readonly rid: number; /** A writable stream interface to `stdout`. */ readonly writable: WritableStream; @@ -2797,8 +2807,13 @@ declare namespace Deno { * @category I/O */ export const stderr: Writer & WriterSync & Closer & { - /** The resource ID assigned to `stderr`. This can be used with the discreet - * I/O functions in the `Deno` namespace. */ + /** + * The resource ID assigned to `stderr`. This can be used with the discreet + * I/O functions in the `Deno` namespace. + * + * @deprecated Use {@linkcode Deno.stderr} instance methods instead. + * {@linkcode Deno.stderr.rid} will be removed in Deno 2.0. + */ readonly rid: number; /** A writable stream interface to `stderr`. */ readonly writable: WritableStream; -- cgit v1.2.3