Skip to content
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

dgram: remove unnecessary fd property from Socket #21684

Closed
wants to merge 1 commit into from

Conversation

oyyd
Copy link
Contributor

@oyyd oyyd commented Jul 6, 2018

It seems the property socket.fd is used long before for the compatibility reason but it's not used anymore.

It's also not documented in docs so that it's not a public api/property.

Keep the property also makes the code a bit confusing as socket._handle.fd is the actual property representing fd.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows [commit guidelines]

@nodejs-github-bot nodejs-github-bot added the dgram Issues and PRs related to the dgram subsystem / UDP. label Jul 6, 2018
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

In theory this LGTM as a semver-major, but it might need a CITGM run.

@cjihrig cjihrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 6, 2018
@oyyd
Copy link
Contributor Author

oyyd commented Jul 8, 2018

FYI: nodejs/node-v0.x-archive#8057

lib/dgram.js Outdated
@@ -138,7 +138,6 @@ function Socket(type, listener) {
this._bindState = BIND_STATE_UNBOUND;
this[async_id_symbol] = this._handle.getAsyncId();
this.type = type;
this.fd = null; // compatibility hack
Copy link
Member

Choose a reason for hiding this comment

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

hmm... @nodejs/tsc ... do we know if this could break anyone? It may be minor, but we should likely do a deprecation on this before just removing it.

Copy link
Member

Choose a reason for hiding this comment

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

I think a simple semver-major removal is fine for this, given that it seems pretty unusable.

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jul 18, 2018
@addaleax
Copy link
Member

This needs another @nodejs/tsc review

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

Sorry, I guess I didn't make my LGTM explicit enough before.

@maclover7 maclover7 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 28, 2018
@maclover7
Copy link
Contributor

@oyyd Can you rebase this PR please?

It seems the property socket.fd is used long before for the
compatibility reason but it's not used anymore. It's also
not documented in docs so that it's not a public api/property.
Keep the property also make the code a bit confusing as
socket._handle.fd is the actual property representing fd.
@oyyd
Copy link
Contributor Author

oyyd commented Aug 10, 2018

@maclover7 PTAL

@maclover7
Copy link
Contributor

@maclover7
Copy link
Contributor

CI is green besides for worker tests which are having infra issues right now, this should be safe to land

@maclover7
Copy link
Contributor

Landed in 3ce6bc3

@maclover7 maclover7 closed this Aug 10, 2018
maclover7 pushed a commit that referenced this pull request Aug 10, 2018
It seems the property socket.fd is used long before for the
compatibility reason but it's not used anymore. It's also
not documented in docs so that it's not a public api/property.
Keep the property also make the code a bit confusing as
socket._handle.fd is the actual property representing fd.

PR-URL: #21684
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dgram Issues and PRs related to the dgram subsystem / UDP. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants