StaticconnectConnects the micro application to the SCION Workbench and SCION Microfrontend Platform.
After connected, the micro application can interact with the workbench and other micro applications. Typically, the micro application connects to the workbench during the bootstrapping. In Angular, for example, this can be done in an app initializer.
See @scion/microfrontend-platform!MicrofrontendPlatformClient.connect for more information about connecting to the platform host.
Specifies the symbolic name of the micro application. The micro application needs to be registered in the workbench under that identity.
OptionalconnectOptions: ConnectOptionsControls how to connect to the workbench.
A Promise that resolves once connected to the workbench, or that rejects otherwise.
StaticregisterProvides texts to the SCION Workbench and micro apps.
A text provider is a function that returns the text for a translation key.
Texts starting with the percent symbol (%) are passed to the text provider for translation, with the percent symbol omitted.
This function must be called in an Activator. Refer to @scion/microfrontend-platform!ActivatorCapability for details on activators.
Applications can use WorkbenchTextService to get texts from other micro applications.
Function to provide the text for a translation key.
Object to unregister the text provider.
SCION Workbench Client provides core API for a web app to interact with SCION Workbench and other microfrontends.
It is a pure TypeScript library based on the framework-agnostic
@scion/microfrontend-platformlibrary and can be used with any web stack.You can use the
Beansobject to get references to services to interact with the SCION Workbench and the SCION Microfrontend Platform.Core services include:
MessageClientfor sending or receiving messages between micro applications.IntentClientfor issuing or receiving intents between micro applications.ManifestServicefor reading and registering capabilities at runtime.SciRouterOutletElementfor embedding microfrontends.OutletRouterfor navigating to a site in a router outlet element.ContextServicefor looking up contextual data set on a router outlet.PreferredSizeServicefor a microfrontend to report its preferred size.FocusMonitorfor observing if the microfrontend has received focus or contains embedded web content that has received focus.For example, you can obtain the workbench router as follows:
Below is a summary of the core concepts of the SCION Microfrontend Platform.
Host Application and Micro Applications
The host application, sometimes also called the container application, provides the top-level integration container for microfrontends. Typically, it is the web app which the user loads into his browser and provides the main application shell, defining areas to embed microfrontends. The host application has SCION Workbench installed, registers micro apps and starts the SCION Microfrontend Platform in host mode.
A micro application deals with well-defined business functionality. It is a regular web application that provides one or more microfrontends. SCION Microfrontend Platform uses iframes to embed microfrontends; thus, any web page can be integrated as a microfrontend. A micro application can communicate with other micro applications safely using the platform's cross-origin messaging API. A micro application has to provide an application manifest which to register in the host application.
For more information, see the chapter Core Concepts of the SCION Microfrontend Platform Developer's Guide.
Embedding of Microfrontends
You can embed microfrontends using the
<sci-router-outlet>web component. Web content displayed in the web component is controlled via theOutletRouter.For more information, see the chapter Embedding Microfrontends of the SCION Microfrontend Platform Developer's Guide.
Cross-Application Communication
You can interact with other micro applications via messaging or through so-called intents. Intents are a mechanism known from Android development, enabling controlled collaboration across application boundaries.
For more information, see the chapters Cross-Application Communication and Intention API of the SCION Microfrontend Platform Developer's Guide.
Activation
You can provide an activator to connect to the platform when the user loads the host app into his browser, allowing to initialize and install message listeners for interacting with other micro applications. Starting an activator may take some time. In order not to miss any messages, you can instruct the platform host to wait until you signal readiness.
For more information, see the chapter Activator of the SCION Microfrontend Platform Developer's Guide.
See our Developer's Guide for the full documentation about the SCION Microfrontend Platform.