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: better linkaged to node-addon-api #24371

Closed

Conversation

mhdawson
Copy link
Member

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), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@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 Nov 14, 2018
@Trott
Copy link
Member

Trott commented Nov 15, 2018

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
Copy link
Member

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.)

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

In order to -> To

Copy link
Member

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:
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

C based -> C-based

Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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?

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.
@mhdawson mhdawson force-pushed the improve-node-addon-api-reference branch from f778998 to 7659fc1 Compare November 15, 2018 14:16
@mhdawson
Copy link
Member Author

@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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

node-addon-api, right?

Copy link
Contributor

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.

doc/api/n-api.md Show resolved Hide resolved
@mhdawson
Copy link
Member Author

@thefourtheye thanks for the comments, I believe I've addressed them now.

doc/api/n-api.md Outdated Show resolved Hide resolved
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

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

Doc form LGTM)

@mhdawson
Copy link
Member Author

mhdawson commented Nov 16, 2018

@mhdawson
Copy link
Member Author

CI good landing.

@mhdawson
Copy link
Member Author

Landed as a569686

@mhdawson mhdawson closed this Nov 16, 2018
mhdawson added a commit that referenced this pull request Nov 16, 2018
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 <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
targos pushed a commit that referenced this pull request Nov 18, 2018
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 <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
rvagg pushed a commit that referenced this pull request Nov 28, 2018
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 <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Dec 5, 2018
4 tasks
codebytere pushed a commit that referenced this pull request Jan 12, 2019
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 <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@codebytere codebytere mentioned this pull request Jan 15, 2019
codebytere pushed a commit that referenced this pull request Jan 29, 2019
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 <thechargingvolcano@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
@mhdawson mhdawson deleted the improve-node-addon-api-reference branch September 30, 2019 13:13
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.

6 participants