Major design differences between Angular, React, and Blaze (client-side Meteor)?

All we need is an easy explanation of the problem, so here it is.

I’ve seen the Angular vs. React, vs Meteor questions asked a number of times. On the meteor side inevitably the answer to that question is an explanation of how meteor is much larger in scope (has DDP, deployment, all the server side stuff, and all the other things it provides).

I want to restrict this question to only the Blaze engine and things where they do somewhat overlap, especially where either one may provide additional features and/or capability in terms of writing or structuring the client side code.

  • Where are they complementary to each other? (e.g. what does https://github.com/lvbreda/Meteor_angularjs bring to the table)
  • Assuming the above brings certain advantages, how do you compensate for that if using pure meteor?
  • Given that angular encourages a fairly strict separation of code on the client for MVC, how should one structure good code on the client in meteor to follow its MVVM pattern? (Does it just come inherently from having template, client module(s), and a model)

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Okay as far as I can tell you are asking three different questions:

Where are they complementary to each other? (e.g. what does https://github.com/lvbreda/Meteor_angularjs bring to the table)

AngularJS is a full stack client side framework that brings ton’s of features for frontend development.

The following things it brings to the table above standard meteor:

  • Testing: Angular offers a complete testing framework for the client side
  • Form Validation
  • Localization
  • Components (Example: http://angular-ui.github.io/ )

Assuming the above brings certain advantages, how do you compensate for that if using pure meteor?

If you are using pure meteor you can use almost all possible client side libraries like for example jQuery or you can code some convenience functions from angular like form validation by hand.

Given that angular encourages a fairly strict separation of code on the client for MVC, how should one structure good code on the client in meteor to follow its MVVM pattern? (Does it just come inherently from having template, client module(s), and a model)

There are many ways to structure your code. Meteor is not that opinionated about code organization. You can use http://docs.meteor.com/#structuringyourapp as your guidance but it really depends how you like to code. It is possible to split your code into different files in folders or to put everything into just one big file. For very small apps I prefer to keep everything in one file.

I like to split my code into two folders:

  • A folder for client side stuff (subfolders like Views and Assets are sometimes a great choice)
  • A folder for server side stuff

If you are looking for a good practice then you can also have a look at the http://telesc.pe/ source code: https://github.com/SachaG/Telescope

Method 2

Abigail Watson has written a good summary of how Meteor relates to other MVC frameworks in her Meteor cookbook:

https://github.com/awatson1978/meteor-cookbook

Scroll down to the “Model, View, Controllers” section.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply