-
Notifications
You must be signed in to change notification settings - Fork 45
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 broken builds on Node.js 12.x due to changes to the V8 API. #80
base: master
Are you sure you want to change the base?
Conversation
The changes are: - v8::Handle is now called v8::Local. - A number of functions now require isolates, so we pass in v8::Isolate::GetCurrent() - A number of functions now require a context, so we pass in Nan::GetCurrentContext() - A number of functions now return Maybe<T>, so call .FromJust() on those results.
All the code files changed in this PR are actually autogenerated by NodeRT. So I'd rather not merge this because the changes would all be lost if the code was generated again. Unfortunately it looks like NodeRT is not being actively maintained any longer; I don't think anyone is updating it to generate code that works with Node 12. See also #4 |
@jasongin Makes sense to me. #4 would probably be better, but I don't have time at the moment to pursue that one personally. I'll leave my fork out there in case anyone using Node.js v12 wants to use noble-uwp like me, but otherwise feel free to close this PR if you don't think you'll ever merge it in. |
I noticed a fix was merged into NodeRT (months after we last looked at this), so we should be able to update that dependency and regenerate the code to resolve the issue. |
nodejs v12.16.0, electron v8.2.2
Installing NodeRT UWP adapter for Windows.Foundation C:\Users\mk10261\AppData\Local\node-gyp\Cache\8.2.2\include\node\v8.h(8931): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\NodeRtUtils.cpp) [E:\working\mbuilder\build\node_modules\noble-uwp\uwp\windows.foundation\build\binding.vcxproj] what can i do to fix this, thank you very much |
I was attempting to use noble-uwp with Node.js v12.0.0 (actually, it was Electron v5.0.7 which is based on that), but some differences in the V8 API prevented it from compiling successfully.
I have made the following changes to get things working:
As far as I can tell, things are working well with those changes.
The only problem I'm aware of is that I don't believe these changes will compile on older versions of Node.js, which isn't ideal... But I'm not sure how to work around that, short of creating two sets of mostly duplicated files in the repo or something.
I'm happy to answer any questions or make tweaks to these changes!