-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: document process.versions.modules #9901
Conversation
This commit adds a description of `process.versions.modules`, based on the comment in `src/node_version.h` lines 47-50.
@@ -1651,7 +1651,9 @@ added: v0.2.0 | |||
* {Object} | |||
|
|||
The `process.versions` property returns an object listing the version strings of | |||
Node.js and its dependencies. | |||
Node.js and its dependencies. `process.versions.modules` indicates the current | |||
ABI version, which is increased whenever a C++ API changes. Node.js will refuse |
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.
Thanks for the contribution. I'm not sure if we have something in the docs that explains ABI, but if we do, making ABI
a link to that explanation would be great.
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 think this should be more of a "In addition, the modules
property indicates ...", because this version contradicts the earlier sentence, the modules property is not a version of Node.js or its dependencies.
Perhaps it would be even better by enumerating each individual property, and describing it?
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.
There's nothing in the docs that explains ABI currently. Could be a good addition to https://nodejs.org/dist/latest-v7.x/docs/api/addons.html at some point (/cc @nodejs/documentation). I wouldn't make it a condition for landing this PR tho
@kzurawel are you still working on this? |
I'm still "working" on this, but I'm not sure what needs to be done at this point. |
You need to read all comments, and if they suggest a change, implement it or explain why not. If they ask a question, answer it as a comment, or answer implicitly by pushing to the PR. Specifically, in #9901 (comment) I said:
You should do this, or something similar, or comment on why you don't think it should be done.
This is phrased as a question, so you can answer it, or just do what I suggeest and change the doc format, or not change the doc format if you don't have the time or don't think its a good idea. |
@kzurawel Are you still working on this? (If not, does anyone else want to take it over and get it across the finish line?) |
I think that's all, I'll leave describing the other properties for future work. |
@sam-github Looks good to you? |
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 a nit, thanks for this!
Node.js and its dependencies. | ||
Node.js and its dependencies. In addition, `process.versions.modules` indicates | ||
the current ABI version, which is increased whenever a C++ API changes. Node.js | ||
will refuse to load native modules built for an older `modules` value. |
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.
nit: This sounds like Node will load native modules built for newer modules
values, which isn’t the case… maybe something like for a different
fits better?
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.
Lines 46 to 52 in e03ee71
/** | |
* When this version number is changed, node.js will refuse | |
* to load older modules. This should be done whenever | |
* an API is broken in the C++ side, including in v8 or | |
* other dependencies. | |
*/ | |
#define NODE_MODULE_VERSION 51 /* Node.js v7.0.0 */ |
Documentation text mirrors the only available documentation for this property.... an in-source comment. @addaleax are you saying the comment is wrong?
If so, this PR should change both the comment and the docs.
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.
@sam-github No, I didn’t say the current text is wrong. It’s just incomplete and might therefore be misleading.
If so, this PR should change both the comment and the docs.
No objections to that, but, like, this isn’t worth holding up the PR or anything imho.
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.
Right, so text should be something like "Node.js will refuse to load modules that weren't compiled against its own
module ABI number."
Landed in f368eee. I'll update the text further (based on the back-and-forth between @addaleax and @sam-github) in a subsequent PR. |
This commit adds a description of `process.versions.modules`, based on the comment in `src/node_version.h` lines 47-50. PR-URL: nodejs#9901 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit adds a description of `process.versions.modules`, based on the comment in `src/node_version.h` lines 47-50. PR-URL: #9901 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs#10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: nodejs#9901 (comment)
This commit adds a description of `process.versions.modules`, based on the comment in `src/node_version.h` lines 47-50. PR-URL: #9901 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit adds a description of `process.versions.modules`, based on the comment in `src/node_version.h` lines 47-50. PR-URL: #9901 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs#10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: nodejs#9901 (comment)
PR-URL: nodejs#10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: nodejs#9901 (comment)
PR-URL: nodejs#10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: nodejs#9901 (comment)
PR-URL: nodejs#10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: nodejs#9901 (comment)
PR-URL: #10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: #9901 (comment)
PR-URL: #10419 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Refs: #9901 (comment)
Checklist
Affected core subsystem(s)
doc process
Description of change
This commit adds a description of
process.versions.modules
,based on the comment in
src/node_version.h
lines 47-50.