nodejs / node-api-headers

Repository used to make the N-API headers more accessible
MIT License
32 stars 13 forks source link

Automations to synchronize source files from Node.js core repo #2

Closed legendecas closed 1 year ago

legendecas commented 3 years ago

We may need automation setups to help us reduce the labor works on synchronizing source files in this project that shared with the Node.js core repo.

mhdawson commented 3 years ago

Automation would be good, but we only need to sync when there is a new version of Node-API. For example the next time will be when we introduce version 9. We remove the experimental functions, so that is the only time we should need to change the files.

It might be something like a few times a year.

KevinEady commented 2 years ago

We discussed in the 10 June Node API meeting that it various approaches to automation to update the exported symbols as well as the header file.

Updating the header file:

  1. [Simpler] Have some command in the package that would update the headers and then update the symbols file manually.
  2. [Harder] Use a github action to check if the header has changed on core and create a PR for updating the header file. Someone would need to manually update the PR to change the symbols file with new symbols added

In discussions, it sounds like solution 1 is a simpler approach that we should take.

Updating the symbols file:

In discussions, since this is not something that occurs frequently, it may not be super beneficial to have an automated process to update the symbols.

NickNaso commented 1 year ago

Hi everybody, I'll take care ofi this issue. I started to investigate if its possible to list the symbols using the preprocessor output. I wanto to try to navigate the results and discover if they are usefult o produce the list of symbols that we need.

legendecas commented 1 year ago

Thank you @NickNaso for taking on this work. Nevertheless, I'm ok with the conclusion above to manually update the table as we can see that the node-api is not updated in a so frequent manner.

GitMurf commented 1 year ago

I am new to finding this repo which is a life saver! But in tracking all the history with past GH Issues discussing the issues of the node_api.h being removed from the node-addon-api package, I am wondering if currently this repository is the newest/correct files? I see there hasn't been an update to the releases in the last year. It is also a little confusing because if I understand correctly, the node-api (in the readme hear it mentions Node-API version: 8) is NOT on the same version as node.js (v18/19), correct? Thanks!

GitMurf commented 1 year ago

I answered my own question but want to post back here for others in the future :) As of today, Node-API is at version 8 (which this repository supports) and Node-API versioning is independent of Node.js (see screenshot).

See here: https://nodejs.org/api/n-api.html#node-api-version-matrix

Below is the current version matrix showing Node-API v8 as indeed the current version.

image

Julusian commented 1 year ago

While hte api version hasn't changed, this library could do with an update. There have been some backwards compatible changes made to the headers that would be useful to expose https://github.com/nodejs/node/commit/09ae62b9a869ff19d634b0fd1f5a17f198cd1ae7

legendecas commented 1 year ago

Done in https://github.com/nodejs/node-api-headers/pull/7.