"Micro frontends: Unbelievably true life story", Dmytro Pavlov
fwdays
132 views
31 slides
May 27, 2024
Slide 1 of 31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
About This Presentation
A real life story about the experience of using Micro frontends in an existing Enterprise product. Problems and their solutions on the way from the integration of a separate component to an extensible No-code platform.
2019 2020 2023 2024
ISSUES
... ...
Maintenance
Optimizations
New features
Bugs
2019 2020 2023 2024
ISSUES
... ...
Specific knowledge required
Internal community limitation
Documentation
Hiring issues
2019 2020 2023 2024
CHANGE TECH STACK ISSUES
... ...
New tech stack issues
Existing functionality and plans
Ability to integrate new techs in monolith app
Lack of expertise & experience
Educate big team
2019 2020 2023 2024
MICRO FRONTENDS: General Info
... ...
Benefits
Incremental upgrades
Decoupled codebases
Independent deployment
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Preliminary work
Identifу a suitable task
Make a PoC
Be ready to face issues
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Created Component with Angular
Angular
Cmp
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Packed as Web-component
Web Cmp
Angular
Cmp
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Packed as Web-component
import {Component, Injector} from '@angular/core';
import {createCustomElement} from '@angular/elements';
//...
@Component({
//...
})
export class AppComponent {
constructor(
injector: Injector,
public forecast: ForecastComponent,
) {
// Convert `ForecastComponent` to a custom element.
const ForecastComponent = createCustomElement(ForecastComponent,
{injector});
// Register the custom element with the browser.
customElements.define( 'forecast', ForecastComponent);
}
}
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Used proxy for integration into existing App
Proxy Cmp
Web Cmp
Angular
Cmp
2019 2020 2023 2024
MICRO FRONTENDS: First steps
... ...
Results
Unlocked new tech injection flow
Gained new expertise & experience
Faced new issues
Proxy Cmp
Web Cmp
Angular
Cmp
Proxy Cmp
Web Cmp
Angular
Cmp
Proxy Cmp
Web Cmp
Angular
Cmp
2019 2020 2023 2024
MICRO FRONTENDS: ISSUES
... ...
Issues
Each component loads own deps
Increases traffic
Downgrades performance
Proxy Cmp
Web Cmp
Angular
Cmp
Angular, RxJS
<code>
Component
<code>
2019 2020 2023 2024
MICRO FRONTENDS: Externals
... ...
The externals configuration option
provides a way of excluding
dependencies from the output bundles.
Instead, the created bundle relies on
that dependency to be present in
application environment.
Angular, RxJS
<code>
Component
<code>
Component
<code>
Component
<code>
2019 2020 2023 2024
MICRO FRONTENDS: Further plans
... ...
Plans for the future
Split libs into a smaller chunks for more advanced
lazy loading
Optimize build process
2019 2020 2023 2024
MICRO FRONTENDS: Carry outs
... ...
Micro frontends
Enabled possibility and added flexibility in using new
technologies
Led to new issues