Download presentation
Presentation is loading. Please wait.
Published byChrystal Johnston Modified over 9 years ago
1
React
2
A library for creating user interfaces.
3
React Renders your UI and responds to events.
4
React Plays nicely with your stack
5
Build components, not templates.
7
Separation of concerns: Reduce coupling, increase cohesion.
8
Coupling is: “The degree to which each program module relies on each of the other modules.” http://en.wikipedia.org/wiki/Coupling_(computer_science)
9
Cohesion is: “The degree to which elements of a module belong together.” http://en.wikipedia.org/wiki/Cohesion_(computer_science)
10
The framework cannot know how to separate your concerns for you. It should only provide powerful, expressive tools for the user to do it correctly.
11
This tool is a React component. A highly cohesive building block for UIs loosely coupled with other components.
12
Use components to separate your concerns. With the full power of JavaScript, not a crippled templating language.
13
Abstraction Composition Expressivity
14
Components are reusable.
15
Components are composable.
16
Components are unit testable.
17
JSX is an optional preprocessor to let you use HTML-like syntax. @jmiller7367 on Instagram
18
JSX is an optional preprocessor to let you use HTML-like syntax. React.DOM.a( {href: ‘http://instagram.com/jmiller7367’}, ‘@jmiller7367 on Instagram’ )
19
With JSX, it’s easy for designers to contribute code.
20
Virtual DOM Makes re-rendering on every change fast.
21
So React built a virtual DOM (and events system). Optimized for performance and memory footprint
22
The virtual DOM lets us do fun things. It can run in Node.js
23
The virtual DOM lets us do fun things. Optimizations based on app structure
24
The virtual DOM lets us do fun things. Testability for free
25
The virtual DOM lets us do fun things. SVG, VML and support
26
The virtual DOM lets us do fun things. Running the whole app in a Web Worker (experimental)
27
Key takeaways
28
Components, not templates.
29
Re-render, don’t mutate.
30
Virtual DOM is simple and fast
31
Sources http://facebook.github.io/react/index.html http://www.andrewgreig.com/637/ http://backbonejs.org/ http://nodejs.org/ http://www.infoq.com/news/2013/06/facebo ok-react
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.