Skip to content
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

QUESTION: Move on from CoffeeScript? #56

Open
pedrosanta opened this issue Mar 23, 2018 · 9 comments
Open

QUESTION: Move on from CoffeeScript? #56

pedrosanta opened this issue Mar 23, 2018 · 9 comments
Labels

Comments

@pedrosanta
Copy link
Collaborator

Hi all,

So something has been crossing my mind over and over... at the time the work on this lib began (2015) the JS ecosystem was quite different from nowadays, and within that context I understand the benefits that CoffeeScript brought, namely, class syntax, arrow functions of sorts, and many others.

But given the latest advances of JS, namely with ES6, Promises and all, and I ponder if it wasn't beneficial from a maintenance standpoint to consider to migrate to ES6 or TypeScript?

I focus on the maintenance standpoint for two main reasons:

  • By using ES6, we would make the development easier, simpler and remove the compilation/build phase.
  • By using TypeScript, we would maintain the compilation/build phase, but would gain type checking.

Personally, I find the usage of CoffeeScript at this point to be more cumbersome (and make the code harder to read) than not, and between the two proposals above I'm still leaning to ES6 at this point, basically for the sake of simplicity. (We can always move on to TypeScript if we strongly feel that need later on.)

Thoughts? @cyrilis?

@cyrilis
Copy link
Owner

cyrilis commented Mar 26, 2018

Hi @pedrosanta ,
I think porting to ES6 or Typescript is becoming more and more necessary. I agree to abandon CoffeeScript too (which is one of top 3 most dreaded language in stackoverflow 2018 survey ).

And porting to ES6 or Typescript is also a good change to refactoring some old/abandoned code, and I'm learning ES6 too. 😉

Cheers, let's do this. 🤖

@pedrosanta
Copy link
Collaborator Author

Great @cyrilis!

So, if you don't have a strong opinion between those two, I would lean to migrate to ES6 at the moment (which will already allow us to upgrade the code/syntax by a lot) – and if we feel the need later, upgrade to TypeScript.

Sounds fair?

@cyrilis
Copy link
Owner

cyrilis commented Mar 26, 2018 via email

Repository owner locked as resolved and limited conversation to collaborators Mar 26, 2018
Repository owner unlocked this conversation Mar 26, 2018
@actuallymentor
Copy link
Contributor

+1 for ES6.

It would also make it easier for people like me to contribute more frequently to the repo.

@mikecook
Copy link

mikecook commented May 9, 2018

I'll just leave this here in case you hadn't seen it: https://github.com/decaffeinate/decaffeinate

@gcoda
Copy link

gcoda commented Apr 4, 2020

@cyrilis i just converted it to typescript, without reading code first. 😕
I did a bad job, but with "strict": true option.
forked repo
Looks like it works, most likely something broke, but with some understanding of internals i will do some refactoring of my mess 😉

Edit: type definitions might be helpfull with current build

Screenshot-20200405020008-732x500

@bmccann36
Copy link

👍 for typescript

@emagnier
Copy link
Contributor

emagnier commented Dec 20, 2020

On my side, I'm definitely in favor of TypeScript.
It will probably be a little more work to add typing, but I think it's worth it, because this will bring a lot more robust codebase for sure!

However moving first to ES6 could be a first step before going on TS.

@gcoda
Copy link

gcoda commented Dec 21, 2020

@emagnier it took less than hour to convert this to typescript, with help of decaffeinate, and few simple types, since ES6 is still valid TypeScript you can cut some corners and disable some of default checks.

check commits from my fork, gcoda/epub-gen.
i will be glad to do it all over again, since i modified a lot of code for my needs without really digging in the logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants