-
Notifications
You must be signed in to change notification settings - Fork 461
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
Bundles node_api.h is outdated #463
Comments
AFAIK, you could directly include |
@legendecas But I would like to do this in a platform independent way (that also works on Windows). |
@legendecas Also, I suspect the linker might yield problems if the same c++ code is using two different versions of the same header file in the same build ? |
@extmchristensen you only need the bundled N-API implementation if you're planning on building against a version of Node.js which does not itself have an implementation of N-API (i.e. pre-6.14.2, IIRC). node-addon-api avoids using the built-in headers if the version of Node.js against which it's building has its own headers. The reason node-addon-api does not have thread-safe function is not that it's missing from the bundled headers, but that it hasn't been implemented in the C++ wrapper – however, as you noticed, we have #442 that seeks to implement it. |
@gabrielschulhof I don't understand the point that node-addon-api is unneeded for recent node versions.... If I don't add node-addon-api to package.json + binding.gyp, I get compilation errors about napi.h being missing. |
@extmchristensen node-addon-api is needed if you wish to use What versions of Node.js do you plan to support with your native addon? |
@gabrielschulhof On my node 11 windows installation, I can not find the headers in the node installation. itself, but they ("C" headers only, not the C++ nap.h header) are present under node-gyp at .node-gyp\version\include\node As for your question, I need to support at minimum v10 and v11 with additional support for v8 and v9 as nice to have. I am currently using the C++ node-addon wrapper + a 3rd party napi-thread-safe-callback library to allow async callback from 3rd party thread. |
@extmchristensen for this range of Node.js versions N-API is built-in. Therefore node-addon-api will not compile the version of N-API it ships. This means that the files in its |
This issue, along with #509 needs to be closed when Node.js v8.x goes out of scope and we will have removed the src/-provided implementation of N-API. |
Remove the files associated with the external implementation of N-API. Making this move is possible because all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs#463 Fixes: nodejs#509
Remove the files associated with the external implementation of N-API and the v8.x Travis CI testing. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs#463 Fixes: nodejs#509
Remove the files associated with the external implementation of N-API and the v8.x Travis CI testing. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs#463 Fixes: nodejs#509 Fixes: nodejs#640
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs#463 Fixes: nodejs#509 Fixes: nodejs#640
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs/node-addon-api#463 Fixes: nodejs/node-addon-api#509 Fixes: nodejs/node-addon-api#640 PR-URL: nodejs/node-addon-api#643 Reviewed-By: Nicola Del Gobbo <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs/node-addon-api#463 Fixes: nodejs/node-addon-api#509 Fixes: nodejs/node-addon-api#640 PR-URL: nodejs/node-addon-api#643 Reviewed-By: Nicola Del Gobbo <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs/node-addon-api#463 Fixes: nodejs/node-addon-api#509 Fixes: nodejs/node-addon-api#640 PR-URL: nodejs/node-addon-api#643 Reviewed-By: Nicola Del Gobbo <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Remove the followings: * the files associated with the external implementation of N-API * Travis CI jobs for v8.x and v6.x * documentation instructing users to add the external N-API implementation to their dependencies. * conversion tool code that adds the external N-API implementation as a dependency to the user's addon. This move is possible because of v8.x EOL, which means that all supported versions of Node.js now have an internal implementation of N-API. Fixes: nodejs/node-addon-api#463 Fixes: nodejs/node-addon-api#509 Fixes: nodejs/node-addon-api#640 PR-URL: nodejs/node-addon-api#643 Reviewed-By: Nicola Del Gobbo <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
I am writing a large C++ addon and would like to use the node-addon-api but it lacks some of the "C" API's features (thread safe functions in particular) so I need to fallback on the "C" N-API.
Unfortunately, the node-addon-api bundles a too old version of "node_api.h", so I can't mix and match.
Could node-addon-api be updated to use latest N-API C header files ?
The text was updated successfully, but these errors were encountered: