Skip to content

doc: documentation deprecation of process.binding - #22004

Closed
jasnell wants to merge 4 commits into
nodejs:masterfrom
jasnell:docs-deprecate-process-binding
Closed

doc: documentation deprecation of process.binding#22004
jasnell wants to merge 4 commits into
nodejs:masterfrom
jasnell:docs-deprecate-process-binding

Conversation

@jasnell

Copy link
Copy Markdown
Member

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.

/cc @nodejs/tsc @nodejs/security-wg

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

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.
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added deprecations Issues and PRs related to deprecations. doc Issues and PRs related to the documentations. labels Jul 27, 2018

@mcollinamcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@addaleaxaddaleax added the process Issues and PRs related to the process subsystem. label Jul 27, 2018
Comment threaddoc/api/deprecations.md Outdated
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.

@TrottTrottJul 27, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be best to avoid the possessive by removing a couple words so it becomes: bridge between JavaScript and native code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment threaddoc/api/deprecations.md Outdated

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, we use userland everywhere and user-land nowhere, so let's stick with userland.

Comment threaddoc/api/deprecations.md Outdated

Type: Documentation-only

The `process.binding()` API is intended for use strictly by Node.js internal

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove strictly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary. It's also imprecise. "only" would be more precise.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe this?:

process.binding() is intended for use by Node.js internal code only.

@Trott

Trott commented Jul 27, 2018

Copy link
Copy Markdown
Member

Putting all my nits together (and one or two that I didn't leave), the wording might be simplified to:

process.binding() is intended for use by Node.js internal code. Use in
userland code is unsupported.

...or (adding one word more):

process.binding() is intended for use by Node.js internal code only. Use in
userland code is unsupported.

@ChALkeRChALkeR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ChALkeR

ChALkeR commented Jul 27, 2018

Copy link
Copy Markdown
Member

@jasnell Perhaps DEP0103 text should be updated (in the «should be avoided» part) to mention this deprecation?

@jdalton

Copy link
Copy Markdown
Member

I'd be great to make some things, like process.binding('config'), accessible in a more user-friendly way. As we move thing along we should try to examine what folks have found handy (to cause them to reach for these internals) and try to fill the feature gap in a more polished way.

@mcollina

Copy link
Copy Markdown
Member

@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!

@targostargos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with @Trott comments addressed

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasnell

Copy link
Copy Markdown
MemberAuthor

@jasnell

Copy link
Copy Markdown
MemberAuthor

Will land this on Monday if there are no objections by then.

Trott
Trott previously requested changes Jul 29, 2018
Comment threaddoc/api/deprecations.md Outdated

Type: Documentation-only

The `process.binding()` API is intended for use by Node.js internal only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by Node.js internal only code -> by Node.js internal code only or only by Node.js internal code.

@Trott
Trott dismissed their stale reviewJuly 29, 2018 19:54

fixed the word ordering

@ChALkeR

Copy link
Copy Markdown
Member

What about DEP0103?

@jasnell

Copy link
Copy Markdown
MemberAuthor

Ah, right, yeah I'll update the description for that

@jasnell

Copy link
Copy Markdown
MemberAuthor

jasnell added a commit that referenced this pull request Aug 1, 2018
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>
@jasnell

Copy link
Copy Markdown
MemberAuthor

Landed in 182051b

@jasnelljasnell closed this Aug 1, 2018
@ChALkeR

Copy link
Copy Markdown
Member

@jasnell Is it supposed to include the deprecation codes as DEP00XX?
Are those assigned at the time of a release, or was that not deliberate?

@targos

Copy link
Copy Markdown
Member

The deprecation number should be assigned when the PR is landed.

@jasnell

Copy link
Copy Markdown
MemberAuthor

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

@ChALkeR

ChALkeR commented Aug 1, 2018

Copy link
Copy Markdown
Member

@targos@jasnell Apparently, that doesn't work :-/.

As the space of deprecation codes is pretty high, perhaps we could assign codes at PR open time instead and add a test for those? Would holes or out-of-order landing of deprecation codes hurt?

@jasnell

Copy link
Copy Markdown
MemberAuthor

It would be helpful if node-core-util could handle it :)

@jasnell

Copy link
Copy Markdown
MemberAuthor

Fixup here: #22062

@jdalton

Copy link
Copy Markdown
Member

@mcollina

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!

Opened #22064

@TrottTrott added the notable-change PRs with changes that should be highlighted in changelogs. label Aug 1, 2018
targos pushed a commit that referenced this pull request Aug 1, 2018
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>
@rvaggrvagg mentioned this pull request Aug 13, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecationsIssues and PRs related to deprecations.docIssues and PRs related to the documentations.notable-changePRs with changes that should be highlighted in changelogs.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

18 participants

@jasnell@nodejs-github-bot@Trott@ChALkeR@jdalton@mcollina@targos@bengl@addaleax@cjihrig@sagirk@tniessen@devsnek@gireeshpunathil@vdeturckheim@BridgeAR@mhdawson@vsemozhetbyt