Scion Microfrontend Platform Versions Save

SCION Microfrontend Platform is a TypeScript-based open-source library that helps to implement a microfrontend architecture using iframes.

1.2.2

6 months ago

1.2.2 (2023-11-10)

Bug Fixes

  • platform: support navigating to blob URL (5bbb1e0)

1.2.1

6 months ago

1.2.1 (2023-11-02)

Bug Fixes

  • platform/client: show splash if instructed by the navigator, but only if not navigating to the same capability, if any (a91286d)

1.2.0

7 months ago

1.2.0 (2023-10-31)

Bug Fixes

Features

  • platform/client: enable microfrontend to display a splash until loaded (f44087f)
  • devtools: display splash while loading (11f0a53)
  • devtools: migrate to new theme of @scion/components (88f4ce5)

1.1.0

8 months ago

1.1.0 (2023-07-21)

Bug Fixes

  • platform/client: add missing method overload to ContextService#lookup (29d4e09)

Features

  • platform: allow associating arbitrary metadata with platform-specific capabilities (6eca043)
  • platform: provide API to check if application is qualified for capability (2204eff)

1.0.0

8 months ago

1.0.0 (2023-05-15)

chore

  • platform: drop deprecated API and backward compatibility (ccae819), closes #196

BREAKING CHANGES

  • platform: dropping deprecated API and backward compatibility introduced a breaking change for host and client applications.

    To migrate:

    • Update host and clients to version 1.0.0-rc.13 or higher.
    • Deprecated property ManifestService.lookupApplications$ has been removed; use ManifestService.applications instead.
    • Deprecated property Capability.requiredParams has been removed; declare required parameters via Capability.params instead and mark it as required.
    • Deprecated property Capability.optionalParams has been removed; declare optional parameters via Capability.params instead and mark it as non-required.

1.0.0-rc.13

8 months ago

1.0.0-rc.13 (2023-03-10)

Performance Improvements

  • platform: increase broker gateway message throughput (579c125), closes #90

1.0.0-rc.12

8 months ago

1.0.0-rc.12 (2022-12-21)

Bug Fixes

  • platform/client: do not provide HttpClient in client as only used in the host (e47ed8b)
  • platform/client: remove startup progress monitor from client (755422e)
  • platform/host: remove ManifestObject from public API since internal (36f0dd8)

Performance Improvements

  • platform: reduce library bundle size in client application (fff9953), closes #174

BREAKING CHANGES

  • platform: reducing the bundle size in client applications 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. This reduced the raw size of the library in a client application by more than 50%, from 120 KB to 40 KB.

    Platform Entry Points:

    • MicrofrontendPlatformHost to configure and start the platform in the host application;
    • MicrofrontendPlatformClient to connect to the platform from a microfrontend;
    • MicrofrontendPlatform to react to platform lifecycle events and stop the platform;

    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
  • platform/client: removing client startup progress introduced a breaking change in the client.

    To reduce the size of the client bundle, the API for monitoring the startup progress in the client has been removed. This API is useful in the host, but not in the client, because the client only connects to the host and does not perform any long-running operation. There is no replacement.

  • platform/host: removing ManifestObject from public API introduced a breaking change.

    The ManifestObject interface is the internal representation of capabilities and intensions in the platform host. It was never intended to be public API.

    To migrate:

    • In the unlikely event that you use this interface, replace it with the following union type: Capability | Intention.

1.0.0-rc.11

8 months ago

1.0.0-rc.11 (2022-12-06)

Bug Fixes

  • platform/host: add secondary origin to allowed origins (61cddc0), closes #197
  • platform/host: validate params of intent before passing it to interceptors (1f5f5e5)
  • platform/host: assert topic not to contain empty segments (f8c47e3)
  • platform/client: stop platform in beforeunload to avoid posting messages to disposed window (3969c17), closes #168
  • platform: do not break clients not supporting the ping liveness protocol (6d4eb78), closes #178
  • platform: do not unregister clients after resuming the computer from hibernation (a210d4b), closes #178

Features

  • platform/client: provide API for microfrontend to monitor focus (e5dc6c2)
  • platform/host: support for intercepting messages after platform-internal interceptors (bbfac42)
  • platform: drop support for wildcard capability qualifiers and optional wildcard intention qualifiers (9713cf0), closes #163
  • platform/client: provide hook to decorate observable emissions (4e0e9b4)

Performance Improvements

  • platform: optimize focus tracking and mouse event dispatching (daff4f0), closes #172

BREAKING CHANGES

  • platform/host: Property for configuring a secondary origin has been renamed from messageOrigin to secondaryOrigin. This breaking change only refers to the host.

    To migrate, configure the additional allowed origin via the secondaryOrigin property instead of messageOrigin, as following:

    await MicrofrontendPlatform.startHost({
      applications: [
        {symbolicName: 'client', manifestUrl: 'https://app/manifest.json', secondaryOrigin: 'https://secondary'},
      ],
    });
    
  • platform/host: The host now performs liveness probes to detect and remove stale clients, instead of relying on the heartbeats emitted by the clients of previous versions.

    The breaking change only refers to the host. The communication protocol between host and client has NOT changed. You can independently update host and clients to the new version.

    To migrate setting of a custom probe configuration in the host, specify the liveness instead of heartbeatInterval property, as follows:

    MicrofrontendPlatform.startHost({
      liveness: {interval: 60, timeout: 10},
      // omitted rest of the config
    });
    
  • platform: Optimization of mouse event dispatching introduced a breaking change for Angular applications.

    IMPORTANT: For Angular applications, we strongly recommend replacing zone-specific decorators for MessageClient and IntentClient with an ObservableDecorator. Otherwise, you may experience performance degradation due to frequent change detection cycles.

    It turned out that Angular zone synchronization with decorators for MessageClient and IntentClient is not sufficient and that observables should emit in the same Angular zone in which the subscription was performed. Using the new ObservableDecorator API, Angular zone synchronization can now be performed in a single place for all observables exposed by the SCION Microfrontend Platform.

    To migrate:

    • Remove decorators for MessageClient and IntentClient including their registration in the bean manager (e.g., NgZoneMessageClientDecorator and NgZoneIntentClientDecorator).
    • Provide a NgZoneObservableDecorator and register it in the bean manager before starting the platform. Note to register it as a bean, not as a decorator.

    For a complete example and detailed instructions, see https://scion-microfrontend-platform-developer-guide.vercel.app/#chapter:angular-integration-guide:synchronizing-rxjs-observables-with-angular-zone.

    Example of a decorator for synchronizing the Angular zone

    /**
    * Mirrors the source, but ensures subscription and emission {@link NgZone} to be identical.
    */
    export class NgZoneObservableDecorator implements ObservableDecorator {
    
      constructor(private zone: NgZone) {
      }
    
      public decorate$<T>(source$: Observable<T>): Observable<T> {
        return new Observable<T>(observer => {
          const insideAngular = NgZone.isInAngularZone();
          const subscription = source$
            .pipe(
              subscribeInside(fn => this.zone.runOutsideAngular(fn)),
              observeInside(fn => insideAngular ? this.zone.run(fn) : this.zone.runOutsideAngular(fn)),
            )
            .subscribe(observer);
          return () => subscription.unsubscribe();
        });
      }
    }
    

    Registration of the decorator in the bean manager

    const zone: NgZone = ...;
    
    // Register decorator
    Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
    // Connect to the host from a micro app
    zone.runOutsideAngular(() => MicrofrontendPlatform.connectToHost(...));
    // Start platform host in host app
    zone.runOutsideAngular(() => MicrofrontendPlatform.startHost(...));
    
  • platform: dropping support for wildcard capability qualifiers and optional wildcard intention qualifiers introduced a breaking change in the Intention API.

    To migrate:

    • Replace asterisk (*) wildcard capability qualifier entries with required params.
    • Replace optional (?) wildcard capability qualifier entries with optional params.
    • If using QualifierMatcher to match qualifiers, construct it without flags. The matcher now always evaluates asterisk wildcards in the pattern passed in the constructor.

    The following snippets illustrate how a migration could look like:

    Before migration

    Capability in Manifest of App 1

    {
      "name": "App 1",
      "capabilities": [
        {
          "type": "microfrontend",
          "qualifier": {
            "entity": "person",
            "id": "*",
            "readonly": "?"
          },
          "private": false,
          "properties": {
            "path": "person/:id?readonly=:readonly"
          }
        }
      ]
    }
    

    Intention in Manifest of App 2

    {
      "name": "App 2",
      "intentions": [
        {
          "type": "microfrontend",
          "qualifier": {
            "entity": "person",
            "id": "*",
            "readonly": "?"
          }
        }
      ]
    }
    

    Sending Intent in App 2

    const intent: Intent = {
      type: 'microfrontend',
      qualifier: {
        entity: 'person',
        id: '123',
        readonly: true
      }
    };
    Beans.get(IntentClient).publish(intent);
    

    After migration

    Capability in Manifest of App 1

    {
      "name": "App 1",
      "capabilities": [
        {
          "type": "microfrontend",
          "qualifier": {
            "entity": "person"
          },
          "params": [
            {
              "name": "id",
              "required": true
            },
            {
              "name": "readonly",
              "required": false
            }
          ],
          "private": false,
          "properties": {
            "path": "person/:id?readonly=:readonly"
          }
        }
      ]
    }
    

    Intention in Manifest of App 2

    {
      "name": "App 2",
      "intentions": [
        {
          "type": "microfrontend",
          "qualifier": {
            "entity": "person"
          }
        }
      ]
    }
    

    Sending Intent in App 2

    const intent: Intent = {
      type: 'microfrontend',
      qualifier: {
        entity: 'person'
      },
      params: new Map().set('id', '123').set('readonly', true)
    };
    Beans.get(IntentClient).publish(intent);
    

1.0.0-rc.10

8 months ago

1.0.0-rc.10 (2022-11-08)

Bug Fixes

  • platform/messaging: receive latest retained message per topic in wildcard subscription (b578317)
  • devtools: activate selected tab in application details even after quick navigation (b9e1cff)

Features

  • platform: use unique identifier for capability and intention ID (e2957ba), closes #162 #171
  • platform/messaging: support sending retained intents (08afb72), closes #142
  • platform/messaging: support sending retained requests to a topic (1098f8f)
  • devtools: allow filtering capabilities by id (fff5dd7)
  • devtools: remove logical operator for capability filters where not useful (3909ba3)
  • devtools: render logical operators (OR/AND) in capability filters as toggle button (3130e88)

BREAKING CHANGES

  • platform/messaging: The IntentClient now uses the same options object as the MessageClient to control how to send a message or request. The content of the options object has not changed, only its name, i.e., migration is only required if assigning it to a typed variable or decorating the IntentClient.

    Note that the communication protocol between host and client has NOT changed, i.e., host and clients can be migrated independently.

    To migrate:

    • options for sending an intent was changed from IntentOptions to PublishOptions (IntentClient#publish)
    • options for requesting data was changed from IntentOptions to RequestOptions (IntentClient#request)
  • platform: Using unique identifier for capability and intention ID introduced a breaking change.

    Previously, the IDs used for capabilities and intentions were stable but not unique, which caused problems when deregistering capabilities and intentions. If your application requires stable capability identifiers, you can register a capability interceptor, as follows:

    import {Capability, CapabilityInterceptor} from '@scion/microfrontend-platform';
    import {Crypto} from '@scion/toolkit/crypto';
    import {Beans} from '@scion/toolkit/bean-manager';
    
    Beans.register(CapabilityInterceptor, {
      useValue: new class implements CapabilityInterceptor {
        public async intercept(capability: Capability): Promise<Capability> {
          const stableId = await Crypto.digest(JSON.stringify({
            type: capability.type,
            qualifier: capability.qualifier,
            application: capability.metadata!.appSymbolicName,
          }));
          return {
            ...capability,
            metadata: {...capability.metadata!, id: stableId},
          };
        }
      },
      multi: true
    })
    

    Note that the communication protocol between host and client has NOT changed. You can independently upgrade host and clients to the new version.

1.0.0-rc.9

8 months ago

1.0.0-rc.9 (2022-11-02)

Features

  • platform/devtools: display platform version per application in DevTools (1c8d69c)
  • platform: allow intercepting capabilities before their registration (ba423af)

Performance Improvements

  • platform/messaging: index topic subscriptions for faster resolution (e8c2178)
  • platform/messaging: subscribe for replies when posting the request in request-response communication (cb23da3)
  • platform/messaging: track the number of subscriptions based on subscription change events (8b3c877)