Skip to content

Releases: SchweizerischeBundesbahnen/scion-microfrontend-platform

1.3.1

29 Oct 11:17
Compare
Choose a tag to compare

1.3.1 (2024-10-29)

Bug Fixes

  • platform/router-outlet: remove inline styles for CSP compliance (40e4fbd), closes #287

DevTools

  • devtools: move DevTools to *.scion.vercel.app subdomain (3897efe)

BREAKING CHANGES

1.3.0

04 Jun 11:38
Compare
Choose a tag to compare

1.3.0 (2024-06-04)

Features

  • platform: provide method to get a specific application (c917433)

1.2.2

10 Nov 10:57
Compare
Choose a tag to compare

1.2.2 (2023-11-10)

Bug Fixes

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

1.2.1

02 Nov 13:36
Compare
Choose a tag to compare

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

31 Oct 09:42
Compare
Choose a tag to compare

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

08 Sep 07:59
Compare
Choose a tag to compare

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

07 Sep 14:11
Compare
Choose a tag to compare

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

07 Sep 14:10
Compare
Choose a tag to compare

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

Performance Improvements

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

1.0.0-rc.12

07 Sep 14:09
Compare
Choose a tag to compare

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

07 Sep 14:09
Compare
Choose a tag to compare

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);