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
Hello World 2018 - We need to talk about Preact
Search
Hello World Tech Conference
February 15, 2018
Programming
83
1
Share
Hello World 2018 - We need to talk about Preact
Hello World Tech Conference
February 15, 2018
More Decks by Hello World Tech Conference
See All by Hello World Tech Conference
Hello World 2018 - Learn how to get that dream job at Google!
helloworldconf
0
120
Hello World 2018 - Introduction to Swift
helloworldconf
0
65
Hello World 2018 - Understanding attacker behaviors, motivations and common ways of operation
helloworldconf
0
75
Hello World 2018 - GraphQL A query language for your API
helloworldconf
1
86
Hello World 2018 - Why Ruby?
helloworldconf
0
49
Hello World 2018 - Recent Advances in Machine Learning
helloworldconf
0
70
Hello World 2018 - Quality from the start
helloworldconf
0
36
Hello World 2017 - React Native
helloworldconf
0
110
Hello World 2017 - Testing & QA - Carreira Profissional?
helloworldconf
0
84
Other Decks in Programming
See All in Programming
実用!Hono RPC2026
yodaka
2
310
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
340
PHPer、Cloudflare に引っ越す
suguruooki
1
150
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
ハーネスエンジニアリングとは?
kinopeee
13
6.9k
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
450
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
400
AI-DLC Deep Dive
yuukiyo
9
5.7k
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.5k
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
350
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
250
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
340
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
Designing Experiences People Love
moore
143
24k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
130
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
500
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
910
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
280
Skip the Path - Find Your Career Trail
mkilby
1
120
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
AI: The stuff that nobody shows you
jnunemaker
PRO
6
630
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Transcript
WE NEED TO TALK ABOUT PREACT
HELLO! I am Sara I work at YLD and make
useless stuff on the internet @NikkitaFTW
Portugal
REMEMBER THIS JOKE?
Y’ALL JUST LOST TO A TEAM OF FLAMINGOS
PREACT
I know what your first question is !
I brought them stickers
1. What ? 2. Who ? 3. Why ? 4.
Future ? 5. The CLI
WHAT IS PREACT ?
None
IS IT PRODUCTION READY ?
None
YES !
WHO MADE PREACT ?
Jason Miller / @developit
WHY PREACT ?
THE COMMUNITY There is an amazing community behind preact !
None
None
None
None
None
IT’S PERFORMANT Preact is 3KB and was made with performance
in mind
X KB OF JS IS NOT THE SAME AS X
KB OF IMAGES The browser has to download it but also parse it and in older devices this may be the biggest problem
BENCHMARKS
Firefox 57.0 (64-bit)
Chrome Version 62 (64-bit)
REACT COMPATIBILITY You can use it with any react component
yarn add preact-compat { // ... resolve: { alias: {
'react': 'preact-compat', 'react-dom': 'preact-compat', // Not necessary unless you consume a module using `createClass` 'create-react-class': 'preact-compat/lib/create-react-class' } } // ... } How ?
What’s included in Preact ?
ES6 CLASS COMPONENTS And all the awesome lifecycle methods of
course
HIGH ORDER COMPONENTS Create them composes
FUNCTIONAL COMPONENTS Functions that just receive props as arguments and
return JSX/VDOM
CONTEXT In some cases, you want to pass data through
the component tree without having to pass the props down manually at every level. You can do this directly in with the “context” API.
REFS We all use it, don’t lie
VIRTUAL DOM DIFFING Preact's diff is simple but effective, and
extremely fast.
What’s added in Preact ?
PROPS AND STATE IN RENDER this.props and this.state are passed
to render() for you. THIS IS SO SWEET
class Home extends Component { constructor() { super(); this.state =
{ loading: true } } render = () => { const { name } = this.props; const { loading } = this.state; return ( <div> {loading ? ‘Loading...’ : name} </div> ) } }
class Home extends Component { state = { loading: true
} render = ({ name }, { loading }) => ( <div> {loading ? ‘Loading...’ : name} </div> ) }
DOM UPDATES Batching of DOM updates, debounced/collated using setTimeout (can
also use requestAnimationFrame)
CSS CLASS You can just use class for CSS classes.
className is still supported, but class is preferred.
Component and element recycling / pooling.
What’s missing in Preact ?
DANGEROUSLY SET innerHTML Do we really want this ? There
is preact-markup to fill this gap
SYNTHETIC EVENTS Preact's browser support target does not require this
extra overhead. Preact uses the browser's native addEventListener for event handling
BROWSER SUPPORT Preact supports modern browsers (Chrome, Firefox, Safari, Edge)
and IE9+
FUTURE
FASTER DIFFING ALGORITHM
ARRAY RETURNS
FRAGMENT SUPPORT
ASYNC DIFFING
DEMO TIME Let’s talk about the preact-cli
THANK YOU