[UPDATE] node-red-contrib-components v0.2.0

node-red-contrib-components Update to v0.2.0

I never announced my stuff here, but since the new version might affect some of your projects, it's probably a good idea to do so.

Components 0.2.0 got some noticeable changes:

  • component context

    Inside a component flow, there now is a msg.component part, that collects all local parameters.
    This context is put on the component's stack and thus preserved when used in nested or recursive scenarios.
    msg.component also has a msg.component._parent part when nested, which is the context of the next outer, parent flow. That makes building recursive structures much easier. There is an example now, too.
  • local / global Parameters

    This is a somewhat breaking change, since the default behaviour of all parameters changes to be local.
    local Parameter (default)
    A local parameter is stored inside the component context, i.e. msg.component. That context is destroyed, when the flow ends (RETURN node). So these parameters only exist in their matching flow.
    global Parameter
    Parameters can be set to "global" in the API now. In that case they are stored inside the msg as they were until now.
    This decision follows the original idea of components to separate concerns and is the point, where components are not another kind of subflow.
  • Broadcast scenario

    If a RETURN node receives a message, that is not originating from its IN node, it will broadcast this message to all connected RUN nodes. That allows components to be a message source.
  • IN-only scenario

    If a component has no RETURN node (a valid way to go), its RUN nodes become a terminating node without an output port. That setup needed some love to make the nodes behave nicely.
  • Examples are there

    I finally managed to add some examples to show the component's features.
  • Fixed Connectivity Validation

    The component nodes try to understand their setup and scan for their matching counter parts. That allows to validate the nodes state. The last versions were messed up somehow and 0.2.0, should now allow decent working.
  • Fixes

    • The scans for matching nodes now handle recursion.
    • README is a little more up-to-date now.

Feedback is very welcome.