-
Notifications
You must be signed in to change notification settings - Fork 30.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
doc: add blurb about implications of ABI stability #22508
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,39 @@ for the N-API C based functions exported by Node.js. These wrappers are not | |
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). | ||
|
||
## Implications of ABI Stability | ||
|
||
Although N-API provides an ABI stability guarantee, other parts of Node.js do | ||
not, and any external libraries used from the addon may not. In particular, | ||
neither of the following Node.js APIs provides an ABI stability guarantee: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this wording is a bit misleading – we do have ABI stability guarantees, but we follow semver rather than not allowing any breakage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point - sorry! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about instead (s/neither/none/, s/Node.js//, s/provides/provide/):
|
||
* the Node.js C++ APIs available via any of | ||
```C++ | ||
#include <node_buffer.h> | ||
#include <node_context_data.h> | ||
#include <node_contextify.h> | ||
#include <node_mutex.h> | ||
#include <node_object_wrap.h> | ||
#include <node_perf_common.h> | ||
#include <node_platform.h> | ||
#include <node_version.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only |
||
``` | ||
* the libuv APIs which are also included with Node.js and available via | ||
```C++ | ||
#include <uv.h> | ||
``` | ||
* the V8 API available via | ||
```C++ | ||
#include <v8.h> | ||
``` | ||
|
||
Thus, for an addon to remain ABI-compatible across Node.js major versions, it | ||
must make use exclusively of N-API by restricting itself to using | ||
```C | ||
#include <node_api.h> | ||
``` | ||
and by checking, for all external library that it uses, that the external | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: libraries |
||
library makes ABI stability guarantees similar to N-API. | ||
|
||
## Usage | ||
|
||
In order to use the N-API functions, include the file | ||
|
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.
add-on
->addon
for consistency with the rest of the doc.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.
Actually, I'll just go ahead and make that change myself since I'm right here...