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
270
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React JS Code Splitting - Why and How?
Slides for "React JS Code Splitting - Why and How?" workshop.
Arun Michael Dsouza
June 30, 2019
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
130
Using the Gamepad API for a better gaming experience on the web
arunmichaeldsouza
0
280
Building your first web app with React JS, Webpack and Babel
arunmichaeldsouza
0
460
React 16 & NPM, Create your own library - React Delhi NCR 07 Oct 2018 Meetup
arunmichaeldsouza
0
220
Houdini, what lies ahead - Web Weekend Kathmandu 2018
arunmichaeldsouza
0
210
Intro to React Components - React Delhi NCR 01 Jul 2018 Meetup
arunmichaeldsouza
1
750
Houdini, what lies ahead - JSConf Iceland 2018
arunmichaeldsouza
0
530
The Era of Module Bundlers - GDG Dev Fest Delhi 2017
arunmichaeldsouza
0
220
Getting started with React 16
arunmichaeldsouza
1
1.3k
Other Decks in Programming
See All in Programming
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
130
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
210
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
140
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
380
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
数百円から始めるRuby電子工作
tarosay
0
140
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
260
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
590
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
Android CLI
fornewid
0
210
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
170
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
The Mindset for Success: Future Career Progression
greggifford
PRO
0
440
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
610
Abbi's Birthday
coloredviolet
3
9.3k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Un-Boring Meetings
codingconduct
0
380
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.3k
Building AI with AI
inesmontani
PRO
1
1.1k
Automating Front-end Workflow
addyosmani
1369
210k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
330
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
410
Believing is Seeing
oripsolob
1
180
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!