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
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.