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

doc: clarify that N-API addons are context-aware #36640

Closed
wants to merge 1 commit into from

Conversation

mildsunrise
Copy link
Member

The docs on N-API say that NAPI_MODULE_INIT must be used for the addon to be context-aware. That seems to be wrong, i.e. all N-API addons are context-aware(?)

The docs on N-API say that NAPI_MODULE_INIT must
be used for the addon to be context-aware. That seems
to be wrong, i.e. all N-API addons are context-aware(?)
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API. labels Dec 26, 2020
@Trott
Copy link
Member

Trott commented Dec 27, 2020

@nodejs/n-api

Copy link
Member

@NickNaso NickNaso 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

@gabrielschulhof gabrielschulhof left a comment

Choose a reason for hiding this comment

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

I'm blocking solely because many have already approved, and the change really should say NAPI_MODULE, not NODE_MODULE.

If the module will be loaded multiple times during the lifetime of the Node.js
process, use the `NAPI_MODULE_INIT` macro to initialize the module:
You can also use the `NAPI_MODULE_INIT` macro, which acts as a shorthand
for `NODE_MODULE` and defining an `Init` function:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for `NODE_MODULE` and defining an `Init` function:
for `NAPI_MODULE` and defining an `Init` function:

@gabrielschulhof
Copy link
Contributor

Otherwise, LGTM.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM once @gabrielschulhof comment is addresssed.

@gabrielschulhof
Copy link
Contributor

I think we can fix this as we land it.

Copy link
Contributor

@gabrielschulhof gabrielschulhof left a comment

Choose a reason for hiding this comment

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

Landing with the fix...

gabrielschulhof pushed a commit that referenced this pull request Jan 5, 2021
The docs on N-API say that NAPI_MODULE_INIT must
be used for the addon to be context-aware. That seems
to be wrong, i.e. all N-API addons are context-aware(?)

PR-URL: #36640
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@gabrielschulhof
Copy link
Contributor

Landed in a3fcf24.

danielleadams pushed a commit that referenced this pull request Jan 12, 2021
The docs on N-API say that NAPI_MODULE_INIT must
be used for the addon to be context-aware. That seems
to be wrong, i.e. all N-API addons are context-aware(?)

PR-URL: #36640
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@danielleadams danielleadams mentioned this pull request Jan 12, 2021
targos pushed a commit that referenced this pull request May 1, 2021
The docs on N-API say that NAPI_MODULE_INIT must
be used for the addon to be context-aware. That seems
to be wrong, i.e. all N-API addons are context-aware(?)

PR-URL: #36640
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants