url-pattern
url-pattern copied to clipboard
Convert CoffeeScript to ES6 please
i'll do this eventually
updates?
This feels like a step backwards to me. ES6 means transpilers or polyfills become required for broader browser coverage.
Right now you could start using this with an inline <script> tag if you wanted to.
This does a pretty good job of auto conversion, just needs some cleaning up after: http://decaffeinate-project.org/
This feels like a step backwards to me. ES6 means transpilers or polyfills become required for broader browser coverage.
@cferdinandi You are compiling either way. You might as well use babel instead. The broadest skill all web developer have in common is plain javascript it is here to stay. And more will contribute to the code. coffeescript will always be one step behind javascript. you couldn't use async await when it came out. you had to wait for CS to adopt to it.
I'm not advocating coffee script. I'm a vanilla JS evangelist. I'm simply arguing for ES5 until ES6 has broader support.
What advantage does ES6 bring to the script?
https://github.com/lukehoban/es6features
ES6 is fully supported in all major browsers and in node.js. Many of the language features I personally used to use CoffeeScript for are now supported natively in ES6 (arrow functions and classes are the two major ones).
ES6 has way better editing and debugging experience in most major editors than CoffeeScript. More developers know JavaScript than CoffeeScript, hence a lower maintenance burden.
Afterthought: I realize the responses to my comments are driven by this being an issue about CoffeeScript. When I first read it, I missed the part about CoffeeScript and assumed the ask what just to update from ES5 to ES6.
@chucksellick This makes perfect sense:
More developers know JavaScript than CoffeeScript, hence a lower maintenance burden.
tldr: I'm a dumbass, missed the thing about CoffeeScript, and agree 100%, so long as the end product is converted to ES5.
The usual strategy is to distribute the npm package with multiple ES5 transpiled versions of the library (different versions to target different module loaders; CommonJS, UMD, etc), as well as the raw ES6 source. This way the environment can decide which version is most appropriate, with ES5 being the default. ES6 can be run in environments where it's supported natively (e.g. modern node) and bundlers can also use ES6 as they might only transpile a subset of ES6 features if they are targeting newer browsers.
What real advantages does ES6 bring to the table over ES5? Cleaner and therefore more maintainable source code is the only really tangible thing I can actually claim!
i agree.
i'll do the conversion to ES6 before the end of february since this package is seeing some use and several people want this. i've been using ES6 and babel extensively over the last couple of years so this shouldn't be a big deal.
when i started work on this package back in 2012 there were good reasons to use coffeescript. today there aren't any imo. continuing to use coffee makes it harder for others to contribute.
The usual strategy is to distribute the npm package with multiple ES5 transpiled versions of the library (different versions to target different module loaders; CommonJS, UMD, etc), as well as the raw ES6 source. This way the environment can decide which version is most appropriate, with ES5 being the default. ES6 can be run in environments where it's supported natively (e.g. modern node) and bundlers can also use ES6 as they might only transpile a subset of ES6 features if they are targeting newer browsers.
What real advantages does ES6 bring to the table over ES5? Cleaner and therefore more maintainable source code is the only really tangible thing I can actually claim!
100% agree.
thanks for the links
Any news on this?