banderson / generator-flux-react

A yeoman generator for app based on Facebook's Flux/React architecture
332 stars 35 forks source link

Run babelify before reactify #32

Closed mattikl closed 9 years ago

mattikl commented 9 years ago

If reactify gets run first, ES6 syntax not supported by reactify (hit this error with using the import syntax) causes parse errors.

banderson commented 9 years ago

@mattikl cool! Thanks for catching this, I was gonna switch this to use import very soon. I assume this solution was all you needed to get it working?

mattikl commented 9 years ago

@banderson Yes, that was all. I tested by creating a new project, which compiled & ran without errors, then switched one of the require's to import and it worked too. Babelify transpiles .jsx with default settings.

I actually started this branch to make the component generator return ES6 classes. I'll add that change too.

mattikl commented 9 years ago

@banderson After some thought I think it's too early to switch to ES6 classes in the component generator. First the example app should be written using them not to get too confusing for the user, and there are still benefits to using React.createClass like autobinding this in class methods.

But the import syntax is nice and store implementation is cleaner when you can use class inheritance instead of object-assign.

banderson commented 9 years ago

@mattikl agreed! Can you change this back to use createClass and I'll merge?

mattikl commented 9 years ago

@banderson I rebased and force pushed the branch, so it now includes only the first commit. Thanks!

banderson commented 9 years ago

@mattikl :+1: thanks!

banderson commented 9 years ago

@mattikl just an FYI, your changes were included in the v0.4.0 release just a few minutes ago