-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
N-API support for node-serialport #1186
Comments
This is great. Once it supports LTS nodes this will make life a lot easier for a lot of people. |
great ! |
@reconbot can we set up a time to have a quick chat ? |
hit me up via email @mhdawson |
sent to your wizard email listed in github profile. |
This is my understanding of our conversation today: We talked today about Node Serial port. Francis is happy to have a branch in the repo and help maintain once there is a port. Francis sees definite benefits in that today the npm needs to support downloading because there has to be a different binary for every version of Node.js and the sum of those are too big to bundle into an npm. With a single binary bundling would be possible. The plan is for me to take a first cut at porting, Francis is available to support us by answering questions etc. Once we have an initial cut we'll get back together to get it into a branch in the repo and figure out the plan going forward. |
Now is the time to go head with what's in master I think |
Starting to work on the port here https://github.com/mhdawson/node-serialport/tree/n-api. Have just started so have only done a small part of the conversion so far. |
One note is that I saw a few tests failing before I started, notably those that required changing the baud rate. I commented those out and other than those 3-4 all were passing using a connected arduino and linux. I figure as long as the same tests pass after the N-API port that will be a good starting point. |
Looks good so far =) |
👍 ! We (at Particle) are really excited about the prospect of simplifying and improving reliability of node-serialport installations across the various platforms our particle-cli npm module is designed to run on. This has been a big pain point for our community. Am I correct in thinking that this work will help on this front? I'm assuming the answer is yes. If not, would be curious to know where I got the wrong assumption. We'll be watching progress of N-API and this issue, thanks for taking this on, please don't hesitate to reach out to me or @monkbroc if there is potential technical work we could do to help with this. |
This will help for sure. I switched us to Another side effect of All this is neither here nor there if n-api takes over. |
I've not made as much progress as I'd like on this (just lack of time, its been a busy last few months for me), @joegoggins if you would like to collaborate on the port lets touch base and discuss how we do that. |
Hey there @mhdawson thank you kindly for reaching out to collaborate. Despite our keen interest in seeing this project move forward, we are actually in the same boat--we don't have extra engineering muscle to throw down on this right now. Additionally, in grok-ing the commits you introduced in your n-api serialport fork, I don't know if we have anyone here that would be able to contribute quickly and productively to this project. All of that ^^ could change though; so please reach out the next time you dig deep into this or want someone to alpha test your fork. In the meantime, let's hope someone else on the interwebs steps up with the resources to you help push this forward. Cheers 🍻 ! |
@joegoggins thanks for the response. I do hope to get back to this soon and I'll keep this issue up to date so you can see where it is at if there are changes on your side. |
Hey everyone, what's the status of this? |
And does this prebuild issues effect it at all? prebuild/prebuild#220 |
Unfortunately, I never squeezed in time push it forward. If node-serialport uses prebuild then that discussion/PR will help when it comes time to build binaries for N-API versions. |
I understand, It is a lot of work to maintain a separate binding package
that used n-api. I recently switched us to only supporting LTS. So.. it
would pay off eventually but there isn't a rush on my end.
…On Wed, Aug 29, 2018, 9:13 AM Michael Dawson ***@***.***> wrote:
Unfortunately, I never squeezed in time push it forward. If
node-serialport uses prebuild then that discussion/PR will help when it
comes time to build binaries for N-API versions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1186 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABlbrbalsmooIsK_9w0SKezexmNDEDSks5uVpOGgaJpZM4Nx7D_>
.
|
So node 6 is EOL Today 🎉 I had a call with the N-API working group yesterday where they guided my hand a bit. The biggest takeaway is that I can't use node's libuv, as that's not ABI stable. (or it isn't guaranteed but is stable and maybe we can't rely on that?) I love libuv but as far as I know there's not much I can do, other than move away from it. The steps as I see it;
|
Which now says we can probably rely on |
I tried a simple example of reading from the serial port and it worked but when I try to call the same port reading file from a worker then I get and error which seems related to serialport still using NAN??? FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope |
Hi All, I would like to understand the level of interest/ support for this feature request. I know this issue is quite old, but I think it is still relevant and worthwhile. Could you please let me know if you would like to support or contribute to migrating to N-API? In particular I have local version where I have ported the core (non platform specific functionality) over to napi, and am working through the platform specifics, for windows at the moment, and plan to look at Linux next. At the moment it feels a little hacky, but the happy path is working so I'm encouraged to progress. If people are interested in getting involved then I would be happy to share the work in progress for review, feedback and any guidance on best practice or examples of other projects which could act as good reference implementations (license permitting). Don't worry if you don't have time to support, I'll continue to work on this in my garage (/local repo); but if other are able to help them I'll try to share updates so we can collaborate on this |
If you do a draft pr I'm more than happy to do review. This is still a very important feature. |
I've created #2305 for this. Please note this only includes the architecture agnostic changes as the other stuff is still WIP, but I would be very keen for any review, feedback, comments and suggestions. To build and test at the moment you need to stub out the arch specific functions; as such a pure code review is probably easier. @mhdawson If you or any of your team of NAPI experts are able to review or help then it would be greatly appreciated |
@GazHank created nodejs/abi-stable-node#430 so that the team is aware of the ask and we can see if anybody has some time to review/help. |
Thanks Michael |
This can be closed now. 🚀 |
The recently announced Node 8 has a new experimental feature called N-API which is aimed at reducing maintenance cost for node native addons. Checkout this blog for more details on its benefits.
node-serialport is one of the top 30 native modules by download dependency count, and in order to help the Node.js community make the important transition to N-API, we are hoping you will be able to work with us in order to port X to support N-API. Your support and feedback is important in making this effort a success.
I am part of the N-API working group and and would like to talk to you about how you can can get started with N-API and what help we might be able to provide. I'm available to talk on the phone individually if you'd like. Alternatively, if you prefer, feel free to jump in our WG meeting which happens every Thursday at 1.30 Eastern / 10.30 Pacific US time, to discuss any issues.
Here’s a video of N-API in action
https://www.youtube.com/watch?v=nmXhJ88nZsk
The text was updated successfully, but these errors were encountered: