Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upn-api: make func argument of napi_create_threadsafe_function optional #27791
Conversation
nodejs-github-bot
added
C++
n-api
labels
May 21, 2019
legendecas
force-pushed the
legendecas:tsfn
branch
2 times, most recently
from
a2bcde8
to
dc0cb8e
May 21, 2019
This comment has been minimized.
This comment has been minimized.
|
Awesome - thanks for putting this together! <3 |
This comment has been minimized.
This comment has been minimized.
|
@nodejs/n-api … how would one feature-detect this? Should we provide that? |
This comment has been minimized.
This comment has been minimized.
|
That would be good - either that or it can be part of the standard API for napi version 5 and later. |
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
@legendecas please also modify https://nodejs.org/docs/latest/api/n-api.html#n_api_napi_threadsafe_function_call_js by mentioning for the |
This comment has been minimized.
This comment has been minimized.
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.) |
This comment has been minimized.
This comment has been minimized.
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 |
gabrielschulhof
added
the
semver-minor
label
May 21, 2019
legendecas
force-pushed the
legendecas:tsfn
branch
from
dc0cb8e
to
3767947
May 22, 2019
|
Excellent progress! A few minor changes and it'll be golden |
This comment has been minimized.
This comment has been minimized.
|
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) |
legendecas
force-pushed the
legendecas:tsfn
branch
2 times, most recently
from
7bfb88f
to
b985dd2
May 24, 2019
|
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. |
legendecas
force-pushed the
legendecas:tsfn
branch
2 times, most recently
from
bc653a9
to
4142960
May 27, 2019
This comment has been minimized.
This comment has been minimized.
@gabrielschulhof Alternatively, you could approve it but add one of the |
gabrielschulhof
dismissed
their
stale review
May 28, 2019
Using the method mentioned by @Trott instead.
gabrielschulhof
added
the
work in progress (WIP)
label
May 28, 2019
legendecas
force-pushed the
legendecas:tsfn
branch
from
4142960
to
af66250
May 29, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@nodejs/build can you please help me out here? The one failing job is from a different build. I don't get how come https://ci.nodejs.org/job/node-test-pull-request/24016/ didn't replace the job from https://ci.nodejs.org/job/node-test-pull-request/23975/. |
This comment has been minimized.
This comment has been minimized.
You can ignore the GitHub widget if it conflicts with what the actual Jenkins CI is telling you. |
This comment has been minimized.
This comment has been minimized.
|
Landed in 5705d7b |
Trott
closed this
Jun 22, 2019
legendecas
deleted the
legendecas:tsfn
branch
Jun 22, 2019
This comment has been minimized.
This comment has been minimized.
|
@Trott thanks! Will do in the future. |
legendecas commentedMay 21, 2019
•
edited
Ref: #27592
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes