facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 114 forks source link

Make react-tools JSX compilation optional #36

Open jemgold opened 9 years ago

jemgold commented 9 years ago

Forcing compilation with react-tools stops you from using Babel -

=> Errors prevented startup:

   While building the application:
   error: conflict: two packages included in the app, grigio:babel and react, are both trying to handle .jsx

Not a huge deal, but Babel supports way more ES6 fun stuff than react-tools.

benjamn commented 9 years ago

Yuck, this seems like a pretty general problem for Meteor.

benjamn commented 9 years ago

Some existing discussion: https://github.com/meteor/meteor/pull/1207

grigio commented 9 years ago

Currently I've disabled jsx support in babel to avoid the conflict https://github.com/grigio/meteor-babel/issues/10 so at least it works. @benjamn in the future who will compile jsx ? react-tools or babel ?

AdamBrodzinski commented 9 years ago

+1 I'd like to use Babel without using a fork of the official ReactJS repo!

nicksergeant commented 9 years ago

@adambrodzinski which fork did you end up using?

AdamBrodzinski commented 9 years ago

@nicksergeant I had my own fork that removed the JSX compiling... however now i've switched back to reactjs:react and babel for js files. The only snag is I think JSX ES6 classes in the current reactjs:react force a full reload for CSS changes.

However this isn't a huge deal as it's hard to use the Meteor mixin with ES6 anyway.

nicksergeant commented 9 years ago

Oh! How are you able to have Babel compile the JSX files without React also conflicting if you're using the standard repo?

nicksergeant commented 9 years ago

The reason I ask is that I'm having an issue with react-meteor's JSX compilation step breaking meteor build: https://github.com/reactjs/react-meteor/issues/91

AdamBrodzinski commented 9 years ago

@nicksergeant can't remember how I did it offhand. However soon Meteor will be transpiling ES6 and their React package will use that instead of the JSX transformer. Can't wait :smile:

nicksergeant commented 9 years ago

Yeah, that will be great!

denisw commented 9 years ago

Given that react-tools is deprecated now, maybe support should be dropped entirely and Babel recommended instead?