You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use node-api-headers package instead of full nodejs headers #2736
For modules built using NAN, they need the correct version of the nodejs/electron headers to build against.
For modules built using Node-API, they do not need the full headers and instead only need a small subset. That small subset is available as its own package on npm. https://github.com/nodejs/node-api-headers.
If node-gyp was to use node-api-headers for sourcing the node-api headers, that would provide some benefits:
Some builds would be sped up as they wouldnt need to download the full headers. Perhaps node-api-headers could be bundled into node-gyp? Not sure how that would work when new versions are released.
Some native modules are accidentally including headers that are not part of node-api and so do not follow the stability guarantees https://nodejs.org/api/n-api.html#implications-of-abi-stability. This is all too easy to do when porting code from NAN to Node-API.
It would be ideal if there was a way for modules to opt into using node-api-headers instead of the full headers, and it should be recommended in the docs for node-api based modules to enable this option.
Perhaps in the next major version it could be looked into enabling this automatically, but I dont know if that would be achievable or if it would break too many modules.
Activity