4 ms·
CoffeeScript is a match in the heaven with JSX IMO. You for example no longer have to face the bracket and semicolon hell. (Unless you have StandardJS or ESLint
by stevefan1999 9y ago
CoffeeScript is a match in the heaven with JSX IMO. You for example no longer have to face the bracket and semicolon hell. (Unless you have StandardJS or ESLint, which is pretty much default for all devs)
There’s also implicit return, so the code pattern is prettier, no more return (<JSX />)-ish thingy, and it feels closer to a template, but it is a boon and a bane at a same time since some devs got used to return like that.
Before CS2, we have to stick with coffee-react-transform, which is hacky and unmaintained and old. It transpile JSX to createElement directly, not good.
With CS2, you can write JSX expressions directly. A large subset of JSX is parsed, and only bracket/property expression will be transformed by the compiler, then processed with Babel. This is safer, more spec-conforming, and I could do some tricks like babel-preset-react-optimised.
CSX gets even better if you have MobX! It feels like PHP+Rails all the way while you’re also enjoying the MVVM ride. I'm already loving it and using it in my production heavily.
CoffeeScript is great, man. It is influential to ES6. Don't give up on CS yet. The ecosystem, however, is already shifted to JS. It took years to revive CS I guess.