Skip to content

zlib: refactor constants for consistency - #7203

Closed
jasnell wants to merge 2 commits into
nodejs:masterfrom
jasnell:zlib_constants
Closed

zlib: refactor constants for consistency#7203
jasnell wants to merge 2 commits into
nodejs:masterfrom
jasnell:zlib_constants

Conversation

@jasnell

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX) or vcbuild test nosign (Windows) passes
  • a test and/or benchmark is included
  • documentation is changed or added
  • the commit message follows commit guidelines
Affected core subsystem(s)

zlib

Description of change

refactor zlib constants for consistency with the changes to
constants in fs, os etc. Adds a new zlib.constants, docs-only
deprecation
for the constants hanging directly off zlib, moves
the constants decls from node_zlib.cc into node_constants.cc, and
removes a couple of constants from the docs that apparently no longer
exist in the code any where (surprise!)

/cc @addaleax

@jasnelljasnell added zlib Issues and PRs related to the zlib subsystem. semver-major PRs that contain breaking changes and should be released in the next major version. labels Jun 7, 2016
@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jun 7, 2016
Comment threaddoc/api/zlib.md 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.

typo: missing .

@jasnell

Copy link
Copy Markdown
MemberAuthor

@addaleax ... nit fixed!

@jasnell

Copy link
Copy Markdown
MemberAuthor

@nodejs/ctc ... please review. This includes a docs only deprecation.

@rvagg

rvagg commented Jun 8, 2016

Copy link
Copy Markdown
Member

👍 for consistency, lgtm

commit message could be more clear about what's going on to make it easier to spot when scanning the changelog

@mscdex

Copy link
Copy Markdown
Contributor

If this is a docs-only deprecation, why is this a semver-major?

@jasnell

Copy link
Copy Markdown
MemberAuthor

@mscdex ... we've generally treated docs-only deprecations as semver-major. In the previous update for require('constants'), we did it as semver-minor because the constants module wasn't actually documented. In this case, the zlib.md actually already documented the constants.

zlib constants were previously being added to binding in node_zlib.cc.
This moves the zlib constants to node_constants.cc for consistency with
the recent constants refactoring:
nodejs#6534
Adds require('zlib').constants to expose the constants
Docs-only deprecates the constants hung directly off require('zlib')
Removes a couple constants from the docs that apparently no longer
exist in the code
@jasnell

jasnell commented Jun 8, 2016

Copy link
Copy Markdown
MemberAuthor

@rvagg: commit log updated.

CI: https://ci.nodejs.org/job/node-test-pull-request/2958/ ... Green
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/301/ ... Lodash installation error appears unrelated

@addaleax

Copy link
Copy Markdown
Member

LGTM

@jasnell

Copy link
Copy Markdown
MemberAuthor

Thank you! will land tomorrow barring any other issues.

@jasnell

Copy link
Copy Markdown
MemberAuthor

@bnoordhuis ... can I ask you to take a look at this quickly? Any nits with the node_constants.cc changes?

Comment threadsrc/node_constants.cc Outdated
NODE_DEFINE_CONSTANT(target, INFLATERAW);
NODE_DEFINE_CONSTANT(target, UNZIP);

#define Z_MIN_WINDOWBITS 8

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.

Don't indent preprocessor directives.

@jasnell

Copy link
Copy Markdown
MemberAuthor

@bnoordhuis .. updated!

@bnoordhuis

Copy link
Copy Markdown
Member

LGTM

jasnell added a commit that referenced this pull request Jun 12, 2016
zlib constants were previously being added to binding in node_zlib.cc.
This moves the zlib constants to node_constants.cc for consistency with
the recent constants refactoring:
#6534
Adds require('zlib').constants to expose the constants
Docs-only deprecates the constants hung directly off require('zlib')
Removes a couple constants from the docs that apparently no longer
exist in the code
PR-URL: #7203
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@jasnell

Copy link
Copy Markdown
MemberAuthor

Landed in 197a465

@jasnelljasnell closed this Jun 12, 2016
@fhinkelfhinkel mentioned this pull request Jul 2, 2016
3 tasks
fhinkel added a commit to fhinkel/node that referenced this pull request Jul 9, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in nodejs#7203, but marked as
semver-major, so will not land in v6.x.
Fixes: nodejs#7204
Fishrock123 pushed a commit that referenced this pull request Jul 15, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in #7203, but marked as
semver-major, so will not land in v6.x.
Fixes: #7204
PR-URL: #7520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 9, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in #7203, but marked as
semver-major, so will not land in v6.x.
Fixes: #7204
PR-URL: #7520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
MylesBorins pushed a commit that referenced this pull request Sep 28, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in #7203, but marked as
semver-major, so will not land in v6.x.
Fixes: #7204
PR-URL: #7520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
rvagg pushed a commit that referenced this pull request Oct 18, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in #7203, but marked as
semver-major, so will not land in v6.x.
Fixes: #7204
PR-URL: #7520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
MylesBorins pushed a commit that referenced this pull request Oct 26, 2016
Some constants in the zlib docs are not in the actual code:
zlib.Z_BINARY
zlib.Z_TEXT
zlib.Z_ASCII
zlib.Z_UNKNOWN
Also handled in #7203, but marked as
semver-major, so will not land in v6.x.
Fixes: #7204
PR-URL: #7520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@gibfahngibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.semver-majorPRs that contain breaking changes and should be released in the next major version.zlibIssues and PRs related to the zlib subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@jasnell@rvagg@mscdex@addaleax@bnoordhuis@nodejs-github-bot