Skip to content

CoffeeScript to EcmaScript Conversion

The cozy-desktop lib and CLI were historically written in CoffeeScript, like many Cozy apps. CoffeeScript used to provide many benefits over EcmaScript, but that’s not true anymore:

  • EcmaScript has catched up regarding language features
  • it is the standard: it won’t die soon
  • more people can read/write ES code than CoffeeScript
  • ES provides us with more options (there are far more ES libs/tools than Coffee ones out there)
  • ES tooling is becoming better (Eslint spots far more issues in our codebase than Coffeelint, and tools like Flow bring static type checking to ES)
  • As many Cozy apps were rewritten in EcmaScript, going the same way would makes the platform more consistent

This is why the code was converted from CoffeeScript to EcmaScript.

Part of this was done automatically using decaffeinate. But some conversion issues were also fixed afterwards. Build and tools also moved to the new language stack. The list of changes can be seen in the corresponding GitHub pull request.

Because of lack of time, some minor issues still remain in the ES code, like a few useless return statements for example.

Those will be adressed progressively while working on new features or enhancements. But help is still welcome 😄