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
61
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
210
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
290
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
130
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
690
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
450
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
160
Getting started with React 16
arunmichaeldsouza
1
1.1k
Other Decks in Programming
See All in Programming
Flatt Security XSS Challenge 解答・解説
flatt_security
0
600
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
330
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.8k
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
140
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
720
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
160
선언형 UI에서의 상태관리
l2hyunwoo
0
250
Beyond ORM
77web
11
1.5k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
880
Package Traits
ikesyo
1
160
MCP with Cloudflare Workers
yusukebe
2
270
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Navigating Team Friction
lara
183
15k
A Tale of Four Properties
chriscoyier
157
23k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
550
The Cult of Friendly URLs
andyhume
78
6.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Typedesign – Prime Four
hannesfritz
40
2.5k
Done Done
chrislema
182
16k
RailsConf 2023
tenderlove
29
960
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Embracing the Ebb and Flow
colly
84
4.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!