stream: deprecate legacy prependListener fallback#62435
stream: deprecate legacy prependListener fallback#62435karan-lrn wants to merge 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62435 +/- ##
========================================
Coverage 89.68% 89.69%
========================================
Files 676 678 +2
Lines 206738 207206 +468
Branches 39594 39726 +132
========================================
+ Hits 185414 185854 +440
+ Misses 13467 13447 -20
- Partials 7857 7905 +48
π New features to boost your workflow:
|
|
cc @nodejs/streams @mcollina @ronag This PR removes the legacy Since Node.js v6 has been EOL for over 8 years, this cleanup removes ~15 lines of unnecessary code and the associated tests that explicitly tested the fallback behavior. |
mcollina
left a comment
There was a problem hiding this comment.
It would be better to deprecate this first
73f182e to
dbb2a5f
Compare
|
Hey @mcollina The deprecation warning now fires when piping to an EventEmitter that lacks the Once this lands and goes through a few releases, we can remove the fallback code entirely. |
The prependListener method has been available on EventEmitter since Node.js v6.0.0 (April 2016). The internal fallback code that manually manipulates the _events object was intended for pre-v6 compatibility. This adds a runtime deprecation warning (DEP0205) when piping to an EventEmitter that lacks the prependListener method. The fallback behavior is preserved for now but will be removed in a future version. PR-URL: https://github.com/nodejs/node/pull/XXXXX Refs: https://github.com/nodejs/node/issues/XXXXX
dbb2a5f to
dea878a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Commit Queue failed- Loading data for nodejs/node/pull/62435 β Done loading data for nodejs/node/pull/62435 ----------------------------------- PR info ------------------------------------ Title stream: deprecate legacy prependListener fallback (#62435) Author Karan Mangtani <karanmangtani5@gmail.com> (@karan-lrn) Branch karan-lrn:stream-remove-prependlistener-hack -> nodejs:main Labels stream, semver-major, needs-ci Commits 1 - stream: deprecate piping to emitters without prependListener Committers 1 - Karan Mangtani <karan.mangtani@lrn.com> PR-URL: https://github.com/nodejs/node/pull/62435 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/62435 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> -------------------------------------------------------------------------------- βΉ This PR was created on Wed, 25 Mar 2026 20:25:37 GMT β Approvals: 3 β - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62435#pullrequestreview-4023940838 β - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/62435#pullrequestreview-4024660541 β - Mattias Buelens (@MattiasBuelens): https://github.com/nodejs/node/pull/62435#pullrequestreview-4025663529 β GitHub CI failed with status: FAILURE βΉ Last Full PR CI on 2026-03-28T22:58:04Z: https://ci.nodejs.org/job/node-test-pull-request/72172/ - Querying data for job/node-test-pull-request/72172/ β Build data downloaded - Querying failures of job/node-test-commit/86441/ β Data downloaded β 3 failure(s) on the last Jenkins CI run -------------------------------------------------------------------------------- β Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/23706198878 |
The prependListener method has been available on EventEmitter since Node.js v6.0.0 (April 2016). The fallback code that manipulated the internal _events object is no longer necessary.
This also removes tests that explicitly tested the fallback behavior.