JavaScript frameworks are developing at an extremely fast pace. This post is describing main points, advantages and disadvantages of ReactJS and AngularJS as Library and Framework.
ReactJS
- Just a small view javascript library
- Components: emerging web components standard/Component based architecture
- Size: smaller than Angular, so a bit faster
- Has a Virtual DOM, which renders updates faster than Angular’s Regular DOM
- Uses JSX, which combines markup and logic in the same file (making components easier to read)
- Data Binding: one-way
- You Can use ES6/7 JavaScript, although you can use Typescript or Flow if you so choose
- Mobile: React Native is faster than Angular’s solutions
- Testing: Jest & Enzyme
- Learning Curve is lower, but you only get the view. Because of this, you’re going to have to learn a slew of 3rd party libraries. Ex. State management (Redux or MobX), Asynchronous calls (react-promise, react-thunk, or react-saga), etc.
- Scalability: is more testable, so also easy to scale
- Popularity: has increased exponentially
- Open source: GitHub stars: 111,927 / Contributors: 1,242 / Issues: 287
- Used on: Facebook, Airbnb, Uber, Netflix, Instagram, Whatsapp, Dropbox
- React Fiber will increase the speed of React dramatically
Cons of ReactJS:
- In ReactJS you need more code for development then it’s counterparts.
- Not using isomorphic approach to exploit applications leads to SEO indexing problems.
- ReactJS has large size of dependencies.
AngularJS
- Is a full framework
- Has a Regular DOM, which renders updates slower than React’s Virtual DOM also has a virtual Dom too
- The rendered JavaScript and HTML maintains a physical separation
- Utilizes Components: emerging web components standard/Module + Component based architecture
- Data Binding: two-way
- You must use TypeScript
- Scalability: easy to scale
- Mobile: Ionic and Cordova are slower than React Native
- Testing: Jasmine & Mocha
- Learning Curve is higher, but once you understand it you have an entire MVC framework
- Popularity: dropped since AngularJS (Angular 1)
- Open source: GitHub stars: 40,963 / Contributors: 732 / Issue: 2,162
- Size: larger, resulting in longer load times and performance on mobile
- Used on: Google, Nike, Forbes, Upwork, General Motors, HBO, Sony
Cons of AngularJS:
- Basics are quite easy , but then learning curve becomes very steep making it hard to learn.
- Scopes are easy to use, but hard to debug.
- Directives are powerful, but difficult to use.
- AngularJS has search engine indexibility.