Skip to content

Latest commit

 

History

History
749 lines (423 loc) · 37.2 KB

CHANGELOG_WORKBENCH_CLIENT.md

File metadata and controls

749 lines (423 loc) · 37.2 KB

1.0.0-beta.28 (2024-11-25)

Features

  • workbench-client/view: add functional CanClose guard, deprecate class-based guard (ecd52b3)

Deprecations

  • workbench-client/view: The class-based CanClose guard has been deprecated in favor of a functional guard that can be registered on WorkbenchView.canClose.

    Migrate by registering a callback on WorkbenchView.canClose instead of implementing the CanClose interface.

    Before migration:

    import {CanClose, WorkbenchView} from '@scion/workbench-client';
    import {Beans} from '@scion/toolkit/bean-manager';
    
    export class ViewComponent implements CanClose {
    
      constructor() {
        Beans.get(WorkbenchView).addCanClose(this);
      }
    
      public canClose(): boolean {
        return true;
      }
    }

    After migration:

    import {WorkbenchView} from '@scion/workbench-client';
    import {Beans} from '@scion/toolkit/bean-manager';
    
    export class ViewComponent {
    
      constructor() {
        Beans.get(WorkbenchView).canClose(() => {
          return true;
        });
      }
    }

1.0.0-beta.27 (2024-10-11)

Bug Fixes

  • workbench-client: position document root as required by @scion/toolkit (007e9c3)

1.0.0-beta.26 (2024-09-11)

Features

  • workbench-client/popup: support returning result on focus loss (ce5089e)

BREAKING CHANGES

  • workbench-client/popup: The method closeWithError has been removed from the WorkbenchPopup handle. Instead, pass an Error object to the close method.

Before migration:

import {Beans} from '@scion/toolkit/bean-manager';
import {WorkbenchPopup} from '@scion/workbench-client';

Beans.get(WorkbenchPopup).closeWithError('some error');

After migration:

import {Beans} from '@scion/toolkit/bean-manager';
import {WorkbenchPopup} from '@scion/workbench-client';

Beans.get(WorkbenchPopup).close(new Error('some error'));

1.0.0-beta.25 (2024-08-28)

Bug Fixes

  • workbench-client/dialog: unsubscribe previous title observable when setting new title observable (2e72b39)

1.0.0-beta.24 (2024-06-21)

Features

  • workbench-client/router: control workbench part to navigate views (af702d0)
  • workbench-client/view: provide part via view handle (849d7f3)
  • workbench-client/perspective: enable micro app to contribute perspective (f20f607), closes #449

1.0.0-beta.23 (2024-05-21)

Features

  • workbench-client/message-box: enable microfrontend display in a message box (3e9d88d), closes #488

BREAKING CHANGES

  • workbench-client/message-box: The signature of the WorkbenchMessageBoxService.open method has changed.

    To migrate:

    • To display a text message, pass the message as the first argument, not via the content property in the options.
    • To display a custom message box, pass the qualifier as the first argument and options, if any, as the second argument.

    Example migration to display a text message

    // Before Migration
    inject(WorkbenchMessageBoxService).open({
      content: 'Do you want to continue?',
      actions: {yes: 'Yes', no: 'No'},
    });
    
    // After Migration
    inject(WorkbenchMessageBoxService).open('Do you want to continue?', {
      actions: {yes: 'Yes', no: 'No'},
    });

    Example migration to open a custom message box capability

    // Before Migration
    inject(WorkbenchMessageBoxService).open({
        title: 'Unsaved Changes',
        params: {changes: ['change 1', 'change 2']},
        actions: {yes: 'Yes', no: 'No'},
      },
      {confirmation: 'unsaved-changes'},
    );
    
    // After Migration
    inject(WorkbenchMessageBoxService).open({confirmation: 'unsaved-changes'}, {
      title: 'Unsaved Changes',
      params: {changes: ['change 1', 'change 2']},
      actions: {yes: 'Yes', no: 'No'},
    });

1.0.0-beta.22 (2024-05-07)

Bug Fixes

  • workbench-client/view: fix issues to prevent a view from closing (a280af9), closes #27 #344

Refactor

  • workbench-client/router: remove blank prefix from navigation extras (446fa51)

BREAKING CHANGES

  • workbench-client/view: Interface and method for preventing closing of a view have changed.

    To migrate, implement the CanClose instead of the ViewClosingListener interface.

    Before migration:

    class YourComponent implements ViewClosingListener {
     
      constructor() {
        Beans.get(WorkbenchView).addClosingListener(this);
      }
     
      public async onClosing(event: ViewClosingEvent): Promise<void> {
        // invoke 'event.preventDefault()' to prevent closing the view.
      }
    }

    After migration:

    class YourComponent implements CanClose {
     
      constructor() {
        Beans.get(WorkbenchView).addCanClose(this);
      }
     
      public async canClose(): Promise<boolean> {
        // return `true` to close the view, otherwise `false`.
      }
    }
  • workbench-client/router: Property blankInsertionIndex in WorkbenchNavigationExtras has been renamed.

    Use WorkbenchNavigationExtras.position instead of WorkbenchNavigationExtras.blankInsertionIndex.

  • workbench-client/view: Changed type of view id from string to ViewId.

    If storing the view id in a variable, change its type from string to ViewId.

1.0.0-beta.21 (2024-03-29)

Bug Fixes

  • workbench-client/view: remove qualifier from microfrontend URL and params (57cfd9e)

Features

  • workbench-client/dialog: enable microfrontend display in a dialog (11d762b)

BREAKING CHANGES

  • workbench-client/view: Removing qualifier from params has introduced a breaking change.

    The view qualifier has been removed from the view parameters as it is static.

1.0.0-beta.20 (2023-10-31)

Features

  • workbench-client: enable microfrontend to display a splash until loaded (7a79065)
  • workbench-client: provide workbench color scheme (ed63b22)

1.0.0-beta.19 (2023-10-10)

Features

  • workbench-client: rework tab design and styling of the SCION Workbench (5cbd354), closes #110

1.0.0-beta.18 (2023-05-23)

Features

  • workbench-client: consolidate workbench view handle (3f6fb22)

BREAKING CHANGES

  • workbench-client: consolidating workbench view handle introduced a breaking change.

    The following APIs have changed:

    • WorkbenchView.viewId => WorkbenchView.id

1.0.0-beta.17 (2023-02-10)

Bug Fixes

  • workbench-client/router: ignore matrix params to resolve views for navigation (ce133bf), closes #239

Features

  • workbench-client/router: support closing views that match a pattern (4d39107), closes #240

BREAKING CHANGES

  • workbench-client/router: adding support for closing views that match a pattern introduced a breaking change in the Workbench Router API.

    The communication protocol between host and client is backward compatible, so you can upgrade the host and clients independently.

    To migrate:

    • Use close=true instead of closeIfPresent=true in navigation extras to instruct the router to close matching view(s).
    • Parameters now support the asterisk wildcard value (*) to match views with any value for that parameter.

    The following snippets illustrate how a migration could look like:

    Close views

    // Capability
    this.manifestService.registerCapability({
      type: 'view',
      qualifier: {component: 'user'},
      params: [
        {name: 'id', required: true},
        {name: 'param', required: false},
      ],
      properties: {
        path: 'user/:id',
      },
    });
    
    // Before migration: optional params affect view resolution
    this.workbenchClientRouter.navigate({component: 'user'}, {target: 'blank', params: {id: 1, param: 1}}); // opens view 1
    this.workbenchClientRouter.navigate({component: 'user'}, {target: 'blank', params: {id: 1, param: 2}}); // opens view 2
    this.workbenchClientRouter.navigate({component: 'user'}, {close: true, params: {id: 1, param: 1}}); // closes view 1
    this.workbenchClientRouter.navigate({component: 'user'}, {close: true, params: {id: 1, param: 2}}); // closes view 2
    
    // After migration: optional params do not affect view resolution
    this.workbenchClientRouter.navigate({component: 'user'}, {target: 'blank', params: {id: 1, param: 1}}); // opens view 1
    this.workbenchClientRouter.navigate({component: 'user'}, {target: 'blank', params: {id: 1, param: 2}}); // opens view 2
    this.workbenchClientRouter.navigate({component: 'user'}, {close: true, params: {id: 1}}); // closes view 1 and view 2

    Close views matching a pattern (NEW)

    // Capability
    this.manifestService.registerCapability({
      type: 'view',
      qualifier: {component: 'team-member'},
      params: [
        {name: 'team', required: true},
        {name: 'user', required: true},
      ],
      properties: {
        path: 'team/:team/user/:user',
      },
    });
    
    // Open 4 views
    this.workbenchClientRouter.navigate({component: 'team-member'}, {params: {team: 33, user: 11}});  // opens view 1
    this.workbenchClientRouter.navigate({component: 'team-member'}, {params: {team: 33, user: 12}});  // opens view 2
    this.workbenchClientRouter.navigate({component: 'team-member'}, {params: {team: 44, user: 11}});  // opens view 3
    this.workbenchClientRouter.navigate({component: 'team-member'}, {params: {team: 44, user: 12}});  // opens view 4
    
    // Closes view 1
    this.workbenchClientRouter.navigate({component: 'team-member'}, {close: true, params: {team: 33, user: 11}});
    
    // Closes view 1 and view 2
    this.workbenchClientRouter.navigate({component: 'team-member'}, {close: true, params: {team: 33, user: '*'}});
    
    // Closes view 2 and view 4
    this.workbenchClientRouter.navigate({component: 'team-member'}, {close: true, params: {team: '*', user: 12}});
    
    // Closes all views
    this.workbenchClientRouter.navigate({component: 'team-member'}, {close: true, params: {team: '*', user: '*'}});
  • workbench-client/router: ignoring matrix params to resolve views for navigation introduced a breaking change in the Workbench Router API.

    The communication protocol between host and client is backward compatible, so you can upgrade the host and clients independently.

    To migrate:

    • Use target=auto instead of activateIfPresent=true in navigation extras.
      Using auto as the navigation target navigates existing view(s) that match the qualifier and required parameter(s), if any. If not finding a matching view, the navigation opens a new view. This is the default behavior if no target is specified.
    • Use target=blank instead of activateIfPresent=false in navigation extras.
      Using blank as the navigation target always navigates in a new view.
    • Use target=<view.id> instead of setting target=self and selfViewId=<view.id> in navigation extras.
      Setting a view id as the navigation target replaces the specified view, or creates a new view if not found.
    • Use the property activate in navigation extras to instruct the router to activate the view after navigation. Defaults to true if not specified.
    • The router does not navigate the current view anymore. To navigate the current view, specify the current view as the navigation target in navigation extras.

    The following snippets illustrate how a migration could look like:

    Navigate existing view(s)

    // Before migration
    this.workbenchClientRouter.navigate({entity: 'person'}, {activateIfPresent: true});
    
    // After migration
    this.workbenchClientRouter.navigate({entity: 'person'});
    this.workbenchClientRouter.navigate({entity: 'person'}, {target: 'auto'}); // this is equivalent to the above statement

    Open view in new view tab

    // Before migration
    this.workbenchClientRouter.navigate({entity: 'person'}, {activateIfPresent: false});
    
    // After migration
    this.workbenchClientRouter.navigate({entity: 'person'}, {target: 'blank'});

    Replace existing view

    // Before migration
    this.workbenchClientRouter.navigate({entity: 'person'}, {target: 'self', selfViewId: 'view.1'});
    
    // After migration
    this.workbenchClientRouter.navigate({entity: 'person'}, {target: 'view.1'});

    Prevent view activation after navigation (NEW)

    this.workbenchClientRouter.navigate({entity: 'person'}, {target: 'blank', activate: false});

1.0.0-beta.16 (2022-12-21)

Features

  • workbench-client/popup: enable popup opener to locate popup via CSS class (73a4ee0), closes #358

Dependencies

  • workbench-client: update @scion/microfrontend-platform to version 1.0.0-rc.12 (1f674fa)

BREAKING CHANGES

  • workbench-client: Updating @scion/microfrontend-platform to version 1.0.0-rc.12 introduced a breaking change.

    More information on how to migrate can be found in the changelog of the SCION Microfrontend Platform.

1.0.0-beta.15 (2022-12-07)

Bug Fixes

  • workbench-client: do not focus nested microfrontend in a popup (9293464)

Dependencies

  • workbench-client: update @scion/microfrontend-platform to version 1.0.0-rc.11 (34fec1d)

Features

  • workbench-client: enable Observables of WorkbenchView to emit in the correct context (ec0d808)

BREAKING CHANGES

  • workbench-client: Updating @scion/microfrontend-platform to version 1.0.0-rc.11 introduced a breaking change.

    More information on how to migrate can be found in the changelog of the SCION Microfrontend Platform.

    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.

    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.
    Example of an ObservableDecorator for Angular Applications
    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();
        });
      }
    }
    Example of Registering an ObservableDecorator in Angular Applications
    const zone: NgZone = ...;
    
    // Register decorator
    Beans.register(ObservableDecorator, {useValue: new NgZoneObservableDecorator(zone)});
    // Connect to the host
    zone.runOutsideAngular(() => WorkbenchClient.connect(...));

1.0.0-beta.14 (2022-11-09)

Features

  • workbench-client/router: support named parameters in title/heading of view capability (98f4bbd)

1.0.0-beta.13 (2022-10-11)

Features

  • workbench-client/popup: add 'referrer' to popup handle to provide information about the calling context (920d831)

1.0.0-beta.12 (2022-10-07)

Features

  • workbench/popup: allow positioning of a popup relative to its contextual view or the page viewport (484d9bd), closes #342
  • workbench/router: allow setting CSS classes on a view via router and route data definition (3d46204)

1.0.0-beta.11 (2022-09-14)

Documentation

  • workbench-client: change example to new parameter declaration API (e83bd74)

  • workbench-client: fix TypeDoc links (bd4bcd7)

1.0.0-beta.10 (2022-05-20)

Dependencies

  • workbench-client: migrate to the framework-agnostic package @scion/toolkit (38368e9)

BREAKING CHANGES

  • workbench-client: Migrating to the framework-agnostic package @scion/toolkit introduced a breaking change.

    Previously, framework-agnostic and Angular-specific tools were published in the same NPM package @scion/toolkit, which often led to confusion and prevented framework-agnostic tools from having a release cycle independent of the Angular project. Therefore, Angular-specific tools have been moved to the NPM package @scion/components. Framework-agnostic tools continue to be released under @scion/toolkit, but now starting with version 1.0.0 instead of pre-release versions.

    To migrate:

    • Install the NPM package @scion/toolkit in version 1.0.0 using the following command: npm install @scion/toolkit@latest --save. Note that the toolkit was previously released as pre-releases of version 13.0.0 or older.
    • If you are using Angular components from the toolkit in your project, for example the <sci-viewport> component, please follow the migration instructions of the SCION Toolkit Changelog. Components of the toolkit have been moved to the NPM package @scion/components.

1.0.0-beta.9 (2022-05-02)

Bug Fixes

  • workbench/view: discard parameter if set to undefined (b3b6a14), closes #325
  • workbench/view: preserve position and size of inactive views (c0f869b)

Dependencies

  • workbench-client: migrate @scion/workbench-client to RxJS 7.5 (e666841), closes #298

BREAKING CHANGES

1.0.0-beta.8 (2022-02-11)

Code Refactoring

  • workbench/popup: open popups from within an interceptor (a11fd9d), closes #276
  • workbench/view: open views from within an interceptor (137b8d0)

Features

BREAKING CHANGES

  • workbench: Supporting @scion/microfrontend-platform v1.0.0-beta.20 introduced a breaking change in the configuration of the host application and the host/client communication protocol.

    SCION Microfrontend Platform consolidated the API for configuring the platform, eliminating the different ways to configure the platform. Consequently, SCION Workbench could also simplify its API for enabling microfrontend support.

    Related issue of the SCION Microfrontend Platform: SchweizerischeBundesbahnen/scion-microfrontend-platform/#96

    Client App Migration

    • 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 WorkbenchClient.connect has been renamed from MicroApplicationConfig to ConnectOptions and messaging options are now top-level options;
    • the bean MicroApplicationConfig has been removed; you can now obtain the application's symbolic name as following: Beans.get<string>(APP_IDENTITY);

    For further instructions on how to migrate the client, refer to https://github.com/SchweizerischeBundesbahnen/scion-microfrontend-platform/blob/master/docs/site/changelog/changelog.md#client-app-migration

  • workbench/popup: Opening popups from within an interceptor introduced a breaking change in the host/client communication protocol.

    The communication protocol between host and client HAS CHANGED for opening a popup. You need to update host and affected clients to the new version simultaneously. The API has not changed; the breaking change applies only to the version of @scion/workbench and @scion/workbench-client. To migrate, upgrade to @scion/[email protected] and @scion/[email protected], respectively.

  • workbench/view: Opening views from within an interceptor introduced a breaking change in the host/client communication protocol.

    The communication protocol between host and client HAS CHANGED for opening a view. You need to update host and affected clients to the new version simultaneously. The API has not changed; the breaking change applies only to the version of @scion/workbench and @scion/workbench-client. To migrate, upgrade to @scion/[email protected] and @scion/[email protected], respectively.

1.0.0-beta.7 (2021-07-09)

chore

  • compile with TypeScript strict checks enabled (2f26260), closes #246

1.0.0-beta.6 (2021-04-13)

Features

  • workbench/popup: allow the host app to provide popup capabilities (a4e74b1), closes #270

BREAKING CHANGES

  • workbench/popup: Adding support for opening a popup of the host app from within a microfrontend introduced a breaking change in the host/client communication protocol.

    The communication protocol between host and client HAS CHANGED for opening a popup. You need to update host and clients to the new version simultaneously. The API has not changed; the breaking change applies only to the version of @scion/workbench and @scion/workbench-client. To migrate, upgrade to @scion/[email protected] and @scion/[email protected], respectively.

1.0.0-beta.5 (2021-02-12)

Bug Fixes

  • workbench-client/router: provide microfrontends with the most recent view capability (0b8f140)

Code Refactoring

  • workbench/popup: configure contextual reference(s) via context object (0591e7a)

BREAKING CHANGES

  • workbench/popup: Changed popup config for passing contextual reference(s)

    To migrate: Set a popup's view reference via PopupConfig#context#viewId instead of PopupConfig#viewRef.

1.0.0-beta.4 (2021-02-10)

Features

  • support for merging parameters in self navigation (a984ace), closes #259

1.0.0-beta.3 (2021-02-03)

Bug Fixes

  • workbench-client/message-box: provide the messagebox capability under the type messagebox instead of message-box (ad15ba1)
  • workbench-client/routing: allow view navigation without specifying navigation extras (4ade8a9)

Features

1.0.0-beta.2 (2021-01-25)

Bug Fixes

  • workbench: start microfrontend platform outside the Angular zone (296f6b0)

Code Refactoring

  • workbench-client/message-box: consolidate message box API to be consistent with the popup API (4a386c3)
  • workbench-client/notification: consolidate notification API to be consistent with the message box and popup API (162a70d)

Features

  • workbench-client/message-box: allow messages to be displayed from microfrontends (30aef07)
  • workbench-client/notification: allow notifications to be displayed from microfrontends (4757ac3)
  • workbench-client/popup: allow providing a microfrontend for display in a workbench popup (bc23e65)
  • workbench/popup: allow to open a popup from a screen coordinate and bind it to the lifecycle of a view (864d75c)

BREAKING CHANGES

  • workbench-client/notification: The refactoring of the notification introduced a breaking change as properties were renamed:

    • To display a notification, pass a NotificationConfig instead of a Notification object. The Notification object is now used exclusively as the handle for injection into the notification component. It has the following new methods: setTitle, setSeverity, setDuration, setCssClass.
    • If passing data to the notification component, set it via componentInput config property instead of the input property.
  • workbench-client/message-box: The refactoring of the message box introduced a breaking change as properties were renamed:

    • To display a message box, pass a MessageBoxConfig instead of a MessageBox object. The MessageBox object is now used exclusively as the handle for injection into the message box component. It has the following new methods: setTitle, setSeverity, setActions, setCssClass.
    • If passing data to the message box component, set it via componentInput config property instead of the input property.
  • workbench/popup: consolidated the config for opening a popup in preparation for the microfrontend popup integration

    To migrate:

    • Rename the position property to align. This property is used for aligning the popup relative to its anchor.
    • Remove the closing strategy onLayoutChange as binding a popup to a Workbench view is now supported. This strategy existed only as a workaround to close popups when switching between views.
    • Pass the preferred popup overlay size as PopupSize object literal instead of separate top-level config properties, as follows:
      • PopupConfig.width -> PopupConfig.size.width
      • PopupConfig.height-> PopupConfig.size.height
      • PopupConfig.minWidth -> PopupConfig.size.minWidth
      • PopupConfig.maxWidth -> PopupConfig.size.maxWidth
      • PopupConfig.minHeight -> PopupConfig.size.minHeight
      • PopupConfig.maxHeight-> PopupConfig.size.maxHeight

1.0.0-beta.1 (2020-12-22)

Features

  • workbench-client: add project skeleton for @scion/workbench-client (59895f4)
  • workbench-client: provide core workbench API to microfrontends (55fabc3)

BREAKING CHANGES

  • workbench-client: Workbench Microfrontend support introduced the following breaking changes:

    • The workbench component is no longer positioned absolutely but in the normal document flow. To migrate, add the workbench component to your CSS layout and make sure it fills the remaining space vertically and horizontally.
    • Renamed the workbench config from WorkbenchConfig to WorkbenchModuleConfig.
    • Removed the e2e-testing related CSS classes e2e-active and e2e-dirty; to migrate, replace them with active and dirty.
    • Renamed flag to set popup closing strategy from onGridLayoutChange to onLayoutChange