Metadata

The provided webpack plugin uses metadata in comments to gather information about the plugin, and generate the XML for you.

Supported metadata

NameTypeDescription
@clientside-extension*-Indicates that the next function is a plugin factory to be consumed by the webpack plugin.
@extension-point*stringDefines the location where the plugin will be rendered.
@weightnumber

Determines the order in which this plugin appears respect to others in the same location.

Plugins are displayed top to bottom or left to right in order of ascending weight.

@conditionstring | Conditions

Defines one or multiple conditions that must be satisfied for the client plugin to be displayed.

This conditions are just web-fragment conditions evaluated in the server, and created with Java.

If one of the conditions is not met, the code of the plugin won't be loaded in the client.

* required

Usage notes

1. Define a client plugin and the location to be rendered in

1
2
3
4
5
6
7
import { LinkPlugin } from '@atlassian/clientside-extensions';

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 */
export default LinkPlugin.pluginFactory(/*...*/);

2. Specify a weight

1
2
3
4
5
6
7
8
import { LinkPlugin } from '@atlassian/clientside-extensions';

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 * @weight 100
 */
export default LinkPlugin.pluginFactory(/*...*/);

3. Define a condition

1
2
3
4
5
6
7
8
import { LinkPlugin } from '@atlassian/clientside-extensions';

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 * @condition class com.atlassian.clientpluginsdemorefapp.RandomCondition
 */
export default LinkPlugin.pluginFactory(/*...*/);

4. Defining multiple conditions

You can make use of AND / OR keywords to combine multiple conditions for your client plugin as follow:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { LinkPlugin } from '@atlassian/clientside-extensions';

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 * @condition type AND
 * @condition conditions.0.type OR
 * @condition conditions.0.conditions.0.class class com.atlassian.clientpluginsdemorefapp.RandomCondition
 * @condition conditions.0.conditions.0.invert true
 * @condition conditions.0.conditions.0.params.attributes.name permission
 * @condition conditions.0.conditions.0.params.value admin
 * @condition conditions.0.conditions.1.class class com.atlassian.clientpluginsdemorefapp.SuperCondition
 * @condition conditions.0.conditions.1.invert true
 * @condition conditions.0.conditions.1.params.attributes.name permission
 * @condition conditions.0.conditions.1.params.value project
 * @condition conditions.1.class class com.atlassian.clientpluginsdemorefapp.PerfecCondition
 * @condition conditions.1.params.attributes.name permission
 * @condition conditions.1.params.value admin
 */
export default LinkPlugin.pluginFactory(/*...*/);