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
As discussed today it seems like rather than having developers declare their version specifically it would make sense to enforce it in the header file.
By default only the first version would be exposed and the developer can explicitly opt in using a preprocessor directive:
#defineNAPI_VERSION2
#include<node_api.h>
I've made the required changes in a private branch to start the discussion. If there are no objections I can go ahead and open a PR in the main repo.
@mhdawson I can update the documentation for N-API to describe the approach for module authors, is that sufficient?
It would probably make sense to have an answer for this before we exit experimental, but there are more pieces to put into place. I'm not sure how this would fit into the end-to-end pipeline, for instance how do modules surface this value to npm/node-gyp?
Activity
mhdawson commentedon Dec 13, 2017
Looks reasonable. I think we'll need a doc that captures the approach and update the doc on creating a release so that we include the required steps.
I also think we should discuss if we start enforcing this before/after we exit experimental.
kfarnung commentedon Jan 11, 2018
@mhdawson I can update the documentation for N-API to describe the approach for module authors, is that sufficient?
It would probably make sense to have an answer for this before we exit experimental, but there are more pieces to put into place. I'm not sure how this would fit into the end-to-end pipeline, for instance how do modules surface this value to npm/node-gyp?
mhdawson commentedon Jan 12, 2018
Updating the N-API documentation works for me.
kfarnung commentedon Apr 5, 2018
Based on discussion in the meeting today we'll set the starting version at 2 (the current shipping N-API version) so we don't break any developers.
kfarnung commentedon Apr 12, 2018
I'm still working on this PR, but I took a stab at trying to figure out the version mapping:
* Versions 1 and 2 were really loose (during experimental) so these are approximate.
kfarnung commentedon Apr 12, 2018
I opened the initial PR: nodejs/node#19962
mhdawson commentedon Jul 5, 2018
PR landed, closing out.