- Add support for io.js
- On Node.js ComponentLoader
setSource
now loads components virtually from<baseDir>/components
to support relative module loading - Subgraphs don't get unattached ports implicitly exported any longer. Register in/outports in the graph to make them available from the outside
- Added safeties for restarted networks to WirePattern
- Port names are now validated to only contain lowercase alphanumeric characters or underscores
ComponentLoader.load
method now calls its callback with the Node.js styleerror, instance
signature to allow catching component loading issues- Graph merging support via the graph journal
getSource
now returns correct type for graphs- Subgraph networks are started when the main network starts, instead of automatically on their own timing. As a fallback they will also start when any of their ports receives a
connect
- Networks can now be stopped and restarted at will using the
stop
andstart
methods - The running state of a NoFlo network can be now queried with the
isRunning
method - NoFlo networks support FBP protocol debugging via the
setDebug
andgetDebug
methods Ports.add
is now chainable- The
start
port was removed from subgraphs
These changes mean that in situations where a subgraph is used standalone without a network around it, you need to call component.start()
manually. This is typical especially in unit tests.
- Hotfix reverting backwards-incompatible changes in subgraph loading, see #229.
- Fixed several issues in connections and data synchronization
- Updated
read-installed
to the latest version - Updated JSON Schema for NoFlo graph definition format
- Low-level functions to add and remove graph inports at run-time, see #242
- Fixes for default port values and IIPs in subgraphs.
- Added
dropInput
option for WirePattern to drop premature data while parameters not yet received. See #239 - Addressable ports support in WirePattern. See details.
- 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 usingWirePattern
and supportsforwardGroups
option for error packets.WirePattern
components now deal more consistently with groups and disconnect events
- 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()
- 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
- The new noflo-api-updater tool assists in updating components to the latest NoFlo API
GroupedInput
helper has been renamed toWirePattern
due to a bigger collection of synchronization options.- The
WirePattern
helper has a newordered
option for choosing whether the output should be in same order as the incoming packets - Options
group
andforwardGroups
ofWirePattern
are made independent, so make sure to useforwardGroups: true
if you need this feature together withgroup: true
. - Added support for multiple outputs and reading/writing substreams as solid objects in
WirePattern
. - Added
load
outport handing inWirePattern
to make it a complete replacement forAsyncComponent
. - 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.
integer
is accepted as an alias for theint
datatype for portsbuffer
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'}
- Fixed a minor packaging issue
- 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.
- Support for setting the default
baseDir
of Node.js NoFlo environment withNOFLO_PROJECT_ROOT
env var (defaults to current working directory) - Support for loading graph definitions via AJAX on browser-based NoFlo
- Support for delayed initialization of Subgraph components via ComponentLoader
- Component instances now get the node's metadata passed to the
getComponent
function - New methods for manipulating Graph metadata:
setProperties
setInportMetadata
setOutportMetadata
setGroupMetadata
setNodeMetadata
setEdgeMetadata
- Graph exports can now be renamed, and emit
addExport
,removeExport
, andrenameExport
events - New Graph transaction API for grouping graph changes. Transactions can be observed
startTransaction
endTransaction
- New Journal class, for following Graph changes and restoring earlier revisions. Currently supports
undo
andredo
- New port API allowing better addressability and metadata
- Graph's published ports are now declared in two separate
inports
andoutports
arrays to reduce ambiguity
With the new API component ports can be declared with:
@inPorts = new noflo.InPorts
@inPorts.add 'in', new noflo.InPort
datatype: 'object'
type: 'http://schema.org/Person'
description: 'Persons to be processed'
required: true
buffered: true
The noflo.Ports
objects emit add
and remove
events when ports change. They also support passing port information as options:
@outPorts = new noflo.OutPorts
out: new noflo.OutPort
datatype: 'object'
type: 'http://schema.org/Person'
description: 'Processed person objects'
required: true
addressable: true
The input ports also allow passing in an optional processing function that gets called on information packets events.
- New component API allowing simpler component definition in both CoffeeScript and JavaScript:
var noflo = require('noflo');
exports.getComponent = function() {
var c = new noflo.Component();
c.inPorts.add('in', function(event, payload) {
if (packet.event !== 'data')
return;
// Do something with the packet, then
c.outPorts.out.send(packet.data);
});
c.outPorts.add('out');
return c;
};
- Support for dealing with component source code via ComponentLoader
setSource
andgetSource
methods
- Support for CoffeeScript 1.7.x on Node.js
- ArrayPorts with attached sockets now return
true
forisAttached
checks. There is a separatecanAttach
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 yourpackage.json
(Node.js libraries) orcomponent.json
(browser libraries) - For components, provide via the
icon
attribute
- For libraries, register via the
- 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 theerror
outport, or throwing them if that isn't attached
- Easier debugging: port errors now contain the name of the NoFlo graph node and the port
- 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 astop
method for starting and stopping execution
Browser support:
- The NoFlo engine has been made available client-side via the Component system
- New BDD tests written with Mocha that can be run on both browser and server
Changes to components:
- All components have been moved to various component libraries
Development tools:
- Grunt scaffold for easily creating NoFlo component packages including cross-platform test automation
File format support:
- NoFlo's internal FBP parser was removed in favor of the fbp package
- The
display
property of nodes in the JSON format was removed in favor of the more flexiblemetadata
object
Internals:
- Support for renaming nodes in a NoFlo graph via the
renameNode
method - Adding IIPs to a graph will now emit a
addInitial
event instead of anaddEdge
event - Graph's
removeEdge
method allows specifying both ends of the connection to prevent ambiguity - IIPs can now be removed using the
removeInitial
method, which fires aremoveInitial
event instead ofremoveEdge
- NoFlo Networks now support delayed starting
- The
isBrowser
method on the main NoFlo interface tells whether NoFlo is running under browser or Node.js - Support for running under Node.js on Windows
Internals:
- New
LoggingComponent
base class for component libraries
Development:
- Build process was switched from Cake to Grunt
- NoFlo is no longer tested against Node.js 0.6
NoFlo internals:
-
Ports now support optional type information, allowing editors to visualize compatible port types
@inPorts = in: new noflo.ArrayPort 'object' times: new noflo.Port 'int' @outPorts = out: new noflo.Port 'string'
-
NoFlo ComponentLoader is now able to register new components and graphs and update package.json files accordingly
loader = new noflo.ComponentLoader __dirname loader.registerComponent 'myproject', 'SayHello', './components/SayHello.json', (err) -> console.error err if err
New libraries:
- noflo-test provides a framework for testing NoFlo components
NoFlo internals:
-
The NoFlo
.fbp
parser now guards against recursion on inline subgraphs -
NoFlo subgraphs now inherit the directory context for component loading from the NoFlo process that loaded them
-
Exported ports in NoFlo graphs are now supported also in NoFlo-generated JSON files
-
Nodes in NoFlo graphs can now contain additional metadata to be used for visualization purposes. For example, in FBP format graphs:
Read(ReadFile:foo) OUT -> IN Display(Output:foo)
will cause both the Read and the Display node to contain a
metadata.routes
field with an array containingfoo
. Multiple routes can be specified by separating them with commas
New component libraries:
- noflo-filesystem provides advanced file system components
- noflo-github provides components for interacting with the GitHub service
- noflo-git provides components for Git revision control system
- noflo-oembed provides oEmbed protocol support
- noflo-redis provides Redis database components
User interface:
-
NoFlo's web-based user interface has been moved to a separate noflo-ui repository
-
The
noflo
shell command now usesSTDOUT
for debug output (when invoked with--debug
) instead ofSTDERR
- Events from subgraphs are also visible when the
noflo
command is used with the additional-s
switch - Contents of packets are shown when the
noflo
command is used with the additional-v
switch - Shell debug output is no colorized for easier reading
- Events from subgraphs are also visible when the
-
DOT language output from NoFlo was made more comprehensive
-
NoFlo graphs can now alias their internal ports to more user-friendly names when used as subgraphs. When aliases are used, the other free ports are not exposed via the Graph component. This works in both FBP and JSON formats:
For FBP format graphs:
EXPORT=INTERNALPROCESS.PORT:EXTERNALPORT
For JSON format graphs:
{ "exports": [ { "private": "INTERNALPROCESS.PORT", "public": "EXTERNALPORT" } ] }
NoFlo internals:
- All code was migrated from 4 spaces to 2 space indentation as recommended by CoffeeScript style guide. Our CI environment safeguards this via CoffeeLint
- Events emitted by ArrayPorts now contain the socket number as a second parameter
- Initial Information Packet sending was delayed by
process.nextTick
to ensure possible subgraphs are ready - The
debug
flag was removed from NoFlo Network class, and the networks were made EventEmitters for more flexible monitoring - The
isSubgraph
method tells whether a Component is a subgraph or a regular code component - Subgraphs loaded directly by ComponentLoader no longer expose their
graph
port - The
addX
methods of Graph now return the object that was added to the graph - NoFlo networks now emit
start
andend
events - Component instances have the ID of the node available at the
nodeId
property - Empty strings and other falsy values are now allowed as contents of Initial Information Packets
Changes to core components:
- ReadGroup now sends the group to a
group
outport, and original packet toout
port - GetObjectKey can now send packets that don't contain the specified key to a
missed
port instead of dropping them - SetPropertyValue provides the group hierarchy received via its
in
port when sending packets out - Kick can now optionally send out the packet it received via its
data
port when receiving a disconnect on thein
port. Itsout
port is now an ArrayPort - Concat only clears its buffers on disconnect when all inports have connected at least once
- SplitStr accepts both regular expressions (starting and ending with a
/
) and strings for splitting - ReadDir and Stat are now AsyncComponents that can be throttled
New core components:
- MakeDir creates a directory at a given path
- DirName sends the directory name for a given file path
- CopyFile copies the file behind the path received via the
source
port to the path received via thedestination
port - FilterPacket allows filtering packets by regular expressions sent to the
regexp
port. Non-matching packets are sent to themissed
port - FirstGroup allows you to limit group hierarchies of packets to a single level
- LastPacket sends the last packet it received when getting a disconnect to the inport
- MergeGroups collects grouped packets from its inports, and sends them out together once each inport has sent data with the same grouping
- SimplifyObject simplifies the object structures outputted by the CollectGroups component
- CountSum sums together numbers received from different inports and sends the total out
- SplitInSequence sends each packet to only one of its outports, going through them in sequence
- CollectUntilIdle collects packets it receives, waits a given time if there are new packets, and if not, sends them out
New component libraries:
- noflo-liquid provides Liquid Templating functionality
- noflo-markdown provides Markdown conversion
- noflo-diffbot provides access to the Diffbot screen-scraping service
The main change in 0.2 series was component packaging support and the fact that most component with external dependencies were moved to their own NPM packages:
- Message Queue components were moved to noflo-mq
- HTML parsing components were moved to noflo-html
- XML parsing components were moved to noflo-html
- YAML parsing components were moved to noflo-html
- Web Server components were moved to noflo-webserver
- CouchDB components were moved to noflo-couchdb
- BaseCamp API components were moved to noflo-basecamp
- Restful Metrics components were moved to noflo-restfulmetrics
To use the components, install the corresponding NPM package and change the component's name in your graph to include the package namespace. For example, yaml/ParseYaml
for the ParseYaml component in the noflo-yaml package
User interface:
- The
noflo
command-line tool now has a newlist
command for listing components available for a given directory, for example:$ noflo list .
NoFlo internals:
- New ComponentLoader to support loading components and subgraphs to installed NPM modules
- NoFlo's own codebase was moved to direct requires making the NPM installation simpler
- daemon dependency was removed from NoFlo's command-line tools
Changes to core components:
- Merge only disconnects once all of its inports have disconnected
- Concat only disconnects once all of its inports have disconnected
- CompileString's
in
port is now an ArrayPort - GroupByObjectKey also supports boolean values for the matched keys
- ReadDir disconnects after reading a directory
New core components:
- Drop allows explicitly dropping packets in a graph. The component performs no operations on the data it receives