1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

docs: update Deno.* deprecation notices (#21283)

This PR updates the deprecation notices to point to the same replacement
APIs that the Standard Library points to. I've also tweaked the notices
to be a little more presentable/navigatable.

In particular, a follow-up PR in std will be made that documents the use
of `toArrayBuffer()`.

Closes #21193
Towards #20976
This commit is contained in:
Asher Gomez 2023-11-22 13:20:27 +11:00 committed by GitHub
parent 0747aef990
commit cc5d6df50b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1786,10 +1786,8 @@ declare namespace Deno {
* an error occurs. It resolves to the number of bytes copied or rejects with * an error occurs. It resolves to the number of bytes copied or rejects with
* the first error encountered while copying. * the first error encountered while copying.
* *
* @deprecated Use * @deprecated Use {@linkcode ReadableStream.pipeTo} instead.
* [`copy`](https://deno.land/std/streams/copy.ts?s=copy) from * {@linkcode Deno.copy} will be removed in the future.
* [`std/streams/copy.ts`](https://deno.land/std/streams/copy.ts)
* instead. `Deno.copy` will be removed in the future.
* *
* @category I/O * @category I/O
* *
@ -1806,11 +1804,8 @@ declare namespace Deno {
/** /**
* Turns a Reader, `r`, into an async iterator. * Turns a Reader, `r`, into an async iterator.
* *
* @deprecated Use * @deprecated Use {@linkcode ReadableStream} instead. {@linkcode Deno.iter}
* [`iterateReader`](https://deno.land/std/streams/iterate_reader.ts?s=iterateReader) * will be removed in the future.
* from
* [`std/streams/iterate_reader.ts`](https://deno.land/std/streams/iterate_reader.ts)
* instead. `Deno.iter` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -1822,11 +1817,8 @@ declare namespace Deno {
/** /**
* Turns a ReaderSync, `r`, into an iterator. * Turns a ReaderSync, `r`, into an iterator.
* *
* @deprecated Use * @deprecated Use {@linkcode ReadableStream} instead.
* [`iterateReaderSync`](https://deno.land/std/streams/iterate_reader.ts?s=iterateReaderSync) * {@linkcode Deno.iterSync} will be removed in the future.
* from
* [`std/streams/iterate_reader.ts`](https://deno.land/std/streams/iterate_reader.ts)
* instead. `Deno.iterSync` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -2497,8 +2489,9 @@ declare namespace Deno {
/** /**
* The Deno abstraction for reading and writing files. * The Deno abstraction for reading and writing files.
* *
* @deprecated Use {@linkcode Deno.FsFile} instead. `Deno.File` will be * @deprecated Use {@linkcode Deno.FsFile} instead. {@linkcode Deno.File}
* removed in the future. * will be removed in the future.
*
* @category File System * @category File System
*/ */
export const File: typeof FsFile; export const File: typeof FsFile;
@ -2691,9 +2684,9 @@ declare namespace Deno {
/** /**
* A variable-sized buffer of bytes with `read()` and `write()` methods. * A variable-sized buffer of bytes with `read()` and `write()` methods.
* *
* @deprecated Use [`Buffer`](https://deno.land/std/io/buffer.ts?s=Buffer) * @deprecated Use the
* from [`std/io/buffer.ts`](https://deno.land/std/io/buffer.ts) instead. * [Web Streams API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Streams_API}
* `Deno.Buffer` will be removed in the future. * instead. {@linkcode Deno.Buffer} will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -2767,10 +2760,9 @@ declare namespace Deno {
* Read Reader `r` until EOF (`null`) and resolve to the content as * Read Reader `r` until EOF (`null`) and resolve to the content as
* Uint8Array`. * Uint8Array`.
* *
* @deprecated Use * @deprecated Use {@linkcode ReadableStream} and
* [`readAll`](https://deno.land/std/streams/read_all.ts?s=readAll) from * [`toArrayBuffer()`](https://deno.land/std/streams/to_array_buffer.ts?s=toArrayBuffer)
* [`std/streams/read_all.ts`](https://deno.land/std/streams/read_all.ts) * instead. {@linkcode Deno.readAll} will be removed in the future.
* instead. `Deno.readAll` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -2780,11 +2772,9 @@ declare namespace Deno {
* Synchronously reads Reader `r` until EOF (`null`) and returns the content * Synchronously reads Reader `r` until EOF (`null`) and returns the content
* as `Uint8Array`. * as `Uint8Array`.
* *
* @deprecated Use * @deprecated Use {@linkcode ReadableStream} and
* [`readAllSync`](https://deno.land/std/streams/read_all.ts?s=readAllSync) * [`toArrayBuffer()`](https://deno.land/std/streams/to_array_buffer.ts?s=toArrayBuffer)
* from * instead. {@linkcode Deno.readAllSync} will be removed in the future.
* [`std/streams/read_all.ts`](https://deno.land/std/streams/read_all.ts)
* instead. `Deno.readAllSync` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -2793,10 +2783,9 @@ declare namespace Deno {
/** /**
* Write all the content of the array buffer (`arr`) to the writer (`w`). * Write all the content of the array buffer (`arr`) to the writer (`w`).
* *
* @deprecated Use * @deprecated Use {@linkcode WritableStream}, {@linkcode ReadableStream.from}
* [`writeAll`](https://deno.land/std/streams/write_all.ts?s=writeAll) from * and {@linkcode ReadableStream.pipeTo} instead. {@linkcode Deno.writeAll}
* [`std/streams/write_all.ts`](https://deno.land/std/streams/write_all.ts) * will be removed in the future.
* instead. `Deno.writeAll` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */
@ -2806,11 +2795,9 @@ declare namespace Deno {
* Synchronously write all the content of the array buffer (`arr`) to the * Synchronously write all the content of the array buffer (`arr`) to the
* writer (`w`). * writer (`w`).
* *
* @deprecated Use * @deprecated Use {@linkcode WritableStream}, {@linkcode ReadableStream.from}
* [`writeAllSync`](https://deno.land/std/streams/write_all.ts?s=writeAllSync) * and {@linkcode ReadableStream.pipeTo} instead.
* from * {@linkcode Deno.writeAllSync} will be removed in the future.
* [`std/streams/write_all.ts`](https://deno.land/std/streams/write_all.ts)
* instead. `Deno.writeAllSync` will be removed in the future.
* *
* @category I/O * @category I/O
*/ */