-
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
confusion about NAPI_VERSION, NAPI_EXPERIMENTAL #421
Comments
@DaAitch This has to be done in both Node.js core and in node-addon-api though. |
Refs: nodejs/node-addon-api#421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available.
I'd have to look more closely as I think we need NAPI_EXPERIMENTAL to be defined in the tests as that is what ends up making NAPI_VERSION 2147483646 the default so that without any options npm test runs all of the tests. I do agree that we should have a constant for NAPI_VERSION_EXPERIMENTAL but I think it makes sense in node core were NAPI_EXPERIMENTAL is defined. Just opened a PR here for that: nodejs/node#25319 . However, we probably need a defined in node-addon-api which sets it if it is not defined so that we cover older versions. Good point that I missed updating the #endifs I also definitely agree with us needing to document npm test --NAPI_VERSION=... It's on my long list of TODO's but if you have time to do it I'd be happy :) |
(also discussed in NAPI team meeting)
next steps:
anything missing? |
@DaAitch sounds good to me. |
Refs: nodejs/node-addon-api#421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available. PR-URL: #25319 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Refs: nodejs/node-addon-api#421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available. PR-URL: #25319 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Refs: nodejs/node-addon-api#421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available. PR-URL: nodejs#25319 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Refs: nodejs/node-addon-api#421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available. PR-URL: nodejs#25319 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made. |
The referenced PR landed, more recently we've added some doc to the README.md so I think this can be closed. Please let us know if you think that was not the right thing to do. |
I'm a bit confused about the NAPI versioning, like
NAPI_VERSION
,NAPI_EXPERIMENTAL
macros.1.
deprecation ofNAPI_EXPERIMENTAL
With 73fed84 impl has been changed to only use
NAPI_VERSION
to determine whether features can be used.#endif
comments like 73fed84#diff-f546e4cc35b454813e5264fe9c9e6fc8R307.Tests are still definingNAPI_EXPERIMENTAL
: this can be removed I think, as well as any other occurrence ofNAPI_EXPERIMENTAL
in the projectnpm test --NAPI_VERSION=...
should be documented or defined as npm scripts, likenpm run test:v2
,npm run test:v3
, etc.2. experimental versions
For features which will land with any future napi version currently not defined, we have those
#if (NAPI_VERSION > 2147483646)
statements. I think it would be easier to read:As well as documentation or defining scriptsnpm run test:experimental
What do you think?
The text was updated successfully, but these errors were encountered: