frontend-app-api: extract createApp out into frontend-defaults

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-08-28 14:02:26 +02:00
parent fc66073fa4
commit 7c80650a1e
27 changed files with 643 additions and 169 deletions
+2 -2
View File
@@ -301,7 +301,7 @@ An example of [integration with scalprum](https://github.com/backstage/backstage
**Dynamic Feature configuration**
The dynamic remote loading can be added directly into the [`createApp`](https://github.com/backstage/backstage/blob/master/packages/frontend-app-api/src/wiring/createApp.tsx#L234) function.
The dynamic remote loading can be added directly into the [`createApp`](https://backstage.io/docs/reference/frontend-defaults.createapp) function.
The current `feature` type can be expanded with a `DynamicFrontendFeature` type:
@@ -351,7 +351,7 @@ const scalprum = initialize({
});
```
Because the [`appLoader`](https://github.com/backstage/backstage/blob/master/packages/frontend-app-api/src/wiring/createApp.tsx#L193) is already async, it is a perfect place to load the plugin registry and init the dynamic plugins.
Because the [`appLoader`](https://backstage.io/docs/reference/frontend-defaults.createapp) is already async, it is a perfect place to load the plugin registry and init the dynamic plugins.
Initializing the dynamic feature is just a case of mapping the `DynamicFrontendFeature` to `FrontendFeature` via Scalprum: