Changelog

New Features

⚠️ Note that each new feature is listed under all libraries it affects.

@interopio/browser

Set Current Layout

When saving a Global Layout programmatically, you can now specify whether to set it as the currently active Global Layout by using the setAsCurrent property of the NewLayoutOptions object:

const options = {
    name: "My Layout",
    setAsCurrent: false
};

const myLayout = await io.layouts.save(options);

Intent Handler Exclusion List

To exclude Intent handlers from the results when using the filterHandlers() method, use the excludeList property of the HandlerFilter object and pass an array of HandlerExclusionCriteria as a value.

It's possible to exclude Intent handlers by app name and by app instance ID:

const filter = {
    intent: "ViewChart",
    openResolver: false,
    // Excluding an app by its name and a running instance of another app from the Intent handler result.
    excludeList: [
        {
            // This will exclude the app, but won't exclude any running instances of it.
            applicationName: "my-app-name"
        },
        {
            // This will exclude a running instance of an app, but won't exclude the app itself.
            instanceId: "my-other-app-instance-id"
        }
    ]
};

const result = await io.intents.filterHandlers(filter);

Custom Intent Handler Configuration

Added a customConfig property in the IntentHandler object which holds any custom configuration for the Intent Handler specified in the app definition or provided dynamically:

const handler = (intentHandler) => {
    console.log(`Custom config: ${JSON.stringify(intentHandler.customConfig)} for Intent handler: "${intentHandler.applicationName}".`);
};

const unsubscribe = io.intents.onHandlerAdded(handler);

Custom Logger

You can now specify your own custom logger implementation to be used by the library as a system logger and also by any logger instances created via the Logger API.

To instruct the platform to use your custom logger implementation, use the systemLogger property of the Config object for initializing the library:

import IOBrowser from "@interopio/browser";
import MyCustomLogger from "./MyCustomLogger";

const config = {
    systemLogger: {
        customLogger: MyCustomLogger,
        level: "info"
    }
};

const io = await IOBrowser(config);

@interopio/browser-platform

Connecting to io.Bridge

io.Connect Browser projects can now connect to io.Bridge and use its capabilities.

To specify settings for the connection to io.Bridge, use the bridge property of the gateway object inside the configuration object for initializing the @interopio/browser-platform library. The following example demonstrates configuring the connection to io.Bridge by specifying the io.Bridge URL, user details, and settings for the io.Connect APIs:

import IOBrowserPlatform from "@interopio/browser-platform";

const config = {
    licenseKey: "my-license-key",
    gateway: {
        bridge: {
            // URL pointing to io.Bridge.
            url: "https://my-io-bridge.com",
            // Disabling the Channels API for cross-platform and cross-machine interoperability via io.Bridge.
            channels: {
                enabled: false
            },
            contexts: {
                // Settings for the visibility of the shared context objects when using io.Bridge.
                visibility: [
                    {
                        // Name of the shared context object whose visibility to restrict.
                        context: "MySharedContext",
                        // The specified shared context will be visible only within the current platform.
                        restrictions: "local"
                    }
                ]
            }
        }
    },
    // When connecting to io.Bridge, it's required to specify user details.
    // Only the platforms of the same user can be connected via io.Bridge.
    user: {
        id: "user-id"
    }
};

const { io } = await IOBrowserPlatform(config);

ℹ️ For more details on the available settings for connecting to io.Bridge, see the Capabilities > io.Bridge section.

Dynamic Options for Remote Store Requests

The getRequestInit() function for providing a RequestInit object for fetch requests sent to remote stores now accepts as an argument a RequestInitInfo object. This object contains the URL of the remote store to which the request will be sent and the default RequestInit object created by the platform:

import IOBrowserPlatform from "@interopio/browser-platform";

const getRequestInit = (info) => {
    let requestInit;

    if (info.url === "https://my-app-store.com/apps") {
        requestInit = { cache: "no-cache" };
    } else {
        requestInit = { cache: "reload" };
    }

    return requestInit;
};

const config = {
    licenseKey: "my-license-key",
    applications: {
        remote: {
            url: "https://my-app-store.com/apps/",
            // The `RequestInit` object returned by your function will be merged with
            // the default one and sent with every request to the remote app store.
            getRequestInit
        }
    }
};

const { io } = await IOBrowserPlatform(config);

⚠️ Note that the getRequestInit() function is available in the settings for remote app definition stores, remote app preferences stores, and remote Layout stores.

Set Current Layout

When saving a Global Layout programmatically, you can now specify whether to set it as the currently active Global Layout by using the setAsCurrent property of the NewLayoutOptions object.

Intent Handler Exclusion List

Added support for excluding Intent handlers from the results when using the filterHandlers() method.

Custom Intent Handler Configuration

Added a customConfig property in the IntentHandler object which holds any custom configuration for the Intent Handler specified in the app definition or provided dynamically:

import IOBrowserPlatform from "@interopio/browser-platform";

const config = {
    licenseKey: "my-license-key",
    applications: {
        local: [
            {
                name: "Instrument Chart",
                details: {
                    url: "http://localhost:4242/chart"
                },
                // Intent definitions.
                intents: [
                    {
                        name: "ViewChart",
                        displayName: "Instrument Chart",
                        contexts: ["Instrument"],
                        // Custom configuration for the Intent handler.
                        customConfig: {
                            io: 42
                        }
                    }
                ]
            }
        ]
    }
};

const { io } = await IOBrowserPlatform(config);

@interopio/intent-resolver-ui

Added support for excluding Intent handlers from the results when using the filterHandlers() method.

Improvements & Bug Fixes

⚠️ Note that each improvement or bug fix is listed under all libraries it affects.

@interopio/browser

  • Improved the internal mechanisms of the save() and rename() methods of the Layouts API to achieve consistency with io.Connect Desktop.

@interopio/browser-platform

  • Improved the internal mechanisms of the save() and rename() methods of the Layouts API to achieve consistency with io.Connect Desktop.
  • Fixed a race condition related closing windows manually.
  • Fixed an issue related to restoring Layouts when the browser tab has been refreshed manually.

@interopio/home-ui-react

  • Improved scroll behavior and visual consistency in the Launchpad panels.
  • Improved the behavior for reloading the window based on the current authentication mechanism when the "Logout" button of the Home App is pressed.