doc: documentation deprecation of process.binding#22004
doc: documentation deprecation of process.binding#22004jasnell wants to merge 4 commits intonodejs:masterfrom
Conversation
This is the first step in a long process of deprecating `process.binding()` and replacing it with `internalBinding()`. Eventually, once we have replaced internal uses of `process.binding()` with `internalBinding()`, we can escalate to a runtime deprecation and eventual end-of-life.
| Type: Documentation-only | ||
|
|
||
| The `process.binding()` API is intended for use strictly by Node.js internal | ||
| code to provide a bridge between Node.js' JavaScript and native code layer. |
There was a problem hiding this comment.
It might be best to avoid the possessive by removing a couple words so it becomes: bridge between JavaScript and native code.
There was a problem hiding this comment.
Even better perhaps is remove everything after code from this sentence. You don't have to explain what the function does. That's superfluous information in this case.
|
|
||
| The `process.binding()` API is intended for use strictly by Node.js internal | ||
| code to provide a bridge between Node.js' JavaScript and native code layer. | ||
| Use of `process.binding()` by user-land code is unsupported. |
There was a problem hiding this comment.
AFAIK, we use userland everywhere and user-land nowhere, so let's stick with userland.
|
|
||
| Type: Documentation-only | ||
|
|
||
| The `process.binding()` API is intended for use strictly by Node.js internal |
There was a problem hiding this comment.
It's unnecessary. It's also imprecise. "only" would be more precise.
There was a problem hiding this comment.
So maybe this?:
process.binding()is intended for use by Node.js internal code only.
|
Putting all my nits together (and one or two that I didn't leave), the wording might be simplified to:
...or (adding one word more):
|
There was a problem hiding this comment.
We needed this for a long time.
Technically, it was never part of a documented public API afaik so we could just move to runtime deprecation, but given that the usage (of certain modules) was widespread, it seems to be a good decision to doc-deprecate it first.
|
@jasnell Perhaps DEP0103 text should be updated (in the «should be avoided» part) to mention this deprecation? |
|
I'd be great to make some things, like |
|
@jdalton can you please open an issue on how you use process.bindings(‘config’), and what would you need to have as a public API? Thanks! |
|
Will land this on Monday if there are no objections by then. |
|
|
||
| Type: Documentation-only | ||
|
|
||
| The `process.binding()` API is intended for use by Node.js internal only |
There was a problem hiding this comment.
by Node.js internal only code -> by Node.js internal code only or only by Node.js internal code.
|
What about DEP0103? |
|
Ah, right, yeah I'll update the description for that |
This is the first step in a long process of deprecating `process.binding()` and replacing it with `internalBinding()`. Eventually, once we have replaced internal uses of `process.binding()` with `internalBinding()`, we can escalate to a runtime deprecation and eventual end-of-life. PR-URL: #22004 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
|
Landed in 182051b |
|
@jasnell Is it supposed to include the deprecation codes as |
|
The deprecation number should be assigned when the PR is landed. |
|
Doh... Missed the step in landing. I used to have that in my local checks but I got rid of those when switching to node-core-util. Completely forgot about it. Will do a fixup pr |
|
It would be helpful if node-core-util could handle it :) |
|
Fixup here: #22062 |
This is the first step in a long process of deprecating `process.binding()` and replacing it with `internalBinding()`. Eventually, once we have replaced internal uses of `process.binding()` with `internalBinding()`, we can escalate to a runtime deprecation and eventual end-of-life. PR-URL: #22004 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is the first step in a long process of deprecating
process.binding()and replacing it withinternalBinding().Eventually, once we have replaced internal uses of
process.binding()withinternalBinding(), we can escalateto a runtime deprecation and eventual end-of-life.
/cc @nodejs/tsc @nodejs/security-wg
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes