Skip to content
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

Upgrade to [email protected] - refs #125 #127

Merged
merged 8 commits into from
Jun 23, 2018
Merged

Upgrade to [email protected] - refs #125 #127

merged 8 commits into from
Jun 23, 2018

Conversation

springmeyer
Copy link
Contributor

@springmeyer springmeyer commented Apr 30, 2018

This starts using Nan::AsyncResource (aka Node::AsyncResource under the hood) to enable us to upgrade to latest nan without hitting deprecation warnings (that we turn into errors in skel due to our use of -Werror).

What is Node::AsyncResource?

It looks like it is a simple C++ class that needs to be created and passed to all callbacks. It looks like it is needed to be able to support this JS-land API: https://nodejs.org/api/async_hooks.html

My understanding is that we need to create one with a unique name. The Nan wrappers make this easy: https://github.com/nodejs/nan/blob/master/doc/asyncworker.md#nanasyncworker.

For the one place what we call a callback directly (not using Nan) this PR creates a Nan::AsyncResource directly.

refs mapbox/mapbox-gl-native#11288
refs #125

@springmeyer springmeyer requested a review from jfirebaugh April 30, 2018 19:22
@springmeyer springmeyer force-pushed the latest-nan branch 2 times, most recently from 4111d65 to e02ca16 Compare May 3, 2018 14:57
@springmeyer springmeyer mentioned this pull request Jun 4, 2018
3 tasks
@springmeyer
Copy link
Contributor Author

Summary is that one should use Nan::Call for sync calls, and Nan::Callback::Call for async.

from sass/node-sass#2298 is relevant since we do both sync and async calls.

@springmeyer springmeyer merged commit a1105dd into master Jun 23, 2018
@springmeyer springmeyer deleted the latest-nan branch June 27, 2018 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant