Skip to content

stream: expose ReadableStreamTee#64195

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
mcollina:expose-readable-stream-tee
Jul 5, 2026
Merged

stream: expose ReadableStreamTee#64195
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
mcollina:expose-readable-stream-tee

Conversation

@mcollina

Copy link
Copy Markdown
Member

Refs: nodejs/undici#5358

Expose ReadableStreamTee() so Fetch body clone can use cloneForBranch2.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Jun 29, 2026
@mcollina mcollina requested a review from KhafraDev June 29, 2026 10:47
@MattiasBuelens

Copy link
Copy Markdown
Contributor

I don't know if we should be exposing this as a top-level function. At the very least, we should mark ReadableStreamTee() as experimental and guide users towards readableStream.tee() for "common" use cases.

Ideally, we land on a solution in the Streams standard itself. The current proposal is to add an options bag to tee(), so you could write readableStream.tee({ clone: true }). Tracking issue: whatwg/streams#1156.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina force-pushed the expose-readable-stream-tee branch from 4430357 to fb6e605 Compare June 29, 2026 12:39
@KhafraDev

KhafraDev commented Jun 29, 2026

Copy link
Copy Markdown
Member

Ideally, we land on a solution in the Streams standard itself. The current proposal is to add an options bag to tee(), so you could write readableStream.tee({ clone: true }). Tracking issue: whatwg/streams#1156.

This would be great, but it doesn't look like browsers have any interest in implementing it, considering the issue is nearly 5 years old.

@mcollina

Copy link
Copy Markdown
Member Author

@KhafraDev @MattiasBuelens should we expose this verbatim or change the name to webStreams.tee(stream, opts)

@KhafraDev

Copy link
Copy Markdown
Member

ReadableStreamTee might be a little verbose. Honestly the only reason I didn't try implementing this myself was because I don't particularly like the verbose name, but didn't have any better ideas

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina added semver-minor PRs that contain new features and should be released in the next minor version. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed needs-ci PRs that need a full CI run. labels Jul 4, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 4, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64195
✔  Done loading data for nodejs/node/pull/64195
----------------------------------- PR info ------------------------------------
Title      stream: expose ReadableStreamTee (#64195)
Author     Matteo Collina <matteo.collina@gmail.com> (@mcollina)
Branch     mcollina:expose-readable-stream-tee -> nodejs:main
Labels     stream, semver-minor, commit-queue-squash
Commits    2
 - stream: expose ReadableStreamTee
 - doc: mark ReadableStreamTee as experimental
Committers 1
 - Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64195
Refs: https://github.com/nodejs/undici/issues/5358
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64195
Refs: https://github.com/nodejs/undici/issues/5358
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 29 Jun 2026 09:01:30 GMT
   ✔  Approvals: 2
   ✔  - Matthew Aitken (@KhafraDev): https://github.com/nodejs/node/pull/64195#pullrequestreview-4594006348
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/64195#pullrequestreview-4629919230
   ✔  Last GitHub CI successful
   ✘  No Jenkins CI runs detected
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/28718869468

@nodejs-github-bot nodejs-github-bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Jul 4, 2026
@KhafraDev KhafraDev added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jul 5, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 5, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 5, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 5, 2026
@nodejs-github-bot nodejs-github-bot merged commit 4d27d80 into nodejs:main Jul 5, 2026
90 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 4d27d80

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. semver-minor PRs that contain new features and should be released in the next minor version. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants