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
VibeCodingからAgenticWorkflowへ
starfish719
0
770
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
990
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
350
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
100
Flow は今どうなっているか
mizdra
PRO
0
680
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
190
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
590
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
370
プロポーザルを書いてもらう
pvcresin
0
570
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
280
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
440
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Are puppies a ranking factor?
jonoalderson
2
3.8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Docker and Python
trallard
47
4.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
810
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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