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
220
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
89
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
240
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
370
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
190
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
170
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
720
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
490
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
190
Getting started with React 16
arunmichaeldsouza
1
1.2k
Other Decks in Programming
See All in Programming
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
350
Devoxx BE - Local Development in the AI Era
kdubois
0
150
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
600
Go言語はstack overflowの夢を見るか?
logica0419
0
650
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
CSC509 Lecture 08
javiergs
PRO
0
270
KoogではじめるAIエージェント開発
hiroaki404
1
170
Swift Concurrency 年表クイズ
omochi
2
140
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
170
One Enishi After Another
snoozer05
PRO
0
170
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
600
Software Architecture
hschwentner
6
2.4k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
A Tale of Four Properties
chriscoyier
161
23k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Faster Mobile Websites
deanohume
310
31k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Unsuck your backbone
ammeep
671
58k
How to train your dragon (web standard)
notwaldorf
97
6.3k
YesSQL, Process and Tooling at Scale
rocio
173
15k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
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!