firmata / firmata.js

JavaScript implementation of the Firmata protocol
711 stars 147 forks source link

Modernizing the codebase #150

Closed rwaldron closed 5 years ago

rwaldron commented 7 years ago

I've had some work in progress sitting in a stash for a very long time. I tried it out tonight and of course it needed tons of updating. When I got to changing relevant portions of code from function declarations (constructors) to class definitions, mocha exploded:

Running "mochaTest:files" (mochaTest) task
>> Mocha exploded!
>> SyntaxError: Unexpected reserved word

Which is the last effing straw for mocha. I'm going to start rewriting all the tests to use nodeunit.

rwaldron commented 7 years ago

On further investigation, it was actually this:

-module.exports = com;
+export default com;
rwaldron commented 7 years ago

I actually didn't mean to close this.

rwaldron commented 7 years ago

This is on hold until I can do a study of all projects that depend on Firmata.js and which also stub the constructor with sinon.js

dtheb commented 6 years ago

A friendly suggestion is that instead of worrying about all the other projects and how they depends on this module, maybe start clean with firmata2.js or something like that, with all the fancy async/await or maybe even write it in typescript or at least provide native typescript support to make testing easier etc..?

Others can upgrade later whenever they feel like it?

rwaldron commented 5 years ago

This has been completed in 2.0.0