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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Arun Michael Dsouza
June 30, 2019
Programming
1
240
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
100
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
250
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
420
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
200
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
190
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
730
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
510
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
200
Getting started with React 16
arunmichaeldsouza
1
1.3k
Other Decks in Programming
See All in Programming
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
280
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
210
AI巻き込み型コードレビューのススメ
nealle
1
220
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Fragmented Architectures
denyspoltorak
0
150
Implementation Patterns
denyspoltorak
0
290
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
230
CSC307 Lecture 06
javiergs
PRO
0
680
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
67
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
My Coaching Mixtape
mlcsv
0
48
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
350
The World Runs on Bad Software
bkeepers
PRO
72
12k
For a Future-Friendly Web
brad_frost
182
10k
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!