Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua committed Feb 6, 2024
1 parent 14ec201 commit 882ab0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/static/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
},
{
"code": "no-deprecated-deno-api",
"docs": "Warns the usage of the deprecated Deno APIs\n\nThe following APIs in the `Deno` namespace are now marked as deprecated and will\nbe removed from the namespace in Deno 2.0.\n\n**IO APIs**\n\n- `Deno.Buffer`\n- `Deno.copy`\n- `Deno.iter`\n- `Deno.iterSync`\n- `Deno.readAll`\n- `Deno.readAllSync`\n- `Deno.writeAll`\n- `Deno.writeAllSync`\n\nMost of these APIs have been moved to [`std/io`](https://deno.land/std/io) of\nthe Deno Standard Library. For more detail, see\n[the tracking issue](https://github.com/denoland/deno/issues/9795).\n\n**Sub Process API**\n\n- `Deno.run`\n\n`Deno.run` was deprecated in favor of `Deno.Command`. See\n[deno#9435](https://github.com/denoland/deno/discussions/9435) for more details.\n\n**Custom Inspector API**\n\n- `Deno.customInspect`\n\n`Deno.customInspect` was deprecated in favor of\n`Symbol.for(\"Deno.customInspect\")`. Replace the usages with this symbol\nexpression. See [deno#9294](https://github.com/denoland/deno/issues/9294) for\nmore details.\n\n**File system API**\n\n- `Deno.File`\n\n`Deno.File` was deprecated in favor of `Deno.FsFile`. Replace the usages with\nnew class name.\n\n### Invalid:\n\n```typescript\n// buffer\nconst a = new Deno.Buffer();\n\n// read all\nconst b = await Deno.readAll(reader);\nconst c = Deno.readAllSync(reader);\n\n// write all\nawait Deno.writeAll(writer, data);\nDeno.writeAllSync(writer, data);\n\n// iter\nfor await (const x of Deno.iter(xs)) {}\nfor (const y of Deno.iterSync(ys)) {}\n\n// copy\nawait Deno.copy(reader, writer);\n\n// custom inspector\nclass A {\n [Deno.customInspect]() {\n return \"This is A\";\n }\n}\n\n// file\nfunction foo(file: Deno.File) {\n // ...\n}\n```\n\n### Valid:\n\n```typescript\n// buffer\nimport { Buffer } from \"https://deno.land/std/io/buffer.ts\";\nconst a = new Buffer();\n\n// read all\nimport { readAll, readAllSync } from \"https://deno.land/std/io/read_all.ts\";\nconst b = await readAll(reader);\nconst c = readAllSync(reader);\n\n// write all\nimport { writeAll, writeAllSync } from \"https://deno.land/std/io/write_all.ts\";\nawait writeAll(writer, data);\nwriteAllSync(writer, data);\n\n// iter\n// reader is `ReadableStream`\nfor await (const chunk of reader) {\n // do something\n}\n\n// copy\n// reader is `ReadableStream` and writer is `WritableStream`\nawait reader.pipeTo(writer);\n\n// custom inspector\nclass A {\n [Symbol.for(\"Deno.customInspect\")]() {\n return \"This is A\";\n }\n}\n\n// file\nfunction foo(file: Deno.FsFile) {\n // ...\n}\n```\n\n- `Deno.isatty`\n\n`Deno.isatty` was deprecated in favor of `Deno.stdin.isTerminal()`,\n`Deno.stdout.isTerminal()` and `Deno.stderr.isTerminal()`.\n\n### Invalid:\n\n```typescript\nDeno.isatty(Deno.stdin.rid);\nDeno.isatty(Deno.stdout.rid);\nDeno.isatty(Deno.stderr.rid);\n```\n\n### Valid:\n\n```typescript\nDeno.stdin.isTerminal();\nDeno.stdout.isTerminal();\nDeno.stderr.isTerminal();\n```\n\n- `Deno.close`\n\n`Deno.close` was deprecated in favor of `.close()` method available on relevant\nobjects.\n\n### Invalid:\n\n```typescript\nconst file = await Deno.open(\"foo.txt\");\nDeno.close(file.rid);\n```\n\n### Valid:\n\n```typescript\nconst file = await Deno.open(\"foo.txt\");\nfile.close();\n```\n\n- `Deno.resources()`\n\nDeno.resources() was deprecated. There are no replacements for this API.\n\n- `Deno.metrics()`\n\nDeno.metrics() was deprecated. There are no replacements for this API.\n\n**HTTP server API**\n\n- `Deno.serveHttp`\n\n`Deno.serveHttp` was deprecated in favor of `Deno.serve`.\n",
"docs": "Warns the usage of the deprecated - Deno APIs\n\nThe following APIs will be removed from the `Deno.*` namespace but have newer\nAPIs to migrate to. See the\n[Deno 1.x to 2.x Migration Guide](https://docs.deno.com/runtime/manual/advanced/migrate_deprecations)\nfor migration instructions.\n\n- `Deno.Buffer`\n- `Deno.Closer`\n- `Deno.close()`\n- `Deno.Conn.rid`\n- `Deno.copy()`\n- `Deno.customInspect`\n- `Deno.File`\n- `Deno.fstatSync()`\n- `Deno.fstat()`\n- `Deno.FsWatcher.rid`\n- `Deno.ftruncateSync()`\n- `Deno.ftruncate()`\n- `Deno.futimeSync()`\n- `Deno.futime()`\n- `Deno.isatty()`\n- `Deno.Listener.rid`\n- `Deno.ListenTlsOptions.certFile`\n- `Deno.ListenTlsOptions.keyFile`\n- `Deno.readAllSync()`\n- `Deno.readAll()`\n- `Deno.Reader`\n- `Deno.ReaderSync`\n- `Deno.readSync()`\n- `Deno.read()`\n- `Deno.run()`\n- `Deno.seekSync()`\n- `Deno.seek()`\n- `Deno.serveHttp()`\n- `Deno.Server`\n- `Deno.shutdown`\n- `Deno.stderr.rid`\n- `Deno.stdin.rid`\n- `Deno.stdout.rid`\n- `Deno.TlsConn.rid`\n- `Deno.UnixConn.rid`\n- `Deno.writeAllSync()`\n- `Deno.writeAll()`\n- `Deno.Writer`\n- `Deno.WriterSync`\n- `Deno.writeSync()`\n- `Deno.write()`\n- `new Deno.FsFile()`\n\nThe following APIs will be removed from the `Deno.*` namespace without\nreplacement.\n\n- `Deno.resources()`\n- `Deno.metrics()`\n",
"tags": [
"recommended"
]
Expand Down

0 comments on commit 882ab0f

Please sign in to comment.