Famo.us 
Javascript Framework for any device 
@allenfantasy
Famo.us is… 
A Javascript framework, including: 
• A 3D layout engine can render to DOM, 
Canvas, WebGL 
• A 3D physics animation engine
Famo.us is NOT… 
• Backbone, Angular, Ember, … 
• Node.js, Koa, … 
• jQuery, Prototype, Mootools, …
http://disrupt.famo.us/periodic402/! 
! 
http://famous-bird.herokuapp.com/
Why Famo.us ? 
• 60 FPS on ANY device 
• Built-in Physics Engine 
• Built-in event mechanism 
• Lightweight (179kb minimized) 
• Javascript ONLY, NO CSS/HTML (if u want) 
• Open source & Community 
Build up mature, cross-device Web-App that 
can compete with Native App
Famo.us abstracts away DOM 
management by maintaining a 
representation called the Render Tree
HTML 
CSS! 
DOM 
jQuery! 
Prototype! 
[pure Javascript]! 
… 
Traditional Model
CSS 
Famo.us 
! 
Render Tree 
DOM 
HTML 
Famo.us Model
Render Tree 
• Abstraction of DOM 
• Context Root 
• Renderable Basic Unit of content 
• Modifier Control Renderable’s 
• style & position 
Context 
Renderable Modifier 
Renderable
Context 
Modifier 
Renderable 
Context 
Modifier Renderable 
Renderable
Renderable 
• Surface <div> 
• ContainerSurface <div> (Can have children) 
• InputSurface <input> 
• ImageSurface <image> 
• …
View 
• Contains a set of ‘node’s. 
• Represent part of the page 
• ‘Subtree’ in Render Tree 
Context 
Modifier 
Renderable 
View
Example 
Vertical alignment
floater
Context 
Surface! 
(<div>) 
Modifier
Layout 
HeaderFooterLayout GridLayout 
Header 
Content 
Footer
Layout 
Sequential Layout FlexibleLayout 
surface 1 
surface 3 
1 
3 
1 
surface 2 
surface 4
Famo.us in Production 
• Mobile WebApp + Wechat service for Business 
• 7 man-month. 
• Express + Famo.us + Ruby 
• 95% Javascript, NO HTML 
• Grunt + Bower + Mocha 
• Learning curve: 2-3 weeks for Javascript beginners
When to use ? 
• SPA 
• when you need fancy animation 
• Mobile Application (esp. for web devs)
Drawbacks 
• ONLY ‘View’ 
• ‘All or Nothing’ 
• Some specific device issues (e.g Android 
Keyboard)
Possibilities 
• Famo.us + Angular (or other MV*) 
• Famo.us + PhoneGap / Cordova 
• Famo.us + Ruby (Sinatra / Padrino) 
• … 
• More on famo.us
⼲⼴广告时间 
• 大学城Ruby小组 / Famo.us 讨论小组 
• Ruby小组订阅号 
• Web实习生招聘
Thanks! 
allen@dxhackers.com

Famo.us introduction