22. Angular, Ember and Knockout put “JS” in your HTML.
React puts “HTML” in your JS.
Cory House
React’s JSX: The Other Side of the Coin
Single Responsibility Principle
23. JSX
● The same file for
code/template
● XML-like syntax
● Build components, not
templates.
○ Reusable
○ Composable
○ Unit testable
24. React render
React re-render entire component
Re-render on every change makes life
simple
Declarative JSX
Re-render on every change? That
seems expensive
http://www.slideshare.net/floydophone/react-preso-v2
32. Redux
● Evolution of Flux
● One immutable state
● Hot reload
View layer
Action
Dispatcher Store View
Provider Connect
33. Redux flow - Store
Create store.
Connect store to
Root element
34. Redux flow - Connect State/Actions to Components
35. Redux flow - Action
Whenever you want to change
the state of the application,
you shoot off an action.
Action function returns a
formatted action object
36. Redux flow - Root Reducer
Creation of Root
reducer
37. Redux flow - Reducer
Every reducer:
receive state
return new state
Not mutated old state! new one!
42. Angular validation
Property Class Description
$valid ng-valid Boolean Tells whether an item is currently valid based on the rules you
placed.
$invalid ng-invalid Boolean Tells whether an item is currently invalid based on the rules you
placed.
$pristine ng-pristine Boolean True if the form/input has not been used yet.
$dirty ng-dirty Boolean True if the form/input has been used.
$touched ng-touched Boolean True if the input has been blurred.
50. Performance is not the reason
Improvements:
track by
Minimize watchers
:: one-time binding
debounce ng-model
ng-show/ng-if
use VanillaJS (native JavaScript)
51. Performance is not the reason
http://blog.500tech.com/is-reactjs-fast/
React Performance:
http://speed.examples.500tech.com/ngrepeat/before/react.html
Angular before optimisation:
http://speed.examples.500tech.com/ngrepeat/before/angular.html
Angular after optimisation:
http://speed.examples.500tech.com/ngrepeat/after/angular.html
52. Performance is not the reason
React’s true strengths: composition, unidirectional data
flow, freedom from DSLs, explicit mutation and static
mental model.
Dan Abramov
Redux Author
https://medium.com/@dan_abramov/youre-missing-the-point-of-react-
a20e34a51e1a
53. Readability
To read Angular: Learn a long list of Angular-specific syntax.
To read React: Learn JavaScript.
Angular 2 versus React: There Will Be Blood
Ember: {{# each}}
Angular 1: ng-repeat
Angular 2: ngFor
Knockout: data-bind=”foreach”
React: JUST USE JS. :)
54. Who uses?
Angular:
Google
Youtube for PS3
Nike
General Motors
Guardian
Wolphram alpha
NBC
Intel
React:
Facebook
Instagram
Atlassian
Dropbox
Flipboard
IMDb
Netflix
PayPal
WhatsApp
64. Summary
React + Redux:
VirtualDOM
Uni-directional data flow
Low entry barrier
Easily manageable state.
Immutable.
React Native for mobile
development
Angular:
Full-featured MV* framework
Fast to start-off
2-way binding
TypeScript (Angular 2)
Remember about optimization
65. P.S.
Looking to build something quickly that can be picked up by new developers
without long lead times? Pick Angular.
Building a long term project that requires a specific set of components and a
componentized architecture? Pick React.
Prefer Angular? Pick Angular.
Prefer React? Pick React.
Mike W.
Waracle Project ManagementAngular vs React