-
Notifications
You must be signed in to change notification settings - Fork 459
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
update for latest n-api changes #140
Conversation
@gabrielschulhof the other thing of note in this is that I had to add uv.h and node.h to node_internals.h because of refactoring that took place in the node files. I'm wondering who we could have built the wrapper without the vm as node_api.cc would have needed uv.h and node.h ? Maybe its just late and I'm tired though ? |
Following is an outline of the updates required for the async hooks changes:
Since it's not trivial, it's probably better to do as a separate PR. |
@jasongin so are you suggesting that we land this PR as is and then do a follow on PR to cover the steps you have outline ? That would make sense to me. It would let us address the current breakage so that we minimize the time people can't use the wrapper with master (and 8.6 when goes out soon) |
Yes. |
Ok then @jasongin need a review on this PR so I can land. |
ModuleRegisterCallback registerCallback) { | ||
return details::WrapCallback([&] { | ||
return napi_value(registerCallback(Napi::Env(env), | ||
Napi::Object(env, exports))); |
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.
nit: The last line here should be indented further to align with the previous argument.
Or, the explicit napi_value()
constructor can be omitted because that conversion can be implicit.
|
||
napi_value resource_id; | ||
napi_status status = napi_create_string_latin1( | ||
_env, "generic", -1, &resource_id); |
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.
I don't like this much, but it's fine for now. The follow-up changes will move this resource name string to a parameter of the AsyncWorker
constructor.
Will land and address @jasongin comments. |
PR-URL: #140 Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Landed as 8b66730 |
This change is initiated from nodejs#140 (comment).
This change is initiated from nodejs#140 (comment).
This change is initiated from nodejs#140 (comment).
This change is initiated from #140 (comment). PR-URL: #253 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
PR-URL: nodejs/node-addon-api#140 Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
This change is initiated from nodejs/node-addon-api#140 (comment). PR-URL: nodejs/node-addon-api#253 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
PR-URL: nodejs/node-addon-api#140 Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
This change is initiated from nodejs/node-addon-api#140 (comment). PR-URL: nodejs/node-addon-api#253 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
PR-URL: nodejs/node-addon-api#140 Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
This change is initiated from nodejs/node-addon-api#140 (comment). PR-URL: nodejs/node-addon-api#253 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
PR-URL: nodejs/node-addon-api#140 Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
This change is initiated from nodejs/node-addon-api#140 (comment). PR-URL: nodejs/node-addon-api#253 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@NickNaso.local>
There is a better way to handle the changes for async hooks, this gets it compiling/working but I know its not right @jasongin can you suggest what we should be doing in terms of properly supporting the new async hook parameters.