I totally agree with this. Blaze gets a bad rap from the lack of guidance and structure. As much as I dislike FBs saying of they aim to have the developer ‘fall into the pit of success’… they do so much more than Blaze. It feels like you get a shovel, flashlight, and a map and you’ll need good luck or experience to not make a mess.
Much like jQuery actually… you can write a mess but i’ve also seen some really nice SPAs written in just jQuery. However, they had lots of structure (Backbone has made me a better programmer comes to mind).
On a side note, everyone one in JS had been making messes with their UI with jQuery and then Backbone came along and created a paradigm shift in how we made UI. This was 10x better than most jQuery apps.
Anyway, I feel like that ship has sailed and there isn’t much time left to change Blaze so that devs fall into the pit of success.
With Iron Routers reactive routes and Session some legacy apps I made feel like playing whack-a-mole when maintaining it. Newer Blaze apps are much easier to maintain after adopting better patterns, making it more declarative and dropping Iron Router and Session.
I do hope that Blaze will be something that can be used for several more years, I would hate to see it just drop out of the ecosystem.
I’ve been checking out React (with Redux) and Vue.js for a while, and I honestly cannot see the upside of using React instead of Blaze, except for a performance increase and potentially server side rendering. I’d love to be enlightened though!
I think React is one of those things that looks horrible from glancing at docs or tinkering with for a few mins. You almost have to build an entire crud app with it to really appreciate the different way of thinking. Redux is 10x more so… almost impossible to grok from looking at readmes or even tutorials. I think Redux also makes more sense once you hit the edges of building a React app without flux and can then appreciate what it does.
I do wish Redux didn’t have all the ‘extras’. At it’s core it’s just a pattern like:
user clicks button
|
V
even handler gathers data from UI
and calls dispatch( buttonClicked(data) )
|
V
buttonClicked function prepares data and
does dirty work (send db reqs) and then
returns object which is returned in dispatch call above
|
V
a 'reducer' function takes old state and new object from above and
merges them together, returns what the new state should look like
|
V
UI layer listens to specific keys and updates if they change
That being said I still think Blaze is a great UI layer. It’s more important that users like your app and that you’re productive so you spend less time debugging and more time working on the real featues.
Here are some ‘patterns’ that were pre-react that helped me build better Blaze apps:
https://github.com/AdamBrodzinski/react-ive-meteor/blob/master/both/actions/post_actions.jsx
https://github.com/AdamBrodzinski/react-ive-meteor/blob/master/both/domains/feed_domain.jsx
The key is to decouple the UI and make things predictable for your future self and team.