Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Renderizando Componentes React no Servidor
Search
Bruno Genaro
July 01, 2017
Technology
1
280
Renderizando Componentes React no Servidor
Talk presented at FrontInSampa 2017 (07/01/2017) in Sao Paulo (Brazil)
Bruno Genaro
July 01, 2017
Tweet
Share
More Decks by Bruno Genaro
See All by Bruno Genaro
The future of React with Universal web applications
brunogenaro
0
92
The future of React with Universal web applications
brunogenaro
0
100
Understand Front-End Roles
brunogenaro
1
140
Why did I build my website using ReactJS?
brunogenaro
0
36
Essential JavaScript libraries to improve your workflow
brunogenaro
0
50
Consuming Third Party Data With JSONP
brunogenaro
0
86
Improving your code with Linter tools
brunogenaro
0
56
Improving your Sublime Text 3 workflow
brunogenaro
0
170
Other Decks in Technology
See All in Technology
TinyGoを使ったVSCode拡張機能実装
askua
2
200
10分でわかるfreee エンジニア向け会社説明資料
freee
18
520k
「視座」の上げ方が成人発達理論にわかりやすくまとまってた / think_ perspective_hidden_dimensions
shuzon
2
15k
FOSS4G 2024 Japan コアデイ 一般発表25 PythonでPLATEAUのデータを手軽に扱ってみる
ra0kley
1
120
フルカイテン株式会社 採用資料
fullkaiten
0
39k
Deno+JSRでパッケージを作って公開する
askua
0
100
OCI Data Integration技術情報 / ocidi_technical_jp
oracle4engineer
PRO
1
2.6k
コンテナのトラブルシューティング目線から AWS SAW についてしゃべってみる
kazzpapa3
1
120
国土交通省 データコンペ参加者向け勉強会
takehikohashimoto
0
360
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
600
Windows Autopilot Deployment by OSD Guy
tamaiyutaro
0
290
データの信頼性を支える仕組みと技術
chanyou0311
3
1.4k
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
15
2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Writing Fast Ruby
sferik
627
61k
The Cult of Friendly URLs
andyhume
78
6k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Statistics for Hackers
jakevdp
796
220k
Transcript
RENDERIZANDO COMPONENTES REACT NO SERVIDOR BRUNO GENARO @BFGENARO
WHO IS THIS GUY? BRUNO GENARO FRONT-END ENGINEER
SAN FRANCISCO'S OFFICE
None
None
None
None
None
PIRACICABA/SP
None
WHAT IS THIS TALK ABOUT? JAVASCRIPT NODEJS UNIVERSAL VS ISOMORPHIC
JAVASCRIPT REACTJS WHY? HOW? WHEN? WHERE?
None
1995
1995 Brendan eich • hired by netscape • creator of
javascript • javascript was written in 10 days!!!
2009 ryan dahl • creator of nodejs • Google’s V8
JavaScript runtime • javascript on the server
2011 Jordan Walke • creator of reactjs • one-way data
flow • virtual dom • JSX
2011 still… Charlie Robbins • Isomorphic Javascript • JAVASCRIPT on
the Client and the server
None
2014 michael jackson • universal Javascript • JAVASCRIPT on the
Client and the server
None
LET THE FIGHT BEGIN THEY ARE THE SAME THING
THERE ARE ONLY TWO HARD THINGS IN COMPUTER SCIENCE: CACHE
INVALIDATION AND NAMING THINGS. - PHIL KARLTON
let’s go back in time! being a JavaScript developer wasn’t
a thing to be proud of
None
“real coding" was done in the backend
and now… even on the server (and client at the
same time)
OK, LET’S TALK ABOUT REACT
UNIVERSAL REACT REACT CODE THAT RUNS ON CLIENT SIDE (BROWSER)
AND SERVER SIDE
what does that mean? - On first page load, SERVER
returns pre- rendered HTML STRING - Client-side JS app bootstraps on top of server-rendered HTML - From that point on, it's a client-side JS app
why? - usually jAVascript frameworks render on dom load (which
can be really slow) - bad for user experience - SEO BENEfits
EVERY TIME YOU RELEASE A CLIENT-SIDE ONLY WEBSITE TO THE
INTERNET SOMEONE WRITES A FRUSTRATED BLOG POST
None
how? ABILITY TO RENDER A REACT COMPONENT TO A STRING
react component
returns this string
WAIT! WE CAN RUN JAVASCRIPT ALSO ON THE SERVER SIDE,
RIGHT?
THAT’S RIGHT! SO… SO WE CAN RENDER REACT COMPONENTS ON
THE SERVER!
where?
then…
None
when? ELIMINATE THE FOUC (flash of unstyled content) Better overall
user experience
when? SHARED CODE Easier code maintenance
when? PROGRESSIVE ENHANCEMENt
when? Improve search engine optimization
None
final thoughts •UNIVERSAL apps do NOT replace the server •instead
it Is a way to PRE-initialize the client •after the page loads, it becomes a client-side JS app
QUICK RECAP • On first page load, SERVER returns pre-rendered
HTML STRING • From that point on, it's a client-side JS app • ELIMINATE "FOUC" GIVING A BETTER USER EXPERIENCE • EASIER CODE MAINTENANCE • PROGRESSIVE ENHANCEMENt • IMPROVE SEARCH ENGINE OPTIMIZATION
what next?
None
None
orlandoJS
None
REACT WEBPACK UNIVERSAL REACT REDUX REACT INTL
THANK YOU! @BFGENARO