Developing apps into
smaller components
Seiji Villafranca
github.com/SeijiV13
github.com/SeijiV13
Senior Software Engineer, KPN Netherlands
Microsoft MVP
Book Author
Community Lead, AngularPH,
seijivillafranca.com
What the ***** is MicroFrontend
"Micro" means small
"micro web services" was first used by Dr. Peter Rogers in 2005
A developed architecture which is intended to solve the monolithic maintainability dilemma
early companies who adapted microservice architecture
What does it "Solve"
Monolithic Architecture
the common thing we "do"
App1
A big chunk of App with a single repository or codebase
service 1
service 2
service 2
Well, we know it's a single codebase
A big chunk of App with a single repository or codebase
Application 1
Code Change (Has errors)
All code are affected
The Solution
Smaller Fine Components
Single Responsibility Principle
S1
S2
S3
S4
Client
API
Gateway
Service
Service
Service
Service
Orchestration
Storage
Client
API
Gateway
Service
Service
Service
Service
Storage
Event Bus
first came up in ThoughtWorks Technology Radar at the end of 2016
Microservice concepts going into frontend world
Well idea is not new, it has a lot in common with Self Contained Systems
The Monolithic Structure
Frontend with Verticals
Client
API
Gateway
Service
Service
Service
Service
Orchestration
MF4
MF3
MF2
MF1
Orchestration
Design Pattern
What are the goals
Is microfrontend feasible on top and latest frameworks?
YES!!
Bit.Dev
Microfrontend Frameworks
Helps us publish Angular components as custom elements. It does this by taking the Angular component and compiling it into a web component
Angular Elements
Angular Elements
CI/CD
build/js concat
element (js file)
Angular Code
CI/CD
react/vue pipelines
framework for bringing together multiple JavaScript micro frontends in a frontend application, can be used also in different js frameworks
The container App — single-SPA-root-config
basically the whole application.
Micro frontend Applications
Single-page applications are packaged up into modules and combine with the container app. Angular Vue React etc.
Composition
Architecture
Build Pipelines
Production
MF A
MF B
MF C
Lifecycle
frontend framework that implements single-spa comprises of 3 lifecycle methods:
bootstrap(): method to instantiate the application.
mount(): method to load the UI on the parent layer.
unmount(): method to unload the UI from the parent layer.
How to enable into the root app?
singleSpa.registerApplication()...
singleSpa.start()...
The power of cli
npm install -g create-single-spa
Is it really useful?
Yeah it also has its disadvantages