question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more maintainers

See original GitHub issue

While I’ve been merging small PRs and occasionally making releases, I’m not really using Node much these days, and so my motivation to work on this library has declined.

The project has reached a point where several long-standing issues have become pressing, while I’m not currently able to put in the effort to deal with them. I’m glad to see the project so widely used, but I hate to see the issues and pull requests piling up. I’m hoping there are contributors interested in taking on a more active role.

Given the risk of supply-chain attacks, I’m going to do this cautiously, with a preference for existing contributors or maintainers of other libraries, and may end up simply recommending publishing under a new npm package name instead.

Here are the issues that most need attention:

Prebuild ABI treadmill

As a C++ extension using V8 / NAN directly, node-usb currently needs to be built for each new Node and Electron release. Users tend not to have compiler toolchains on Windows, so rely on prebuilds that have to be kept updated.

N-API (implemented in https://github.com/tessel/node-usb/pull/399) is the way out of this.

Old libusb

This library is linked against a very outdated fork of libusb, containing my rebase of an old patch from the libusb mailing list adding hotplug event support for Windows. Upstream libusb has still not added hotplug support for Windows, but we’re missing out on several years of upstream bugfixes.

I don’t know what the best answer here is. Libusb is similarly undermaintained, and I don’t expect them to add Windows hotplug support anytime soon. It’s possible that node-usb 2.0 should just make the breaking change of not guaranteeing hotplug support on all platforms.

Testing

The full test suite, which I run prior to releases, requires hardware that was never produced in quantity, running firmware that I seem to have lost the source code for. The firmware is pretty simple, just a couple of endpoints and control requests that echo data back, and it would be good to migrate this to a piece of widely available hardware. (https://github.com/tessel/node-usb/issues/5)

Travis-CI is sunsetting their support for open source projects, necessitating a move to another CI platform, probably GitHub Actions.

API issues

The API was designed before Promise and async/await and could use a redesign. Other major deficiencies include broken handling of USB configurations because that was added as an afterthought. The standard for USB in JS nowadays is WebUSB, so a hypothetical node-usb 2.0 should probably just adopt that API wholesale. @thegecko’s webusb wraps this library in a webusb-compatible API and could be a good starting point.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (23 by maintainers)

github_iconTop GitHub Comments

3reactions
rwaldroncommented, Feb 12, 2021

@kevinmehall I’ve added @thegecko

1reaction
kevinmehallcommented, Apr 16, 2021

Correct. The libusb hotplug APIs are unsupported on Windows. This maps to the 'attach' and 'detach' events in node-usb. The version of libusb used in node-usb is based on one of the previous attempts at implementing hotplug on Windows that seemed to work but never got merged upstream.

Libwdi could be useful in some cases but I fear it would be a support burden. With how many people report issues here trying to use HID, CDC, or mass storage devices with this library, I’d want a big warning on it, because someone’s going to loop over all their devices and replace all the drivers and break their mouse and keyboard.

The preferred option for custom devices is a WCID descriptor that tells Windows 7+ to bind the WinUSB driver automatically. That’s not always an option, but it’s a more elegant solution when it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assigning the team maintainer role to a team member
Above the list of team members, use the drop-down menu and click Change role.... Drop-down menu with option to change role. Select a...
Read more >
How to hand over an Open Source project to a new maintainer
You can add new maintainers as collaborators on your repository or move the repository to an organization namespace which can have teams ...
Read more >
Members of a project - GitLab Docs
In GitLab 14.8 and earlier, direct members of a project have a maximum role of Maintainer. The Owner role can be added for...
Read more >
Understanding User Roles | Transifex Help Center
Project Maintainers · Add/remove project languages. · Approve/deny language requests · Add/delete resources. · Assign new project maintainers · Access reports · Post ......
Read more >
Supporting Roles - Gerrit Code Review
Maintainers are trusted to assess changes, but are also expected to align with the other maintainers, especially if large new features are being...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found