color-diff icon indicating copy to clipboard operation
color-diff copied to clipboard

Migrate to ES6 / ES2015?

Open marcobiedermann opened this issue 8 years ago • 7 comments

What do you think about migrating the project to ES2015?

marcobiedermann avatar Feb 26 '16 15:02 marcobiedermann

Hi! I am not familiar with the status of ES6 on nodejs, are there any benefits (especially in performance)?

markusn avatar Mar 02 '16 06:03 markusn

@markusn Using native ES2015 functions instead of your own will always be faster e.g. import vs require. Also with constthe interpreter can assign memory more efficiently. With ES2015 you code might look cleaner for you and the parser to read.

marcobiedermann avatar Mar 02 '16 07:03 marcobiedermann

It seems interesting as it is possible to transpile to ES5 for backward compatibility for users of older versions of node. However I will not likely have time to implement this in the near future, but would happily take a pull-request.

markusn avatar Mar 05 '16 06:03 markusn

did a pull request, see #12

valmynd avatar Nov 26 '16 12:11 valmynd

@markusn, were you thinking of a build step and traspiling down to ES5? I'm down to help migrate to ES6+

evelynhathaway avatar Mar 23 '19 22:03 evelynhathaway

Hi! I'm going to do a 2.0.0 with ES6 (no transpiling to ES5).

markusn avatar Mar 25 '19 07:03 markusn

Awesome! Let me know if there's anything I can do to help. I've already changed var to let and const where appropriate in a fork (see commit: https://github.com/markusn/color-diff/commit/5624aaea7d2eb06305882d059eddea765ba64a75) in case you want to rebase it or I can create a PR for it. 😄

evelynhathaway avatar Mar 27 '19 00:03 evelynhathaway

Any news here? I'd love to use this in a client-side JS modules only project. I can help port too.

justinfagnani avatar Feb 18 '23 00:02 justinfagnani

Any news here? I'd love to use this in a client-side JS modules only project. I can help port too.

Hi! What is stopping you from using it at the moment?

markusn avatar Feb 20 '23 17:02 markusn

@markusn browsers don't support Common JS, and I'm not using a bundler.

justinfagnani avatar Feb 20 '23 22:02 justinfagnani

@justinfagnani I have a PR open to solve this: https://github.com/markusn/color-diff/pull/22 . Would that work for you?

markusn avatar May 30 '23 11:05 markusn

fixed in v1.4.0

markusn avatar May 31 '23 19:05 markusn