Skip to content

dgram: clean up private APIs - #21923

Merged
cjihrig merged 4 commits into
nodejs:masterfrom
cjihrig:dgram
Jul 28, 2018
Merged

dgram: clean up private APIs#21923
cjihrig merged 4 commits into
nodejs:masterfrom
cjihrig:dgram

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@cjihrigcjihrig added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 21, 2018
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@apapirovskiapapirovski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with 1 nit.

Comment threadlib/dgram.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It feels a bit cleaner if these were all declared directly on the state object. Meaning:

conststate={
handle,receiving: false,
...etc,};

@cjihrig
cjihrig requested a review from a teamJuly 23, 2018 15:00
Comment threadlib/dgram.js Outdated

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 is the console.log(this) added?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Because I forgot to remove it facepalm

@oyydoyyd mentioned this pull request Jul 24, 2018
4 tasks

@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 with @jasnell nit.

@cjihrig
cjihrigforce-pushed the dgram branch 3 times, most recently from c189e0a to ec00636CompareJuly 28, 2018 02:51
@cjihrigcjihrig removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 28, 2018
@cjihrig

cjihrig commented Jul 28, 2018

Copy link
Copy Markdown
ContributorAuthor

Addressed nits. Backed out the deprecations, and instead added getters/setters so that the PR is no longer semver-major. I'm going to open a follow up semver-major PR that reimplements the deprecations only. For now, this shouldn't cause problems for other PRs.

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

EDIT: CI was green

These methods are private APIs of dgram sockets, but do not
need to be exposed via the Socket prototype.
PR-URL: nodejs#21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
dgram sockets have a fair number of exposed private properties.
This commit hides them all behind a single symbol property.
PR-URL: nodejs#21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
_createSocketHandle() is used internally by the cluster module.
This commit makes it internal only API.
PR-URL: nodejs#21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit makes all previously private APIs available via
getters, setters, and wrapper functions.
PR-URL: nodejs#21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@cjihrig
cjihrig merged commit 045b07d into nodejs:masterJul 28, 2018
@cjihrig

Copy link
Copy Markdown
ContributorAuthor

Landed in d497ebb, 79e41cc, 3f6ee75, and 045b07d.

@cjihrig
cjihrig deleted the dgram branch July 28, 2018 04:36
targos pushed a commit that referenced this pull request Jul 31, 2018
These methods are private APIs of dgram sockets, but do not
need to be exposed via the Socket prototype.
PR-URL: #21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2018
dgram sockets have a fair number of exposed private properties.
This commit hides them all behind a single symbol property.
PR-URL: #21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2018
_createSocketHandle() is used internally by the cluster module.
This commit makes it internal only API.
PR-URL: #21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2018
This commit makes all previously private APIs available via
getters, setters, and wrapper functions.
PR-URL: #21923
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@targostargos mentioned this pull request Jul 31, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@cjihrig@nodejs-github-bot@apapirovski@mcollina@jasnell@geek