News for hackers. Stuff that matters.
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.