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
220
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
89
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
240
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
370
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
190
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
170
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
720
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
490
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
190
Getting started with React 16
arunmichaeldsouza
1
1.2k
Other Decks in Programming
See All in Programming
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
SODA - FACT BOOK(JP)
sodainc
1
8.9k
Introduce Hono CLI
yusukebe
6
3.2k
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
130
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
110
NIKKEI Tech Talk#38
cipepser
0
330
理論と実務のギャップを超える
eycjur
0
200
Vue 3.6 時代のリアクティビティ最前線 〜Vapor/alien-signals の実践とパフォーマンス最適化〜
hiranuma
2
280
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
120
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
The Invisible Side of Design
smashingmag
302
51k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Code Review Best Practice
trishagee
72
19k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
Documentation Writing (for coders)
carmenintech
75
5.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
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!