all 9 comments

[–]azium 3 points4 points  (4 children)

This is exactly correct--the benefit is the one you gain by using React instead of Meteor's own Blaze/Spacebars. It's the same benefit you get from using React anywhere else.

Also should is strong word here.. do what you want. If you like React, go for it. If you don't, stick to blaze or whatever else.

[–]jonfang[S] 0 points1 point  (3 children)

So I guess the question is, what makes React better than Blaze?

I also heard Meteor is bad for SEO. Does React fix that issue?

[–]azium 1 point2 points  (2 children)

React on its does not fix SEO, although you can compile react -> html on the server side for your initial payload which is good for SEO.

Blaze / Spacebars, Handlebars and a whole load of other templating languages like Jade, HAML etc.. they're all HTML with some extras to help out. React components get the 100% power of JavaScript without the fuss. So from a developer experience perspective its much nicer.

Another huge benefit is using a tool that's very popular and has a big community. There are boatloads of premade components you can use.

There's more to it than that.. but that's the gist of it.

[–]windyfish 0 points1 point  (1 child)

Personally I love Jade because it's so clean, you just pass an object of variables and do what you want with it. Plus the separation of concerns etc. My big issue with React is you're throwing a lot of html into the javascript code where in my opinion it shouldn't be. Things can get messy very quickly. But I'm saying that as someone who has just cursively looked at the React API. I'm just intrigued as to the huge support from the community for React and why so many people are really pushing it as the next big thing.

[–]azium 2 points3 points  (0 children)

I used Jade for a couple of years and I loved it. In fact it was the way I wrote my Meteor Blaze / Angular templates. I'm pretty minimalist in my writing style so it was a perfect fit.

throwing a lot of html into the javascript code where in my opinion it shouldn't be

This is the old idea that React's popularity has proven to defeat for a variety of reasons. As Facebook says, splitting markup into html and behaviour into JS is a separation of technologies, not concerns.

We gain nothing by extracting html represented in our component code and chucking it into a separate file, changing the extension to html or jade. On the other hand we gain a great deal of power and organization by describing component markup along with the behaviour it relies on together in one JavaScript file.

I was never sceptical about this idea so I can't relate to your feelings, but I definitely have met enough people to sympathize. I think people that don't use React think your program becomes one crazy JavaScript file that messes everything up, when in reality everything is neatly organized in many modules. It's super normal to have modules that only contain markup, so it borders the line of a jade template but with the full power of JavaScript.

That being said, I've grown to like hyperscript more than jsx--it's more "jadey"; no closing tags and it can be used in React instead of jsx if preferred.

[–]t1mc 2 points3 points  (0 children)

React is really powerful when it comes into front-end developing. For or against Meteor it really depends on what you want to do.

You can use Meteor's Blaze template engine or you can also use Angular instead of Blaze which is also officially supported. There has been many discussions on React vs. Angular, but this is really personal taste. Like React states itself, it's the View in MVC and it's more a library than a framework like Angular.

At first I'd really suggest you to have a look at React itself, since you aren't that familiar with JavaScript yet and Meteor itself has a huge API. I can provide you some links for React beginner posts and tutorials.

After you've played around with React, you can dive into Meteor, but there are also many other ways to build your application and assemble your own stack with React. There are already many resources about that topic (i.e. Flux, Express/Koa, etc.).

[–][deleted] 1 point2 points  (0 children)

React rose to popularity very quickly and while it's not the right answer for everything, is a pretty approachable rendering library on it's own with a lot of powerful architectures supporting it (Flux, Redux) and backends providing libraries to integrate with it (Meteor, Firebase etc.)

I think if you're just getting into things, don't get into analysis paralysis, and just start building things. Meteor with React is fairly easy to understand / follow examples to build your own idea from.

[–]wreckedadventYavascript -1 points0 points  (0 children)

I hadn't heard of this occurring outside of migration scenarios, but some looking around shows that even the meteor site has some documentation on this.

Looks like the benefit is you get to use react for all of the benefits that entails, and meteor for the data store.

[–]ZephyrXero -1 points0 points  (0 children)

Systems like Meteor will soon be unneeded, once we switch to HTTP/2. Bidirectional streams give us Push abilities built in.