News for hackers. Stuff that matters.
Re:React on ES6+ by dugmartin on Wednesday July 08, 2015 @07:56AM (#9850988)
I understand the interest in new Javascript standards in the browser however I've been doing a lot of React+CoffeeScript (without JSX) work lately and it can do all of what is mentioned in the article in a more expressive and (imho) more beautiful syntax.

I'm genuinely curious about all the ES6/ES7 articles. Is the interest driven from the eventual native support in future browsers and being able to drop transpiler dependencies?

Re:React on ES6+ by emergentcypher on Wednesday July 08, 2015 @08:43AM (#9851151)
IMHO the CoffeeScript syntax is ugly and confusing.

ES6 improves the language without borking the syntax so much.

To add something more constructive, CoffeeScript is still just a transpiler. I think the long-term goal is for browsers to "natively" interpret/run ES6 code rather than forever transpiling to ES5. Either that, or we actually move on to something like web assembly.

Re:React on ES6+ by honest_joe on Wednesday July 08, 2015 @11:10AM (#9852032)
That's your personal opinion as it's his about ES6
Re:React on ES6+ by RussianCow on Wednesday July 08, 2015 @03:43PM (#9854137)
> I think the long-term goal is for browsers to "natively" interpret/run ES6 code rather than forever transpiling to ES5.

That's not an opinion; this will actually happen. See this: https://kangax.github.io/compat-table/es6/

Re:React on ES6+ by emergentcypher on Thursday July 09, 2015 @12:20PM (#9858841)
Did you miss the part where I started my entire comment with "IMHO"?
Re:React on ES6+ by mytranspiler on Wednesday July 08, 2015 @08:09AM (#9851028)
Whats the state on coffeescript+jsx these days? I had a horrible time getting it transpile correctly (with gulp) about a year ago.
Re:React on ES6+ by rawrmaan on Wednesday July 08, 2015 @12:21PM (#9852686)
We use CJSX at OneRent with Grunt and Browserify and it's been nothing but fantastic. The syntax is terse and beautiful and IT saves us a lot of typing. To me, ES6 just seems like a lot of catch-up to CoffeeScript, while still maintaining much of the unnecessarily verbose syntax of JS.
Re:React on ES6+ by dugmartin on Wednesday July 08, 2015 @09:50AM (#9851482)
I stopped using JSX with React+CoffeeScript. I think the following looks a lot cleaner and removes the jsx dependency:

    {div, a} = React.DOM
    ...
    render: ->
      (div {},
        (a {href: 'foo'}, 'bar')
      )
The only downside is having to extract the tags from React.DOM.
Re:React on ES6+ by seivan on Wednesday July 08, 2015 @10:26AM (#9851682)
You could omit the parenthesis and it starts to look a lot like HAML :-)
Re:React on ES6+ by dugmartin on Wednesday July 08, 2015 @10:53AM (#9851904)
The parens help to make sure CoffeeScript parses it correctly. Plus it looks kind of Lispy which is good right?
Re:React on ES6+ by seivan on Wednesday July 08, 2015 @12:05PM (#9852518)
"looks kind of Lispy which is good right?" :D, you sound not sure :)

I haven't had any issues without the parens, but then again I've only just fooled around.

You probably know better.

Re:React on ES6+ by mikewhy on Wednesday July 08, 2015 @09:59AM (#9851530)
Wouldn't you have to use `React.createFactory` in this case as well? (when not dealing with React.DOM components)
Re:React on ES6+ by dugmartin on Wednesday July 08, 2015 @10:51AM (#9851877)
Yes you do need to use it. I put each component in its own file and use Browserify to require them in like this:

    MyComponent = React.createFactory require './my-component'
then you can do

    render: ->
      (div {},
        (MyComponent {})
      )
Re:React on ES6+ by Keats on Wednesday July 08, 2015 @03:30PM (#9854070)
Works very well in typescript as well !
Re:React on ES6+ by superplussed on Wednesday July 08, 2015 @09:05AM (#9851246)
The code is just so clean. I never understand why it's not more widely used. The JSX blocks are just so clean without all of the braces and the like, and even get syntax highlighted as HTML in sublime.
Re:React on ES6+ by epmatsw on Wednesday July 08, 2015 @08:48AM (#9851169)
We've had pretty good success compiling cjsx with gulp-cjsx. The one annoyance I've noticed is that it's just a tad more finicky about whitespace and parentheses/brackets than normal coffeescript, but I suppose that's to be expected.
Re:React on ES6+ by mambodog on Wednesday July 08, 2015 @10:33AM (#9851743)
If there is a particular case which you think should work but doesn't, please file an issue on the coffee-react-transform repo and I'll look into it.
Re:React on ES6+ by jbhatab on Wednesday July 08, 2015 @12:39PM (#9852847)
Here's a random template I made with react in middleman that uses coffeescript with no jsx if anyones curious, https://github.com/jbhatab/middleman-backbone-react-template. I love the syntax and think it's really clean. The view code reminds me of slime.
Re:React on ES6+ by rictic on Wednesday July 08, 2015 @02:47PM (#9853824)
For me the nice thing is that we're converging. I like the features added by all of the languages that transpile to js, but I want to be able to use them consistently across every project I'm involved in and being an official part of the language makes that much more likely. Convergence is also a boon for tooling and interop.
Re:React on ES6+ by baby on Wednesday July 08, 2015 @05:02PM (#9854553)
Can you give some examples like the ones he gave in the article but in react+coffeescript without jsx?

edit: Someone else posted that https://github.com/jbhatab/middleman-backbone-react-template...

Everytime I see people saying bad things about coffeescript I really wonder why. This looks way nicer/clearer to me.

Re:React on ES6+ by k__ on Wednesday July 08, 2015 @08:47AM (#9851165)
I tried to use it with LiveScript (without JSX) but it was a horrible mess. All those commas and nulls.

If there were something like CoffeeScript+JSX for LiveScript I would be sold.

Re:React on ES6+ by Offler on Wednesday July 08, 2015 @03:24PM (#9854030)
Basically JavaScript is a tool that I can leverage in more places then CS and CS offers me very little advantage over ES6.
Re:React on ES6+ by endemic on Thursday July 09, 2015 @10:08AM (#9857898)
> I can leverage in more places then CS

Doesn't ES6 still require transpiling for maximum compatibility at this point? I would reverse your statement; aside from polyfills, ES6 offers me very little advantage over CS.

Re:React on ES6+ by andyl on Wednesday July 08, 2015 @02:37PM (#9853759)
Both CS and ES6 use transpilers. ES6 syntax is ugly and adds no features. ES6 makes me think: the emperor has no clothes.
Re:React on ES6+ by city41 on Wednesday July 08, 2015 @03:20PM (#9854007)
No features? Destructuring, arrow functions, module system, default values, spread operator, decorators, template strings, on and on. It provides almost all of CoffeeScript's features. What advantage do you see CoffeeScript having?
Re:React on ES6+ by andyl on Wednesday July 08, 2015 @06:59PM (#9855171)
None of those features are new - I can get everything on your list with CoffeeScript. For me the advantage of CoffeeScript is that it is less verbose. Main advantage that I see in ES6 is that Transpiling is now widely accepted.