Skip to content

docs: document Deno.serve legacy request abort behavior#3386

Merged
bartlomieju merged 2 commits into
mainfrom
docs/unstable-no-legacy-abort
Jul 2, 2026
Merged

docs: document Deno.serve legacy request abort behavior#3386
bartlomieju merged 2 commits into
mainfrom
docs/unstable-no-legacy-abort

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Adds a dedicated reference page documenting the legacy request.signal
abort behavior in Deno.serve: why it fires on successful responses
today, why that breaks Node-style HTTP proxies (http-proxy,
http-proxy-middleware / Vite), and what the corrected behavior under
--unstable-no-legacy-abort looks like.

The most common reason people reach for the legacy abort is to know when
a response has been fully delivered. The page documents the intended
replacement, the completed promise on ServeHandlerInfo (the handler's
second argument), which resolves once the response (including a streaming
body) is sent and rejects if delivery fails partway.

The page is intentionally kept out of the sidebar. It is reachable only
from the --unstable-no-legacy-abort entry on the unstable flags
reference and from the docs.deno.com/go/unstable-no-legacy-abort short
link (added to go.json). A companion deno PR points the runtime
deprecation warning at that short link.

Refs denoland/deno#28850, denoland/deno#29111, denoland/deno#34397.

Adds a dedicated page explaining the legacy `request.signal` abort
behavior in `Deno.serve`, why it is changing, and how to detect request
completion via `info.completed` when opting in to
`--unstable-no-legacy-abort`.

The page is reachable from the unstable flags reference and via the
`docs.deno.com/go/unstable-no-legacy-abort` short link, which the Deno
runtime deprecation warning points to. It intentionally stays out of the
sidebar navigation.
@bartlomieju
bartlomieju merged commit 025da4a into main Jul 2, 2026
2 of 3 checks passed
bartlomieju added a commit to denoland/deno that referenced this pull request Jul 2, 2026
…35713)

The `Deno.serve` legacy request abort deprecation warning added in
#34397 pointed users at
https://docs.deno.com/runtime/reference/migrate-deprecations/,
a page that does not exist. This repoints it at the stable
`docs.deno.com/go/unstable-no-legacy-abort` short link.

That short link resolves to a new dedicated docs page
(denoland/docs#3386) that explains why the `request.signal`
abort behavior is changing, what `--unstable-no-legacy-abort` does,
and how to detect when a request has been fully delivered.

The warning now also names `info.completed` directly, since knowing when
a response has been fully sent is the most common reason people relied on
the legacy abort. That promise (on the handler's `ServeHandlerInfo`
argument) resolves once the response, including a streaming body, has been
delivered and rejects if delivery fails partway, which is the mode-independent
replacement for watching `request.signal`.

The existing warning tests still hold: the message continues to include
both `request.signal` and `--unstable-no-legacy-abort`.

Refs #28850, #29111, #34397.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant