-
Notifications
You must be signed in to change notification settings - Fork 14
Fix node gyp build node 10 #4
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
Fix node gyp build node 10 #4
Conversation
|
I realize it has been a while since you last touched the library. If you are no longer maintaining this, please give me a ping. |
| Local<Value> argv[argc] = { args[0] }; | ||
| Local<Function> cons = Local<Function>::New(isolate, constructor); | ||
| args.GetReturnValue().Set(cons->NewInstance(argc, argv)); | ||
| args.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); |
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.
^ this change is the actual fix. Some info around that can be found here: https://stackoverflow.com/questions/45388032/how-to-silence-newinstance-is-deprecated-warning-in-node-gyp-rebuild-what
|
Great work, I'll review this PR this weekend, and merge it if everything looks 👌. I was planning on fixing the build for v10 via N-API, but was still wrapping my head around it (there's an old branch here on GitHub with the beginning of my inquiries to fix it). I fully intend to still maintain this repo, I just genuinely thought no one besides my own work used this so I could fix it at my leisure. Thanks again for this. |
|
Reviewed this today. Excellent work. The module still works with older node versions (I tested on v9), while also now working on v10 as you stated. My own tests all passed with no changes to the TCP communications, and you added mocha test is a much needed improvement! So, I'm merging this, and then I want to do some house cleaning (such as #5). Then I'll publish these changes as a new minor patch (v1.1.0). Thanks for the excellent work! |
|
Thanks for reviewing and merging. If you'd publish a new release that includes this in a somewhat timely fashion, that would be awesome. |
|
Planning to publish it today 😄 |
|
@basti1302 V1.1.0 is live now: https://www.npmjs.com/package/netlinkwrapper/v/1.1.0 Thanks again for your work. |
The
node-gypbuild breaks on Node.js 10 withThis change fixes this, so the module can also be used with the latest Node.js version.
Note that the build in Node.js 8 also emitted a corresponding deprecation warning:
This warning is now also gone when building with Node 8.
I also added a test case for the TCP client functionality and tested the library for all the Node versions from 4 to 10 (latest patch version for each major version) successfully via
rm -rf node_modules && npm install && rm -rf package-lock.json && node-gyp rebuild && npm test, so I'm quite confident that the change in the production code doesn't break the library for older versions.