GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — process: wrap process.binding for selective fallthrough to internalBinding by jasnell · Pull Request #22269 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Aug 11, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Selectively allow process.binding() to fall-through to internalBinding()

This adds a selective deprecation. We might want to make this a PendingDeprecationWarning instead of a regular DeprecationWarning.

Refs: #22163

/cc @addaleax

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ChALkeR and bricss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@jasnell
process: wrap process.binding for selective deprecation
b0ba27b
Selectively deprecate `process.binding()` and fallthrough

Refs: nodejs#22163
@nodejs-github-bot

nodejs-github-bot commented Aug 11, 2018

Copy link
Copy Markdown
Collaborator

@jasnell build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/520/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 11, 2018

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/16370/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell mentioned this pull request Aug 11, 2018
uv: move process.binding('uv') to internalBinding #22163
Closed
3 tasks done
devsnek
devsnek approved these changes Aug 11, 2018
View reviewed changes

@devsnek devsnek left a comment

Copy link
Copy Markdown
Member

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 with DeprecationWarning

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
addaleax
addaleax approved these changes Aug 11, 2018
View reviewed changes

@addaleax addaleax left a comment

Copy link
Copy Markdown
Member

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.

Nice, thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cjihrig
cjihrig approved these changes Aug 11, 2018
View reviewed changes
@devsnek

devsnek commented Aug 11, 2018

Copy link
Copy Markdown
Member

actually @jasnell can you switch this to use SafeSet from internal/safe_globals? it's currently possible to hack into internalBinding by overriding Set.prototype methods.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added semver-major PRs that contain breaking changes and should be released in the next major version. process Issues and PRs related to the process subsystem. labels Aug 12, 2018
@maclover7

maclover7 commented Aug 12, 2018

Copy link
Copy Markdown
Contributor

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1503

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

maclover7
maclover7 approved these changes Aug 12, 2018
View reviewed changes

@maclover7 maclover7 left a comment

Copy link
Copy Markdown
Contributor

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.

CITGM run has yargs looking okay, with docs added this looks good

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/internal/bootstrap/node.js Outdated
if (!internalBindingWarned.has(name)) {
process.emitWarning(
`Use of process.binding('${name}') is deprecated.`,
'DeprecationWarning', 'DEP0111');

@maclover7 maclover7 Aug 12, 2018

Copy link
Copy Markdown
Contributor

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.

Can you add docs in doc/api/deprecations.md

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@devsnek devsnek Aug 12, 2018

Copy link
Copy Markdown
Member

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.

also it should be DEP00XX

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Aug 12, 2018

Copy link
Copy Markdown
Member Author

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 is part of the existing DEP0111 process.binding deprecation. The documentation is already there. The odd but is that it's not a complete switch to a runtime deprecation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

devsnek and maclover7 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
devsnek
devsnek suggested changes Aug 12, 2018
View reviewed changes
Comment thread lib/internal/bootstrap/node.js Outdated
// Deprecated specific process.binding() modules, but not all, allow
// selective fallback to internalBinding for the deprecated ones.
const processBinding = process.binding;
const internalBindingWhitelist = new Set(['uv']);

@devsnek devsnek Aug 12, 2018

Copy link
Copy Markdown
Member

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.

please use SafeSet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Aug 13, 2018

Copy link
Copy Markdown
Member Author

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.

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@devsnek devsnek mentioned this pull request Aug 12, 2018
url: move process.binding('url') to internalBinding #22204
Closed
2 tasks done
jdalton
jdalton suggested changes Aug 12, 2018
View reviewed changes

@jdalton jdalton left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

I'd like to hold this until an allow list, and those items in it, are more thoroughly digested. Many of the APIs that are deprecated have no user-land alternatives so leaves devs with nothing to fill the functionality gap. I think before a runtime error can be thrown we should have alternatives or guidance for the various APIs.

Update:

The move from process.binding to internalBinding is good. The mapping in process.binding to internalBinding, included in this PR, is good too (needed for a deprecation and migration path).

Update:

See additional comments, here and here, on migration and deprecation of recently removed bindings in master branch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell

jasnell commented Aug 12, 2018

Copy link
Copy Markdown
Member Author

@jdalton ... this is not adding a runtime error. It adds a runtime deprecation for only process.binding('uv') while fixing a regression that was added when migrating it to internalBinding('uv').

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 12, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

this is not adding a runtime error. It adds a runtime deprecation for only process.binding('uv')

The var name is a bit confusing as it suggests an allow list but then it issues a warning (Deprecation warnings can throw).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 12, 2018

Copy link
Copy Markdown
Member Author

They throw only if --throw-deprecation is used, which is off by default.

Either way, we need to fix the process.binding('uv') regression... so perhaps I split the runtime deprecation specific part of this out to a separate PR but keep the rest as is?

jdalton reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maclover7

maclover7 commented Aug 12, 2018

Copy link
Copy Markdown
Contributor

@jasnell would it be possible to update per @devsnek's comment, and then to try and fast track this? Without a green CITGM (via this PR) we can't test the other binding removal PRs for regressions

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 12, 2018

Copy link
Copy Markdown
Member Author

We can't fast track a semver-major with a red x.

ChALkeR reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 13, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I'm a fan of removing reliance on process but the jump to remove instead of deprecate, for many of these, is skipping a bit ahead. This PR (tweaked) or something like it is needed for proper deprecation. This includes deprecations for the existing removed items:

  • performance
  • serdes
  • trace_events
  • uv

I'll update my ✖️ above with this note

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devsnek

devsnek commented Aug 13, 2018

Copy link
Copy Markdown
Member

@jdalton we only need to deprecate the ones with ecosystem usage. (like no one is using process.binding('serdes') because its exposed by v8) @ChALkeR said they were going to be looking into getting those numbers at some point.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 13, 2018

Copy link
Copy Markdown
Member

@devsnek

we only need to deprecate the ones with ecosystem usage [...] were going to be looking into getting those numbers at some point.

Data is great for this!
It's also not horrible to leave them deprecated for a major release.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 13, 2018

Copy link
Copy Markdown
Member Author

Unblocking and landing this specific PR gives us a way of actually deprecating these things incrementally.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 13, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@jasnell I 👍 the approach of your previous comment.

  • Remove the emitWarning bit
  • Allow all recently removed bindings through the allow-list (until we revisit with data)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 13, 2018

Copy link
Copy Markdown
Member Author

Allow all recently removed bindings

There is no need for all. trace_events and performance, for instance, are still experimental and still fall outside the normal semver rules.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 13, 2018

Copy link
Copy Markdown
Member

@jasnell

There is no need for all. trace_events and performance, for instance, are still experimental and still fall outside the normal semver rules.

Cool. You can address specifics in the follow-up commits in this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
[Squash] address feedback
7e4af61
@jasnell jasnell changed the title process: wrap process.binding for selective deprecation process: wrap process.binding for selective fallthrough to internalBinding Aug 13, 2018
@jasnell jasnell removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 13, 2018
@jasnell

jasnell commented Aug 13, 2018

Copy link
Copy Markdown
Member Author

Removed the deprecation warning. Will handle that in a separate PR.

Did not add the additional modules into the whitelist, prefer that to be done as separate PRs based on need.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added dont-land-on-v6.x labels Aug 13, 2018
@jdalton

jdalton commented Aug 13, 2018

Copy link
Copy Markdown
Member

Did not add the additional modules into the whitelist, prefer that to be done as separate PRs based on need.

This doesn't really satisfy the request. It's reasonable to add non-experimental bindings to the list until we can determine if they can safely be removed with data. I'm not a fan of a break-first-then-follow-up process. I dig the doc deprecate -> runtime warn -> then drop process.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Aug 13, 2018

Copy link
Copy Markdown
Member Author

Please let me know which transitioned items you want to see landed... So far we've transitioned:

  • performance (experimental, outside semver)
  • serdes (internal, part of v8, which is explicitly outside semver)
  • trace_events (experimental, outside semver)
  • uv (added to the whitelist by this PR)

The other modules are handled by still open PRs that would need to be updated after this lands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 13, 2018

Copy link
Copy Markdown
Member

I don't think we have data on usage yet so if the bindings aren't experimental they should be added to the allow-list until then (so serdes added to the allow list)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell mentioned this pull request Aug 13, 2018
v8: move process.binding('v8') to internalBinding #22288
Closed
2 tasks done
@jasnell

jasnell commented Aug 13, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

image

serdes is experimental... specifically, it is experimental within an existing module that falls outside of normal server rules.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

devsnek
devsnek approved these changes Aug 13, 2018
View reviewed changes
BridgeAR
BridgeAR approved these changes Aug 13, 2018
View reviewed changes
@jdalton

jdalton commented Aug 13, 2018

Copy link
Copy Markdown
Member

Ah nice! Ok then!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jdalton
jdalton approved these changes Aug 13, 2018
View reviewed changes
@jasnell

jasnell commented Aug 14, 2018

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/16450/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
[Squash] lint
758fcf3
@jasnell

jasnell commented Aug 14, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

CI (with lints fixed): https://ci.nodejs.org/job/node-test-pull-request/16453/
Grr... linux-one build bot failed: https://ci.nodejs.org/job/node-test-commit-linuxone/3951/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell mentioned this pull request Aug 15, 2018
http_parser: move process.binding('http_parser') to internalBinding #22329
Closed
3 tasks done
jasnell added a commit that referenced this pull request Aug 15, 2018
@jasnell
process: wrap process.binding for selective fallthrough
0257fd7
Selectively fallthrough `process.binding()` to `internalBinding()`

Refs: #22163

PR-URL: #22269
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@jasnell

jasnell commented Aug 15, 2018

Copy link
Copy Markdown
Member Author

Landed in 0257fd7

devsnek reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Aug 15, 2018
@antsmartian antsmartian mentioned this pull request Aug 15, 2018
spawn_sync: move process.binding('spawn_sync') to internalBinding #22260
Closed
3 tasks done
This was referenced Aug 15, 2018
CI failures: 20180815 nodejs/reliability#13
Closed
CI Failures: 20180817 nodejs/reliability#14
Closed
@joyeecheung joyeecheung mentioned this pull request Nov 8, 2018
lib: move internalBinding whitelisting into loaders.js #24088
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@cjihrig cjihrig cjihrig approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
+3 more reviewers
@jdalton jdalton jdalton approved these changes
@maclover7 maclover7 maclover7 approved these changes
@devsnek devsnek devsnek approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

process Issues and PRs related to the process subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@jasnell @nodejs-github-bot @devsnek @maclover7 @jdalton @addaleax @cjihrig @BridgeAR
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.