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
170
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
51
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
270
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
150
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
440
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
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
距離関数を極める! / SESSIONS 2024
gam0022
0
280
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.8k
Realtime API 入門
riofujimon
0
150
Quine, Polyglot, 良いコード
qnighy
4
640
Better Code Design in PHP
afilina
PRO
0
120
みんなでプロポーザルを書いてみた
yuriko1211
0
260
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Statistics for Hackers
jakevdp
796
220k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
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!