docs: document Deno.serve legacy request abort behavior#3386
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a dedicated reference page documenting the legacy
request.signalabort behavior in
Deno.serve: why it fires on successful responsestoday, why that breaks Node-style HTTP proxies (http-proxy,
http-proxy-middleware / Vite), and what the corrected behavior under
--unstable-no-legacy-abortlooks 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
completedpromise onServeHandlerInfo(the handler'ssecond 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-abortentry on the unstable flagsreference and from the
docs.deno.com/go/unstable-no-legacy-abortshortlink (added to
go.json). A companion deno PR points the runtimedeprecation warning at that short link.
Refs denoland/deno#28850, denoland/deno#29111, denoland/deno#34397.