Skip to content

Commit d189932

Browse files
committed
Add quick facts about microfrontends
1 parent cc6e96e commit d189932

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Microfrontends with Angular
22

3+
## Local development setup
4+
35
```
46
$ git clone https://github.com/fboeller/microfrontends-with-angular.git
57
$ cd microfrontends-with-angular
@@ -8,3 +10,39 @@ $ npm start
810
```
911

1012
A visit to `localhost:4200` shows the application.
13+
14+
## Benefits of microfrontends
15+
16+
- Vertical services (backend and frontend are fully owned by one team)
17+
- Ship code independently and faster
18+
- Freedom from existing opinionated codebase
19+
- Failures will likely only affect your microfrontend and not the whole app and you can release a fix more quickly
20+
21+
## You might need microfrontends when...
22+
23+
- your releases are slow
24+
- you need to wait for other teams for unblocking the release pipeline
25+
- it is not clear who owns which views
26+
27+
## Drawbacks of microfrontends
28+
29+
- bigger bundle size
30+
- added complexity of stitching shell app and microfrontends together
31+
32+
### Using webpack module federation
33+
34+
- microfrontends are more tightly coupled since they share common dependencies
35+
36+
## web-component vs iframe
37+
38+
iframes are more isolated while web-components are more tightly integrated with the application that embeds them.
39+
40+
### Disadvantages of iframes
41+
42+
#### Overlays
43+
44+
Modals and toast messages are only displayed within the element of the iframe itself and cannot "escape" it. This is why with iframes you would need to use some mechanisms like [Window.postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to let the outer application know that it should display a modal or toast message with some specific content that is passed along.
45+
46+
#### Theming
47+
48+
The DOM of the iframe is separate from the DOM of the embedding application. This makes it harder to use CSS variables for example.

0 commit comments

Comments
 (0)