The first week of our involvement in the Famo.us Private Beta has wrapped up.
Our goals for the week were:
- To learn the library
- To integrate Famous with Meteor
- To evaluate if it's something that we should invest further effort and attention — will it allow us to build better apps?
What is Famo.us?
After spending a week with it, I'd describe it as a fine-tuned, performant, JS-based web rendering engine. If you're primarily a web developer, it's probably unlike anything else you've used before. Infoworld did a nice writeup on it recently.
The Famo.us team has been cranking away building it for two years, and they're closing in on a public release.
In preparation for the release, and now that it's time to start building "real" apps, they've invited a small number of developers from the major modern JS app development frameworks (Ember, Angular, Meteor) to evaluate how ready they are, and what integration pains exist that could be remedied before opening the flood gates.
I was able to integrate it with Meteor quite easily, as were the other developers from other frameworks.
Spending a week with the Famo.us team was awesome. They are all very likable, super smart, and have a clear vision.
It was a little frustrating. I was trying to learn the layers of Famo.us, and I chose a project that was a bit too ambitious that early, and I didn't have a clear, specific vision for what I wanted to build. I decided to focus only on learning Famo.us, saving Meteor integration for day two.
Shallowly integrating Famo.us with Meteor only took me a few hours. My integration involved putting the Meteor files in the public directory of my Meteor app, which introduces some caching annoyances. Pro tip: there is a setting in Google Chrome that will disable the cache while developer tools are open.
I tried a few different things to make it better, but ultimately decided it was "good enough" and wanted to get back to learning Famo.us again.
Days three and four
I started a new project, famous-chat, which involved linking the data layers of Meteor to Famo.us, culminating in a multi-user demo that shows off the power of Meteor and the power of Famo.us together.
The result of my work is contained primarily in two 80-line files, one that describes how the chatBubble's behave, the other describes how the simulation behaves (i.e. how the bubbles interact with each other).
Check it out here: http://famous-chat.meteor.com (requires a computer or tablet screen)
This isn't a "famo.us quality" demo, it's the result of a couple of days of my personal exploration of famo.us. It does use Meteor real-time features, including a steady stream of updates from the server, collaborating with some Famo.us physics libraries — torque springs on the chat bubbles, a random amount of repulsion for each chat bubble, rotational drag on the spring, drag on the linear movement of the boxes.
In the course of the process I used a variety of Famo.us libraries such as Surface, View, RotationalDrag, TorqueSpring, Vector, Modifier, Matrix, Engine, EventHandler, PhysicsEngine, Walls, Repulsion, Drag, and PhysicsTracker. It's a lot to learn :)
I had the opportunity to meet one-on-one with some of the Famo.us team members, show them Meteor, and details of my sample app. Seems they are very keen on the possibilities of an elegant, lower-level Meteor integration.
I also spent time refactoring and improving the code I did write, so that I can commit it to a repo for reference by other Private Beta participants.
Integrating with Meteor
Right now, the Famo.us uses require.js, for the sake of simplicity. It's a simple method to ensure that you load only the parts of famous that are needed. But you need to declare which libraries each file uses.
They have a working version of a new packaging system that will analyze your code, and build a single file on demand, prior to running the app, which should remove that pain.
So if the perfect Meteor integration existed, it would likely consist of:
- Famous library loader, based on code analysis, pulling in only the parts of famous that my app needs.
- Famous/Meteor router and perhaps a higher level abstraction for templates that might allow Meteor developers to use handlebars templates, but rendered into a Famo.us-managed DOM rather than the "normal" DOM.
I agree that the Private Beta strategy is correct at this point. I look forward to a public release as soon as they're ready. It'll be good for them to get the community get more involved in fixing bugs (i.e. pull requests), improving documentation, and building tutorials and walkthroughs.
The great potential I saw in Famo.us has only been confirmed by my experience.
Differential will be back in January to continue the process of learning Famo.us, so we can put it into the apps we build.
Stay tuned :)