Script modules

A script module is a special case of a script policy. A script module provides (exports) a set of features, and other policies and/or variants use (import) these features. A feature is a unique identifier for some functionality. It can refer to a single piece of functionality on a device, or to a functionality provided by a part of the application. Please refer to the topic entitled Features for a complete list of features exported by MCS.

A script module is a special case of a script policy. A script module provides (exports) a set of features, and other policies and/or variants use (import) these features. A feature is a unique identifier for some functionality. It can refer to a single piece of functionality on a device, or to a functionality provided by a part of the application. Please refer to the topic entitled Features for a complete list of features exported by MCS.

Some features exported by a script module may not be supported on some devices. If a script module contains a variant for the selected device, then the features are assumed to be supported on that device, otherwise they are not.

Importing/exporting features

Adding a feature to the page also means adding all of its imported features. Each imported feature has a Use attribute associated with it. This attribute determines how the feature will be used by the variant. After the whole page has been processed it will have a set of used features. Those features need resolving to a set of script modules that provide all used features, so that the scripts can be included in the page. This resolving relies on the mapping created during the script registration process. If there is an overlap between the sets of imported features, then the use from the variant wins.

Related topics