Hi all,
Maybe some of you remember me. I used to be the Chief Architect at famo.us, but left the company in August 2014. I was famo.us’ second engineer. When I first came in, I wrote the physics engine, and later was in charge of most of the codebase. After I left, famo.us decided to go in the mixed-mode direction and rewrote the framework.
What you may not know is that long ago I forked famo.us at version 0.3, and have taken it in my own direction since December 2014. There are now over 800 commits as I’ve been quietly restructuring the framework the way I would have liked it to be from the beginning. It’s still far from done, but the core ideas are there.
I’ve only now started to speak publicly about it. The fork is called SamsaraJS. It’s located here
The key difference from famo.us 0.3 is that it’s a lot more functional and stream-based. The render tree itself is actually one big stream, where nodes (formerly modifiers) act as stream transforms, and the stream exits in the DOM. It embraces more functional reactive programming principles, so you can write code that looks like
var transform = mouseInput
.pluck('value')
.map(function(value){
return Transform.translate(value);
}
var layoutNode = new LayoutNode({transform : transform})
In the above code, transform
is a stream, layoutNode
is a stream. It’s all streams. They all emit start
, update
and end
events, so hypothetically you can call
layoutNode.on('start', function(spec){
//spec = {transform : currentTransform}
}
though this pattern is only used internally. There are many more differences, and I’m happy to discuss them further. But wanted to give you guys a peek and see what your thoughts are. There’s also a pretty minimal website: www.samsaraJS.org
Dave