<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Henri Bergius - Javascript</title>
    <description>Latest posts in category 'javascript'</description>
    <link>https://bergie.iki.fi</link>
    <language>en</language>
    <lastBuildDate>Tue, 05 May 2026 19:17:08 +0000</lastBuildDate>
    
    <item>
      
      <title>Flow-Based Programming, a way for AI and humans to develop together</title>
      <description>&lt;p&gt;I think by now everybody reading this will have seen how the new generation of &lt;a href=&quot;https://en.wikipedia.org/wiki/Large_language_model&quot;&gt;Large Language Models&lt;/a&gt; like ChatGPT are able to produce &lt;a href=&quot;https://tylerglaiel.substack.com/p/can-gpt-4-actually-write-code&quot;&gt;somewhat useful code&lt;/a&gt;. Like any advance in software development—from IDEs to high-level languages—this has generated some discussion on the future employment prospects in our field.&lt;/p&gt;

&lt;p&gt;This made me think about how these new tools could fit the world of &lt;a href=&quot;https://en.wikipedia.org/wiki/Flow-based_programming&quot;&gt;Flow-Based Programming&lt;/a&gt;, a software development technique I’ve been involved with for quite a while. In Flow-Based Programming these is a very strict boundary between reusable “library code” (called &lt;em&gt;Components&lt;/em&gt;) and the “application logic” (called the &lt;em&gt;Graph&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Here’s what the late &lt;a href=&quot;https://jpaulm.github.io&quot;&gt;J. Paul Morrison&lt;/a&gt; wrote on the subject in his seminal work, &lt;em&gt;Flow-Based Programming: A New Approach to Application Development&lt;/em&gt; (2010):&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Just as in the preparation and consumption of food there are the two roles of cook and diner, in FBP application development there are two distinct roles: the component builder and the component user or application designer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;…The application designer builds applications using already existing components, or where satisfactory ones do not exist s/he will specify a new component, and then see about getting it built.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Remembering that passage made me wonder, could I get one of the LLMs to produce useful &lt;a href=&quot;https://noflojs.org&quot;&gt;NoFlo&lt;/a&gt; components? Armed with &lt;a href=&quot;https://www.bing.com/new&quot;&gt;New Bing&lt;/a&gt;, I set out to explore.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/800x/b8c302b0-c698-11ed-8b42-09bd596b6d87Robot%20software.png&quot; alt=&quot;AI and humans working together&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The first attempt was specifying a pretty simple component:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/800x/new-bing-noflo-component.png&quot; alt=&quot;New Bing writing a component&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That actually looks quite reasonable! I also tried asking New Bing to make the component less verbose, as well as generating TypeScript and CoffeeScript variants of the same. All seemed to produce workable things! Sure, there might be some tidying to do, but this could remove a lot of the tedium of component creation.&lt;/p&gt;

&lt;p&gt;In addition to this trivial math component I was able to generate some that to call external REST APIs etc. Bing was even able to switch between HTTP libraries as requested.&lt;/p&gt;

&lt;p&gt;What was even cooler was that it actually &lt;em&gt;suggested&lt;/em&gt; to ask it how to &lt;em&gt;test the component&lt;/em&gt;. Doing as I was told, the result was quite astonishing:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/800x/new-bing-fbp-spec.png&quot; alt=&quot;New Bing writing fbp-spec tests&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That’s &lt;a href=&quot;https://github.com/flowbased/fbp-spec&quot;&gt;fbp-spec&lt;/a&gt;! The declarative testing tool we came up with! Definitely the nicest way to test NoFlo (or any other FBP framework) components.&lt;/p&gt;

&lt;p&gt;Based on my results, you’ll definitely want to check the generated components and tests before running them. But what you get out is not bad at all.&lt;/p&gt;

&lt;p&gt;I of course also tried to get Bing to produce NoFlo graphs for me. This is where it stumbled quite a bit. Interestingly the results were better in the &lt;a href=&quot;https://github.com/flowbased/fbp#language-for-flow-based-programming&quot;&gt;fbp language&lt;/a&gt; than in the JSON graph format. But maybe that even more enforces that the &lt;em&gt;sweet spot would be AI writing components and a human creating the graphs that run those&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/800x/28a14660-c698-11ed-8b42-09bd596b6d87Robot%20software.png&quot; alt=&quot;AI and humans working together&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As I’m not working at the moment, I don’t have a current use case for this way of collaborating. But I believe this could be a huge productivity booster for any (and especially Flow-Based) application development, and expect to try it in whatever my next gig ends up being.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Illustrations: MidJourney, from prompt &lt;em&gt;Robot software developer working with a software architect. Floating flowcharts in the background&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;
</description>
      <pubDate>Mon, 20 Mar 2023 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Ffbp-ai-human-collaboration%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/fbp-ai-human-collaboration/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/fbp-ai-human-collaboration/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>asComponent: turn any JavaScript function into a NoFlo component</title>
      <description>&lt;p&gt;Version 1.1 of &lt;a href=&quot;https://noflojs.org&quot;&gt;NoFlo&lt;/a&gt; shipped this week with a new convenient way to write components. With the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;noflo.asComponent&lt;/code&gt; helper you can turn any JavaScript function into a well-behaved NoFlo component with minimal boilerplate.&lt;/p&gt;

&lt;p&gt;Usage of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;noflo.asComponent&lt;/code&gt; is quite simple:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getComponent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case we have a function that doesn’t take arguments. We detect this, and produce a component with a single “bang” port for invoking the function:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/500x/ascomponent-result.png&quot; alt=&quot;Math.random as component&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You can also amend the component with helpful information like a textual description and and icon:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getComponent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Generate a random number&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/500x/ascomponent-custom-icon.png&quot; alt=&quot;Math.random with custom icon&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;multiple-inputs&quot;&gt;Multiple inputs&lt;/h2&gt;

&lt;p&gt;The example above was with a function that does not take any arguments. With functions that accept arguments, each of them becomes an input port.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;findItemsWithId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getComponent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;findItemsWithId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/500x/ascomponent-multiple-inports.png&quot; alt=&quot;asComponent and multiple inports&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The function will be called when both input ports have a packet available.&lt;/p&gt;

&lt;h2 id=&quot;output-handling&quot;&gt;Output handling&lt;/h2&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;asComponent&lt;/code&gt; helper handles three types of functions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Regular synchronous functions: return value gets sent to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;out&lt;/code&gt;. Thrown errors get sent to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;error&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Functions returning a Promise: resolved promises get sent to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;out&lt;/code&gt;, rejected promises to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;error&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Functions taking a Node.js style asynchronous callback: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;err&lt;/code&gt; argument to callback gets sent to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;error&lt;/code&gt;, result gets sent to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;out&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this, it is quite easy to write wrappers for asynchronous operations. For example, to call an external REST API with the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API&quot;&gt;Fetch API&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;getFlowhubStats&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;https://api.flowhub.io/stats&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getComponent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noflo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getFlowhubStats&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;How that you have this component, it is quick to do a graph utilizing it (&lt;a href=&quot;https://app.flowhub.io/#github/bergie/flowhubstats&quot;&gt;open in Flowhub&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://app.flowhub.io/#github/bergie/flowhubstats&quot;&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/800x/ascomponent-fetch-graph.png&quot; alt=&quot;Example graph with asynchronous asComponent&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we get the BODY element of the browser runtime. When that has been loaded, we trigger the fetch component above. If the request succeeds, we process it through a string template to write a quick report to the page. If it fails, we grab the error message and write that.&lt;/p&gt;

&lt;h2 id=&quot;making-the-components-discoverable&quot;&gt;Making the components discoverable&lt;/h2&gt;

&lt;p&gt;The default location for a NoFlo component is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;components/ComponentName.js&lt;/code&gt; inside your project folder. Add your new components to this folder, and NoFlo will be able to run them.&lt;/p&gt;

&lt;p&gt;If you’re using &lt;a href=&quot;https://flowhub.io/ide&quot;&gt;Flowhub&lt;/a&gt;, you can also write the components in the integrated code editor, and they will be sent to the runtime.&lt;/p&gt;

&lt;p&gt;We’ve already updated the hosted NoFlo browser runtime to 1.1, so you can get started with this new component API right away.&lt;/p&gt;

&lt;h2 id=&quot;advanced-components&quot;&gt;Advanced components&lt;/h2&gt;

&lt;p&gt;In many ways, asComponent is the inverse of the &lt;a href=&quot;https://bergie.iki.fi/blog/ascallback/&quot;&gt;asCallback embedding feature&lt;/a&gt; we introduced a year ago: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;asComponent&lt;/code&gt; turns a regular JavaScript function into a NoFlo component; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;asCallback&lt;/code&gt; turns a NoFlo component (or graph) into a regular JavaScript function.&lt;/p&gt;

&lt;p&gt;If you need to work with more complex firing patterns, like combining streams or having control ports, you can of course still write regular &lt;a href=&quot;https://noflojs.org/documentation/components/#component-api&quot;&gt;Process API&lt;/a&gt; components.&lt;/p&gt;

&lt;p&gt;The regular component API is quite a bit more verbose, but at the same time gives you full access to NoFlo APIs for dealing with manually controlled preconditions, state management, and creating &lt;a href=&quot;https://noflojs.org/documentation/components/#generator-components&quot;&gt;generators&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, thinking about the hundreds of NoFlo components out there, most of them could be written much more simply with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;asComponent&lt;/code&gt;. This will hopefully make the process of developing NoFlo programs a lot more straightforward.&lt;/p&gt;

&lt;p&gt;Read more &lt;a href=&quot;https://noflojs.org/documentation/components/&quot;&gt;NoFlo component documentation&lt;/a&gt; and &lt;a href=&quot;https://noflojs.org/api/AsComponent/&quot;&gt;asComponent API docs&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Fri, 23 Feb 2018 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fascomponent%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/ascomponent/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/ascomponent/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>NoFlo and GNOME</title>
      <description>&lt;p&gt;As the readers of this blog know, I’ve been working on a &lt;a href=&quot;https://en.wikipedia.org/wiki/Flow-based_programming&quot;&gt;Flow-Based Programming&lt;/a&gt; implementation for JavaScript in the form of the &lt;a href=&quot;https://noflojs.org/&quot;&gt;NoFlo&lt;/a&gt; project. The idea of FBP in nutshell is to separate the control flow of software from the actual implementation. Developers build reusable “black box” components that are then connected with each other through a graph that you can define either visually or textually.&lt;/p&gt;

&lt;p&gt;FBP has been around for quite a while, having been &lt;a href=&quot;http://bergie.iki.fi/blog/paul-morrison-interview/&quot;&gt;invented by J. Paul Morrison in the 60s&lt;/a&gt;, but is now becoming more and more relevant thanks to the need for talking to multiple asynchronous APIs and different devices. While NoFlo has been stable enough for production use for about two years now, we ran a &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;successful Kickstarter&lt;/a&gt; earlier this fall to push the development tools to a new level.&lt;/p&gt;

&lt;p&gt;I attended the &lt;a href=&quot;https://fscons.org/2013/&quot;&gt;FSCONS&lt;/a&gt; conference last weekend, and gave a NoFlo talk. Since quite a few &lt;a href=&quot;http://www.gnome.org/&quot;&gt;GNOME&lt;/a&gt; regulars were there as well, we ended up chatting about how NoFlo and FBP could be utilized in the desktop environment. I’m writing this to &lt;a href=&quot;https://planet.gnome.org/&quot;&gt;Planet GNOME&lt;/a&gt; to introduce some of those ideas.&lt;/p&gt;

&lt;p&gt;The video from &lt;a href=&quot;http://bergie.iki.fi/talks/2013/noflo-fscons/#0&quot;&gt;my talk&lt;/a&gt; isn’t online yet, but you can watch &lt;a href=&quot;http://vimeo.com/72065207&quot;&gt;a video&lt;/a&gt; from the talk I gave at &lt;a href=&quot;http://c-base.org/&quot;&gt;c-base&lt;/a&gt; couple of months ago:&lt;/p&gt;

&lt;iframe src=&quot;https://bergie.iki.fi//player.vimeo.com/video/72065207?color=ffffff&quot; width=&quot;500&quot; height=&quot;281&quot; frameborder=&quot;0&quot; webkitallowfullscreen=&quot;&quot; mozallowfullscreen=&quot;&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;noflo-on-gjs&quot;&gt;NoFlo on gjs&lt;/h2&gt;

&lt;p&gt;An interesting development that happened this fall was that NoFlo was ported to the &lt;a href=&quot;https://wiki.gnome.org/Gjs&quot;&gt;gjs&lt;/a&gt; JavaScript engine by &lt;a href=&quot;https://github.com/djdeath&quot;&gt;Lionel Landwerlin&lt;/a&gt;. This allows us to take the ideas of Flow-Based Programming and connect them with the desktop. GNOME is an excellent candidate for this, given that JavaScript is a first-class citizen on the &lt;a href=&quot;https://developer.gnome.org/&quot;&gt;development platform&lt;/a&gt;, meaning that with the right set of components your FBP programs could integrate with all the relevant parts of the GNOME ecosystem.&lt;/p&gt;

&lt;p&gt;Lionel posted &lt;a href=&quot;http://youtu.be/p7NYgqG0CQ8&quot;&gt;a screencast&lt;/a&gt; of window management with &lt;a href=&quot;https://wiki.gnome.org/Clutter&quot;&gt;Clutter&lt;/a&gt; coordinated by NoFlo:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://bergie.iki.fi//www.youtube.com/embed/p7NYgqG0CQ8&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;This is of course only the first steps, but shows a little bit of the potential. While NoFlo’s low overhead could mean making actual GNOME applications with it, the initial sweet spot for the integration would be:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Having a fast UI prototyping tool in GNOME, a bit like how &lt;a href=&quot;https://en.wikipedia.org/wiki/Quartz_Composer&quot;&gt;Quartz Composer&lt;/a&gt; is used on the Apple platforms&lt;/li&gt;
  &lt;li&gt;Allowing users to automate parts of their desktop workflow through simple FBP programs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/vkhosla/statuses/365206789182078976&quot;&gt;Vinod Khosla summarized&lt;/a&gt; the significance of this quite well:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;An author can write a book, a musician a song, a painter  a painting. Most UI designers cannot realize their creation&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;http://www.linkedin.com/in/zeenix&quot;&gt;Zeeshan&lt;/a&gt; also wrote about similar ideas for GNOME in his &lt;a href=&quot;https://wiki.gnome.org/Pentu&quot;&gt;Pentu&lt;/a&gt; project proposal two years ago.&lt;/p&gt;

&lt;h2 id=&quot;bringing-the-gnome-platform-to-noflo&quot;&gt;Bringing the GNOME platform to NoFlo&lt;/h2&gt;

&lt;p&gt;The big part of enabling flow-based GNOME development would be to provide &lt;a href=&quot;https://noflojs.org/library/&quot;&gt;NoFlo components&lt;/a&gt; for the various APIs in the GNOME ecosystem. This could be done manually, but quite possibly we could automate at least parts of the process by some smart &lt;a href=&quot;https://wiki.gnome.org/GObjectIntrospection&quot;&gt;GObject Introspection&lt;/a&gt; hacking.&lt;/p&gt;

&lt;p&gt;This would be quite similar to &lt;a href=&quot;https://github.com/noflo/noflo-polymer&quot;&gt;how we integrated&lt;/a&gt; the &lt;a href=&quot;http://www.polymer-project.org/&quot;&gt;Polymer Web Components&lt;/a&gt; with NoFlo.&lt;/p&gt;

&lt;p&gt;As I’m currently quite busy on the NoFlo Development Environment, I won’t be able to do this personally. But this sort of work would be the perfect fit for something like &lt;a href=&quot;https://wiki.gnome.org/OutreachProgramForWomen&quot;&gt;OPW&lt;/a&gt; or &lt;a href=&quot;https://developers.google.com/open-source/soc/&quot;&gt;GSoC&lt;/a&gt;. I’d be happy to mentor that effort.&lt;/p&gt;

&lt;h2 id=&quot;the-noflo-development-environment&quot;&gt;The NoFlo Development Environment&lt;/h2&gt;

&lt;p&gt;We’re building a quite nice graphical editor and debugger for flow-based programs. You can see the current state in &lt;a href=&quot;http://bergie.iki.fi/blog/noflo-update/&quot;&gt;a UI walkthrough&lt;/a&gt; I posted last month.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/noflo-ui/clock-demo-preview-small.png&quot; alt=&quot;NoFlo UI in action&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/noflo/noflo-ui&quot;&gt;NoFlo UI&lt;/a&gt; is a web application that could be brought to the desktop by running it inside a &lt;a href=&quot;https://wiki.gnome.org/WebKitGtk&quot;&gt;webview&lt;/a&gt;. To control the NoFlo runtime inside gjs we would also need a GNOME library for dealing with &lt;a href=&quot;https://en.wikipedia.org/wiki/WebSocket&quot;&gt;WebSockets&lt;/a&gt;, as that is the way we talk with non-browser runtimes like &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt; or the &lt;a href=&quot;https://github.com/jonnor/microflo&quot;&gt;microflo&lt;/a&gt; environment for Arduino programming.&lt;/p&gt;

&lt;p&gt;By supporting the &lt;a href=&quot;https://github.com/noflo/noflo/issues/107&quot;&gt;NoFlo network protocol&lt;/a&gt; on gjs we could easily start, stop, modify, and monitor FBP programs running inside GNOME.&lt;/p&gt;

&lt;p&gt;In the long run it would also be possible to build a native flow-based editor as well. After all, since the data model and runtime interactions are standardized, there is no reason why multiple different tools couldn’t interact with the same NoFlo graphs.&lt;/p&gt;

&lt;p&gt;To find out more about NoFlo, visit the &lt;a href=&quot;https://noflojs.org&quot;&gt;website&lt;/a&gt;, read the code &lt;a href=&quot;http://github.com/noflo&quot;&gt;on GitHub&lt;/a&gt;, or &lt;a href=&quot;http://bergie.iki.fi/blog/noflo-coverage-august/&quot;&gt;read the various press stories&lt;/a&gt; that appeared during the Kickstarter.&lt;/p&gt;

&lt;p&gt;While I’m currently working &lt;a href=&quot;http://bergie.iki.fi/blog/working-on-android/&quot;&gt;outside of the desktop context&lt;/a&gt;, having been around GNOME since early 2000s I’m still following the project with interest. Having NoFlo there would be a great way to revitalize this connection.&lt;/p&gt;
</description>
      <pubDate>Wed, 13 Nov 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fnoflo-and-gnome%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/noflo-and-gnome/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/noflo-and-gnome/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>My interview on the origins of NoFlo</title>
      <description>&lt;p&gt;&lt;a href=&quot;https://vimeo.com/68285726&quot;&gt;Here&lt;/a&gt; is a video interview of me talking about the origins of &lt;a href=&quot;https://noflojs.org/&quot;&gt;NoFlo&lt;/a&gt;, the flow-based programming environment for JavaScript:&lt;/p&gt;

&lt;iframe src=&quot;https://player.vimeo.com/video/68285726?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;640&quot; height=&quot;360&quot; frameborder=&quot;0&quot; webkitallowfullscreen=&quot;&quot; mozallowfullscreen=&quot;&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;You’ve seen short pieces from this in the &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;NoFlo Kickstarter video&lt;/a&gt;, but most of the material is new. This was shot when &lt;a href=&quot;http://bergie.iki.fi/blog/noflo-two-years/&quot;&gt;NoFlo turned two&lt;/a&gt;, and so I’m obviously spending some time talking about where things came from.&lt;/p&gt;

&lt;p&gt;The video should work well to support the &lt;a href=&quot;http://bergie.iki.fi/blog/noflo-kickstarter-launch/&quot;&gt;hacker’s perspective&lt;/a&gt; of our funding campaign. Please &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;support us&lt;/a&gt; and spread the word!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It is pretty amazing to think that since &lt;a href=&quot;http://bergie.iki.fi/blog/noflo-kickstarter-launch/&quot;&gt;my last post&lt;/a&gt; on Friday, we’ve almost doubled the amount of contributions. Thanks to all the &lt;strong&gt;nearly 500 backers&lt;/strong&gt; who have already helped us to change the world of programming!&lt;/em&gt;&lt;/p&gt;
</description>
      <pubDate>Tue, 06 Aug 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Finterview-noflo-origins%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/interview-noflo-origins/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/interview-noflo-origins/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>NoFlo Kickstarter, the hacker's perspective</title>
      <description>&lt;p&gt;This has been a big week for &lt;a href=&quot;https://noflojs.org/&quot;&gt;NoFlo&lt;/a&gt;, the flow-based programming environment for JavaScript. Yesterday we released &lt;a href=&quot;https://github.com/noflo/noflo/releases/tag/0.4.0&quot;&gt;NoFlo 0.4&lt;/a&gt;, which added support for running flow-based programs in web browsers. And today we launched our &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;NoFlo Development Environment effort on Kickstarter&lt;/a&gt;. Before continuing, make sure to watch &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;the video&lt;/a&gt;!&lt;/p&gt;

&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;https:&amp;#x2F;&amp;#x2F;www.kickstarter.com&amp;#x2F;projects&amp;#x2F;noflo&amp;#x2F;noflo-development-environment&amp;#x2F;widget&amp;#x2F;video.html&quot; frameborder=&quot;0&quot;&gt; &lt;/iframe&gt;

&lt;p&gt;This is our effort to bring visual and collaborative flow-based tools into the world of mainstream software development. Similar tools are already in use in many specialized industries from movie special effects to hardware simulation, but we programmers still have to &lt;em&gt;construct these complex maps of our software’s control flow&lt;/em&gt; inside our brains based on their textual representation. With &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;your support&lt;/a&gt;, we could change that!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We’ve already reached a third of our goal on the first day. Clearly people see the need for these tools. Exciting times!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The stories from &lt;a href=&quot;http://techcrunch.com/2013/08/01/noflo-launches-kickstarter-campaign-to-provide-a-way-for-everyone-to-understand-and-visualize-code/&quot;&gt;TechCrunch&lt;/a&gt; and &lt;a href=&quot;http://gigaom.com/2013/08/01/noflo-turns-to-kickstarter-to-expand-program-to-help-non-techies-read-code/&quot;&gt;GigaOm&lt;/a&gt; tell the story well for non-programmers. But based on the questions I’ve received today, I thought it would be good to clarify various points from a more programmer-centric point of view.&lt;/p&gt;

&lt;h2 id=&quot;hasnt-visual-programming-been-tried-before&quot;&gt;Hasn’t visual programming been tried before?&lt;/h2&gt;

&lt;p&gt;The story of visual programming tools started with the &lt;a href=&quot;http://youtu.be/QQhVQ1UG6aM&quot;&gt;GRaIL system&lt;/a&gt; of the 60s, and has progressed to tools like &lt;a href=&quot;http://www.ni.com/labview/&quot;&gt;LabView&lt;/a&gt; and &lt;a href=&quot;http://puredata.info/&quot;&gt;Pure Data&lt;/a&gt;. So far none of these tools has reached mainstream acceptance outside of their (sometimes fanatic) industry niches.&lt;/p&gt;

&lt;p&gt;This is partly because these tools were built originally with a particular problem domain in mind, and partly because of the user experience. Execution matters, as we’ve seen so many times in the tech industry. After all, there were tablets a lot before the iPads.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;http://www.kickstarter.com/profile/noflo&quot;&gt;our team&lt;/a&gt; I have the confidence that we have the necessary skills and vision to build something that is actually a pleasure to use, and that makes it truly easier to work with the control flow of your software than it is with the text editors.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is not a rehash of UML&lt;/em&gt;. UML is a diagram mapping out object-oriented constructs, often used for code generation. NoFlo graphs instead are only the &lt;em&gt;coordination layer&lt;/em&gt; that manages the control flow of your software. The components are still handcrafted and unit-tested code that NoFlo merely wires together at runtime, following the edges specified in a &lt;a href=&quot;https://noflojs.org/documentation/json/&quot;&gt;JSON file&lt;/a&gt;. No code generation here.&lt;/p&gt;

&lt;h2 id=&quot;why-map-out-the-control-flow&quot;&gt;Why map out the control flow?&lt;/h2&gt;

&lt;p&gt;All software is inherently a graph. Functions call other functions, sending data along. Signals are emitted and connections are made. But outside of some debugging tools we rarely see this in a visual format. Instead, when starting to work on a program you have to parse the code and build this map in your head.&lt;/p&gt;

&lt;p&gt;This imposes a lot of cognitive load that tools like NoFlo could avoid. When you can see visually how things are connected, you can focus on the bigger picture and build the software you need in a more efficient way. This is what &lt;a href=&quot;http://vimeo.com/71278954&quot;&gt;Bret Victor talked about recently&lt;/a&gt;.&lt;/p&gt;

&lt;iframe src=&quot;https://player.vimeo.com/video/71278954?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;500&quot; height=&quot;281&quot; frameborder=&quot;0&quot; webkitallowfullscreen=&quot;&quot; mozallowfullscreen=&quot;&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;what-is-the-role-for-code-then&quot;&gt;What is the role for code, then?&lt;/h2&gt;

&lt;p&gt;However, there still remains a role for text-based code. The actual components, the boxes in the graph, are still written out in JavaScript. But since they’re isolated from their surroundings until a NoFlo graph wires them together, each component can focus on accomplishing a single task well.&lt;/p&gt;

&lt;p&gt;My original &lt;a href=&quot;http://bergie.iki.fi/blog/inspiration-for-fbp-ui/&quot;&gt;NoFlo UI prototype&lt;/a&gt; already included the code editor for modifying and creating new components. By the principles of &lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;TDD&lt;/a&gt;, each component is always edited alongside its unit tests, and the tests can be run at any point with a single click. We’re now bringing that back into the new UI:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://d2vqpl3tx84ay5.cloudfront.net/noflo-ui-code.jpg&quot;&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/noflo-ui-code-small.jpg&quot; alt=&quot;Editing code in the NoFlo UI&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For those who don’t want this UI, NoFlo is still fully usable also without it. As a matter of fact, we don’t have a UI before the Kickstarter succeeds, and yet many companies are already building their applications with NoFlo. One way is by using the &lt;a href=&quot;https://noflojs.org/documentation/fbp/&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.fbp&lt;/code&gt; language&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;why-now&quot;&gt;Why now?&lt;/h2&gt;

&lt;p&gt;Another reason why the &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;NoFlo development environment&lt;/a&gt; may succeed where many others failed is that programming has changed.&lt;/p&gt;

&lt;p&gt;We no longer target a single protocol — whether the Win32 API or HTTP — in our applications. Instead, we need to talk multiple protocols and with multiple devices at the same time. Even just dealing with both REST and WebSockets is difficult to many traditional programming environments.&lt;/p&gt;

&lt;p&gt;The other big change is the usage of &lt;a href=&quot;http://bergie.iki.fi/blog/internet-application-blueprint/&quot;&gt;different web APIs&lt;/a&gt; as part of your applications. Authentication, handling asynchronous requests and services that are sometimes down can be a pain.&lt;/p&gt;

&lt;p&gt;NoFlo brings a &lt;em&gt;controlling layer&lt;/em&gt; to your software that allows you to map out these scenarios and isolate the handling of each protocol or API into its own set of small, simple components.&lt;/p&gt;

&lt;h2 id=&quot;where-could-this-be-used&quot;&gt;Where could this be used?&lt;/h2&gt;

&lt;p&gt;Many of the nodal editing tools built in the past have been very domain-specific. However, &lt;a href=&quot;http://en.wikipedia.org/wiki/Flow-based_programming&quot;&gt;flow-based programming&lt;/a&gt; is a general software development paradigm. NoFlo has already been used for a wide variety of tasks, including:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Business data extraction and reporting&lt;/li&gt;
  &lt;li&gt;Automating billing workflows&lt;/li&gt;
  &lt;li&gt;Receiving, routing, and sending text messages&lt;/li&gt;
  &lt;li&gt;Static site generation&lt;/li&gt;
  &lt;li&gt;Building server-side web applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we &lt;a href=&quot;https://github.com/noflo/noflo/releases/tag/0.4.0&quot;&gt;added browser support&lt;/a&gt; it will be possible to also build physics-based user interfaces with NoFlo. There should be some interesting examples of that coming up soon.&lt;/p&gt;

&lt;p&gt;NoFlo being a general JavaScript library could in future enable us to coordinate the flows also in new kinds of places like desktop applications. There are &lt;a href=&quot;http://www.gnome.org/&quot;&gt;several&lt;/a&gt; &lt;a href=&quot;http://kde.org/&quot;&gt;desktop&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Windows_Runtime&quot;&gt;environments&lt;/a&gt; where JavaScript is a first-class citizen. Combining flow-based interactions with declarative UI definitions could be something very powerful!&lt;/p&gt;

&lt;p&gt;Many of the giants of the software industry, like Google, Facebook, Microsoft, Adobe, and Mozilla are all working on improving the JavaScript development tools. It would be awesome to have their support for what we’re doing.&lt;/p&gt;

&lt;h2 id=&quot;how-about-open-source&quot;&gt;How about open source?&lt;/h2&gt;

&lt;p&gt;If you’re following this blog, you probably know that I feel strongly for software freedom. Everything I’ve done during my &lt;a href=&quot;http://www.linkedin.com/in/bergie&quot;&gt;professional career&lt;/a&gt; has been possible only thanks to the open source community.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://noflojs.org/&quot;&gt;NoFlo&lt;/a&gt; and the UI we’re building are and will remain open source available under the &lt;a href=&quot;https://en.wikipedia.org/wiki/MIT_License&quot;&gt;MIT license&lt;/a&gt;. As a matter of fact, the UI is designed to not only work with NoFlo, but also to be adaptable to work with other flow-based systems. I feel this is an area with a lot of potential for collaboration with the various functional and dataflow projects out there.&lt;/p&gt;

&lt;p&gt;We will however be offering a hosted version of the software for a fee. The various &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;Kickstarter rewards&lt;/a&gt; will give our backers an early and cheaper access to that.&lt;/p&gt;

&lt;p&gt;But still, you’ll always be able to run the whole stack on your own infrastructure if you choose to do so.&lt;/p&gt;

&lt;h2 id=&quot;what-happens-next&quot;&gt;What happens next?&lt;/h2&gt;

&lt;p&gt;Our &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;Kickstarter campaign&lt;/a&gt; has been up for less than a day, and we’re already &lt;em&gt;above 30%&lt;/em&gt; of our goal. This makes me quite optimistic for the effort. But of course we won’t succeed without the help of the wider open source and JavaScript community!&lt;/p&gt;

&lt;p&gt;There are still quite a lot of days left in the campaign. Tonight I’ll be flying back to Europe, and then we’ll focus on the next steps.&lt;/p&gt;

&lt;p&gt;One important area of attention is publishing more demos and examples of NoFlo in real-world use. I hope by early next week we’ll be able to show a few applications running on both browser and Node.js. I will also publish our flow-based port of the &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll static site generator&lt;/a&gt;. These should help people getting started with this style of programming.&lt;/p&gt;

&lt;p&gt;We also have quite a lot of content lined up and waiting for editing. Something of interest to everybody working with flow-based or functional programming will be the long cut of the interview we made with &lt;a href=&quot;http://en.wikipedia.org/wiki/John_Paul_Morrison&quot;&gt;J. Paul Morrison&lt;/a&gt;, the father of FBP. My hope is that video will be live by the end of the next week.&lt;/p&gt;

&lt;p&gt;If you’re interested in the developments, make sure to follow NoFlo on &lt;a href=&quot;https://twitter.com/noflo&quot;&gt;Twitter&lt;/a&gt;, &lt;a href=&quot;https://www.facebook.com/noflo&quot;&gt;Facebook&lt;/a&gt;, or &lt;a href=&quot;https://plus.google.com/u/0/112372998187205178398&quot;&gt;Google+&lt;/a&gt;. If you back &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;our campaign&lt;/a&gt;, you’ll also receive the updates via Kickstarter.&lt;/p&gt;

&lt;p&gt;Thanks everybody for helping to make this possible! Keep spreading the world and giving &lt;a href=&quot;http://www.kickstarter.com/projects/noflo/noflo-development-environment&quot;&gt;your support&lt;/a&gt;!&lt;/p&gt;
</description>
      <pubDate>Thu, 01 Aug 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fnoflo-kickstarter-launch%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/noflo-kickstarter-launch/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/noflo-kickstarter-launch/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>NoFlo: two years of flow-based programming</title>
      <description>&lt;p&gt;&lt;a href=&quot;https://noflojs.org&quot;&gt;NoFlo&lt;/a&gt; — the flow-based programming system I started — is now two years old. I &lt;a href=&quot;https://github.com/noflo/noflo/commit/04698a77272d9cd552ac57ca511ec8f05696ea40&quot;&gt;pushed the first commits&lt;/a&gt; to GitHub on June 5th 2011 from &lt;a href=&quot;http://www.hackerdojo.com/&quot;&gt;Hacker Dojo&lt;/a&gt; in Mountain View. To get us started with the story, I’ll let &lt;a href=&quot;http://en.wikipedia.org/wiki/Flow-based_programming&quot;&gt;Wikipedia summarize&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Flow-based programming (FBP) is a programming paradigm that defines applications as networks of “black box” processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While flow-based programming is still far from mainstream, it has been great to watch to the community grow around NoFlo.&lt;/p&gt;

&lt;p&gt;There are several start-ups using it as their base infrastructure, with several of their engineers contributing to the open source effort. I’ve personally used the system for quite a wide range of tasks from &lt;a href=&quot;http://bergie.iki.fi/blog/8998693776/&quot;&gt;web services&lt;/a&gt; and &lt;a href=&quot;http://bergie.iki.fi/blog/business_analytics_with_couchdb_and_noflo/&quot;&gt;document transformations&lt;/a&gt; to handling payments and user on-boarding processes.&lt;/p&gt;

&lt;h2 id=&quot;why-i-started-noflo&quot;&gt;Why I started NoFlo&lt;/h2&gt;

&lt;p&gt;Two years ago I was undergoing a transition from PHP and Python to the JavaScript world, largely lured by the benefits of a &lt;a href=&quot;http://bergie.iki.fi/blog/the_universal_runtime/&quot;&gt;universal runtime&lt;/a&gt; and the event-based multi-protocol paradigm &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt; offers.&lt;/p&gt;

&lt;p&gt;While new programming languages and environments are easy to get into, this transition provided yet another point where I would have to sit down and port over all the little libraries and utilities I’ve grown to rely on over the years.&lt;/p&gt;

&lt;p&gt;I wondered if there could be a better way.&lt;/p&gt;

&lt;p&gt;To figure that out, I spent the time I had when traveling between conferences and hackathons of the &lt;a href=&quot;http://www.iks-project.eu/&quot;&gt;IKS Project&lt;/a&gt; reading various computer science papers on different programming paradigms. Eventually I stumbled upon some mentions of flow-based programming. I dug deeper, and finally read the canonical book on the subject — Paul Morrison’s &lt;a href=&quot;http://amzn.com/1451542321&quot;&gt;Flow-based programming, 2nd edition&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Having worked with component architectures and Unix pipes before, the idea resonated with me. To think things through, I took the excuse of having some meetings in Portland to &lt;a href=&quot;http://www.flickr.com/photos/bergie/sets/72157626665916769/&quot;&gt;drive up there&lt;/a&gt; following the beautiful &lt;a href=&quot;http://en.wikipedia.org/wiki/California_State_Route_1&quot;&gt;California 1&lt;/a&gt; coastal road. Couple of days alone in a car is a great way to let your mind flow!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/oregon-coast.jpg&quot; alt=&quot;The coastal road in Oregon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Implementing your own is usually the best method for learning a new concept, and so when I got back to the Bay Area, I decided to write an &lt;a href=&quot;https://noflojs.org&quot;&gt;FBP system of my own&lt;/a&gt; on Node.js.&lt;/p&gt;

&lt;p&gt;I also kept a &lt;a href=&quot;http://en.wikipedia.org/wiki/Qaiku&quot;&gt;Qaiku&lt;/a&gt; thread on the things I discovered, parts of which I later &lt;a href=&quot;http://bergie.iki.fi/blog/flow-based-programming-is-interesting/&quot;&gt;republished on this site&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;beyond-oop&quot;&gt;Beyond OOP&lt;/h2&gt;

&lt;p&gt;Object-oriented programming and Model-View-Controller have been the dominant programming paradigms since the desktop computing era of the 90s, even while the world has become more connected and multi-device. While these concepts did improve some things, the big promises of programmer productivity and component reuse have mostly been &lt;a href=&quot;http://blog.dmbcllc.com/object-oriented-programming-has-failed-us/&quot;&gt;left unrealised&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Software has &lt;a href=&quot;http://online.wsj.com/article/SB10001424053111903480904576512250915629460.html&quot;&gt;become one of the most important aspects&lt;/a&gt; of business and the society. As an effect, the demand for programmers &lt;a href=&quot;http://blog.nwjobs.com/careercenter/talking_code_demand_for_programmers_software_engineers_outstrips_supply.html&quot;&gt;vastly outstrips&lt;/a&gt; the amount of computer science graduates we’re able to produce.&lt;/p&gt;

&lt;p&gt;The tools side of things isn’t looking much better, either. While IDEs are admittedly improving all the time, most of the talented programmers have ditched them and moved back to the console-based editors of the 80s like vim and Emacs, many following the &lt;a href=&quot;http://blog.sanctum.geek.nz/unix-as-ide-introduction/&quot;&gt;Unix as your IDE&lt;/a&gt; idea. Clearly the productivity boost given by IDEs doesn’t yet match the overhead of using them.&lt;/p&gt;

&lt;p&gt;These areas are where flow-based programming can help.&lt;/p&gt;

&lt;h2 id=&quot;the-logic-is-in-the-graph&quot;&gt;The logic is in the graph&lt;/h2&gt;

&lt;p&gt;When we design software, we usually start by drawing boxes and arrows on a whiteboard. Later on these are then translated to actual software through various text files containing classes, methods, and configuration information.&lt;/p&gt;

&lt;p&gt;As the software evolves, people rarely go back to the original drawing and update it, effectively making the source code only place documenting how different pieces of a system fit together.&lt;/p&gt;

&lt;p&gt;With FBP, the logic of the software is designed as &lt;a href=&quot;http://en.wikipedia.org/wiki/Directed_graph&quot;&gt;a graph&lt;/a&gt; — much like a flowchart — and stays as a graph.&lt;/p&gt;

&lt;p&gt;The boxes of the graph depict various instances of reusable components, and the arrows the wiring connecting their ports together.&lt;/p&gt;

&lt;p&gt;The graph is what FBP systems like NoFlo execute, and it is also something that can be easily drawn on the screen, or even edited visually.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/fbp-ui/drawfbp-small.png&quot; alt=&quot;NoFlo graph in DrawFBP&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We humans &lt;a href=&quot;http://books.google.de/books?id=ffw6aBE-9ykC&amp;amp;lpg=PA1108&amp;amp;ots=baZIBoNyYI&amp;amp;dq=humans%20are%20visual%20creatures&amp;amp;pg=PA1108#v=onepage&amp;amp;q=humans%20are%20visual%20creatures&amp;amp;f=false&quot;&gt;are visual creatures&lt;/a&gt;. We are much better at recognizing shapes and visual connections than at finding them from a jumble of text files.&lt;/p&gt;

&lt;p&gt;Each node (or &lt;em&gt;process&lt;/em&gt; in FBP terminology) of a graph is an instance of a component. Just like objects in OOP can receive and react to messages (&lt;em&gt;method calls&lt;/em&gt;), NoFlo components react to packets they receive through their input ports, process them, and eventually send something to their output ports.&lt;/p&gt;

&lt;p&gt;The graph decides where the output is sent, meaning that the overall behavior of a program can be modified by just rewiring some of these connections. In traditional OOP the connections between various objects are usually hardcoded, or managed by a complicated &lt;a href=&quot;http://en.wikipedia.org/wiki/Dependency_injection&quot;&gt;dependency injection&lt;/a&gt; systems.&lt;/p&gt;

&lt;h2 id=&quot;component-reuse&quot;&gt;Component reuse&lt;/h2&gt;

&lt;p&gt;Because FBP components are just black boxes performing some well-defined task on incoming packets, they can be connected with each other in multitude of different ways to produce a different behaviour. This gives FBP systems a much better scale of code reuse than traditional OOP or procedural environments.&lt;/p&gt;

&lt;p&gt;As an example, my typical NoFlo applications only contain some 5-15% of components written specifically for that project. The rest are all coming from the &lt;a href=&quot;https://npmjs.org/browse/depended/noflo&quot;&gt;growing ecosystem&lt;/a&gt; of ready-made NoFlo components.&lt;/p&gt;

&lt;p&gt;Writing and &lt;a href=&quot;http://bergie.iki.fi/blog/distributing-noflo-components/&quot;&gt;publishing components&lt;/a&gt; is already quite easy, and is becoming even faster and more reliable through tools like the &lt;a href=&quot;https://github.com/noflo/grunt-init-noflo&quot;&gt;Grunt component scaffolder&lt;/a&gt; and &lt;a href=&quot;https://github.com/noflo/noflo-test&quot;&gt;noflo-test&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The more components are out there the less time we need to spend writing code, and the more we can focus on designing the software logic itself.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;noflo-on-the-browser&quot;&gt;NoFlo on the browser&lt;/h2&gt;

&lt;p&gt;Apart of better tooling and more components, the other big improvement in NoFlo has been support for running FBP programs on the client. Originally NoFlo was designed for server-side flows, but thanks to the improving &lt;a href=&quot;http://bergie.iki.fi/blog/sharing-javascript-libraries-node-browser/&quot;&gt;client-side Component ecosystem&lt;/a&gt;, it became feasible to expose the environment also to web browsers.&lt;/p&gt;

&lt;p&gt;This is keeping true with the promises of the universal runtime. With the next release of NoFlo, flow-based programs can be run on pretty much any computing device, whether a Node.js equipped web server, or a smartphone with a browser.&lt;/p&gt;

&lt;p&gt;The ability to run client-side flow-based programs presents new opportunities. There is a tradition of using tools like &lt;a href=&quot;http://www.filterforge.com/features/editor.html&quot;&gt;FilterForge&lt;/a&gt; for visual effects, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Quartz_Composer&quot;&gt;Quartz Composer&lt;/a&gt; for user interaction design. As a matter of fact, &lt;a href=&quot;https://medium.com/the-year-of-the-looking-glass/af182add5a2f&quot;&gt;Facebook Home was designed using flow-based tools&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;…something like Facebook Home is completely beyond the abilities of Photoshop as a design tool. How can we talk about physics-based UIs and panels and bubbles that can be flung across the screen if we’re sitting around looking at static mocks? (Hint: we can’t.) It’s no secret that many of us on the Facebook Design team are avid users of Quartz Composer, a visual prototyping tool that lets you create hi-fidelity demos that look and feel like exactly what you want the end product to be.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since NoFlo graphs run on any device including the tablets and smartphones that the application being designed is likely to target, it can provide an even better environment for such prototyping. There are lots of opportunities for a new tool here, especially given that &lt;a href=&quot;http://www.fcp.co/final-cut-pro/news/932-will-the-end-of-apple-s-quartz-composer-finally-kill-off-final-cut-pro-7-and-its-plugins&quot;&gt;Quartz Composer’s future is quite uncertain&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We are already doing some work on &lt;a href=&quot;https://github.com/noflo/noflo/issues/66&quot;&gt;visual interaction components for NoFlo&lt;/a&gt;. This could be huge for NoFlo and FBP in general!&lt;/p&gt;

&lt;h2 id=&quot;ui-is-the-missing-part&quot;&gt;UI is the missing part&lt;/h2&gt;

&lt;p&gt;What we have with NoFlo is already a quite solid programming environment:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://noflojs.org&quot;&gt;Flow-based engine&lt;/a&gt; that works well in both browser and Node.js&lt;/li&gt;
  &lt;li&gt;Growing ecosystem of &lt;a href=&quot;https://npmjs.org/browse/depended/noflo&quot;&gt;reusable open source components&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Framework for quickly &lt;a href=&quot;https://github.com/noflo/grunt-init-noflo&quot;&gt;scaffolding&lt;/a&gt; and &lt;a href=&quot;https://github.com/noflo/noflo-test&quot;&gt;testing&lt;/a&gt; new components&lt;/li&gt;
  &lt;li&gt;Domain-specific language for &lt;a href=&quot;https://github.com/noflo/fbp#language-for-flow-based-programming&quot;&gt;defining NoFlo graphs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the missing part is a tool that would allow viewing and editing NoFlo graphs visually. Sure, &lt;a href=&quot;http://www.jpaulmorrison.com/cgi-bin/wiki.pl?DrawFBP&quot;&gt;DrawFBP&lt;/a&gt; is there, and can be used with NoFlo. But something fitting modern touchscreen interactions and more connected to the live graphs would be better.&lt;/p&gt;

&lt;p&gt;I did some prototypes on this with &lt;a href=&quot;https://github.com/noflo/noflo-ui&quot;&gt;noflo-ui&lt;/a&gt;, and wrote down &lt;a href=&quot;http://bergie.iki.fi/blog/inspiration-for-fbp-ui/&quot;&gt;bunch of thoughts&lt;/a&gt; on how the graphs would be best shown. There has also been some collaboration with Forrest Oliphant of &lt;a href=&quot;http://meemoo.org/&quot;&gt;Meemoo&lt;/a&gt; fame.&lt;/p&gt;

&lt;p&gt;Last week I sat down with &lt;a href=&quot;http://www.behance.net/leightaylor&quot;&gt;Leigh Taylor&lt;/a&gt;, the original designer behind the &lt;a href=&quot;https://medium.com/&quot;&gt;Medium&lt;/a&gt; blogging platform, to go through the various ideas and concepts we had. Based on this we’re starting to have a quite solid design to continue working with.&lt;/p&gt;

&lt;p&gt;There will be more on that in the near future, but here is a sneak preview:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/fbp-ui/leigh-concept-small.jpg&quot; alt=&quot;Leigh&apos;s NoFlo UI concept&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;telling-the-story-of-noflo&quot;&gt;Telling the story of NoFlo&lt;/h2&gt;

&lt;p&gt;Apart from the user interface, the other important task ahead of us is to grow the community around NoFlo and FBP in general.&lt;/p&gt;

&lt;p&gt;This means producing better documentation, and explaining the concept in conferences and meetups. I gave &lt;a href=&quot;http://youtu.be/pgP4v9b5DvE&quot;&gt;a talk on NoFlo in JS.Everywhere 2011&lt;/a&gt;, but the project has moved quite far ahead since then.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/bergie-noflo-interview.jpg&quot; alt=&quot;Being interviewed on NoFlo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To tell the story of NoFlo and FBP we’re currently filming a set of interviews with the people involved from the different sides. We’re talking with NoFlo contributors, designers, and with people who have years (or even decades!) of experience with flow-based programming. This will hopefully come out next month.&lt;/p&gt;

&lt;p&gt;Expect also more posts and tutorials here &lt;a href=&quot;http://bergie.iki.fi/&quot;&gt;on my blog&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Wed, 05 Jun 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fnoflo-two-years%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/noflo-two-years/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/noflo-two-years/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>Automated linking with rich text editors</title>
      <description>&lt;p&gt;The web is built of links, of pages linking to other resources on the internet. But making those links manually is tedious. This is another area where &lt;a href=&quot;http://createjs.org&quot;&gt;modern inline editors&lt;/a&gt; could do better.&lt;/p&gt;

&lt;p&gt;Yesterday on Hacker News, there was a thread about &lt;a href=&quot;http://www.wikidata.org&quot;&gt;Wikidata&lt;/a&gt;, Wikimedia Foundation’s new knowledge base. &lt;a href=&quot;https://news.ycombinator.com/item?id=5627968&quot;&gt;This comment&lt;/a&gt; struck me especially:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I was using Wikipedia the other day and it occurred to me how primitive it is to have all the inner links to other Wikipedia articles defined manually, surely these should have been automated by now (i.e., marking a word or two would link you to the relevant article).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And indeed, this is a usability problem that can already be fixed with the &lt;a href=&quot;http://viejs.org/&quot;&gt;Semantic Interaction stack&lt;/a&gt; underneath Create.js.&lt;/p&gt;

&lt;h2 id=&quot;introducing-annotatejs&quot;&gt;Introducing Annotate.js&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/szabyg/annotate.js&quot;&gt;Annotate.js&lt;/a&gt;&lt;/strong&gt; is a VIE widget built by Szaby Grünwald. It works very similarly to a spell checker in traditional text editors — you write text, and it highlights the potential entities you might want to link to. You then can either accept or decline these link suggestions by clicking them. In case of multiple potential matches, you can also disambiguate between them by selecting from an offered list.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=zAMUpd6rb9k&amp;amp;feature=share&amp;amp;list=UUnPE7t9tqwcsO0LLyw5zuPQ&quot;&gt;Here is a quick video&lt;/a&gt; of Annotate.js in action:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/zAMUpd6rb9k?list=UUnPE7t9tqwcsO0LLyw5zuPQ&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;You can also try it yourself &lt;a href=&quot;http://szabyg.github.io/annotate.js/&quot;&gt;with an online demo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Currently Annotate.js &lt;a href=&quot;https://github.com/bergie/hallo/blob/master/src/plugins/annotate.coffee&quot;&gt;has been integrated&lt;/a&gt; with the &lt;a href=&quot;http://hallojs.org&quot;&gt;Hallo rich text editor&lt;/a&gt;, but it would be easy to do the same with other popular editors like Aloha and CKEditor.&lt;/p&gt;

&lt;h2 id=&quot;connecting-to-entities&quot;&gt;Connecting to entities&lt;/h2&gt;

&lt;p&gt;The big question with automatic linking is &lt;em&gt;where the entities come from&lt;/em&gt;. There are services like &lt;a href=&quot;http://www.opencalais.com/&quot;&gt;OpenCalais&lt;/a&gt; that can provide these suggestions for your content, but most of them are focused only on shared knowledge bases of big companies, famous people, and major cities.&lt;/p&gt;

&lt;p&gt;Unless you’re running a newspaper, it is unlikely that these are the things your content is about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://stanbol.apache.org/&quot;&gt;Apache Stanbol&lt;/a&gt;&lt;/strong&gt; is an open source engine that can provide the enhancements for you. Out of the box it provides suggestions based on the Wikipedia knowledge repository. But more importantly, you can feed it with your own entities.&lt;/p&gt;

&lt;p&gt;This way the enhancements you get for your content can be tuned to be meaningful to your content and your audience. If you write about medicine, they could be about symptoms and diseases, or if you’re writing about technology, they could be specific open source projects and their contributors. With Stanbol, the choice is yours.&lt;/p&gt;

&lt;p&gt;The current downside of Stanbol is that you’ll have to run it yourself, but there may be &lt;a href=&quot;http://signup.redlink.co/&quot;&gt;solutions coming for that as well&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;beyond-editing&quot;&gt;Beyond editing&lt;/h2&gt;

&lt;p&gt;Like &lt;a href=&quot;http://bergie.iki.fi/blog/never-lose-content/&quot;&gt;never losing your content&lt;/a&gt; or &lt;a href=&quot;http://bergie.iki.fi/blog/create-collections/&quot;&gt;managing collections&lt;/a&gt;, Annotate.js shows what we can do to improve the editing experience when we interact with it in a &lt;em&gt;semantically meaningful&lt;/em&gt; manner.&lt;/p&gt;

&lt;p&gt;What Annotate.js does is not merely creating links, but it also marking the machine-readable relationship between them and the HTML content being edited. This can then be used by yet another set of tools — like search engines — to understand and organize the content better.&lt;/p&gt;

&lt;p&gt;It is easy to see Create.js (like Drupal did, &lt;a href=&quot;http://drupal.org/node/1979784&quot;&gt;unfortunately&lt;/a&gt;) as just an easy way to add nice inline editing features to your CMS. However, while that is a good initial step, the addition of being able to interact with your content on the semantic level can do a lot more. Automated linking is just another demonstration of that.&lt;/p&gt;

&lt;p&gt;As the ecosystem around Create.js and VIE matures, and it ships in more systems, there will be things that we can’t even imagine now built on the stack.&lt;/p&gt;

&lt;p&gt;If your CMS is &lt;a href=&quot;http://bergie.iki.fi/blog/decoupling_content_management/&quot;&gt;properly decoupled&lt;/a&gt;, you can benefit from that immediately.&lt;/p&gt;
</description>
      <pubDate>Tue, 30 Apr 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fautomated-linking%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/automated-linking/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/automated-linking/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>Writing reusable, multi-platform JavaScript with Component</title>
      <description>&lt;p&gt;I’m currently in the process of porting the &lt;a href=&quot;https://noflojs.org&quot;&gt;NoFlo&lt;/a&gt; Flow-Based Programming environment to run also in the browser. While there are some obvious differences in things like filesystem interaction and component loading, the goal here is to reuse as much of the same code as possible between these two platforms.&lt;/p&gt;

&lt;p&gt;Many of the building blocks are already in place, and so the port should be complete still this week. You can track the work in &lt;a href=&quot;https://github.com/noflo/noflo/issues/63&quot;&gt;issue 63&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; the post below is mostly of historical value. Nowadays I would recommend using NPM for dependency management and &lt;a href=&quot;https://webpack.js.org&quot;&gt;Webpack&lt;/a&gt; for browser builds. For NoFlo, &lt;a href=&quot;https://github.com/noflo/grunt-noflo-browser&quot;&gt;grunt-noflo-browser&lt;/a&gt; provides automation for this.&lt;/p&gt;

&lt;h2 id=&quot;a-fragmented-ecosystem&quot;&gt;A fragmented ecosystem&lt;/h2&gt;

&lt;p&gt;The current client-side JavaScript ecosystem is quite fragmented. While on general level any code can be used anywhere, there are many different approaches at packaging, code loading, and templating. In many ways this resembles the PHP landscape before &lt;a href=&quot;http://bergie.iki.fi/blog/composer_solves_the_php_code-sharing_problem/&quot;&gt;Composer solved the problem there&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On Node.js we haven’t had this problem for a while, as &lt;a href=&quot;https://npmjs.org/&quot;&gt;NPM&lt;/a&gt; provides an excellent way to share and install code. With more than 27000 modules available, it is truly the default solution for JavaScript package management server-side. Some frameworks like Meteor tried to deviate from this by introducing their own package managers, but eventually &lt;a href=&quot;http://meteor.com/blog/2013/04/04/meteor-060-brand-new-distribution-system-app-packages-npm-integration&quot;&gt;came back to the fold&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;module-definitions&quot;&gt;Module definitions&lt;/h3&gt;

&lt;p&gt;There are many different ways for handling loading and encapsulation of JavaScript code. The &lt;a href=&quot;http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html&quot;&gt;module pattern&lt;/a&gt; is quite popular building block. Many also expose their code as &lt;a href=&quot;http://plugins.jquery.com/&quot;&gt;jQuery plugins&lt;/a&gt; even though that really only makes sense or DOM handling.&lt;/p&gt;

&lt;p&gt;Here is how you would define a jQuery plugin:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(function ($) {
  $.fn.somePlugin = function () {
    // some code here
  };
})(jQuery);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Some efforts towards standardization have been made, including the &lt;a href=&quot;http://requirejs.org/docs/whyamd.html&quot;&gt;Asynchronous Module Definition&lt;/a&gt; spec, and the synchronous &lt;a href=&quot;http://dailyjs.com/2010/10/18/modules/&quot;&gt;CommonJS module&lt;/a&gt; spec that Node.js also uses.&lt;/p&gt;

&lt;p&gt;Here is how an AMD wrapper for code looks like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;define(&apos;somePlugin&apos;, [&apos;jquery&apos;], function ($) {
  return function () {
    // some code here
  };
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The CommonJS definition for something similar would be the following. This will look familiar to Node.js developers:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var $ = require(&apos;jquery&apos;);
exports.someFunction = function () {
  // some code here
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Harmony is the proposed next generation of the JavaScript language, and it includes a &lt;a href=&quot;http://wiki.ecmascript.org/doku.php?id=harmony:modules&quot;&gt;new module syntax&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module &apos;myModule&apos; {
  import &apos;jquery&apos; as $;
  export function someFunction () {
    // some code here
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is no wonder many developers feel a bit lost on how they should expose their code or widgets!&lt;/p&gt;

&lt;p&gt;The Harmony module spec may eventually harmonize this, but it will take a while before you can actually ship code like that for even a reasonably majority of browsers.&lt;/p&gt;

&lt;h3 id=&quot;module-installation-and-loading&quot;&gt;Module installation and loading&lt;/h3&gt;

&lt;p&gt;Once you’ve picked the module pattern to follow, the next question is how to actually get your dependencies installed.&lt;/p&gt;

&lt;p&gt;The traditional way is to fetch “known good” versions of the libraries, add them to your project repository, and then just include each library with its own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;script&lt;/code&gt; tag. But this means having to maintain all the libraries in your own project, and cluttering your repository and change log with them.&lt;/p&gt;

&lt;p&gt;A variant of this is loading common libraries from a Content Delivery Network &lt;a href=&quot;https://developers.google.com/speed/libraries/&quot;&gt;like Google&lt;/a&gt;. This has the advantage that your users won’t have to download something like jQuery separately from each web server, and that you don’t need to duplicate the library files in your own code repository. But at the same time, this relies on the CDN provider not breaking things, and complicates offline usage.&lt;/p&gt;

&lt;p&gt;And you still have to write &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;script&lt;/code&gt; tag for each of them.&lt;/p&gt;

&lt;h4 id=&quot;bower&quot;&gt;Bower&lt;/h4&gt;

&lt;p&gt;Twitter’s &lt;a href=&quot;http://twitter.github.io/bower/&quot;&gt;Bower package manager&lt;/a&gt; aims to help with dependency management. You declare the libraries your code needs in a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;component.json&lt;/code&gt; file, run Bower, and you’ll get the correct versions downloaded to your system.&lt;/p&gt;

&lt;p&gt;Bower only handles dependency resolution and downloading, and so you’ll still be writing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;script&lt;/code&gt; tags for all modules you installed. But at least this allows you to keep the library files out of your repository.&lt;/p&gt;

&lt;h4 id=&quot;requirejs-and-volo&quot;&gt;Require.js and volo&lt;/h4&gt;

&lt;p&gt;The &lt;a href=&quot;http://requirejs.org/&quot;&gt;Require.js&lt;/a&gt; project seeks to solve this by handling module loading for you in an automated manner. They even provide the &lt;a href=&quot;http://volojs.org/&quot;&gt;volo package manager&lt;/a&gt; for installing all the libraries you need.&lt;/p&gt;

&lt;p&gt;Require.js is a quite popular way of solving this, but means that you will need to follow the Asynchronous Module Definition specification with your code.&lt;/p&gt;

&lt;h4 id=&quot;component&quot;&gt;Component&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/component/component&quot;&gt;Component&lt;/a&gt; is a newer solution for this started by TJ Holowaychuk of &lt;a href=&quot;http://expressjs.com&quot;&gt;Express&lt;/a&gt; and &lt;a href=&quot;http://visionmedia.github.io/mocha/&quot;&gt;Mocha&lt;/a&gt; fame.&lt;/p&gt;

&lt;p&gt;The system is explained a lot better in &lt;a href=&quot;http://tjholowaychuk.com/post/27984551477/components&quot;&gt;the introductory blog post&lt;/a&gt;, but in nutshell Component is a combination of a package manager and a module loading system based on CommonJS.&lt;/p&gt;

&lt;p&gt;With Component you can easily write and distribute reusable JavaScript modules, including user interface components that may include HTML templates and CSS. There is a &lt;a href=&quot;http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component&quot;&gt;component writing tutorial&lt;/a&gt; available.&lt;/p&gt;

&lt;p&gt;The Component installer will pull all the dependencies for you, and construct a single, easy-to-include JavaScript file out of them and your own code. &lt;em&gt;If you want to think of it in that way, this is sort of similar to &lt;a href=&quot;http://getcomposer.org/doc/01-basic-usage.md#autoloading&quot;&gt;Composer generating an autoload file&lt;/a&gt; for PHP code&lt;/em&gt;.&lt;/p&gt;

&lt;h3 id=&quot;which-to-choose&quot;&gt;Which to choose?&lt;/h3&gt;

&lt;p&gt;Given the multitude of options available, it can be &lt;a href=&quot;http://stackoverflow.com/questions/14967521/what-is-the-difference-between-component-and-bower&quot;&gt;hard to choose&lt;/a&gt; which one to go with. Eventually a winner may emerge, but in the meanwhile, my approach is the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Component&lt;/strong&gt; for client-side libraries and widgets&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;NPM&lt;/strong&gt; for Node.js libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If I was just writing client-side code, Require.js and volo may have been just as good option, at least if I want to deal with AMD.&lt;/p&gt;

&lt;p&gt;However, the big advantage of Component is that it is based on CommonJS modules, which Node.js also uses. With it, I can share library code a lot more easily between browser and the server, the two main platforms of the &lt;a href=&quot;http://bergie.iki.fi/blog/the_universal_runtime/&quot;&gt;Universal Runtime&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;CommonJS modules run nicely in the browser, on Node.js, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions&quot;&gt;other server-side JavaScript runtimes&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;writing-a-multi-platform-library&quot;&gt;Writing a multi-platform library&lt;/h2&gt;

&lt;p&gt;Writing widgets with Component is covered nicely in the &lt;a href=&quot;http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component&quot;&gt;building a date picker component&lt;/a&gt; tutorial, and so I’m focusing on how to build more general-purpose libraries here.&lt;/p&gt;

&lt;h3 id=&quot;getting-component&quot;&gt;Getting Component&lt;/h3&gt;

&lt;p&gt;The first step with Component is getting the tooling in place. Component — like most of the JavaScript dependency managers — is written on top of &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt;. It would be possible to implement the &lt;a href=&quot;https://github.com/component/component/wiki/Spec&quot;&gt;Component spec&lt;/a&gt; in other languages for easier integration in their native toolchain, but for now Node.js is what you must install.&lt;/p&gt;

&lt;p&gt;Once you have Node.js running, getting the Component tools is easy:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ sudo npm install -g component
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will give you the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;component&lt;/code&gt; command. You can run it to see the functionality it provides.&lt;/p&gt;

&lt;h3 id=&quot;finding-dependencies&quot;&gt;Finding dependencies&lt;/h3&gt;

&lt;p&gt;The next step is to find the libraries you need. Quite a lot of libraries and widgets are already available, and can be found from &lt;a href=&quot;https://github.com/component/component/wiki/Components&quot;&gt;the Component Wiki&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also use the Component command to look up modules:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ component search underscore

component/underscore
url: https://github.com/component/underscore
desc: JavaScript&apos;s functional programming helper library.

nathan7/memoize
url: https://github.com/nathan7/memoize
desc: underscore&apos;s memoize
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, the components use a “GitHub-like” naming scheme of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;vendor&amp;gt;/&amp;lt;module&amp;gt;&lt;/code&gt;. This is again similar to vendor names in Composer:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The package name consists of a vendor name and the project’s name. Often these will be identical - the vendor name just exists to prevent naming clashes. It allows two different people to create a library named json, which would then just be named igorw/json and seldaek/json.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since &lt;a href=&quot;https://noflojs.org&quot;&gt;NoFlo&lt;/a&gt; relies heavily on Node’s &lt;a href=&quot;http://nodejs.org/api/events.html&quot;&gt;event API&lt;/a&gt;, we need to find an equivalent library for Component. After a quick look through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;component search events&lt;/code&gt;, it turns out &lt;a href=&quot;https://github.com/component/emitter&quot;&gt;component/emitter&lt;/a&gt; does the job.&lt;/p&gt;

&lt;h3 id=&quot;the-componentjson-file&quot;&gt;The component.json file&lt;/h3&gt;

&lt;p&gt;Each Component module must provide a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;component.json&lt;/code&gt; file where you declare things like the name of the package, the version number, the software license, the files provided, and the possible dependencies. This is quite similar to the &lt;a href=&quot;http://package.json.nodejitsu.com/&quot;&gt;package.json file in NPM&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m using a very simplified version of NoFlo’s Graph class as the example here, so I can call the library &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bergie/graph&lt;/code&gt;. Like most JavaScript libraries, this will be under the &lt;a href=&quot;http://en.wikipedia.org/wiki/MIT_License&quot;&gt;MIT license&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
  &quot;name&quot;: &quot;graph&quot;,
  &quot;repo&quot;: &quot;bergie/graph&quot;,
  &quot;description&quot;: &quot;Simple graph class&quot;,
  &quot;license&quot;: &quot;MIT&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;scripts&quot;: [
    &quot;graph.js&quot;
  ],
  &quot;dependencies&quot;: {
    &quot;component/emitter&quot;: &quot;*&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For Node.js support you’ll also need a corresponding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;package.json&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
  &quot;name&quot;: &quot;graph&quot;,
  &quot;description&quot;: &quot;Simple graph class&quot;,
  &quot;main&quot;: &quot;./graph.js&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once the dependencies are declared, run the installation:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ component install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The example only uses Node.js’s built-in libraries, so NPM installation is not yet needed. If you add third-party libraries, you need to install them also:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ npm install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;module-code&quot;&gt;Module code&lt;/h3&gt;

&lt;p&gt;Writing a Component module is very similar to writing Node.js modules. Create the file we just declared in the JSON file and open it in your favourite editor.&lt;/p&gt;

&lt;p&gt;Since we’re aiming for multi-platform code, the main difference is dealing with platform-specific differences. For example, the event emitter library in Node.js is called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;events&lt;/code&gt;, and the Component equivalent is called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;emitter&lt;/code&gt;.Luckily their APIs are exactly the same, so we only have to do loading conditionally:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var EventEmitter;
if (typeof process === &apos;object&apos; &amp;amp;&amp;amp; process.title === &apos;node&apos;) {
  // Node.js
  EventEmitter = require(&apos;events&apos;).EventEmitter;
} else {
  // Browser
  EventEmitter = require(&apos;emitter&apos;);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This way, we have the correct event emitter implementation available for our code. Now we just create a constructor function to inherit from that:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// The constructor, just call &quot;super&quot;
function Graph () {
  this.nodes = [];
  EventEmitter.call(this);
}

// Set up inheritance
Graph.prototype = Object.create(EventEmitter.prototype);

// Define methods
Graph.prototype.addNode = function (name) {
  this.nodes.push(name);
  this.emit(&apos;node&apos;, name);
};
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once the code is there, we need to expose it as a CommonJS module:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module.exports = Graph;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;running-the-module-in-nodejs&quot;&gt;Running the module in Node.js&lt;/h3&gt;

&lt;p&gt;For Node, this is all we need to do to be able to use our Graph as a module:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// Include the module
var Graph = require(&apos;./graph&apos;);

// Instantiate
var g = new Graph();

// Hook into events
g.on(&apos;node&apos;, function (name) {
  console.log(&quot;Node added &quot; + name);
});

// Call a method
g.addNode(&apos;Foo&apos;);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running this should end up with message &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Node added Foo&lt;/code&gt; shown on the console.&lt;/p&gt;

&lt;h3 id=&quot;running-the-module-in-browser&quot;&gt;Running the module in browser&lt;/h3&gt;

&lt;p&gt;To be able to run the module in the browser, we need to run Component’s build process.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ component build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will generate a JavaScript file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;build/build.js&lt;/code&gt; which provides CommonJS module loading support, and all the JavaScript code we’ve declared in the JSON file.&lt;/p&gt;

&lt;p&gt;Now you can include that file in your HTML, and start using the Graph module:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;
    &amp;lt;script src=&quot;./build/build.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
      var Graph = require(&apos;graph/graph.js&apos;);
      var g = new Graph();
      g.on(&apos;node&apos;, function (name) {
        alert(&quot;Node added &quot; + name);
      });
      g.addNode(&apos;foo&apos;);
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Component can be used for solving the JavaScript code-sharing problem. They let you build full applications out of smaller, reusable modules. And thanks to the CommonJS module specification, it is quite easy to write these modules in away which enables them to be used also under Node.js and other JavaScript runtimes.&lt;/p&gt;

&lt;p&gt;This post, and the &lt;a href=&quot;http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component&quot;&gt;date picker tutorial&lt;/a&gt; should give you enough information needed for starting to decouple your front-end applications, and to participate in the emerging &lt;a href=&quot;https://github.com/component/component/wiki/Components&quot;&gt;open source Component ecosystem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Even with more than &lt;a href=&quot;https://twitter.com/tjholowaychuk/status/316267708381528064&quot;&gt;800 components available&lt;/a&gt;, it is too early to declare Component the winner in the front-end dependency management space, but it is a well-designed system that works quite well.&lt;/p&gt;

&lt;p&gt;I will be utilizing Component for some of my &lt;a href=&quot;https://github.com/bergie&quot;&gt;JavaScript projects&lt;/a&gt; in the future.&lt;/p&gt;
</description>
      <pubDate>Thu, 11 Apr 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fsharing-javascript-libraries-node-browser%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/sharing-javascript-libraries-node-browser/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/sharing-javascript-libraries-node-browser/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>Create.js in 2013</title>
      <description>&lt;p&gt;It is now 2013, and the &lt;a href=&quot;http://www.iks-project.eu/&quot;&gt;IKS project&lt;/a&gt;, started &lt;a href=&quot;http://bergie.iki.fi/blog/starting_the_interactive_knowledge_project/&quot;&gt;back in 2009&lt;/a&gt; to improve content management systems through semantic technologies, has ended. Alongside &lt;a href=&quot;http://stanbol.apache.org/&quot;&gt;Apache Stanbol&lt;/a&gt; and &lt;a href=&quot;http://viejs.org/&quot;&gt;VIE.js&lt;/a&gt;, the &lt;a href=&quot;http://createjs.org&quot;&gt;Create.js&lt;/a&gt; inline editing toolkit was one of the major outcomes of this European Union funded effort.&lt;/p&gt;

&lt;p&gt;This post outlines the current state of Create, and some of the things that will be happening around it in 2013.&lt;/p&gt;

&lt;h2 id=&quot;increased-cms-adoption&quot;&gt;Increased CMS adoption&lt;/h2&gt;

&lt;p&gt;Thanks to being picked up by major CMSs like &lt;a href=&quot;http://drupal.org/&quot;&gt;Drupal 8&lt;/a&gt;, &lt;a href=&quot;http://neos.typo3.org/&quot;&gt;TYPO3 Neos&lt;/a&gt;, &lt;a href=&quot;http://midgard-project.org/&quot;&gt;Midgard&lt;/a&gt;, &lt;a href=&quot;http://cmf.symfony.com/&quot;&gt;Symfony CMF&lt;/a&gt; and &lt;a href=&quot;http://www.opencms.org/en/&quot;&gt;OpenCms&lt;/a&gt; for their inline editing needs, Create.js is experiencing very strong adoption. Many of these CMSs will be shipping a new major version during 2013.&lt;/p&gt;

&lt;p&gt;These releases will bring Create.js into millions of sites out there, giving users a friendlier and faster way to edit the web. By being built on the semantic interaction framework of VIE, this also means a significant expansion of the RDFa &lt;a href=&quot;http://www.w3.org/standards/semanticweb/data&quot;&gt;Linked Data&lt;/a&gt; base.&lt;/p&gt;

&lt;p&gt;This amount of new users will be staggering, meaning that we will need to put a lot of focus into stability and ease-of-use of the toolkit. To make life for new integrators and &lt;a href=&quot;http://www.ohloh.net/p/midgardcreate/contributors?sort=latest_commit&quot;&gt;contributors&lt;/a&gt; easier, we will also need to improve the &lt;a href=&quot;http://createjs.org/guide/&quot;&gt;documentation&lt;/a&gt; and test coverage. All of this is shown also by the fact that &lt;a href=&quot;https://github.com/bergie/create&quot;&gt;Create.js on GitHub&lt;/a&gt; has climbed from few hundred watchers a year ago to nearly 1400 today.&lt;/p&gt;

&lt;h2 id=&quot;any-editor-you-want&quot;&gt;Any editor you want&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;http://bergie.iki.fi/blog/introducing_the_midgard_create_user_interface/&quot;&gt;first versions of Create.js&lt;/a&gt; were written exclusively with the &lt;a href=&quot;http://aloha-editor.org/&quot;&gt;Aloha Editor&lt;/a&gt; in mind. Later on we added support for &lt;a href=&quot;http://hallojs.org/&quot;&gt;Hallo.js&lt;/a&gt; in order to provide a simpler, MIT-licensed alternative. However, the needs of CMSs change and new promising editors are released.&lt;/p&gt;

&lt;p&gt;With this in mind, we received a contribution from the OpenCms team to have a more generic editor abstraction allowing integration of any new editors that CMSs may want to integrate. With it, the latest versions of Create.js support also &lt;a href=&quot;http://imperavi.com/redactor/&quot;&gt;Redactor&lt;/a&gt; and &lt;a href=&quot;http://ckeditor.com/&quot;&gt;CKEditor 4&lt;/a&gt; alongside Aloha and Hallo.&lt;/p&gt;

&lt;p&gt;The utility of this abstraction layer was proven recently when &lt;a href=&quot;http://buytaert.net/from-aloha-to-ckeditor&quot;&gt;Drupal switched&lt;/a&gt; from Aloha to CKEditor.&lt;/p&gt;

&lt;p&gt;Hallo.js:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-editors/hallo.png&quot; alt=&quot;Create.js with Hallo Editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Aloha Editor:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-editors/aloha.png&quot; alt=&quot;Create.js with Aloha Editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;CKEditor:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-editors/ckeditor.png&quot; alt=&quot;Create.js with CKEditor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Redactor:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-editors/redactor.png&quot; alt=&quot;Create.js with Redactor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In addition to the editors we now support, integrators can use the reasonably simple &lt;a href=&quot;https://github.com/bergie/create/tree/master/src/editingWidgets&quot;&gt;property editor API&lt;/a&gt; to implement their own editors when needed. For example, Drupal provides a &lt;a href=&quot;http://drupalcode.org/project/edit.git/blob/06e86c82ab5412ef1f78aea343dbe0f9cbd16867:/js/createjs/editingWidgets/formwidget.js&quot;&gt;custom editor widget&lt;/a&gt; that utilizes forms rendered on the server side for editing more complex field types.&lt;/p&gt;

&lt;h2 id=&quot;new-default-ui&quot;&gt;New default UI&lt;/h2&gt;

&lt;p&gt;As many of you probably know, Create.js can be used on two levels: as a full inline editing interface, or as a set of components for building your own editing UI.&lt;/p&gt;

&lt;p&gt;In the latter part of 2012, much of focus was put into the components themselves, as that is the way most CMSs leverage Create. But the default user interface is also important, and so I have been collaborating with the Berlin-based designer &lt;a href=&quot;http://marie-schweiz.de/&quot;&gt;Marie Schweiz&lt;/a&gt; to improve the user experience of stock Create.js. This work is still in the concept stage, but I’m quite happy with the direction we’re headed.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-ui-2013-editing.png&quot; alt=&quot;Editing text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;One important concern to tackle with the new UI is handling of non-visible metadata and the other concerns raised by &lt;a href=&quot;http://www.lullabot.com/articles/inline-editing-and-cost-leaky-abstractions&quot;&gt;Lullabot’s excellent critique&lt;/a&gt; of inline editing. Here you can see some of that in action:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-ui-2013-metadata.png&quot; alt=&quot;Editing geolocation&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Other important parts is to use colored indicators for showing what can be edited, and its state (published, untranslated, etc.), and to make the process of &lt;a href=&quot;http://bergie.iki.fi/blog/create-collections/&quot;&gt;adding new content&lt;/a&gt; clearer:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-ui-2013-create.png&quot; alt=&quot;Adding items&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Clear visuals and bigger touch targets should also make the new UI friendlier for tablets and other new touchscreen devices.&lt;/p&gt;

&lt;h2 id=&quot;new-editing-tools&quot;&gt;New editing tools&lt;/h2&gt;

&lt;p&gt;The main purpose of Create.js is to enable inline editing of textual content, but even in the &lt;a href=&quot;http://bergie.iki.fi/blog/introducing_the_midgard_create_user_interface/&quot;&gt;original versions&lt;/a&gt; we had additional features like image handling and versioning that most CMSs need.&lt;/p&gt;

&lt;p&gt;Adding more functionality related to non-textual content is highly useful, and something that ought to go hand-in-hand with the new UI effort. In the new default UI we have a large overlay (seen in blue in the geolocation editor) that can be used for new interesting editing features, like better image pickers, or even editing images and videos to be inserted to a page.&lt;/p&gt;

&lt;p&gt;Another idea I’ve been toying around has been a more semantic way of handling tables. Instead of editing tables in the traditional WYSIWYG way, how about making queries to your CMS system and then presenting the data in tabular manner? &lt;a href=&quot;http://aloha-editor.org/guides/plugin_block.html&quot;&gt;Aloha’s Blocks feature&lt;/a&gt; can give a lot of inspiration here.&lt;/p&gt;

&lt;h2 id=&quot;getting-involved&quot;&gt;Getting involved&lt;/h2&gt;

&lt;p&gt;In 2013 the development of Create.js should happen in a lot more community-driven manner. Given the massive adoption of the library, this shouldn’t be a problem.&lt;/p&gt;

&lt;p&gt;If you’re interested in getting involved, take a look at &lt;a href=&quot;https://github.com/bergie/create&quot;&gt;the repository on GitHub&lt;/a&gt;, file &lt;a href=&quot;https://github.com/bergie/create/issues?state=open&quot;&gt;issues&lt;/a&gt;, and send &lt;a href=&quot;http://github.com/guides/pull-requests&quot;&gt;pull requests&lt;/a&gt;. The most immediate concern is getting the &lt;a href=&quot;https://github.com/bergie/create/issues?milestone=1&amp;amp;page=1&amp;amp;state=open&quot;&gt;1.0.0 stable&lt;/a&gt; out of the door, which should be helped greatly by the recently-released &lt;a href=&quot;https://groups.google.com/d/topic/viejs/RYKfp0Fhuag/discussion&quot;&gt;VIE 2.1.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For discussing both development and integration of Create.js, the &lt;a href=&quot;http://groups.google.com/group/createjs&quot;&gt;Create.js Google Group&lt;/a&gt; and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#iks&lt;/code&gt; IRC channel on FreeNode are the best options. The &lt;a href=&quot;https://github.com/bergie/create/blob/master/CHANGES.md&quot;&gt;Create.js change log&lt;/a&gt; is also an important thing to watch.&lt;/p&gt;
</description>
      <pubDate>Sun, 06 Jan 2013 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fcreatejs-in-2013%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/createjs-in-2013/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/createjs-in-2013/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
    <item>
      
      <title>Create.js hackathon in Berlin</title>
      <description>&lt;p&gt;Last week we at &lt;a href=&quot;http://www.iks-project.eu/&quot;&gt;IKS&lt;/a&gt; organized a two-day hackathon for developers interested in &lt;a href=&quot;http://createjs.org&quot;&gt;Create.js&lt;/a&gt;, &lt;a href=&quot;http://viejs.org&quot;&gt;VIE&lt;/a&gt;, and in new tools for editing websites semantically.&lt;/p&gt;

&lt;p&gt;The original agenda for the event can be found from the &lt;a href=&quot;http://wiki.iks-project.eu/index.php/DevWorkshops/VieBerlin&quot;&gt;event’s wiki page&lt;/a&gt;, and I believe we got it covered quite well. I’ve been to quite a lot of hackfests, and usually the first day is mostly spent by people arriving, figuring out the WiFi setup, and getting to know the development tools. This time was different: people jumped straight into the code and started working.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-berlin-hackathon1.jpg&quot; alt=&quot;Create.js Berlin hackathon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The venue at &lt;a href=&quot;http://theseus-programm.de/de/tiz.php&quot;&gt;Theseus Innovationszentrum&lt;/a&gt;, arranged by &lt;a href=&quot;http://www.dfki.de/web&quot;&gt;DFKI&lt;/a&gt;, was a nice one. We had food, coffee, and fast connectivity. And the place even had toys like &lt;a href=&quot;http://youtu.be/A1QkA-yceic&quot;&gt;big touchscreen computers&lt;/a&gt; to try Create.js on. On the first evening we continued the event at the &lt;a href=&quot;http://c-base.org/&quot;&gt;c-base&lt;/a&gt; hackerspace, and the participants staying after Friday went to the &lt;a href=&quot;https://github.com/blog/1203-berlin-drinkup&quot;&gt;Berlin GitHub drinkup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-berlin-hackathon2.jpg&quot; alt=&quot;After-hackathon in c-base&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;more-robust-hallo-and-create&quot;&gt;More robust Hallo and Create&lt;/h2&gt;

&lt;p&gt;An important theme in the event was to improve both &lt;a href=&quot;http://hallojs.org/&quot;&gt;Hallo&lt;/a&gt; and Create. The Create.js theme got a lot nicer, and thanks to the contributions from &lt;a href=&quot;http://www.alkacon.com/en/&quot;&gt;Alkacon&lt;/a&gt; the next versions will run nicely also on older Internet Explorer and Opera versions.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-after-berlin-hackathon.png&quot; alt=&quot;Create.js after the hackathon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Create’s editor selection mechanism &lt;a href=&quot;https://github.com/bergie/create/issues/62&quot;&gt;was also rewritten&lt;/a&gt;. Now you can easily set up custom editor configurations for managing different content types. For instance:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// Set a simpler editor for title fields
jQuery(&apos;body&apos;).midgardCreate(&apos;configureEditor&apos;, &apos;title&apos;, &apos;halloWidget&apos;, {
  plugins: {
    halloformat: {}
  }
});
jQuery(&apos;body&apos;).midgardCreate(&apos;setEditorForProperty&apos;, &apos;dcterms:title&apos;, &apos;title&apos;);

// Disable editing of author fields
jQuery(&apos;body&apos;).midgardCreate(&apos;setEditorForProperty&apos;, &apos;dcterms:author&apos;, null);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In addition to the other activities, documentation in the &lt;a href=&quot;http://createjs.org/guide/&quot;&gt;Create.js Integration Guide&lt;/a&gt; also got a lot better.&lt;/p&gt;

&lt;h2 id=&quot;vie-and-literals&quot;&gt;VIE and literals&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;http://viejs.org&quot;&gt;VIE&lt;/a&gt; semantic interaction library is the basis of everything we’re doing in the &lt;a href=&quot;http://bergie.iki.fi/blog/decoupling_content_management/&quot;&gt;decoupled CMS&lt;/a&gt; space.&lt;/p&gt;

&lt;p&gt;Next big step for VIE is &lt;a href=&quot;https://github.com/bergie/VIE/issues/114&quot;&gt;better literals handling&lt;/a&gt;, which will allow a lot easier management of multilingual content. Several people were working on this in the hackathon, and I hope we’ll be able to release the first beta of VIE 2.1 with this soon.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-berlin-hackathon4.jpg&quot; alt=&quot;After-hackathon in a biergarten&quot; /&gt;&lt;/p&gt;

&lt;p&gt;VIE provides a quite comprehensive &lt;a href=&quot;http://viejs.org/docs/2.0.0/src/Type.js.html&quot;&gt;entity type system&lt;/a&gt;, which most systems don’t really utilize yet. To make its capabilities more apparent, I built an integration with the &lt;a href=&quot;https://github.com/powmedia/backbone-forms&quot;&gt;Backbone Forms&lt;/a&gt; library where you can autogenerate quite nice forms on for any type that VIE knows about. For instance, we can generate forms &lt;a href=&quot;http://viejs.org/widgets/forms/&quot;&gt;for Schema.org types&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This will be the key feature for implementing a &lt;a href=&quot;https://github.com/bergie/create/issues/59&quot;&gt;metadata editor&lt;/a&gt; in Create.js, and so it would be nice if CMSs would start providing their content type structure to VIE.&lt;/p&gt;

&lt;h2 id=&quot;new-cms-integrations&quot;&gt;New CMS integrations&lt;/h2&gt;

&lt;p&gt;Several of the hackathon attendees came there to work on integrating Create.js with their CMSs. While &lt;a href=&quot;http://createjs.org/guide/&quot;&gt;the documentation&lt;/a&gt; is getting better, it is still good to be able to help developers implement the necessary steps into their systems.&lt;/p&gt;

&lt;p&gt;An interesting new integration is &lt;a href=&quot;http://drupal.org/project/create&quot;&gt;with Drupal&lt;/a&gt;, worked on by Roni Kantis. While Drupal has their own &lt;a href=&quot;http://drupal.org/project/spark&quot;&gt;Spark&lt;/a&gt; inline editing initiative, the Create.js module should show that cross-CMS collaboration in user interfaces is also possible. I hope to be able to demo this in &lt;a href=&quot;http://munich2012.drupal.org/program/sessions/decoupling-content-management&quot;&gt;DrupalCon Munich&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-berlin-hackathon3.jpg&quot; alt=&quot;Defining CreatePHP interfaces&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For PHP projects interested in Create.js, the &lt;a href=&quot;https://github.com/flack/createphp&quot;&gt;CreatePHP&lt;/a&gt; library should make things a lot easier. In the hackathon its interfaces were clarified quite a bit, and now it powers the inline editing capabilities in both &lt;a href=&quot;http://midgard-project.org/midcom/&quot;&gt;MidCOM&lt;/a&gt; and &lt;a href=&quot;http://cmf.symfony.com/&quot;&gt;Symfony CMF&lt;/a&gt;, with &lt;a href=&quot;http://typo3.org/news/article/typo3-phoenix-becomes-iks-early-adaptor/&quot;&gt;TYPO3&lt;/a&gt; coming soon.&lt;/p&gt;

&lt;p&gt;If you consider &lt;a href=&quot;https://bergie.iki.fi/blog/my_secret_agenda_for_php_content_management_systems/&quot;&gt;my secret plan for PHP content management systems&lt;/a&gt; from last summer, there is clearly some progress.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/createjs-symfony-after-berlin-hackathon.png&quot; alt=&quot;Create.js in Symfony CMF&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There was also work done on integrations into popular frameworks like Ruby on Rails and Django. I hope we’ll hear more of these in the coming weeks.&lt;/p&gt;

&lt;h2 id=&quot;more-visibility-for-createjs-and-hallo&quot;&gt;More visibility for Create.js and Hallo&lt;/h2&gt;

&lt;p&gt;As more and more CMSs are embracing collaboration on the UI level, these projects are becoming quite popular. As I write this, Create.js has &lt;a href=&quot;https://github.com/bergie/create&quot;&gt;1062 watchers&lt;/a&gt; on GitHub, and Hallo &lt;a href=&quot;https://github.com/bergie/hallo&quot;&gt;has 664&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While watchers don’t necessarily mean more contributions, it is certainly nice to see views like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://d2vqpl3tx84ay5.cloudfront.net/github-coffeescript-noflo-hallo.png&quot; alt=&quot;Hallo and NoFlo on GitHub&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;wysiwhat&quot;&gt;WYSIWHAT&lt;/h2&gt;

&lt;p&gt;This week I also participated in the &lt;a href=&quot;https://www.sourcefabric.org/en/community/blog/1268/&quot;&gt;WYSIWHAT event&lt;/a&gt;, where &lt;a href=&quot;https://www.sourcefabric.org/en/&quot;&gt;Sourcefabric&lt;/a&gt; and &lt;a href=&quot;http://oerpub.org/&quot;&gt;OERPUB&lt;/a&gt; were discussing the approaches at rich-text editing of educational and large documents.&lt;/p&gt;

&lt;p&gt;The event is still ongoing, but it seems there is a lot of synergy between what we’re doing with &lt;a href=&quot;http://viejs.org&quot;&gt;VIE&lt;/a&gt; and &lt;a href=&quot;http://createjs.org&quot;&gt;Create.js&lt;/a&gt; and their efforts. I’m certainly looking forward to collaborating with them in the future!&lt;/p&gt;
</description>
      <pubDate>Tue, 24 Jul 2012 00:00:00 +0000</pubDate>
      <atom:link rel="payment" href="https://flattr.com/submit/auto?url=https%3A%2F%2Fbergie.iki.fi%2Fblog%2Fcreatejs-berlin-hackathon%2F&amp;user_id=bergie" type="text/html" />
      <link>https://bergie.iki.fi/blog/createjs-berlin-hackathon/</link>
      <guid isPermaLink="true">https://bergie.iki.fi/blog/createjs-berlin-hackathon/</guid>
      <author>henri.bergius@iki.fi (Henri Bergius)</author>
    </item>
    
  </channel>
</rss>
