-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize bundle size by splitting client and host-related code into separate secondary entry points #174
Comments
danielwiehl
added a commit
that referenced
this issue
Dec 20, 2022
closes #174 BREAKING CHANGE: reducing bundle size in client application introduced a breaking change for host and client applications. The communication protocol between host and client has not changed, i.e., host and clients can be updated independently to the new version. To enable tree-shaking of the SCION Microfrontend Platform, the platform was split into three separate entry points: - `MicrofrontendPlatformHost` to configure and start the platform in the host - `MicrofrontendPlatformClient` to connect to the platform from a microfrontend - `MicrofrontendPlatform` to react to platform lifecycle events and stop the platform The size of the library bundled in a client application could be reduced by more than 50%, from 120 KB to 40 KB. To migrate the host application: - start the platform via `MicrofrontendPlatformHost.start` instead of `MicrofrontendPlatform.startHost` - monitor startup progress via `MicrofrontendPlatformHost.startupProgress$` instead of `MicrofrontendPlatform.startupProgress$` To migrate the client application: - connect to the host via `MicrofrontendPlatformClient.connect` method instead of `MicrofrontendPlatform.connectToHost` - test if connected to the host via `MicrofrontendPlatformClient.isConnected` method instead of `MicrofrontendPlatform.isConnectedToHost`
danielwiehl
added a commit
that referenced
this issue
Dec 20, 2022
closes #174 BREAKING CHANGE: reducing bundle size in client application introduced a breaking change for host and client applications. The communication protocol between host and client has not changed, i.e., host and clients can be updated independently to the new version. To enable tree-shaking of the SCION Microfrontend Platform, the platform was split into three separate entry points: - `MicrofrontendPlatformHost` to configure and start the platform in the host - `MicrofrontendPlatformClient` to connect to the platform from a microfrontend - `MicrofrontendPlatform` to react to platform lifecycle events and stop the platform The size of the library bundled in a client application could be reduced by more than 50%, from 120 KB to 40 KB. To migrate the host application: - start the platform via `MicrofrontendPlatformHost.start` instead of `MicrofrontendPlatform.startHost` - monitor startup progress via `MicrofrontendPlatformHost.startupProgress$` instead of `MicrofrontendPlatform.startupProgress$` To migrate the client application: - connect to the host via `MicrofrontendPlatformClient.connect` method instead of `MicrofrontendPlatform.connectToHost` - test if connected to the host via `MicrofrontendPlatformClient.isConnected` method instead of `MicrofrontendPlatform.isConnectedToHost`
danielwiehl
added a commit
that referenced
this issue
Dec 20, 2022
closes #174 BREAKING CHANGE: reducing bundle size in client application introduced a breaking change for host and client applications. The communication protocol between host and client has not changed, i.e., host and clients can be updated independently to the new version. To enable tree-shaking of the SCION Microfrontend Platform, the platform was split into three separate entry points: - `MicrofrontendPlatformHost` to configure and start the platform in the host - `MicrofrontendPlatformClient` to connect to the platform from a microfrontend - `MicrofrontendPlatform` to react to platform lifecycle events and stop the platform The size of the library bundled in a client application could be reduced by more than 50%, from 120 KB to 40 KB. To migrate the host application: - start the platform via `MicrofrontendPlatformHost.start` instead of `MicrofrontendPlatform.startHost` - monitor startup progress via `MicrofrontendPlatformHost.startupProgress$` instead of `MicrofrontendPlatform.startupProgress$` To migrate the client application: - connect to the host via `MicrofrontendPlatformClient.connect` method instead of `MicrofrontendPlatform.connectToHost` - test if connected to the host via `MicrofrontendPlatformClient.isConnected` method instead of `MicrofrontendPlatform.isConnectedToHost`
danielwiehl
added a commit
that referenced
this issue
Dec 21, 2022
closes #174 BREAKING CHANGE: reducing bundle size in client application introduced a breaking change for host and client applications. The communication protocol between host and client has not changed, i.e., host and clients can be updated independently to the new version. To enable tree-shaking of the SCION Microfrontend Platform, the platform was split into three separate entry points: - `MicrofrontendPlatformHost` to configure and start the platform in the host - `MicrofrontendPlatformClient` to connect to the platform from a microfrontend - `MicrofrontendPlatform` to react to platform lifecycle events and stop the platform The size of the library bundled in a client application could be reduced by more than 50%, from 120 KB to 40 KB. To migrate the host application: - start the platform via `MicrofrontendPlatformHost.start` instead of `MicrofrontendPlatform.startHost` - monitor startup progress via `MicrofrontendPlatformHost.startupProgress$` instead of `MicrofrontendPlatform.startupProgress$` To migrate the client application: - connect to the host via `MicrofrontendPlatformClient.connect` method instead of `MicrofrontendPlatform.connectToHost` - test if connected to the host via `MicrofrontendPlatformClient.isConnected` method instead of `MicrofrontendPlatform.isConnectedToHost`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
To minimize bundle size we should split client and host-related code into separate secondary entry points. It is still the same module published to NPM but organized as secondary entry points.
Describe the solution you'd like
Secondary entry point for host-related code:
@scion/microfrontend-platform/host
Secondary entry point for client-related code:
@scion/microfrontend-platform/client
The host would then start the platform as follows:
The client would then connect to the host as follows:
The text was updated successfully, but these errors were encountered: