-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
n-api: initialize a module via a special symbol #20161
n-api: initialize a module via a special symbol #20161
Conversation
doc/api/n-api.md
Outdated
} | ||
``` | ||
|
||
This macro includes `NAPI_MODULE`, and declares an `Init` function with a special |
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 line has 81 characters and may cause doc linting issue.
d0c4129
to
b699724
Compare
@vsemozhetbyt fixed. Thanks! |
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 modulo comments.
doc/api/n-api.md
Outdated
For example, to define a class so that new instances can be created | ||
(often used with [Object Wrap][]): | ||
To define a class so that new instances can be created (often used with | ||
[Object Wrap][]): |
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.
Can you break out the stylistic changes to a separate commit?
src/node.cc
Outdated
if (auto callback = GetInitializerCallback(&dlib)) { | ||
callback(exports, module, context); | ||
return; | ||
} |
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.
This is arguably a separate change that belongs in its own commit.
tools/remark-cli/package-lock.json
Outdated
@@ -2,7 +2,6 @@ | |||
"name": "remark-cli", | |||
"version": "4.0.0", | |||
"lockfileVersion": 1, | |||
"preserveSymlinks": "1", |
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.
Should not be checked in.
Kinda annoying make lint
still touches this file, I thought that had been fixed.
Much like regular modules, N-API modules can also benefit from having a special symbol which they can expose. Fixes: nodejs#19845
b699724
to
051029c
Compare
@bnoordhuis I split out the changes into two more PRs. |
That's fine. Separate commits in this PR would have been alright too. The main thing is to have one change per commit, makes bisecting/reverting and code archeology easier. |
Landed in 0f8caf2. |
Notable Changes: * console: - make console.table() use colored inspect (TSUYUSATO Kitsune) #20510 * fs: - move fs/promises to fs.promises (cjihrig) #20504 * http: - added aborted property to request (Robert Nagy) #20094 * n-api: - initialize a module via a special symbol (Gabriel Schulhof) #20161 * src: - add public API to expose the main V8 Platform (Allen Yonghuang Wang) #20447 PR-URL: Coming Soon
Notable Changes: * console: - make console.table() use colored inspect (TSUYUSATO Kitsune) #20510 * fs: - move fs/promises to fs.promises (cjihrig) #20504 * http: - added aborted property to request (Robert Nagy) #20094 * n-api: - initialize a module via a special symbol (Gabriel Schulhof) #20161 * src: - add public API to expose the main V8 Platform (Allen Yonghuang Wang) #20447 PR-URL: #20606
Notable Changes: * console: - make console.table() use colored inspect (TSUYUSATO Kitsune) #20510 * fs: - move fs/promises to fs.promises (cjihrig) #20504 * http: - added aborted property to request (Robert Nagy) #20094 * n-api: - initialize a module via a special symbol (Gabriel Schulhof) #20161 * src: - add public API to expose the main V8 Platform (Allen Yonghuang Wang) #20447 PR-URL: #20606
Notable Changes: * console: - make console.table() use colored inspect (TSUYUSATO Kitsune) #20510 * fs: - move fs/promises to fs.promises (cjihrig) #20504 * http: - added aborted property to request (Robert Nagy) #20094 * n-api: - initialize a module via a special symbol (Gabriel Schulhof) #20161 * src: - add public API to expose the main V8 Platform (Allen Yonghuang Wang) #20447 PR-URL: #20606
Much like regular modules, N-API modules can also benefit from having
a special symbol which they can expose.
Fixes: #19845
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes