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
210
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
78
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
230
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
340
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
180
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
150
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
710
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
470
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
170
Getting started with React 16
arunmichaeldsouza
1
1.2k
Other Decks in Programming
See All in Programming
衛星の軌道をWeb地図上に表示する
sankichi92
0
260
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
0
490
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
0
210
REST API設計の実践 – ベストプラクティスとその落とし穴
kentaroutakeda
2
350
"使いづらい" をリバースエンジニアリングする UI の読み解き方
rebase_engineering
0
130
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
130
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
110
Using AI Tools Around Software Development
inouehi
0
710
複数アプリケーションを育てていくための共通化戦略
irof
9
3.5k
ワンバイナリWebサービスのススメ
mackee
10
7.6k
Feature Flag 自動お掃除のための TypeScript プログラム変換
azrsh
PRO
4
670
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
240
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
7
640
The Language of Interfaces
destraynor
158
25k
How STYLIGHT went responsive
nonsquared
100
5.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Rails Girls Zürich Keynote
gr2m
94
13k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
The Cost Of JavaScript in 2023
addyosmani
49
8.3k
Building an army of robots
kneath
306
45k
Site-Speed That Sticks
csswizardry
9
620
The World Runs on Bad Software
bkeepers
PRO
68
11k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
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!