-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
n-api: make func argument of napi_create_threadsafe_function optional #27791
Conversation
a2bcde8
to
dc0cb8e
Compare
Awesome - thanks for putting this together! <3 |
@nodejs/n-api … how would one feature-detect this? Should we provide that? |
That would be good - either that or it can be part of the standard API for napi version 5 and later. |
@addaleax you could simply assume that passing I am curious as to the semverity of this change, though. If it's semver-minor, we need to go through the whole experimental life cycle, but I'm not sure how we would do that for a semantic change like this, rather than the clean addition of a new N-API. |
@legendecas please also modify https://nodejs.org/docs/latest/api/n-api.html#n_api_napi_threadsafe_function_call_js by mentioning for the |
Right, but you usually want to support as many versions as possible, so you’d still end up always providing
Is that a N-API-specific rule that’s written down somewhere? I would consider this semver-minor, but I agree that it doesn’t make sense to label this as experimental. (Fwiw, I think none of the N-API functions currently marked as experimental should be experimental, except maybe the threadsafe function feature due to its complexity.) |
Well, if you get My take is that this change is more about making
Well, the rule concerns new N-APIs. This isn't strictly a new N-API 🙂 But yeah, a semver-minor bump sounds like the way to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent progress! A few minor changes and it'll be golden 👍
I think we can be flexible on going through an experimental cycle. For new functions, I think it makes sense and we should stick to that. In this case I think we'll get agreement that we should just do this immediately. My preference would be to make the change, and bump the N-API version in the same PR. In that way you will know you can depend on the parameter being optional if it is version 5 or higher. We might also want to review if we should promote any other functions out of experimental at the same time as we bump the version number (being careful to think about whether those other changes can be backported in case we want to backport version 5 support to 10.x and 8.x) |
7bfb88f
to
b985dd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually requesting changes. On my part the PR is approved as is, however, I'm marking it as "Request changes" so as to prevent it from landing before we've had a chance to co-ordinate what else should be added to N-API 5.
bc653a9
to
4142960
Compare
@gabrielschulhof Alternatively, you could approve it but add one of the |
Using the method mentioned by @Trott instead.
PR-URL: nodejs#28410 Refs: nodejs#27791 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: #27791 Refs: #27592 Reviewed-By: Gabriel Schulhof <[email protected]>
PR-URL: #28410 Refs: #27791 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
PR-URL: nodejs#27791 Refs: nodejs#27592 Reviewed-By: Gabriel Schulhof <[email protected]>
PR-URL: nodejs#27791 Refs: nodejs#27592 Reviewed-By: Gabriel Schulhof <[email protected]>
PR-URL: #27791 Backport-PR-URL: #28399 Refs: #27592 Reviewed-By: Gabriel Schulhof <[email protected]>
Notable changes: * crypto: * add support for chacha20-poly1305 for AEAD (chux0519) #24081 * increase maxmem range from 32 to 53 bits (Tobias Nießen) #28799 * deps: * update npm to 6.11.3 (claudiahdz) #29430 * upgrade openssl sources to 1.1.1d (Sam Roberts) #29921 * dns: * remove dns.promises experimental warning (cjihrig) #26592 * fs: * remove experimental warning for fs.promises (Anna Henningsen) #26581 * http: * makes response.writeHead return the response (Mark S. Everitt) #25974 * http2: * makes response.writeHead return the response (Mark S. Everitt) #25974 * n-api: * make func argument of napi\_create\_threadsafe\_function optional (legendecas) #27791 * mark version 5 N-APIs as stable (Gabriel Schulhof) #29401 * implement date object (Jarrod Connolly) #25917 * process: * add --unhandled-rejections flag (Ruben Bridgewater) #26599 * stream: * implement Readable.from async iterator utility (Guy Bedford) #27660 * make Symbol.asyncIterator support stable (Matteo Collina) #26989 PR-URL: #29875
Notable changes: * crypto: * add support for chacha20-poly1305 for AEAD (chux0519) #24081 * increase maxmem range from 32 to 53 bits (Tobias Nießen) #28799 * deps: * update npm to 6.11.3 (claudiahdz) #29430 * upgrade openssl sources to 1.1.1d (Sam Roberts) #29921 * dns: * remove dns.promises experimental warning (cjihrig) #26592 * fs: * remove experimental warning for fs.promises (Anna Henningsen) #26581 * http: * makes response.writeHead return the response (Mark S. Everitt) #25974 * http2: * makes response.writeHead return the response (Mark S. Everitt) #25974 * n-api: * make func argument of napi\_create\_threadsafe\_function optional (legendecas) #27791 * mark version 5 N-APIs as stable (Gabriel Schulhof) #29401 * implement date object (Jarrod Connolly) #25917 * process: * add --unhandled-rejections flag (Ruben Bridgewater) #26599 * stream: * implement Readable.from async iterator utility (Guy Bedford) #27660 * make Symbol.asyncIterator support stable (Matteo Collina) #26989 PR-URL: #29875
Ref: #27592
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes