SlideShare a Scribd company logo
Frontend Monolithen: 

Rette sich wer kann!
In 2016 the average webpage size passed the size of Doom
https://mobiforge.com/research-analysis/the-web-is-doom
Web-Page Obesity
The first Mac had
128k of RAM in 1984.
Web: Size does Matter!
The Cost of JavaScript
optional ajax request
data
http://thedomain:80/app
http://thedomain:80/api/data/first
http://thedomain:80/app#/first
http://thedomain:80/app#/second
"navigate" to "first"
screen
http://thedomain:80/app#/first
navigation
Browser Serverinitial request
html-shell
assets
load data &
render screen with JS
"navigate" to
"second" screen
load data &
render screen with JS
html-shell is loaded
optional ajax request
http://thedomain:80/api/data/second
data
loading...
appbootstrapping
Network
CostCPU Cost
The Cost of JavaScript
https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4
For mobile, aim for a JS budget of < 170KB minified/compressed.
Server Side Rendering
http://thedomain:80/app
http://thedomain:80/app#/first
Browser Serverinitial request
html-shell
assets
html-shell 

is displayedloading...
Angular renders 

the page
run JS
http://thedomain:80/app/first
http://thedomain:80/app/first
Browser Serverinitial request
html-shell

with content
assets
rendered
page is
displayed
Angular is
bootstrapped 

on the page
run JS
Angular
renders 

the page
run JS
Traditional SPA:
Enabling Server Side Rendering:
https://angular.io/guide/router#appendix-locationstrategy-and-browser-url-styles
Time to Paint vs.Time to Interactive
https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4
DEMO:
https://www.lei.admin.ch/
Speed == Money
https://www.thinkwithgoogle.com/feature/mobile/
Amazon did tests that showed they would lose $1.6
BILLION every year if they slowed down by just one second.
Walmart Study: For every 100 ms of improvement, they grew
incremental revenue by up to 1%.
https://www.fastcompany.com/1825005/how-one-second-could-cost-amazon-16-billion-sales
https://blog.radware.com/applicationdelivery/wpo/2014/04/web-page-speed-affect-conversions-infographic/
Enterprise Applications
History of Enterprise Apps
• Rich Clients accessing the DB
• Server-Side Web with multiple Domains
• Moving to SPA -> enables Microservices
• Eclipse RCP "Workbenches" -> Moving
to Web
The Fat Client
Feature 1 Feature 2 Feature 2
Rich Client
Workbench & Monolith
Feature 1 Feature 2 Feature 2
Workbench
Monolithic Server
Feature 1 Feature 2 Feature 3
Traditional Web Monolith
Feature 1 Feature 2 Feature 3
Frontend
Browser
Monolithic Server
SPA Monolith
Feature 1 Feature 2 Feature 3
Frontend
Monolithic Server
SPA Monolith & Microservices
Feature 1 Feature 2 Feature 3
Frontend
API API API
Composition &
Orchestration
happens in the
Client
Rich Client Migrations: 

The Rise of the Monoliths
API
Workbench
Monolithic Server
Feature 1 Feature 2 Feature 3
Feature 1 Feature 2 Feature 3
Feature 1
API
Feature 1
API
Feature 1
SPA Monolith
App
API
Workbench
Monolithic Server
Feature 1 Feature 2 Feature 3
Feature 1 Feature 2 Feature 3
Feature 1
API
Feature 1
API
Feature 1
SPA Monolith
App
Improvement!
Much Worse!
Beware of the Monolith
Unfortunately, we've seen many teams create front-end
monoliths - a single, large and sprawling browser
application - on top of their back-end services.
-ThoughtWorksTechnology Radar
App1 App2 App3
API 1 API 2 API 3
SPA Monolith
Problems of the Frontend Monolith
• Performance 

-> size is still relevant for web applications!
• Coupling & Dependencies
• preventing change / agility / time to market
• preventing effective/simple organization

(effective end-to-end delivery, self organizing teams ...)
Coupling / Lock-Step Releases
"Think about the granularity of development & deployment artifacts"
Application 1
- implemented by team 1
- driven by org-unit 1
Application 2
- implemented by team 2
- driven by org-unit 2
shared lib
- inhouse lib
- 3rd party lib 

(ie. Angular, React)
team 2 needs
to change or
update the lib
team 1 is
immediately
affected
The consequence is coupling between App1 and App 2:
- teams have to coordinate changes to the shared lib.
- development & release schedules of applications are coupled
Who is responsible for
testing/fixing application 1?
release
release
release
release
release
release
Problems of the Frontend Monolith
• The web is traditionally not made for
complex applications
• global scope / no isolation / no modularization concepts
• extremely dynamic (typing, monkey paching ...)
• browser differences
• Frequent technology changes
• core technologies are very backwards compatible
• ecosystem moves at break-neck speed
The Bad Parts
Frontend Monoliths: Run if you can!
http://www.commitstrip.com/en/2018/01/08/new-year-new-frameworks/
The first rule of huge 

enterprise applications is: 

You do not build huge enterprise
applications.
The second rule of huge
enterprise applications is:
You do not build huge
enterprise applications.
How?
Micro Frontends:
An architectural style where
independently deliverable frontend
applications are composed into a
greater whole.
?
Micro Frontends
App 1 App 2 App 3
App
API 1 API 2 API 3
SPA Monolith
API 1 API 2 API 3
? ?
The million dollar question:

Modularizing frontend applications.
https://micro-frontends.org/
The Link
<a	href="..."	>
The magical integration pattern that the web is built upon:
Microfrontend Flavors: Mini SPAs
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Page Page PageLink Link
You have complete isolation. But jumping between apps is a full page load!
DEMO
Mini SPAs
Challenges
• Performance: Starting the Mini-SPAs has to be very quick!
• Sharing layout & styles for common UX

-> use reusable technologies for styling -> plain CSS, SASS, less ...

-> be careful with "framework-specific" styling
• Sharing state / context

-> query parameters, cookies, http-headers

-> server side session / context

-> Local Storage / Indexed DB
Feature 1
App 1
Page Link
App2
Page
Feature 1
Context
Remember: Size does Matter
Frameworks could matter ...
Transfer size (KB) for the same application 
https://medium.freecodecamp.org/a-real-world-comparison-of-front-end-frameworks-with-benchmarks-2018-update-e5760fb4a962
Keep an eye on your bundles!
source-map-explorer:

https://www.npmjs.com/package/source-map-explorer
webpack-bundle-analyzer:

https://github.com/webpack-contrib/webpack-bundle-analyzer
npm	install	-g	source-map-explorer	
ng	build	--prod	--source-map	
source-map-explorer	dist/ng-app/main.XYZ.js
npm	install	-g	webpack-bundle-analyzer
ng	build	--prod	--stats-json	
webpack-bundle-analyzer	dist/ng-app/stats.json
www.bundlephobia.com
But I need a single SPA!
Microfrontend Flavors: Sinlge SPA
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell D0M D0M
https://github.com/CanopyTax/single-spa
All applications live
on the same DOM.
App-communication
happens over the
DOM.
You will need a shell
• Top-level routing
• Lazy loading of apps (child SPAs)
• Inter-SPA communication
• Sharing a context
Sinlge SPA: iframes
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
dependencies dependencies dependencies
D0M D0M Analogy: complete
classloader isolation.
Browser can leverage
caching, but for each app
all dependencies have to
be parsed, compiled and
executed.
iframeiframeiframe
Option: "Child SPAs" in iframe
Advantages:
- true isolation
- integration of "non-SPA" applications / sites
Disadvantage:
- No isolation: same global DOM, same
scripting context, same global scope
- Responsive layout is difficult
- Router can't access the URL
- Some 3rd party libraries break, since they
depend on document events
Sinlge SPA: Isolated
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
dependencies dependencies dependencies
D0M D0M
Browser can leverage
caching, but for each app
all dependencies have to
be parsed, compiled and
executed.
Like "complete classloader
isolation", but only if the app
& dependencies don't
pollute the global scope. 

Note:Angular comes with Zone.js,
which heavily pollutes the global
scope!
DEMO: Single-Spa
https://single-spa.js.org/
Option: Shared DOM
empty
empty
Sinlge SPA: Shared Dependencies
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
shared dependencies
D0M D0M
Analogy: shared
classloader
Inter-SPA Communication
https://github.com/jbandi/single-spa-portal-example
globalIncrement()	{	
			this.globals.globalEventDistributor.dispatch(this.actions.increment());	
}
Shell
M
ini
SP
A
1
M
ini
SP
A
2
DEMO: Single-Spa
https://single-spa.js.org/
Thighter Integration
Frontend Composition
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
How?
Web Components
Custom Elements API:
customElements.define('element-details',		class	extends	HTMLElement	{	...	})
WebComponents is a series of browser standards for
creating reusable custom elements:
https://developer.mozilla.org/en-US/docs/Web/Web_Components

https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements
Shadow DOM Encapsulation
HTML
templates
markup that is not initially rendered and can be instantiated.
Custom
elements
JavaScript API to define custom elements that can be used in
html and their behavior
JavaScript
html:
<div>	<element-details></element-details>	<div>	
Browser support:
native: Chrome, Safari
polyfill: Firefox, Edge, IE11
Frontend Monoliths: Run if you can!
Angular Elements
Angular Elements
https://angular.io/guide/elements
Using Angular components as Web Components.
Angular Elements can transform Angular components into classes that
can be registers as custom elemements:
import	{	createCustomElement	}	from	'@angular/elements';	
import	{	PopupComponent	}	from	'./popup.component';	
const	PopupElement	=	createCustomElement(PopupComponent,	{injector});	
customElements.define('element-details',	PopupElement)
Available in Angular 6
in any html (also from React JSX andVue templates):
<div>	<element-details></element-details>	<div>
Vue CLI Compilation
Vue CLI 3 can wrap a vue component / app
inside a Web Component
https://cli.vuejs.org/guide/build-targets.html#web-component 

https://github.com/vuejs/vue-web-component-wrapper
vue-cli-service	build	--target	wc	--name	my-element	./main.js
Build:
<script	src="path/to/my-element.js"></script>	
...	
<my-element></my-element>
any html:
Wrapping React
import	React	from	'react';	
import	ReactDOM	from	'react-dom';	
import	App	from	'./App';	
class	MyApp	extends	HTMLElement	{	
		connectedCallback()	{	
				const	mountPoint	=	document.createElement('span');	
				this.attachShadow({	mode:	'open'	}).appendChild(mountPoint);	
				const	message	=	this.getAttribute('message');	
				ReactDOM.render(<App	message={message}/>,	mountPoint);	
		}	
}	
customElements.define('my-app',	MyApp);	
<my-app	messsage="Hi	there!"></my-app>
any html:
DEMO
https://github.com/manfredsteyer/Angular_MicroApps_Different_Technologies
https://github.com/manfredsteyer/angular-elements-dashboard
More than ever: Size does Matter!
Size Does Matter!
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
670KB
430KB
932KB
Size Does Matter!
Feature 1 Feature 2 Feature 3
App 1
API API API
App 2 App 3
Shell
30KB
35KB
120KB
Angular
React
Vue
300KB
65KB
80KB
Big & Independent 

vs. 

Small & Coupled
More Challenges
Dataflow & sharing state between components:
Applications do not just consist of simple components.

There is shared state & context

(Angular services, React context, Redux stores ...)
WebComponents just have primitive string properties!
Versioning:There is no versioning of custom elements!
"It feels like imperative DOM programming" (remember jQuery?)
There is no Silver Bullet for 

Frontend Modularization
Fragen?
JavaScript / Angular / React Schulungen
& Coachings,

Project-Setup & Proof-of-Concept:
http://ivorycode.com/#schulung

jonas.bandi@ivorycode.com
https://github.com/jbandi/sbb-dev-day-2018

More Related Content

PDF
Modern JavaScript Frameworks: Angular, React & Vue.js
PDF
Frontend Monoliths: Run if you can!
DOCX
How backbone.js is different from ember.js?
PDF
MEAN Vs MERN Stack | Detailed Comparison Between MEAN & MERN Stack
PDF
Java Edge.2008.Web.Frameworks.Catagorized
PPTX
Mobile applications for SharePoint using HTML5
PPTX
Transforming the web into a real application platform
PPTX
Top 10 java script frameworks for 2020
Modern JavaScript Frameworks: Angular, React & Vue.js
Frontend Monoliths: Run if you can!
How backbone.js is different from ember.js?
MEAN Vs MERN Stack | Detailed Comparison Between MEAN & MERN Stack
Java Edge.2008.Web.Frameworks.Catagorized
Mobile applications for SharePoint using HTML5
Transforming the web into a real application platform
Top 10 java script frameworks for 2020

What's hot (19)

PDF
Android Development...Using Web Technologies
PDF
HTML5를 활용한 하이브리드 앱개발하기
PDF
(2015년 상반기) HTML5 및 Hybrid app 최신 동향
PDF
Dreamweaver CS6, jQuery, PhoneGap, mobile design
PPTX
10 top web development frameworks (new version 21 11)
PDF
Frontend Development Bootcamp - React [Online & Offline] In Bangla
PDF
Difference between ajax and silverlight
PPTX
Aeternity Blockchain - Ecosystem & Devtools [2019]
DOCX
Vitaliy Kryvonos_CV_up
PDF
Building a Next Generation Mobile Browser using Web technologies
PDF
Top Web Development Frameworks Comparison: All You Need To Know
DOCX
Hai_Bui
PDF
Angular Rebooted: Components Everywhere
PDF
Building Desktop RIAs with PHP, HTML & Javascript in AIR
PDF
Single Page Application Best practices
PPTX
Education&work experience
DOCX
Portfolio
PDF
React vs. angular a comprehensive guideline for choosing right front-end fr...
PDF
Sencha touchonbb10 bootcamp
Android Development...Using Web Technologies
HTML5를 활용한 하이브리드 앱개발하기
(2015년 상반기) HTML5 및 Hybrid app 최신 동향
Dreamweaver CS6, jQuery, PhoneGap, mobile design
10 top web development frameworks (new version 21 11)
Frontend Development Bootcamp - React [Online & Offline] In Bangla
Difference between ajax and silverlight
Aeternity Blockchain - Ecosystem & Devtools [2019]
Vitaliy Kryvonos_CV_up
Building a Next Generation Mobile Browser using Web technologies
Top Web Development Frameworks Comparison: All You Need To Know
Hai_Bui
Angular Rebooted: Components Everywhere
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Single Page Application Best practices
Education&work experience
Portfolio
React vs. angular a comprehensive guideline for choosing right front-end fr...
Sencha touchonbb10 bootcamp
Ad

Similar to Frontend Monoliths: Run if you can! (20)

PDF
From monolith web app to micro-frontends
PDF
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
PDF
The Characteristics of a Successful SPA
PPTX
Single page application and Framework
PPTX
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
PDF
Angular webinar - Credo Systemz
PDF
Single Page Application (SPA): A Comprehensive Guide for Beginners
PDF
Single Page Apps
PPTX
DIGIT Noe 2016 - Overview of front end development today
PPTX
Building modular single page applications
PDF
Single page applications
PPTX
Single page applications
PPTX
WebNetConf 2012 - Single Page Apps
PDF
Single page applications with backbone js
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
PDF
ITCamp 2018 - Liviu Mandras-Iura - Building SPA silos with VueJS and ASP.NET ...
PDF
Front end microservices: architectures and solution
PPTX
Single Page Applications: Your Browser is the OS!
PPTX
Build Modern Web Apps Using ASP.NET Web API and AngularJS
PPTX
Angular jS Introduction by Google
 
From monolith web app to micro-frontends
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
The Characteristics of a Successful SPA
Single page application and Framework
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Angular webinar - Credo Systemz
Single Page Application (SPA): A Comprehensive Guide for Beginners
Single Page Apps
DIGIT Noe 2016 - Overview of front end development today
Building modular single page applications
Single page applications
Single page applications
WebNetConf 2012 - Single Page Apps
Single page applications with backbone js
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
ITCamp 2018 - Liviu Mandras-Iura - Building SPA silos with VueJS and ASP.NET ...
Front end microservices: architectures and solution
Single Page Applications: Your Browser is the OS!
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Angular jS Introduction by Google
 
Ad

Recently uploaded (20)

PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Transform Your Business with a Software ERP System
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
Cost to Outsource Software Development in 2025
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
assetexplorer- product-overview - presentation
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
history of c programming in notes for students .pptx
Operating system designcfffgfgggggggvggggggggg
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Monitoring Stack: Grafana, Loki & Promtail
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Transform Your Business with a Software ERP System
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Designing Intelligence for the Shop Floor.pdf
Autodesk AutoCAD Crack Free Download 2025
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Salesforce Agentforce AI Implementation.pdf
Cost to Outsource Software Development in 2025
Complete Guide to Website Development in Malaysia for SMEs
Wondershare Filmora 15 Crack With Activation Key [2025
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
assetexplorer- product-overview - presentation
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
history of c programming in notes for students .pptx

Frontend Monoliths: Run if you can!