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
Isomorphic Web Apps with React
Search
Kristian Andersen
February 25, 2016
Programming
51
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Isomorphic Web Apps with React
Kristian Andersen
February 25, 2016
More Decks by Kristian Andersen
See All by Kristian Andersen
Flexbox all the things
ksmandersen
2
170
Static Websites with Gulp & AWS
ksmandersen
0
140
Practical MVVM
ksmandersen
0
230
Practical Swift
ksmandersen
1
210
Introduction to CocoaLumberjack
ksmandersen
0
120
Other Decks in Programming
See All in Programming
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
210
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
130
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
970
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
360
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
140
テーブルをDELETEした
yuzneri
0
130
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
290
AIエージェントで 変わるAndroid開発環境
takahirom
2
770
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.2k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
550
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
210
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
400
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Unsuck your backbone
ammeep
672
58k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Discover your Explorer Soul
emna__ayadi
2
1.2k
Visualization
eitanlees
152
17k
Designing for Timeless Needs
cassininazir
1
430
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Everyday Curiosity
cassininazir
0
270
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
390
Transcript
@CPHFRONT ⎯ @KSMANDERSEN
ISOMORPHIC WEB APPS
IN THE BEGINNING
AND THUS JAVASCRIPT WAS BORN
THE CRAZY ENGINEERS @ GOOGLE
LET'S RUN JAVASCRIPT ON SERVERS
ISOMORPHIC WEB APPS
UNIVERSAL WEB APPS
WHAT IT IS > An app that runs both on
the server and the client > Rendering can be done both by the server and the browser > The apps share at least 90% of the same code
None
None
CLIENT-SIDE RENDERING > Rendering done client-side takes load away from
the server > Consecutive page navigation is very fast > Fancy interactions, animations and rainbows
SERVER-SIDE RENDERING > More load on the server for rendering
> Page content visible to bots, search engines and crazy people > The initial page load is faster (no app to boot client- side)
ISOMORPHIC RENDERING > The best of both worlds > Fast
initial page load (server-side rendering) > Consecutive page loads are very fast (client-side rendering) > Page content visible for bots, search engines and crazy people
None
WHY IS REACT GREAT FOR ISOMORPHIC WEB APPS?
COMPONENTS COMPONENTS COMPONENTS
THE VIRTUAL DOM
await Router.dispatch({ path: req.path, query: req.query, context }, (state, component)
=> { data.body = ReactDOM.renderToString(component); });
DE-COUPLED ROUTING
const router = new Router(on => { on('*', async (state,
next) => { const component = await next(); return component && <App context={state.context}>{component}</App>; }); on('/login', async () => <LoginPage />); });
EXPRESS.JS
const server = global.server = express(); server.get('*', async (req, res,
next) => { res.status(200).send(`Hello World`); });
GREAT HOW DO I GET STARTED?
None
HOW IT ACTUALLY WORKS
None
SERVER.JS const server = global.server = express(); server.get('*', async (req,
res, next) => { try { const data = { title: '', description: '', css: [], body: '', entry: assets.main.js }; const context = { insertCss: styles => data.css.push(styles._getCss()), ... }; await Router.dispatch({ path: req.path, query: req.query, context }, (state, component) => { data.body = ReactDOM.renderToString(component); data.css = css.join(''); }); const html = ReactDOM.renderToStaticMarkup(<Html {...data} />); res.status(200).send(`<!doctype html>\n${html}`); } catch (err) { next(err); } }); server.listen(port, () => {});
DEMO TIME
@CPHFRONT ⎯ @KSMANDERSEN