SlideShare a Scribd company logo
Bundle Splitting in
Volto
Nilesh Gulia
- Developer @Eau De Web
Twitter: @nileshg89
What is Bundle splitting?
Bundle splitting is a way to create separate bundles/chunks for your code when we need them on demand.
This is also known as code splitting. We do have webpack which bundles our code into a single js static
file.
The Idea?
➔ Manually split code using webpack configuration ( not recommended ).
➔ Using splitChunks plugin. It uses internal rules while spitting chunks and removes duplicated
dependencies.
➔ Dynamic import or lazy-load.
Ways to split bundle
Webpack Prefetch/Preload
Prefetch: fetch the resource available which are needed in future pages/navigation.
Preload: load the resources which are needed in the current page/navigation.
They results in <link/> tag creation in the html file, something like:
<link rel="prefetch/preload" href="chunk-name.js">
Dynamic Import
➔ Import a module on demand. Returns a Promise.
➔ To lazy load modules, React supports React.lazy
➔ React.lazy only to be used with <Suspense> and cannot support SSR
Loadable components to Rescue!
➔ API structure similar to React.lazy
➔ Supports dynamic variables names in import statements.
➔ Support SSR out of the box.
➔ Extract chunks on server and pass it to context of your app with extractManager.
Lets try to lazy load an external lib in
Volto!
Lazy load react-dropzone
Chunk size before:
Plugins
Just add dynamic import:
import loadable from '@loadable/component'
const Moment = loadable(() => import('react-dropzone'))
Loadable returns a dynamic import and when webpack come across this syntax, its start component
splitting...
Decreased chunk size
Analyse bundle-size:
-> Webpack bundle analyzer:
https://github.com/webpack-contrib/webpack-bundle-analyzer/
-> bundlephobia: https://bundlephobia.com/
-> bundlesize: https://github.com/siddharthkp/bundlesize
Thank you!
Contribute:
Volto: https://github.com/plone/volto/issues

More Related Content

What's hot

Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
Chen-Tien Tsai
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
SC5.io
 
Structuring web applications with Backbone.js
Structuring web applications with Backbone.jsStructuring web applications with Backbone.js
Structuring web applications with Backbone.js
Diego Cardozo
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
Danillo Corvalan
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
Features: A better way to package stuff in Drupal
Features: A better way to package stuff in DrupalFeatures: A better way to package stuff in Drupal
Features: A better way to package stuff in Drupal
Rob Knight
 
ColdFusion framework comparison
ColdFusion framework comparisonColdFusion framework comparison
ColdFusion framework comparisonVIkas Patel
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
Boris Livshutz
 
The MEAN Stack
The MEAN StackThe MEAN Stack
The MEAN Stack
Md. Ziaul Haq
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
Isatu Conteh
 
Web components, so close!
Web components, so close!Web components, so close!
Web components, so close!
Aleks Zinevych
 
Using html5 to build offline applications
Using html5 to build offline applicationsUsing html5 to build offline applications
Using html5 to build offline applications
Woody Pewitt
 
Node js projects
Node js projectsNode js projects
Node js projects
💾 Radek Fabisiak
 
Html5 storage suggestions for challenges.pptx
Html5 storage   suggestions for challenges.pptxHtml5 storage   suggestions for challenges.pptx
Html5 storage suggestions for challenges.pptx
deepmoteria
 
MEAN stack
MEAN stackMEAN stack
MEAN stack
Iryney Baran
 
Single page applications
Single page applicationsSingle page applications
Single page applications
Diego Cardozo
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.js
Shakti Shrestha
 
Setup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architectureSetup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architecture
Mindfire Solutions
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
Yuriy Shapovalov
 

What's hot (20)

Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
 
Structuring web applications with Backbone.js
Structuring web applications with Backbone.jsStructuring web applications with Backbone.js
Structuring web applications with Backbone.js
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
 
Features: A better way to package stuff in Drupal
Features: A better way to package stuff in DrupalFeatures: A better way to package stuff in Drupal
Features: A better way to package stuff in Drupal
 
ColdFusion framework comparison
ColdFusion framework comparisonColdFusion framework comparison
ColdFusion framework comparison
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
 
The MEAN Stack
The MEAN StackThe MEAN Stack
The MEAN Stack
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
 
Web components, so close!
Web components, so close!Web components, so close!
Web components, so close!
 
Using html5 to build offline applications
Using html5 to build offline applicationsUsing html5 to build offline applications
Using html5 to build offline applications
 
Node js projects
Node js projectsNode js projects
Node js projects
 
Html5 storage suggestions for challenges.pptx
Html5 storage   suggestions for challenges.pptxHtml5 storage   suggestions for challenges.pptx
Html5 storage suggestions for challenges.pptx
 
MEAN stack
MEAN stackMEAN stack
MEAN stack
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.js
 
Setup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architectureSetup ColdFusion application using fusebox mvc architecture
Setup ColdFusion application using fusebox mvc architecture
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
 

Similar to Bundle Splitting in Volto

Introduction to Webpack 5.0 Presentation
Introduction to Webpack 5.0 PresentationIntroduction to Webpack 5.0 Presentation
Introduction to Webpack 5.0 Presentation
Knoldus Inc.
 
Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
Vijay Shukla
 
WEBPACK
WEBPACKWEBPACK
WEBPACK
home
 
Webpack
WebpackWebpack
Webpack
WebpackWebpack
Webpack presentation
Webpack presentationWebpack presentation
Webpack presentation
RAHUL SHARMA
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
ValeriaCastillo71
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdf
Sufalam Technologies
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
LogeekNightUkraine
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
David Gibbons
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
Andrii Lundiak
 
What is code splitting in react
What is code splitting in reactWhat is code splitting in react
What is code splitting in react
BOSC Tech Labs
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
Claudio Procida
 
X tag with web components - joe ssekono
X tag with web components - joe ssekonoX tag with web components - joe ssekono
X tag with web components - joe ssekono
Joseph Ssekono
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
Hamid Ghorbani
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
ssuser65180a
 
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
TechExeter
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
Cem Arguvanlı
 

Similar to Bundle Splitting in Volto (20)

Introduction to Webpack 5.0 Presentation
Introduction to Webpack 5.0 PresentationIntroduction to Webpack 5.0 Presentation
Introduction to Webpack 5.0 Presentation
 
Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
 
WEBPACK
WEBPACKWEBPACK
WEBPACK
 
Webpack
WebpackWebpack
Webpack
 
Webpack
WebpackWebpack
Webpack
 
Webpack presentation
Webpack presentationWebpack presentation
Webpack presentation
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdf
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
 
What is code splitting in react
What is code splitting in reactWhat is code splitting in react
What is code splitting in react
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
X tag with web components - joe ssekono
X tag with web components - joe ssekonoX tag with web components - joe ssekono
X tag with web components - joe ssekono
 
Reactjs Basics
Reactjs BasicsReactjs Basics
Reactjs Basics
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 

More from PloneFoundation

Form Block / Formbuilder
Form Block / FormbuilderForm Block / Formbuilder
Form Block / Formbuilder
PloneFoundation
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
PloneFoundation
 
Améliorer la gouvernance et la gestion interne de la ville avec Plone
Améliorer la gouvernance et la gestion interne de la ville avec PloneAméliorer la gouvernance et la gestion interne de la ville avec Plone
Améliorer la gouvernance et la gestion interne de la ville avec Plone
PloneFoundation
 
Running Plone on AWS
Running Plone on AWSRunning Plone on AWS
Running Plone on AWS
PloneFoundation
 
State of Plone 4 and 5
State of Plone 4 and 5State of Plone 4 and 5
State of Plone 4 and 5
PloneFoundation
 
State of Plone 2020
State of Plone 2020State of Plone 2020
State of Plone 2020
PloneFoundation
 
Plone 6 Theming based on Barceloneta LTS
Plone 6 Theming based on Barceloneta LTSPlone 6 Theming based on Barceloneta LTS
Plone 6 Theming based on Barceloneta LTS
PloneFoundation
 
Modernize Plone's Classic UI
Modernize Plone's Classic UIModernize Plone's Classic UI
Modernize Plone's Classic UI
PloneFoundation
 
Green Party Maps
Green Party MapsGreen Party Maps
Green Party Maps
PloneFoundation
 
Volto: A Journey towards Personalization
Volto: A Journey towards PersonalizationVolto: A Journey towards Personalization
Volto: A Journey towards Personalization
PloneFoundation
 
Asking questions for the benefit of your future self - Growing with the Plone...
Asking questions for the benefit of your future self - Growing with the Plone...Asking questions for the benefit of your future self - Growing with the Plone...
Asking questions for the benefit of your future self - Growing with the Plone...
PloneFoundation
 
The State of Pillow
The State of PillowThe State of Pillow
The State of Pillow
PloneFoundation
 
Pyramid and the Pylons Project in the wild
Pyramid and the Pylons Project in the wildPyramid and the Pylons Project in the wild
Pyramid and the Pylons Project in the wild
PloneFoundation
 
Questions
QuestionsQuestions
Questions
PloneFoundation
 

More from PloneFoundation (14)

Form Block / Formbuilder
Form Block / FormbuilderForm Block / Formbuilder
Form Block / Formbuilder
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
 
Améliorer la gouvernance et la gestion interne de la ville avec Plone
Améliorer la gouvernance et la gestion interne de la ville avec PloneAméliorer la gouvernance et la gestion interne de la ville avec Plone
Améliorer la gouvernance et la gestion interne de la ville avec Plone
 
Running Plone on AWS
Running Plone on AWSRunning Plone on AWS
Running Plone on AWS
 
State of Plone 4 and 5
State of Plone 4 and 5State of Plone 4 and 5
State of Plone 4 and 5
 
State of Plone 2020
State of Plone 2020State of Plone 2020
State of Plone 2020
 
Plone 6 Theming based on Barceloneta LTS
Plone 6 Theming based on Barceloneta LTSPlone 6 Theming based on Barceloneta LTS
Plone 6 Theming based on Barceloneta LTS
 
Modernize Plone's Classic UI
Modernize Plone's Classic UIModernize Plone's Classic UI
Modernize Plone's Classic UI
 
Green Party Maps
Green Party MapsGreen Party Maps
Green Party Maps
 
Volto: A Journey towards Personalization
Volto: A Journey towards PersonalizationVolto: A Journey towards Personalization
Volto: A Journey towards Personalization
 
Asking questions for the benefit of your future self - Growing with the Plone...
Asking questions for the benefit of your future self - Growing with the Plone...Asking questions for the benefit of your future self - Growing with the Plone...
Asking questions for the benefit of your future self - Growing with the Plone...
 
The State of Pillow
The State of PillowThe State of Pillow
The State of Pillow
 
Pyramid and the Pylons Project in the wild
Pyramid and the Pylons Project in the wildPyramid and the Pylons Project in the wild
Pyramid and the Pylons Project in the wild
 
Questions
QuestionsQuestions
Questions
 

Recently uploaded

Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 

Bundle Splitting in Volto

  • 1. Bundle Splitting in Volto Nilesh Gulia - Developer @Eau De Web Twitter: @nileshg89
  • 2. What is Bundle splitting? Bundle splitting is a way to create separate bundles/chunks for your code when we need them on demand. This is also known as code splitting. We do have webpack which bundles our code into a single js static file.
  • 3.
  • 5. ➔ Manually split code using webpack configuration ( not recommended ). ➔ Using splitChunks plugin. It uses internal rules while spitting chunks and removes duplicated dependencies. ➔ Dynamic import or lazy-load. Ways to split bundle
  • 6. Webpack Prefetch/Preload Prefetch: fetch the resource available which are needed in future pages/navigation. Preload: load the resources which are needed in the current page/navigation. They results in <link/> tag creation in the html file, something like: <link rel="prefetch/preload" href="chunk-name.js">
  • 7. Dynamic Import ➔ Import a module on demand. Returns a Promise. ➔ To lazy load modules, React supports React.lazy ➔ React.lazy only to be used with <Suspense> and cannot support SSR
  • 8. Loadable components to Rescue! ➔ API structure similar to React.lazy ➔ Supports dynamic variables names in import statements. ➔ Support SSR out of the box. ➔ Extract chunks on server and pass it to context of your app with extractManager.
  • 9. Lets try to lazy load an external lib in Volto!
  • 12. Just add dynamic import: import loadable from '@loadable/component' const Moment = loadable(() => import('react-dropzone')) Loadable returns a dynamic import and when webpack come across this syntax, its start component splitting...
  • 13.
  • 15. Analyse bundle-size: -> Webpack bundle analyzer: https://github.com/webpack-contrib/webpack-bundle-analyzer/ -> bundlephobia: https://bundlephobia.com/ -> bundlesize: https://github.com/siddharthkp/bundlesize