From e79cd356c4a8e28b67a599347112e971fa6fb2b7 Mon Sep 17 00:00:00 2001 From: Ragib MRB Date: Mon, 16 Nov 2026 16:59:00 +0530 Subject: [PATCH] docs: drop removed Deno 1 APIs from the architecture page and FFI note --- api/deno/index.md | 2 +- runtime/contributing/architecture.md | 44 +++++----------------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/api/deno/index.md b/api/deno/index.md index e3557127a..1112b2ffa 100644 --- a/api/deno/index.md +++ b/api/deno/index.md @@ -553,7 +553,7 @@ const result = dylib.symbols.add(35, 34); // 69 console.log(`Result from external addition of 35 and 34: ${result}`); ``` -Run with `--allow-ffi` and `--unstable` flag: +Run with the `--allow-ffi` flag: ```sh deno run --allow-ffi ffi.ts diff --git a/runtime/contributing/architecture.md b/runtime/contributing/architecture.md index f50b7b0fc..e28b2f062 100644 --- a/runtime/contributing/architecture.md +++ b/runtime/contributing/architecture.md @@ -1,5 +1,5 @@ --- -last_modified: 2025-03-10 +last_modified: 2026-11-16 title: "Architecture Overview" description: "Deep dive into Deno's internal architecture, explaining core components like the runtime, compiler, and security sandbox. Learn how Deno processes requests and executes JavaScript/TypeScript code." oldUrl: /runtime/manual/references/contributing/architecture/ @@ -14,46 +14,18 @@ oldUrl: /runtime/manual/references/contributing/architecture/ | File descriptors (fd) | [Resource ids (rid)](#resources) | | Scheduler | Tokio | | Userland: libc++ / glib / boost | https://jsr.io/@std | -| /proc/\$\$/stat | [Deno.metrics()](#metrics) | | man pages | deno types / https://docs.deno.com | ### Resources Resources (AKA `rid`) are Deno's version of file descriptors. They are integer -values used to refer to open files, sockets, and other concepts. For testing it -would be good to be able to query the system for how many open resources there -are. - -```ts -console.log(Deno.resources()); -// { 0: "stdin", 1: "stdout", 2: "stderr" } -Deno.close(0); -console.log(Deno.resources()); -// { 1: "stdout", 2: "stderr" } -``` - -### Metrics - -Metrics is Deno's internal counter for various statistics. - -```shell -> console.table(Deno.metrics()) -┌─────────────────────────┬───────────┐ -│ (idx) │ Values │ -├─────────────────────────┼───────────┤ -│ opsDispatched │ 9 │ -│ opsDispatchedSync │ 0 │ -│ opsDispatchedAsync │ 0 │ -│ opsDispatchedAsyncUnref │ 0 │ -│ opsCompleted │ 9 │ -│ opsCompletedSync │ 0 │ -│ opsCompletedAsync │ 0 │ -│ opsCompletedAsyncUnref │ 0 │ -│ bytesSentControl │ 504 │ -│ bytesSentData │ 0 │ -│ bytesReceived │ 856 │ -└─────────────────────────┴───────────┘ -``` +values used internally to refer to open files, sockets, and other concepts. +Since Deno 2, they are no longer exposed through public APIs: close a resource +with the `.close()` method on the object that owns it, such as a +[`Deno.FsFile`](/api/deno/~/Deno.FsFile). To check that tests don't leave +resources open, use the +[resource sanitizer](/runtime/test/sanitizers/#resource-sanitizer) of +`deno test`. ## Conference