Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
The React Approach for Building Apps
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ricardo Soares
March 08, 2016
Programming
35
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The React Approach for Building Apps
Ricardo Soares
March 08, 2016
More Decks by Ricardo Soares
See All by Ricardo Soares
Refactor: the tool should not be your process
rsoares
0
54
A gentle intro to Backbone.js
rsoares
0
55
Other Decks in Programming
See All in Programming
残高管理から台帳サービスへの進化
artoy
1
200
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
APNsからLive Activityを開始する話
yumnumm
0
170
Next.js: The final boss of Web Performance
guaca
0
250
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
290
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
sbt 2.0: takeoff
eed3si9n
0
160
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Making Projects Easy
brettharned
120
6.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Scaling GitHub
holman
464
140k
Product Roadmaps are Hard
iamctodd
55
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Code Review Best Practice
trishagee
74
20k
Transcript
The React Approach for Building Apps Or how it breaks
tradition
It’s all about perspective ...
It’s all about perspective - BackboneJS is a lightweight MV*
library - AngularJS focus on extending HTML - EmberJS is more imperative - ReactJS sets a functional design pattern - VueJS prefers the “visual” separation of concerns
Tradition HTML JavaScript CSS DOM Network Cache
Tradition HTML JavaScript CSS DOM Network Cache UI DATA
Sometimes tradition is hard to deal with
Sometimes tradition is hard to deal with JavaScript UI
Sometimes tradition is hard to deal JavaScript onfocus UI
Sometimes tradition is hard to deal JavaScript onclick onfocus UI
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
UI
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI updateA()
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI updateB() updateA()
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI updateC() updateB() updateA()
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA()
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA onprogress
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA onprogress onload
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA onprogress onload onerror
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA onprogress onload onerror ...
Sometimes tradition is hard to deal JavaScript onclick onfocus onchange
... UI ... updateC() updateB() updateA() DATA onprogress onload onerror ... MUCH STATE!
Sometimes tradition is hard to deal - Key-Value Observation (Backbone,
Ember) - Dirty Checking (Angular)
The problem - Deal with the DOM stateful nature -
Seamlessly react to actions/events - Eventually apply updates to the real DOM (and maintain performance)
A different approach - Simple - Predictable - Reliable
Virtual DOM
Virtual DOM A N C B Virtual DOM ... DOM
Successive renders Updates
Lower internals footprint “Simplicity is prerequisite for reliability” Edsger W.
Dijkstra
It’s functional!
It is composable!
It’s a state machine!
Recap - Lots of different approaches out there - Some
have more opinionated than others - DOM is stateful and JS is not reactive - React approach: a Virtual DOM - React was built for simplicity
Thank you! rsoares @botequilha References: http://teropa.info/blog/2015/03/02/change-and-its-detection-in-javascript-frameworks.html https://facebook.github.io/react/docs/displaying-data.html https://www.youtube.com/watch?v=-DX3vJiqxm4