/ collar.js release note

2016-12-11 collar.js 0.7.0 release batch

Release Note

This is release batch with 3 components

  • collar.js -> v0.7.0
  • collar.js-dev-client -> v0.3.0
  • collar-dev-server -> v0.3.0

Please update all of these 3 components to the latest version to benefit all the new features.

collar.js v0.7.0


new operator: through

A new operator is added in collar.js v0.7.0: the through operator

through(comment: string, input_node: Node, output_node : Node, work_as_an_actuator : boolean = false)

The through operator will pipe the signal through the input node, and get the output signal from the output node. This is useful when you want to reuse your created pipeline (with one input and one output)

The last parameter work_as_an_actuator is a boolean with default value false. If it is set to true, the output signal from output node will be added to the result field of input signal, like an actuator does. You can use signal.getResult() to get it.

The output node is optional, if not present, the input node is considered as the output node too.

support multiple dimension hierarchy

You can specify different hierarchy for your namespace

const ns = collar.ns('collar.example', {
  architecture: 'ui.product.detail',
  author: 'ui-team.Bo',
  // other hierarchy 
})

support tags and id in comment

Now you can add tags and human readable id for a node

Use @ to specify an id
Use # to specify a tag

ns.do('@this_is_an_id #this_is_a_tag #another_tag here is the normal comment')

add getState(signal, done) method in Node class

getState() method allows you get current system state

rename node tags to meta

The old node tags are renamed to meta, which accepts a name value pair.

Tag is used to store the # specified tag in comment

add toJSON() method in Signal class

You can use toJSON() method to get a json format of signal, and recreate a signal with new Signal(json) constructor.

This is useful when you want to do complex mutation on a signal and convert it back to signal while keeping the signal sequence (id)

support multiple addons

Now devtool is added as an addon. You can use the following code (the use() method) to enable devtool:

const DevtoolAddon = require('collar.js-dev-client);
collar.use(new DevtoolAddon(options));

experimental transport node

bug fixes


collar.js-dev-client v0.3.0


change dev client to an Addon

Now devtool is added as an addon. You can use the following code (the use() method) to enable devtool:

const DevtoolAddon = require('collar.js-dev-client);
collar.use(new DevtoolAddon(options));

decycle signal

When send signal to server, the signal is decycled first, to avoid serialisation error

support multiple processes

A new option [process] is accepted. You can specify different value for different process. This is useful when your application is consist of several components running on different processes. For example, a server + a web app. By assigning each of your process a unique process id (using process option). Collar-dev-server (v0.7+) will show all these processes together.

const DevtoolAddon = require('collar.js-dev-client);
collar.use(new DevtoolAddon({
  process: 'web ui'
}));

collar-dev-server v0.3.0


add two new hierarchy views on the UI

Top Down Hierarchy View

Profile Hierarchy View

support multiple dimension hierarchy

You can specify different hierarchy for your namespace

const ns = collar.ns('collar.example', {
  architecture: 'ui.product.detail',
  author: 'ui-team.Bo',
  // other hierarchy 
})

You can choose the top down hierarchy view / profile hierarchy view to see your hierarchy

use colourful icons to represents nodes

add a clear button

On the top toolbar, a clear button is added to clear current display.

add a fit button

On the top toolbar, a fit button is added to fit graph to current viewpoint

add a toggle timeline button

On the top toolbar, a toggle timeline button is show/hide timeline

support multiple processes

A new option [process] is accepted. You can specify different value for different process. This is useful when your application is consist of several components running on different processes. For example, a server + a web app. By assigning each of your process a unique process id (using process option). Collar-dev-server (v0.7+) will show all these processes together.

const DevtoolAddon = require('collar.js-dev-client);
collar.use(new DevtoolAddon({
  process: 'web ui'
}));

Performance improvements

Improved the performance with large signal sequences