-
Notifications
You must be signed in to change notification settings - Fork 53
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
Nodejs #61
Nodejs #61
Conversation
Daniel, I just wonder if it's possible to browserify the performance-now module into WebMIDIAPI.js to minimize the number of end user dependencies? |
Not sure if I understand you correctly. The performance-now package is only needed in the nodejs version; for the browser version we have the performance polyfill in src/util.js or the native implementation of performance.now() when available |
Ok, I'll try to do it myself after your check-in gets merged. If that will not work, I'll leave everything as it is :) |
Okay, but browserify is meant for adding functionality of nodejs packages to a web project. So it is a bit odd to browserify performance-now while performance.now() has been implemented in most modern browsers. Also I don't see a problem in having dependencies; npm is made for managing dependencies and it encourages the use of smaller interdependent modules for the sake of maintainability and scalability. The way the WebMIDIAPIShim is currently set up only needs and uses the performance-now package for nodejs projects. Browser projects only need the transpiled .js file in the /lib folder. If you insist on limiting the number of dependencies, you could remove the performance-now package all together: in that case the polyfill will add a performance.now() function based on setTimer(). You can do this by replacing the lines 6 - 8 in in /lib/index.js
by just:
|
Thanks a lot for the advice. I'll try it. |
The examples routing_1 and routing_2 didn't work correctly on Windows and OSX because in Chrome 43 stable the device ids on Windows are index numbers (0, 1, 2, etc.) and therefor not unique per device. On OSX the device ids can be negative numbers which can't be used as html id attribute for the checkboxes. So I have added the prefixes 'input' and 'output'. |
Chris, are you on vacation? :) |
Kind of. Swamped post-I/O, and haven't had a chance to review this (sizable!) update. |
Hey Chris, just wonder if you are still maintaining this project? |
Sooooo sorry. Been very busy, and I wanted to look this over in detail. |
window
in both web and nodejs versionnpm test