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
45
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
240
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
140
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
120
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
670
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
420
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
Jetpack for KMP
fornewid
1
290
Rust.Nagoya #1
codemountains
0
170
OpenAI/Gemini APIを使って EPUBを翻訳するCLIツールをつくってみた
tomiyan
0
790
ぼっちを避けて楽しむためのアノテコノテ / Various Tips and Tricks to Avoid Loneliness and Have Fun
nrslib
3
1.7k
Rustのweb開発を助ける 便利なツール紹介
yuki0418
1
190
社内 LT 会を発足し、アウトプット文化を醸成させるために考えたこと・やったこと / Starting internal LT meetings and fostering an output culture
mackey0225
3
120
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
最古の関数型言語「Lisp」ことはじめ / lisp_in_kamiyama
uhooi
1
190
企業向け生成AIアプリの 開発から得られた知見
takaakikakei
0
310
Product Management LT会_クアンド新家
shinshin
0
260
英語
s_shimotori
1
220
リハビリmruby
kishima
1
160
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Gamification - CAS2011
davidbonilla
78
4.9k
Practical Orchestrator
shlominoach
185
10k
Fireside Chat
paigeccino
25
2.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
Principles of Awesome APIs and How to Build Them.
keavy
124
16k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Being A Developer After 40
akosma
72
580k
The Mythical Team-Month
searls
217
43k
How STYLIGHT went responsive
nonsquared
93
5k
Web Components: a chance to create the future
zenorocha
307
41k
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!