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
React JS Code Splitting - Why and How?
Search
Arun Michael Dsouza
June 30, 2019
Programming
1
180
React JS Code Splitting - Why and How?
Slides for "React JS Code Splitting - Why and How?" workshop.
Arun Michael Dsouza
June 30, 2019
Tweet
Share
More Decks by Arun Michael Dsouza
See All by Arun Michael Dsouza
Using the Gamepad API for a Better Gaming Experience on the Web
arunmichaeldsouza
0
56
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
200
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
280
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
160
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
120
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
680
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
450
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
150
Getting started with React 16
arunmichaeldsouza
1
1.1k
Other Decks in Programming
See All in Programming
たのしいparse.y
ydah
3
120
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Jakarta EE meets AI
ivargrimstad
0
230
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
Security_for_introducing_eBPF
kentatada
0
110
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
From Translations to Multi Dimension Entities
alexanderschranz
2
130
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
103 Early Hints
sugi_0000
1
220
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
130
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Rails Girls Zürich Keynote
gr2m
94
13k
Thoughts on Productivity
jonyablonski
67
4.4k
Why Our Code Smells
bkeepers
PRO
335
57k
The Cult of Friendly URLs
andyhume
78
6.1k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
React JS Code Splitting - Why and How?
bit.ly/react-delhincr
Speakers/Mentors Arun Michael Dsouza @amdsouza92 Kartik Agarwal @kartikag01
Why Code Splitting?
None
None
⚠ Performance
• Multiple HTTP requests to complete • Large payload to
download • Site load speed becomes slow • Multiple files for the browser to process
hobo-web.co.uk (2018)
None
None
• Lesser HTTP requests to complete • Large payload to
download • Site load speed improves • Lesser files for the browser to process
⚠ Shipping too much too soon!
washingtonpost.com
Every byte counts!
developers.google.com
What if we ship our JavaScript on demand?
/home vendor.js home.js /settings settings.js /messages messages.js /profile profile.js
• Limited HTTP requests to complete • Less payload to
download • Site load speed improves drastically • Limited files for the browser to process
How Code Splitting Works?
Dynamic import
None
• Route-level Code-Splitting • Component-level Code-Splitting
github.com
Code Splitting Codelab
• Clone the repo • > git clone https://github.com/React-Delhi-NCR/workshop-02-react-js-code-splitting.git •
Install dependencies • > npm install • Build project and start server • > npm start • This will start the project server on http://localhost:5000
• https://developers.google.com/web/fundamentals/performance/optimizing- javascript/code-splitting/ • https://webpack.js.org/guides/code-splitting/ • https://reactjs.org/docs/code-splitting.html • https://github.com/jamiebuilds/react-loadable •
https://medium.com/front-end-weekly/webpack-and-dynamic-imports- doing-it-right-72549ff49234 • https://www.youtube.com/watch?v=0jB4YWgAxUo Further Reading
Thank you!