-
Notifications
You must be signed in to change notification settings - Fork 37
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
How to use multiple .node files? #57
Comments
We only support one .node file atm, but we have a tagging api we could improve to support this. |
Actually we could just preserve the name now. The reason we call it "node" is legacy (we used to make seperate builds for electron pre-napi). So we could just preserve the name of the files (anything before the first
|
If you wanna help with o/ let me know, otherwise we'll get to it at some point :) |
If we're dropping support of non-napi we can also remove the |
+1 to dropping napi, I think we might wanna keep the abi one incase you wanted to target a specific abi for a bugfix for only that version, ie you have your general one and then one for a specific abi |
What should the default name be?
I ask because option 2 could enable searching a flat directory that contains multiple addons, produced by a bundler like zeit/pkg (prebuild/node-gyp-build#27) or webpack (prebuild/node-gyp-build#22). Which kinda requires that all consumers of |
If you want to fix support for webpack then I dont think you can safely rely on either of those fallbacks. Once it is webpacked, in the unlikely scenario that you do know and manage to load the correct package.json, then someone has configured webpack to mangle If you make an important parameter like this optional, then you are prioritising convenience of a library author over users of that library. It would take a library author a couple of minutes to adjust their call to |
I don't agree with that prioritization though. Convenience for library authors - and us avoiding breaking changes that create work for them if they possibly don't care about webpack at all - is quite important. That work also includes understanding the change which takes more than a couple of minutes. Using webpack is the user's choice, and makes it their responsibility to make it work, considering that webpack is not the only bundler, and that webpack made the unfortunate choice of dropping compatibility with node modules. That said, of course compatibility with webpack is a welcome feature, and if done right, would ultimately also save library authors time. We can get there incrementally, starting with a |
I agree that minimising unnecessary work for them is important (I do neglect updating libraries which do semver major jumps too often), but that doesnt mean it shouldnt be done.
Does it? Both prebuidify and node-gyp-build would complain at the lack of name when being used, and can give a hint at what it should be set to. Or they would check the docs and see the one line justification and description of the new property.
Except that by making it the users responsibility you are leaving them to choose between some painful choices:
From what I gather it does affect other bundlers too, and it makes sense to. Its not that webpack doesnt support node_modules, its that
I am fine with this approach, but do think it needs to be a required option in a future release |
A bundler that targets Node.js should make sure that |
Hi, I'm the current maintainer of
node-hid
. It supports two different back-end native libraries on Linux:libusb
orhidraw
. The bindings loading currently looks like:How do I accomplish something similar using
prebuildify
andnode-gyp-build
?I have a test repo that generates two simple .node libraries here: https://github.com/todbot/napi-demo
I can see that
node-gyp
is correctly building both:but
prebuildify
is only takinghello1.node
and renaming it tonode.napi.node
, leavinghello2.node
behind. And I don't see now innode-gyp-build
I can specify which .node.The text was updated successfully, but these errors were encountered: