Noflo Versions Save

Flow-based programming for JavaScript

0.5.7

9 years ago
  • Ports now default to not required. Set the port option required: true the port needs to be connected in order for the component to work
  • MultiError pattern is enabled by default when using WirePattern and supports forwardGroups option for error packets.
  • WirePattern components now deal more consistently with groups and disconnect events

0.5.6

9 years ago
  • Custom icon support for subgraphs via the icon key in graph properties
  • Parameter support for WirePattern components, allowing them to have configuration parameters that need to be set only once. Example:
component = new noflo.Component
component.inPorts.add 'path',
  datatype: 'string'
  required: true
component.inPorts.add 'delay',
  datatype: 'int'
  required: false
component.inPorts.add 'line',
  datatype: 'string'
component.inPorts.add 'repeat',
  datatype: 'int'
component.outPorts.add 'out',
  datatype: 'object'
component.outPorts.add 'error',
  datatype: 'object'

noflo.helpers.WirePattern component,
  in: ['line', 'repeat']
  out: 'out'
  params: ['path', 'delay']
  async: true
, (data, groups, out, callback) ->
  path = component.params.path
  delay = if component.params.delay then component.params.delay else 0
  doSomeThing path, delay, data.line, data.repeat, (err, res) ->
    return callback err if err
    out.send res
    callback()

0.4.1

9 years ago
  • NoFlo components can now implement a shutdown method which is called when they're removed from a network
  • Graphs can contain additional metadata in the properties key
  • NoFlo networks have now a start and a stop method for starting and stopping execution

0.4.2

9 years ago
  • Easier debugging: port errors now contain the name of the NoFlo graph node and the port

0.4.3

9 years ago
  • ArrayPorts with attached sockets now return true for isAttached checks. There is a separate canAttach method for checking whether more can be added
  • Icon support was added for both libraries and components using the set from Font Awesome
    • For libraries, register via the noflo.icon key in your package.json (Node.js libraries) or component.json (browser libraries)
    • For components, provide via the icon attribute
  • Subgraphs now support closing their internal NoFlo network via the shutdown method
  • Component Loader is able to load arbitrary graphs outside of the normal package manifest registration via the loadGraph method
  • Component Loader of the main NoFlo network is now carried across subgraphs instead of instantiating locally
  • Libraries can provide a custom loader for their components by registering a noflo.loader key in the manifest pointing to a CommonJS module
  • Exported ports can now contain metadata
  • It is possible to create named groups of nodes in a NoFlo graph, which can be useful for visual editors
  • Components have an error helper method for sending errors to the error outport, or throwing them if that isn't attached

0.4.4

9 years ago
  • Support for CoffeeScript 1.7.x on Node.js

0.5.1

9 years ago
  • Custom component loaders can be registered programmatically using the registerLoader method of NoFlo's ComponentLoader
  • contains method for buffered inports returns the number of data packets the buffer has
  • Call stack exhaustion on very large graphs has been fixed
  • The error outport of AsyncComponents now sends the group information of the original input together with the error
  • The error method of regular ports can now also handle groups as a second parameter
  • Ports can now list their attached sockets (by array index) via the listAttached method
  • function is now an accepted datatype for ports
  • There is now initial support for making connections to and from addressable ports with a specified index

In the FBP format, these can be specified with the bracket syntax:

SomeNode OUT[2] -> IN OtherNode
'foo' -> OPTS[1] OtherNode

In the JSON file these are defined in connections by adding a integer to the index key of the src or tgt definition.

The NoFlo Graph class provides these with the following methods:

addEdgeIndex(str outNode, str outPort, int outIndex, str inNode, str inPort, int inIndex, obj metadata)
addInitiaIndex(mixed data, str inNode, str inPort, int inIndex, obj metadata)

If indexes are not specified, the fall-back behavior is to automatically index the connections based on next available slot in the port.

0.5.5

9 years ago
  • Fixed an issue with StreamSender affecting WirePattern components dealing with multiple levels of grouping
  • New CustomizeError helper for passing information with Error objects in NoFlo. For example:
# Instantiate an error object
err = new Error 'Something went wrong'

# Add metadata to it. Usually this should include groups and other machine-readable information
noflo.helpers.CustomizeError err,
  groups: groups
  foo: 'bar'

# Send it to error port
c.error err

0.5.4

9 years ago
  • The new noflo-api-updater tool assists in updating components to the latest NoFlo API
  • GroupedInput helper has been renamed to WirePattern due to a bigger collection of synchronization options.
  • The WirePattern helper has a new ordered option for choosing whether the output should be in same order as the incoming packets
  • Options group and forwardGroups of WirePattern are made independent, so make sure to use forwardGroups: true if you need this feature together with group: true.
  • Added support for multiple outputs and reading/writing substreams as solid objects in WirePattern.
  • Added load outport handing in WirePattern to make it a complete replacement for AsyncComponent.
  • Added helpers for advanced error handling, see #185.
  • Added caching option for OutPorts that makes them re-send their latest value to any newly-added connections, see #151 for example use cases.

0.5.3

10 years ago
  • integer is accepted as an alias for the int datatype for ports
  • buffer is now an accepted port datatype
  • The Continuous Integration setup for NoFlo now runs on both Linux and Windows
  • Fixed a bug with ComponentLoader getSource method when invoked early on in execution
  • New component helpers for easier authoring

The MapComponent helper is usable for synchronous components that operate on a single inport-outport combination:

c = new noflo.Component
  inPorts:
    in:
      datatype: 'number'
  outPorts:
    out:
      datatype: 'number'
noflo.helpers.MapComponent c, (data, groups, out) ->
  out.send data * 2

The GroupedInput helper assists in building components that need to synchronize multiple inputs by groups:

c = new noflo.Component
  inPorts:
    x:
      datatype: 'number'
    y:
      datatype: 'number'
  outPorts:
    radius:
      datatype: 'number'

noflo.helpers.GroupedInput c,
  in: ['x', 'y']
  out: 'radius'
, (data, groups, out) ->
  out.send Math.sqrt(data.x**2 + data.y**2)

GroupedInput can also synchronize via specific fields of object-type packets:

helpers.GroupedInput c,
  in: ['user', 'message']
  out: 'signedMessage'
  field: 'request'
, (data, groups, out) ->
  out.send
    request: data.request
    user: data.user.name
    text: data.message.text

user.send {request: 123, id: 42, name: 'John'}
message.send {request: 123, id: 17, text: 'Hello world'}

# Result:
{ request: 123, user: 'John', text: 'Hello world'}