abi-stable-node icon indicating copy to clipboard operation
abi-stable-node copied to clipboard

Node-API v9

Open NickNaso opened this issue 3 years ago • 2 comments
trafficstars

Might it be time for a new version of Node-API?

We added the following new features:

  • node_api_symbol_for (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L96)
  • node_api_create_syntax_error (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L120)
  • node_api_throw_syntax_error (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L377)
  • node_api_get_module_file_name (https://github.com/nodejs/node/blob/master/src/node_api.h#L276)

NickNaso avatar Apr 27 '22 16:04 NickNaso

+1 from me

mhdawson avatar May 02 '22 21:05 mhdawson

Discussed in the node-api team meeting this week. Lets think about it this week and the decide in the next meeting.

mhdawson avatar May 06 '22 15:05 mhdawson

I think we should wait for https://github.com/nodejs/node/pull/45715 as well.

gabrielschulhof avatar Apr 08 '23 06:04 gabrielschulhof

We did forget this for a while, I think doing a new Node-API version would be good. We missed the lauch of Node.js 20 but I think we can get it in before it goes LTS.

mhdawson avatar Apr 11 '23 21:04 mhdawson

Should we also put there the new finalizer behavior? Or they must be part of v10 as it is a quite big behavioral change?

vmoroz avatar Apr 14 '23 14:04 vmoroz

We discussed today to do Release 9 with just

  • node_api_symbol_for (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L96)
  • node_api_create_syntax_error (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L120)
  • node_api_throw_syntax_error (https://github.com/nodejs/node/blob/master/src/js_native_api.h#L377)
  • node_api_get_module_file_name (https://github.com/nodejs/node/blob/master/src/node_api.h#L276)

along with https://github.com/nodejs/node/pull/45715 and release those along with 45715 but modifying this line to guard with experimental - if (env->module_api_version <= 8) , as well as the documentation that says at what point the new functionality takes place, was well as the tests.

@vmoroz will submit a PR to makes those changes @legendecas will do the the release. As part of that he will add to https://github.com/nodejs/node/issues/47664

mhdawson avatar May 05 '23 15:05 mhdawson

We have released Node-API version 9. Closing.

gabrielschulhof avatar Jul 19 '23 23:07 gabrielschulhof