31
Avi Kedar Open Source Department Manager, codeoasis.com React-js

React-js

Embed Size (px)

Citation preview

Page 1: React-js

Avi KedarOpen Source Department Manager, codeoasis.com

React-js

Page 2: React-js

get the code...https://github.com/avi1234/reactjs-presentation

Page 3: React-js

React

Web Evolution Concept Syntax Example

Page 4: React-js

ReactWeb Evolution

DataPresentationLogic

Page 5: React-js

ReactWeb Evolution

DataPresentationLogicM V C

Page 6: React-js

ReactWeb Evolution

M V C

GenerationXXX

Page 7: React-js

ReactWeb Evolution

MVC

Generation1

Page 8: React-js

ReactWeb Evolution

VC

Generation2

MM

M

M

MM

M

M

Page 9: React-js

ReactWeb Evolution

VC

Generation2

M

M DOMControllers Services Routes Resources Directives

Page 10: React-js

ReactWeb EvolutionGeneration2

1. Scale is a Pain

Page 11: React-js

ReactWeb EvolutionGeneration2

1. Scale is a Pain

Page 12: React-js

ReactWeb EvolutionGeneration2

2. Performance

VCDOM

Controllers Services Routes Resources Directives

Page 13: React-js

ReactWeb Evolution

VC

Generation2

I/O

2. Performance

Page 14: React-js

React

Web Evolution Concept Syntax Example

Page 15: React-js

ReactConcept

View Engine - Not a Framework Carpaccio Reach Components

Single Way Data Flow Virtual DOM

Page 16: React-js

ReactConcept

View Engine - Not a Framework

• Just the V from MVC • No routing • No dependency injection • No major logic components (controllers)

Page 17: React-js

ReactConcept

Carpaccio Reach Components• The entire page is split into a tree of V items

• Each V item contains: • State • Render Method

V Show Feeds

List

V Show Feed

V Show

Comments

V Show

Comment

V Add

Comment

V Show Ad

Page 18: React-js

ReactConcept

Single Way Data Flow• Forget about 2 way data binding • The results of V are immutable • Reconcile process - through away the previous layout and recreate it on every change

onChange

Page 19: React-js

ReactConcept

Virtual DOM• The DOM is presented as javascript object • Each reconcile process creates a new revision of the virtual DOM • React will compare the two revisions and create list of execution actions that will be executed on the actual DOM

onChange old

newcompare

execute

Page 20: React-js

ReactConcept

Virtual DOM

VC Minimum I/O

javascriptbrowser DOM

Page 21: React-js

React

Web Evolution Concept Syntax Example

Page 22: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 23: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 24: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 25: React-js

ReactSyntax

State JSX Props Events Mixings Refs

componentWillMount

render

componentDidMount

componentWillUnmount

Before adding to the DOM for the first time

After each change

After render the component for the first time

Before removing the component from the DOM

Page 26: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 27: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 28: React-js

ReactSyntax

State JSX Props Events Mixings Refs

Page 29: React-js

React

Web Evolution Concept Syntax Example

Page 30: React-js

React

Facebook Wall

Example

Lets Build...

https://github.com/avi1234/reactjs-presentation

Page 31: React-js

React

Thank You