Upgrade from 7.14 to 7.15

A number of APIs will be removed in the 7.16 release. They are listed on the Upcoming removals 7.16 page.

Please update your copy of FDT. If you have it globally installed, you can run the following command from anywhere:

Shell

npm install -g @fontoxml/fontoxml-development-tools

Mandatory changes

Migrate prototype inheritance to ES6 class extension

We have finally migrated the last of our prototype classes to ES6 class declarations. If your configuration extends any of them, you must migrate to ES6 classes as well. You can then use extends instead of prototype inheritance. Prototype inheritance typically looks like this:

JavaScript

function MyConnector() {
	Connector.call(this);
}

MyConnector.prototype = Object.create(Connector.prototype);
MyConnector.prototype.constructor = MyConnector;

You will experience the following error:

Shell

TypeError: Class constructor Connector cannot be invoked without 'new'

The above example is fixed by refactoring to an ES6 class that uses extends:

JavaScript

class MyConnector extends Connector {

}

This change is only necessary for prototype classes that extend a class from Fonto's platform. Read more about ES6 classes and extends.

Replace CmsClient private methods with public method createContext

We have introduced a new method createContext on the CmsClient class. If you used the private methods buildContext or buildContextWithDocumentId before, you must migrate to use createContext:

JavaScript

/**
 * Case 1: Building context without a remote document ID
 */

// Before
cmsClient.buildContext();

// After
cmsClient.createContext();

/**
 * Case 2: Building context with a remote document ID, which sets the documentId context property
 */

// Before
cmsClient.buildContextWithDocumentId(remoteDocumentId);

// After
cmsClient.createContext(remoteDocumentId);

/**
 * Case 3: Building context with a remote document ID, which sets the referrerDocumentId context property
 */

// Before
cmsClient.buildContext(remoteDocumentId);

// After
{ ...cmsClient.createContext(), referrerDocumentId: remoteDocumentId }

Recommended changes

Border operation buttons for CALS tables

This upgrade instruction is for those who forked the fontoxml-table-flow-cals package. We have added the supportsCellBorder property in TableDefinition to hide cell border operations from the TableToolbar and the default table context menu for non-CALS tables. Now, cell border operation buttons will be hidden unless supportsCellBorder is set to true in your tableDefinition. However, we have enabled that property for CALS tables by default in its package tableDefinition.

To apply this recommended change, it is required to rebase your forked implementation at the top of the latest commit of the fontoxml-table-flow-cals package.

Check custom loading strategies

We recently fixed an issue in our example for the retryLoadingDocumentForHierarchyNode handler in our Configure hierarchical multi-document management guide. In the old example, the hierarchyChangedNotifier was not fired as soon as loading started, but rather only when it completed. This caused the loading state to not be shown. In the updated example, the notifier is fired before awaiting the loading promise, which ensures that the loading state is visualized as expected. Please refer to the new example for details, and update any custom loading strategy you may have based on the old example accordingly.