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
160
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
32
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
190
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
220
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
130
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
110
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
660
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
400
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
150
Getting started with React 16
arunmichaeldsouza
1
1k
Other Decks in Programming
See All in Programming
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1.1k
ゆるい個人開発のススメ
kuroppe1819
10
1k
Implementing Design Systems in Swift
seyfoyun
0
350
Snowflakeで眠ったデータを起こそう!
estie
0
130
Code Reviews
bkuhlmann
4
890
Deep Dive into React Stream/Serialize
mugi_uno
2
260
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
新宿ダンジョンを可視化してみた
satoshi7190
2
280
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
590
2 週間で Twitter Bot を作ってみた
contour_gara
0
720
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
230
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
22
1.6k
Making Projects Easy
brettharned
109
5.5k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Why Our Code Smells
bkeepers
PRO
331
56k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Documentation Writing (for coders)
carmenintech
61
4k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Side Projects
sachag
451
41k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
17
1.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
38
2.5k
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!