We are working on an official React package, and we have a prerelease version for you to try. Our goal for the initial release is to provide a great experience for Meteor users who want to use React for part of, or all of, their app’s UI.
A great integration has many parts, from the build tool, to the glue libraries, to the documentation and examples, so we are building all of these things. You can see what we’ve got and try it out by following our guide (URL subject to change): http://react-in-meteor.readthedocs.org/en/latest/
I think there are some other priorities that would come first, but it would be awesome if there was a community package for this. I think most production apps actually don’t use accounts-ui and use some community solution instead.
Also, if you use the react-template-helper package, you can include the Blaze version of accounts-ui if you want.
Great work, thanks for sharing the preview! One thing I noticed is that a lot
of react devs don’t use native jsx it’s either jsx + babel or jsx + coffeescript or jsx + typescript. I have used webpack to compile all of those without much setup. So the question can jsx package accept input from another transformer ?
Currrently people are using npm package with jsx transformer in it in their packages which might lead to desynchronisation of jsx compilers versions.
Are you guys planning to add proper browserify/npm support to the build tool soon?
I talked with @elidoran to make it much more easy to use browserify with meteor.
(Direct support in meteorhacks:npm )
I delayed the idea since your may add a solution for that.
Seems like it’s not, so I might can implement it. Shall I?
It seemed to us that JSX+CS or JSX+TypeScript wasn’t nearly as popular. We want to provide the best possible experience out of the box rather than making people configure chains of transformers to get started.
However, the reason that we ship jsx as a separate package is so that you can use a different one to transform your code if you want to, and still use all of the other parts like the ReactMeteorData mixin.
Also, there is no need to be worried about JSX version mismatches - since the packages are compiled to regular ES5 on publish and not when they are downloaded, the JavaScript code should be compatible even if the versions of JSX are different.
Thanks for building this stuff, it really made the first version of this integration much easier to do.
I’m reasonably sure the next steps for this project will include much better support for client and server-side NPM, and a lot of other goodies that will make us more aligned with the wider JavaScript community. This is just the first step!
What kind of solution were you thinking of implementing?
Right I missed part where it says that it’s using babel. Ok that does make sense, is it possible to try out now ? I guess meteor add react wouldn’t work yet
Having used the package a little bit, I am already a big fan. There is one thing however that is going to prevent me from using it. There needs to be an easy way to get this to work well with routing, i.e. as easy as blaze works with routing. Until that point it’ll be this awesome thing I wish I could use but just can’t.
You can use it fairly easily with FlowRouter. You can either have FlowRouter render the template into a div container or if you’re rendering inside a Blaze shell, you can use a helper to render them with a helper.
Note the Blaze helper is a little different than the MDG preview helper but i’m planning on switching this example over to full React and no Blaze soon.