Skip to content

Commit 03e4425

Browse files
committed
docs: improve tutorial and readme for mf-tools
1 parent b0a9ec5 commit 03e4425

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

libs/mf-tools/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ This can help to **balance the trade-off** between bundle size and isolation of
1414

1515
> **Disclaimer:** Multi-Framework and -Version Micro increase the overall complexity and call for some workarounds. This library tries to hide some of them.
1616
17+
## Features
1718

19+
-**Minimal amount** of helper functions to allow implementing multi-framework/ multi-version Micro Frontends with Module Federation
20+
- ✅ You don't need an additional meta-framework. Instead, you just use your framework of choice, e. g. Angular
21+
- ✅ Extension to [@angular-architects/module-federation](https://www.npmjs.com/package/@angular-architects/module-federation)
1822

1923
## Examples
2024

@@ -67,11 +71,11 @@ export class AppModule {
6771
}
6872
```
6973

70-
### Exposing Web Component with other Frameworks like Ract
74+
### Exposing Web Component with other Frameworks like React
7175

7276
If you framework doesn't directly support exposing your application as a web component, you can easily write a simple Wrapper around it. Basically, a web component -- to be more precise: a custom element -- is just an EcmaScript class extending ``HtmlElement`` and registered via ``customElements.register``. Please find an [example for React here](https://github.com/manfredsteyer/react-app/blob/main/app.js).
7377

74-
### Exposting Web Component-based Micro Frontend via Module Federation
78+
### Exposing Web Component-based Micro Frontend via Module Federation
7579

7680
Add ``@angular-architects/module-federation`` to your micro frontend:
7781

libs/mf-tools/tutorial/index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ If you don't want to do the upstream tutorial first, you can use [this example](
147147
import { bootstrap } from '@angular-architects/module-federation-tools';
148148
149149
bootstrap(AppModule, {
150-
production: environment.production
150+
production: environment.production,
151+
appType: 'shell'
151152
})
152153
```
153154
@@ -157,18 +158,14 @@ If you don't want to do the upstream tutorial first, you can use [this example](
157158
158159
In this part of the lab, we will investigate the loaded micro frontend that has been called ["MF Angular #3"](https://github.com/manfredsteyer/angular3-app) before. We want to draw your attention to the following details:
159160
160-
1. The application is bootstrapped with the [bootstrap function](https://github.com/manfredsteyer/angular3-app/blob/main/src/bootstrap.ts) already used above.
161+
1. The application is bootstrapped with the [bootstrap function](https://github.com/manfredsteyer/angular3-app/blob/main/src/bootstrap.ts) already used above. Please note that here, ``appType`` is set to ``microfrontend``.
161162
162163
2. The ``AppModule`` is wrapping some components as web components using Angular Elements in it's [ngDoBootstrap](https://github.com/manfredsteyer/angular3-app/blob/main/src/app/app.module.ts) method.
163164
164165
3. The [webpack config](https://github.com/manfredsteyer/angular3-app/blob/main/webpack.config.js) exposes the whole ``bootstrap.ts`` file. Hence, everyone importing it can use the provided web components.
165166
166167
4. The [webpack config](https://github.com/manfredsteyer/angular3-app/blob/main/webpack.config.js) shares libraries like ``@angular/core``.
167168
168-
5. The routes set up in the [AppModule](https://github.com/manfredsteyer/angular3-app/blob/main/src/app/app.module.ts) use the url matcher ``endsWith``, because it does not know the shell's parent route.
169-
170-
6. The ``AppComponent`` calls the helper function [connectRouter](https://github.com/manfredsteyer/angular3-app/blob/main/src/app/app.component.ts) to make this app's router work alongside the shell's router.
171-
172169
173170
## More Details on Module Federation **
174171

0 commit comments

Comments
 (0)