[Article] What's Going On With Blaze, React, and Meteor?


#1

Here’s my recap of the recent Blaze thread and everything that’s been going on recently. It also includes some practical advice about what you can do right now:

https://www.discovermeteor.com/blog/blaze-react-meteor/

Let me know what you think!


#2

An excellent article and I enjoyed reading it. The fun part is that you struggle with the same issue, decide how to proceed but then keep us dangling…

We are an excellent example of people who use your book and follow every step. So starting a new project, we need it! … But… now, you say two things: 1) when you start a new project, go for React, 2) we ourselves keep writing the book with Blaze.

So, you confuse us even more… Help !

PS - Actually I think MDG could have made their Blaze-Reaction storm more quiet, if they would speak out and “core” on other things so to show their community that they do care about consistency, even if Blaze/React forces a different course. I think they could decide on:

  • choose a core router, please (Flow/Iron/React router ??? )
  • Coffee optional
  • Simple Schema
  • Forms
  • … ?

#3

To clarify my own position, I believe that if you can use React (in other words: it’s a new project, and you already know React or are interested in learning it), you should use it.

But if you can’t, then I think you can keep using Blaze for the foreseeable future with no immediate downsides. The eventual migration will happen in a while, and even then I think it should be relatively straightforward provided you follow a few Blaze best practices from the start.

And regarding your other points, they’re pretty much all answered decisively by the Meteor Guide project:


#4

Did you have a few Blaze practices in mind when you said this or better yet a resource of Blaze best practices from your perspective?


#5

People definitely need this guidance right now, and Discover Meteor is the best voice for it to come from. I’d just add here:

something like this:

But this likely won’t always be the case. There are already community efforts that will give you a more Blaze-like experience while using React. TrackerReact – an independent React mixin and sub-package of the Blaze React project – is one picking up steam that removes the need to use getMeteorData. Using it, all your JSX code within render methods is automatically reactive just like within Spacebar templates. The future likely will be one where the best of Blaze/Tracker and the best of React make for a nice marriage.


#6

“React doesn’t have an actual templating syntax like Blaze’s Spacebars, but instead lets you insert bits of JavaScript right in your HTML thanks to its JSX file format.”

Or rather “lets you (appear to) insert bits of HTML right into your javascript”

Also:

“You can use Spacebars with Blaze right now thanks to the Blaze-React project.”

“You can use Spacebars with React right now…”


#7

As @sacha mentioned, all these decisions have been made in the guide, but just to be clear, here is our guidance on these:

  1. Use Flow Router
  2. Coffeescript: I see little reason to use now we have ES2015 support unless you are already wedded to it.
  3. Simple Schema: yes
  4. Forms: use Autoform (if you are using Blaze)

Hope that helps ramp up the percentages for you a little.


#8

@sacha mentioned a few in the article, but it’s worth mentioning:

Hope that helps. More detail to come.


#9

I mentioned a few in the article, but I also think @tmeasday might be working on a blog post about this topic.

@faceyspacey thanks for the suggestion :slight_smile:


#10

I agree with others that it was a great and clarifying article.

I would suggest that another approach here is the migration approach (which I’d likely do in two paths:

  1. New UI functionality in your app is done in React (alongside the rest of your Blaze UI)
  2. Slowly refactor/re-write the Blaze UI (probably bottom up) in React components.

This provides a possible pattern to start with: Smoothly feature up your Blaze Apps with React Components

This is clearly somewhat of an over simplification. But it seems like a workable strategy.

That said I’ve not started doing this yet myself so I’m not sure what the “gotchas” will be.


#11

There is a lost of talk about react VS blaze but what about angular, how does it fit into all of this. We are going to start a few projects with meteor and blaze seems to be out of the question so it comes down to react or angular (1/2)? Any thoughts?