cwilso / WebMIDIAPIShim

Polyfill using the Jazz NPAPI MIDI plugin to implement the Web MIDI API on Mac and Windows.
380 stars 53 forks source link

Upgrade 2017 #69

Closed abudaan closed 6 years ago

abudaan commented 7 years ago
abudaan commented 7 years ago

@cwilso @jazz-soft May be we should remove the icons at the top of the README; the list of icons is not complete and the text describes all supported environments anyway.

jazz-soft commented 7 years ago

On the contrary, we should add the Raspberry Pi icon :) But probably we can get rid of Chrome and Opera icons because these already have native MIDI support. (or we can keep them because we support the old versions of Chrome and Opera) I have a solution for the latest Firefox that I plan to check in after we are done this pull request, and I'm currently working on MIDI for MS Edge.

And I strongly believe that we should restore the web-midi-api folder.

abudaan commented 7 years ago

Okay, lets keep the icons.

About the web-midi-api folder; this is ultimately your decision.

In the current version the web-midi-api folder contains the files that are published to npm, but to support module import we need to publish other files and folders as well.

That is why I have reorganized the folder structure of the repository so it matches a commonly used folder layout for npm packages which includes the following folders:

The content of the src folder can be used for reference by the end-user and it is used by bundlers that support es-next code like Rollup.

The content of the build folder is for plain es5 projects; this folder contains the files that you can add to your project using a script tag.

The content of the dist folder is used if you import the shim as a module in commonjs using require or es-next projects using import. Most Node.js projects are written in commonjs but you can also write Node.js projects in es-next.

In the package.json file there are 3 important fields that instruct npm to fetch the right file from the package:

The new folder layout allows us to publish the Github repository as is to npm instead of publishing it via a forked and slightly changed version of the repository.

The files and folders that are not necessary for the functionality of the npm package are added to the .npmignore file.

Note: as of version 8.5.0 Node.js supports es-next modules natively, see this article. This makes it even more important to add a module field to the package.json and include the es-next code in the npm package.

jazz-soft commented 6 years ago

Daniel, can you please make pull request to my fork?

rikner commented 6 years ago

@jazz-soft @abudaan @cwilso hey guys just wanted to push this. i'm very interested in this update.

abudaan commented 6 years ago

@rikner While this PR does fix some issues, it is not yet compatible with the newest version of the Jazz plugin. I am working on it and I hope to finish it in the coming month. Let me know if I you need help for an in-between solution.

jazz-soft commented 6 years ago

BTW, Daniel, check this code, it may be helpful: https://github.com/jazz-soft/web-midi

abudaan commented 6 years ago

Thanks! I will check your code. Sorry for the delay, I have been very busy in the past months.

cwilso commented 6 years ago

@