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

funkyeah picture funkyeah · May 23, 2013 · Viewed 14.5k times · Source

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)

Answer

Bijan picture Bijan · May 29, 2013

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