Skip to content

doc: document TransformStream transformer.cancel option#62566

Open
TomStrepsil wants to merge 5 commits intonodejs:mainfrom
TomStrepsil:doc-transformstream-cancel
Open

doc: document TransformStream transformer.cancel option#62566
TomStrepsil wants to merge 5 commits intonodejs:mainfrom
TomStrepsil:doc-transformstream-cancel

Conversation

@TomStrepsil
Copy link
Copy Markdown

Add documentation for the cancel option of the TransformStream transformer, which allows users to specify a callback that will be called when the stream is canceled.

See: https://streams.spec.whatwg.org/#transformer-api

Fixes: #62540

Add documentation for the `cancel` option of the `TransformStream`
transformer, which allows users to specify a callback that will be
called when the stream is canceled.
See: https://streams.spec.whatwg.org/#transformer-api

Fixes: nodejs#62540
Copilot AI review requested due to automatic review settings April 2, 2026 18:39
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing documentation for the TransformStream transformer’s cancel callback, aligning Node’s Web Streams docs with the WHATWG Streams standard and addressing #62540.

Changes:

  • Document the transformer.cancel option for new TransformStream().
  • Describe the callback’s invocation timing (readable-side cancellation), its reason parameter, and return value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Update to the documentation to confirm that 6.2.3 of
the standard states:
"A function called when the readable side is cancelled,
or when the writable side is aborted."
Copy link
Copy Markdown
Member

@Renegade334 Renegade334 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TYVM!

@Renegade334 Renegade334 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web Streams API TransformStream "transformer" is missing the "cancel" method from the WHATWG streams standard

4 participants