-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: better linkaged to node-addon-api #24371
Conversation
Note for whoever lands this: first line of commit message seems to have a typo? |
doc/api/n-api.md
Outdated
part of N-API, nor will they be maintained as part of Node.js. One such | ||
example is: [node-addon-api](https://github.com/nodejs/node-addon-api). | ||
and different compiler levels. **However, a C++ API can be easier to use | ||
in many cases.** In order to support using C++ the project maintains a |
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.
Do we really need to add bold text here? (No strong opinion other than we have a tendency to overuse bold and italics so it always seems worth asking.)
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.
If you really want people to take notice of the sentence, make it more direct by getting rid of qualifiers like "However" and "in many cases" so it's just:
A C++ API can be easier to use.
Maybe even set it off as its own single-sentence paragraph if it's that important.
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.
In order to
-> To
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.
Comma needed after C++
doc/api/n-api.md
Outdated
obj["foo"] = String::New(env, "bar"); | ||
``` | ||
|
||
what actually gets used in the addon is: |
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.
Splitting the sentence up with examples and having this fragment here makes it pretty hard to read/understand IMO.
doc/api/n-api.md
Outdated
This wrapper provides an inlineable C++ API. Binaries built | ||
with `node-addon-api` will depend on the symbols for the N-API C based | ||
functions exported by Node.js. `node-addon-api` can be seen as a more | ||
efficient way to write code that calls N-API. For example if the following |
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.
Comma needed after example
doc/api/n-api.md
Outdated
C++ wrapper module called | ||
[node-addon-api](https://github.com/nodejs/node-addon-api). | ||
This wrapper provides an inlineable C++ API. Binaries built | ||
with `node-addon-api` will depend on the symbols for the N-API C based |
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.
C based
-> C-based
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.
Is this sentence necessary? Can it be removed? It might be my lack of domain knowledge here, but it's unclear to me why this sentence is necessary given the surrounding material.
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 it's a key point so I'd like to leave it in.
doc/api/n-api.md
Outdated
|
||
While the concepts in the following sections are still useful when | ||
using `node-addon-api` instead of the C APIs, it may make sense | ||
to start with the API docs for `node-addon-api` instead. |
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 sentence is long, complicated, and contains too many qualifiers. How about splitting it up into at least two sentences? Also, provide a link to the API docs you're recommending people use?
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.
Maybe all it really needs to be is?:
When using `node-addon-api` instead of the C APIs, start with the API docs for node-addon-api.
doc/api/n-api.md
Outdated
} | ||
``` | ||
|
||
The end result is that the addon only uses the exported C APIs and as a result |
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.
The end result is that the addon only uses the exported C APIs and as a result | |
The end result is that the addon only uses the exported C APIs. As a result, it |
doc/api/n-api.md
Outdated
[node-addon-api](https://github.com/nodejs/node-addon-api). | ||
This wrapper provides an inlineable C++ API. Binaries built | ||
with `node-addon-api` will depend on the symbols for the N-API C based | ||
functions exported by Node.js. `node-addon-api` can be seen as a more |
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.
functions exported by Node.js. `node-addon-api` can be seen as a more | |
functions exported by Node.js. `node-addon-api` is a more |
doc/api/n-api.md
Outdated
with `node-addon-api` will depend on the symbols for the N-API C based | ||
functions exported by Node.js. `node-addon-api` can be seen as a more | ||
efficient way to write code that calls N-API. For example if the following | ||
`node-addon-api` code is written: |
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.
Maybe replace the whole lead-up here with this:
Take, for example, the following `node-addon-api` code:
doc/api/n-api.md
Outdated
obj["foo"] = String::New(env, "bar"); | ||
``` | ||
|
||
what actually gets used in the addon is: |
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.
what actually gets used in the addon is: | |
What actually gets used in the addon is: |
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense.
f778998
to
7659fc1
Compare
@Trott I believe I've addressed your comments. |
doc/api/n-api.md
Outdated
part of N-API, nor will they be maintained as part of Node.js. One such | ||
example is: [node-addon-api](https://github.com/nodejs/node-addon-api). | ||
and different compiler levels. A C++ API can be easier to use | ||
. To support using C++, the project maintains a |
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: Seeing a line starting with a dot, seems not correct.
doc/api/n-api.md
Outdated
functions exported by Node.js. `node-addon-api` is a more | ||
efficient way to write code that calls N-API. Take, for example, the | ||
following `node-addon-api` code. The first section shows the | ||
`node-add-api` code and the section section shows what actually gets |
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.
node-addon-api
, right?
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.
Also, there are two "section"s.
@thefourtheye thanks for the comments, I believe I've addressed them now. |
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.
Doc form LGTM)
CI good landing. |
Landed as a569686 |
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense. PR-URL: #24371 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense. PR-URL: #24371 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense. PR-URL: #24371 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense. PR-URL: #24371 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
One of the comments we got at the N-API workshop at NodeConfEU was that we should have a better link to node-addon-api and the docs in the main API docs for N-API. The goal being to help people find node-addon-api and potentially start with the node-addon-api docs instead if they are using C++. This expands and strengthens the link along with a recommendation that starting with the node-addon-api docs might make sense. PR-URL: #24371 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
One of the comments we got at the N-API workshop
at NodeConfEU was that we should have a better link to
node-addon-api and the docs in the main API docs for
N-API. The goal being to help people find node-addon-api
and potentially start with the node-addon-api docs
instead if they are using C++.
This expands and strengthens the link along with a
recommendation that starting with the node-addon-api
docs might make sense.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes