Registration cheat sheet
This document explains all parameters of registration config used to register new plugin.
Parameters with asterisk are required.
entry*
Entry is the most important part, it defines the uniqueness of the plugin and ability to be injected elsewhere.
source*
Defines where the plugins source code is. Possible values:
string- a URL path to the entry file (even blob path) which works withimportfunctionobject- already initialized object be it a class or actual object. Such plugin will not be initialized second time and won't receive any injections
{
entry: {
source: new Router() | 'http://cdn.boardmeister.com/plugin/boardmeister/router',
namespace*
A unique name defining the owner of the plugin, it can be any text.
{
entry: {
namespace: 'boardmeister',
name*
A semi-unique name of the plugin, it just have to not repeat in the owners space, it can be any text.
{
entry: {
name: 'router',
version*
The current version of the plugin, it can be any text
{
entry: {
version: '1.0.0.',
arguments
An array of any kind of variables, they will be provided to the constructor of the plugin when initialized in the arrays' order.
{
entry: {
arguments: [
"first",
{ "second" : 1 },
new Observer(),
]
type*
Defined the type of plugin, possible values: module or scope.
{
type: 'scope',
The only additional functionality and change of behavior happens on scope value, otherwise the script doesn't care
what is inside. If you want to add new type like tool for additional functionality feel free to do so.
tags
An array of tags that plugin implements, each tag must be a string.
{
tags: ['controller', "subscriber"],
requires
Defines plugin's dependencies, an array of strings.
{
requires: ['boardmeister/marshal'],
lazy
When plugin is defined as lazy it will not be loaded at the load but instead will return a promise which resolved
will load and initialize the plugin.
{
lazy: true,
asset
Object defining settings regarding assets loading.
src*
The prefix path to where assets are located. Used by asset method.
{
asset: {
src: 'http://cdn.boardmeister.com/asset/'
Example of usage:
marshal.asset(aPlugin, 'logo.svg'); // resolves to http://cdn.boardmeister.com/asset/logo.svg
resource
Object defining settings regarding resource loading (like lazy loaded components).
src*
The prefix path to where components are located. Used by getResourceUrl method.
{
resource: {
src: 'http://cdn.boardmeister.com/resource/'
Example of usage:
marshal.getResourceUrl(aPlugin, 'label.js'); // resolves to http://cdn.boardmeister.com/resource/label.js