Upgrade from 6.10 to 6.11

This release has a single optional upgrade instruction. Instances can, and should, use the new configureProperties API.

Upgrading to per-aspect configuration (configureProperties)

We've added the ability to define variations in configuration of different elements without fully re-configuring them. This reduces the total configuration and improves the performance of the instance by having to execute fewer queries for these variations. This should even be done when an element only has a different markup label. For example when it has a certain attribute.

Please also read the documentation of selector performance for more background on selector optimization.

Starting from this release the, previously undefined, behavior of cascading visualization properties is defined. In older releases, not mentioning a visualization property while configuring a family made it default to an undocumented default value. Starting from this release, not documenting a property will make that property fall back to a configured value for another matching selector with a lower priority.

Given the following configuration:

configureAsFrame(sxModule, 'self::section', {
	visualization: {
		backgroundColor: 'yellow'
	}
});
configureAsFrame(sxModule, 'self::section[@isSpecial]', {
	visualization: {
		weight: 'bold'
	}
});

In previous versions of FontoXML, this would result in the following visualization:

  • An element <section> will be rendered with a yellow background
  • An element <section isSpecial="true"> will be rendered as bold, but with the default background color.

Starting from the 6.11 release, it will result in the following visualization:

  • An element <section> will be rendered with a yellow background
  • An element <section isSpecial="true"> will be rendered as bold, with a yellow background.

In CSS, this is analogous to background-color: 'inherit'versus background-color: 'initial'.

This change has been made to better align 'normal' family configuration with the new configureProperties API.

To make the configuration behave like older releases, the background color should be explicitly defined for overriding families, or use the new configureProperties API.

configureAsFrame(sxModule, 'self::section', {
	visualization: {
		backgroundColor: 'yellow'
	}
});
configureProperties(sxModule, 'self::section[@isSpecial]', {
	weight: 'bold',
	backgroundColor: 'white'
});

Locate all reconfigurations of the same element.

Some schemas define different aspects for some element; it uses a class or type attribute to define different variants of this element. By reconfiguring these elements for all different combinations, the total number of selectors will increase.

Let's say there is a schema which declares an element <emphasis>, which accepts a @type attribute and a @classattribute. The @type can have the values yellow or blue. The @class attribute can either be bold or italic.

The old configuration would look something like this:

configureAsInlineFrame(sxModule, 'self::emphasis', "emphasized");
configureAsInlineFrame(sxModule, 'self::emphasis[@class="bold"]', undefined, {
	visualization: {
		weight: 'bold'
	}
});
configureAsInlineFrame(sxModule, 'self::emphasis["@type="yellow"]', undefined, {
	visualization: {
		backgroundColor: 'yellow'
	}
});
configureAsInlineFrame(sxModule, 'self::emphasis[@type="yellow" and @class="bold"]', undefined, {
	visualization: {
		weight: 'bold',
		backgroundColor: 'yellow'
	}
});
// Etc for the other combinations. This approach uses 3*3=9 different configurations, one for each combination of the attributes, including the attribute being absent.
// If this configuration would have been written as a loop, the same number of configuration variations would have been made. They should still be rewritten to use configureProperties.

Locate code like this and refactor it to per-aspect configuration.

The mentioned example would be refactored to this:

configureAsInlineFrame(sxModule, 'self::emphasis', "emphasized");
configureProperties(sxModule, 'self::emphasis[@class="bold"]', {
	weight: 'bold'
});
configureProperties(sxModule, 'self::emphasis[@class="italic"]', {
	slant: 'italic'
});
configureProperties(sxModule, 'self::emphasis["@type="yellow"]', {
	backgroundColor: 'yellow'
});
configureProperties(sxModule, 'self::emphasis["@type="blue"]', {
	backgroundColor: 'blue'
});

// Etc for the other combinations

Test the reconfigured instance.

The instance should have no more double configuration re-defining the same family for a variation of the same element.

If the instance contained a large number of these configurations, expect a significant performance improvement.