-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(platform): consolidate API for configuring the platform
This commit eliminates the different ways to configure the platform and removes the separate communication channel for library-internal communication. closes #39 closes #96 BREAKING CHANGE: Consolidation of the API for configuring the platform host introduced a breaking change. The communication protocol between host and client is not affected by this change. - API for loading the platform config via a config loader has been removed; to migrate, load the config before starting the platform; - API for passing an app list to `MicrofrontendPlatform.startHost` has been removed; to migrate, register applications via `MicrofrontendPlatformConfig` object, as follows: `MicrofrontendPlatformConfig.applications`; - manual registration of the host application has been removed as now done implicitly; to migrate: - remove host app from the app list; - configure host privileges via `HostConfig` object, as follows: - `MicrofrontendPlatformConfig.host.scopeCheckDisabled` - `MicrofrontendPlatformConfig.host.intentionCheckDisabled` - `MicrofrontendPlatformConfig.host.intentionRegisterApiDisabled` - specify message delivery timeout in `MicrofrontendPlatformConfig.host.messageDeliveryTimeout`; - provide the host's manifest, if any, via `MicrofrontendPlatformConfig.host.manifest`, either as object literal or as URL; - specify the host's symbolic name in `MicrofrontendPlatformConfig.host.symbolicName`; if not specified, defaults to `host`; - the Activator API can now be disabled by setting the flag `MicrofrontendPlatformConfig.activatorApiDisabled` instead of `PlatformConfig.platformFlags.activatorApiDisabled`; - the interface `ApplicationManifest` has been renamed to `Manifest`; - the micro application must now pass its identity (symbolic name) directly as the first argument, rather than via the options object; - the options object passed to `MicrofrontendPlatform.connectToHost` has been renamed from ` MicroApplicationConfig` to `ConnectOptions` and messaging options are now top-level options; to migrate: - set the flag `MicrofrontendPlatformConnectOptions.connect` instead of `MicroApplicationConfig.messaging.enabled` to control if to connect to the platform host; - specify 'broker discovery timeout' in `MicrofrontendPlatformConnectOptions.brokerDiscoverTimeout` instead of `MicroApplicationConfig.messaging.brokerDiscoverTimeout`; - specify 'message delivery timeout' in `MicrofrontendPlatformConnectOptions.messageDeliveryTimeout` instead of `MicroApplicationConfig.messaging.deliveryTimeout`; ### The following snippets illustrate how a migration could look like: #### Before migration ```typescript const applications: ApplicationConfig[] = [ {symbolicName: 'host', manifestUrl: '/manifest.json'}, // optional {symbolicName: 'app1', manifestUrl: 'http://app1/manifest.json'}, {symbolicName: 'app2', manifestUrl: 'http://app2/manifest.json'}, ]; await MicrofrontendPlatform.startHost(applications, {symbolicName: 'host'}); ``` #### After migration ```typescript await MicrofrontendPlatform.startHost({ host: { symbolicName: 'host', manifest: '/manifest.json' }, applications: [ {symbolicName: 'app1', manifestUrl: 'http://app1/manifest.json'}, {symbolicName: 'app2', manifestUrl: 'http://app2/manifest.json'} ] }); ``` #### After migration if inlining the host manifest ```typescript await MicrofrontendPlatform.startHost({ host: { symbolicName: 'host', manifest: { name: 'Host Application', capabilities: [ // capabilities of the host application ], intentions: [ // intentions of the host application ] } }, applications: [ {symbolicName: 'app1', manifestUrl: 'http://app1/manifest.json'}, {symbolicName: 'app2', manifestUrl: 'http://app2/manifest.json'} ], }); ```
- Loading branch information
1 parent
f05d643
commit 142ce8e
Showing
86 changed files
with
2,323 additions
and
2,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.