-
Notifications
You must be signed in to change notification settings - Fork 462
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
Update node_api modules at src/ with threadsafe functionality #509
Comments
Those files should not be being used for any active LTS version. Instead the code being used should come from the Node runtime. |
@mhdawson we need to drop the N-API implementation from node-addon-api once v8.x becomes unmaintained. |
@gabrielschulhof agreed :) |
@markBETA I had meant to ask what version of Node are you using. I see that I missed that in my first post. |
@mhdawson I tried to use the source files from the Node runtime and it worked! I'm using the last LTS version (10.16.0), where the threadsafe operations are marked as stable. I'm working with Cmake-JS to compile the source files of my addon. I think it will be good to specify in the readme to use the files from the Node runtime. As @gabrielschulhof said, I think it will be good to remove the src/ folder that is not maintained anymore. |
@markBETA thanks. By default if you use node-gyp it will find the right files but seems like for other cases we need more doc. Any chance you'd be able to submit a PR to the README.md to add what you would have found useful? |
Yes the src folder with old files is highly confusing. Would be nice to have it deleted. |
Hi,
@mhdawson looking at this documentation[1] I find very hard if not impossible to get the correct information regarding "API X will work with my Electron Y.Z"? It looks to me like a maze, but maybe is because new to this API. [1] https://github.com/nodejs/node-addon-api/blob/master/doc/threadsafe_function.md Thank you so much for your attention and sorry if this is off topic. |
Unfortunately, I'm not up to speed on the mapping between Node versions and Electron. Maybe @codebytere can help.
I don't think this is the case. You need a Node.js version which supports N-API 4 to build using N-API v4 features. The exception is if you enable EXPERIMENTALly and those features were EXPERIMENTAL in the earlier Node.js version. In which case you may build but them later not run if in a Node.js version that does not support v4 features (or have the feature as EXPERIMENTAL)
Unfortunately, there won't be a great answer to this. We've added the ThreadSafeFunction as it became apparent that it was a common use case. You might be able to look at the methods within the C N-API and implement those yourself, but that will likely mean using internal APIs and that the native module would need ot be re-compiled for each version of Node.js (although that's no worse than without N-API). Not sure how easy it will be to bridge between the non N-API and N-API code required to do that either. |
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]>
Hi to everyone!
I have tried to compile with the last update with the ThreadSafeFunction class but it seems that the node_api modules at the src/ folder are not updated with the threadsafe functionality.
I think that is needed to update these files for using the new functionality.
The text was updated successfully, but these errors were encountered: