-
Notifications
You must be signed in to change notification settings - Fork 285
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
mix NAPI and v8/Nan within the same addon #2493
Comments
We don't do anything to specifically prevent the combination however:
|
If the list of things you can't do is small could you paste the list here. |
That's clear that I have to compiler per major node version as soon as I use NAN/v8. My intention is to get rid of as much as possible from using NAN/v8 simply because of easier maintenance. Most likely the safer approach would be to register the addon via the legacy API as context aware addon (via
I created following issues a while ago which should cover most cases: nodejs/abi-stable-node#295 and nodejs/abi-stable-node#296 I think CpuProfiler and HeapProfiler are meanwhile available from JS land via inspector. |
There has been no activity on this issue for 3 years and it may no longer be relevant. It will be closed 1 month after the last non-automated comment. |
I'm going to close out this issue. |
completely forgot about this one. Using Napi and v8/NAN seems to work fine, at least I haven't run into issues. One has to copy over the casting/conversion between Napi <==> v8 handles from node code but as long as this doesn't change there it works. Main drawback here is that this setup accumulates the disadvantages of both worlds:
It's unlikely that all potential relevant v8 APIs will be available via Napi at any time so if one decide to go this path this mixed setup will likely not go away. |
Are there any limitations in mixing NAPI and v8/NAN within the same native Addon?
There are some v8 APIs not available via NAPI like installing GC callbacks or reading inferred function name from a function object therefore I stick on v8/NAN for some corner cases but would prefer NAPI for the rest.
I would expect that at
napi_handle_scope
is also a v8HandleScope
. Is that true?Is it possible to convert between
napi_value
andv8::Value
?The text was updated successfully, but these errors were encountered: