2 ms·
CoffeeScript was great, and I'm pleased how relatively easy it's been to move away from it now that ES6 offers most of the same benefits. I've recently started
by matthewmacleod 9y ago
CoffeeScript was great, and I'm pleased how relatively easy it's been to move away from it now that ES6 offers most of the same benefits.
I've recently started moving our existing CoffeeScript + React codebase – it's been okay, though I still miss the terse CoffeeScript syntax. A similar blog post that's helped is Bugsnag's: https://blog.bugsnag.com/converting-a-large-react-codebase-from-coffeescript-to-es6/ https://blog.bugsnag.com/converting-a-large-react-codebase-f...
- meowface 9y agoIf you miss the syntax, why not wait out for CoffeeScript 2? They're going to add all of the ES6 features, to my understanding.
- matthewmacleod 9y agoThere are a few reasons we made the switch: - Familiarity. Most of our team have a little experience with Javascript, but none at all with CoffeeScript. It's not that different, but there's still a cognitive overhead. - Documentation. Almost all documentation for front-end work, especially with React, is in ES6 now. There's an additional overhead in translating it. - React – CJSX was IMO awesome, but there's no ongoing support for it. Embedding JSX in CoffeeScript is less satisfactory. - Webpack. We've had various problems getting features of Webpack 2 to work correctly with pre-2.x CoffeeScript – HMR etc. that only really work with ES6 modules. We could wait for CoffeeScript 2, but it's already becoming a drag on velocity. In short, CoffeeScript was great, but the benefits are much more marginal now. My preference for terse syntax isn't that high a priority for the rest of my team, so I'm happy to take advantage of the more standard ES6 that we can now use.
- mambodog 9y agoActually if you still really want JSX in CoffeeScript, it's now built in: https://github.com/jashkenas/coffeescript/pull/4551 https://github.com/jashkenas/coffeescript/pull/4551