-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: runtime deprecate process.binding() #48568
Conversation
Review requested:
|
cc808bc
to
3d721f7
Compare
process.emitWarning( | ||
`Access to process.binding('${module}') is deprecated.`, | ||
'DeprecationWarning', | ||
'DEP0111'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this do the opposite of runtime deprecating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was emitting a warning whenever a runtime deprecated module is called with process.binding. Example, process.binding('async_wrap'). Now, all the modules are deprecated, so I removed them in favor of:
process.binding = deprecate(process.binding,
'process.binding() is deprecated. ' +
'Please use public APIs instead.', 'DEP0111');
Otherwise, users were going to see two warning deprecations for the same operation.
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
3d721f7
to
a2b9fec
Compare
I think a less disruptive approach to deprecate
Simply deprecating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
To assess ecosystem impact, we could change it from warning to throwing an error and run CITGM. |
So practically speaking, your suggestion is to keep doing what @jasnell was doing on #37576 and subsequent PRs? My initial thought was to leverage that the next major release is a non-lts version and it's likely the best way to assess the real impact of that feature. If that proves not worth it, we can revert to Node.js 22 -- I know that that's far from ideal and can lead us to some non-great feedback from the community, but I feel that's the only way to really see the impact and plan what to do next.
Agree. Regardless if we're going to pursue this work or not, it's good to have a big picture. I'll run it right after fixing the test issues. |
CITGM: https://ci.nodejs.org/job/citgm-smoker/3179/ (rebased on main) |
FWIW, I'm fine with the more disruptive approach on this. It's been long enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@RafaelGSS can you please rebase? |
Closing in favor of #50687 |
Following up @jasnell work on runtime deprecation of some modules. This pr deprecates the process.binding entirely, targetting Node.js 21 (non-LTS version).
I'm opening this PR just to see how feasible/impactful is this approach. I wonder if #37485 (review) is still an issue.
cc: @nodejs/tsc