Skip to content

confusion about NAPI_VERSION, NAPI_EXPERIMENTAL #421

Closed
@DaAitch

Description

@DaAitch

I'm a bit confused about the NAPI versioning, like NAPI_VERSION, NAPI_EXPERIMENTAL macros.

1. deprecation of NAPI_EXPERIMENTAL

With 73fed84 impl has been changed to only use NAPI_VERSION to determine whether features can be used.

  1. What not has been adapted are the #endif comments like 73fed84#diff-f546e4cc35b454813e5264fe9c9e6fc8R307.
  2. Tests are still defining NAPI_EXPERIMENTAL: this can be removed I think, as well as any other occurrence of NAPI_EXPERIMENTAL in the project
  3. npm test --NAPI_VERSION=... should be documented or defined as npm scripts, like npm 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:

#define NAPI_VERSION_EXPERIMENTAL 2147483647

// [...]

#if (NAPI_VERSION == NAPI_VERSION_EXPERIMENTAL)
// ...
#endif

As well as documentation or defining scripts npm run test:experimental

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions