Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable harmony flag for ES6 support #43

Closed
pistachiomatt opened this issue May 18, 2014 · 7 comments
Closed

Enable harmony flag for ES6 support #43

pistachiomatt opened this issue May 18, 2014 · 7 comments

Comments

@pistachiomatt
Copy link

According to this, if you enable the --harmony flag, we can do cool things like:

class Comment extends React.component
   render: ->

Makes for cleaner and consistent code!

@jtmalinowski
Copy link
Collaborator

Hi,
Thanks for this suggestion!
Would you mind checking if the version of react we're using (react-source gem) supports this OOBE?

@zpao
Copy link
Member

zpao commented May 22, 2014

JSXTransformer doesn't support that, at least not in shipping version. We added it in master though and it'll be a part of 0.11 (or maybe 0.10.1) release.

Also, that sample code you have won't actually work. Extending React.component isn't a thing yet (maybe one day, but not yet)

@pistachiomatt
Copy link
Author

Then what's that Groups post going on about? https://groups.google.com/d/msg/reactjs/zbHSSnDQK8A/6rry4xxWpSkJ

@zpao
Copy link
Member

zpao commented May 22, 2014

If you read the rest of that, he linked to his app which is using https://github.com/elucidata/react-coffee, which adds React.Component and allows it to work with CoffeeScript class syntax (which presumably ends up having the same semantics as ES6 classes, which would be why it works). You then need to call toComponent to get an actually usable thing in React,

We should leave this open so we remember to add harmony support.

@zpao zpao reopened this May 22, 2014
@zpao
Copy link
Member

zpao commented Jul 25, 2014

Harmony works now so if you're interested in adding this, it would probably be appreciated :)

@wiredprairie
Copy link

I thought adding the Harmony switch was a good idea, so I had a go at it: #107

@rmosolgo
Copy link
Member

Added in #136 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants