SlideShare una empresa de Scribd logo
1 de 67
Descargar para leer sin conexión
FAMO.US 
New generation of HTML5 Web Application Framework
ABOUT ME 
˖ )JOB$IFOBLBꟐ⯕崡 
˖ !IJOBCMVF 
˖ '3.3
:4'3.3 
˖ +4%$
-JHIUJOH5BML 
˖ 1)1$POG
8FC$POG 
˖ */,*OD1BSUOFS 
˖ #PVOUZ)VOUFS$50
WHAT IS FAMO.US? 
Is it famous? In Taiwan, NO.
ABOUT 2 YEARS AGO 
HTML5DevConf 2012 
http://www.slideshare.net/befamous/html5-devconf-oct-2012-tech-talk
Steve Newcomb - CEO Co-funder, Famo.us.
WHAT IS FAMO.US? 
• A framework for web application 
• New way to handle the HTML Elements 
• Simplify the DOM render in the browser 
• Solve the performance of DOM/CSS and JavaScript 
• Solve the difference in browsers 
• Easy to develop the web app
DEMO PLEASE 
http://famous-bird.herokuapp.com/
OLD “RENDER” 
WebCore in Webkit
parsing DOM tree 
construction 
Render Tree 
construction 
Layout of 
Render Tree 
RENDER ENGINE IN WEBKIT 
Simplified render 
Render Tree 
painting
NEW “RENDER” 
Famo.us Render Tree
Physics 
Engine 
Render 
Engine 
Rules 
Framework 
THE FAMO.US WAY 
famo.us render engine
parsing DOM tree 
construction 
Render Tree 
construction 
Layout of 
Render Tree 
Render Tree 
painting 
Physics 
Engine 
Render 
Engine 
Rules 
Framework 
WebCore 
Famo.us
WHY FAMO.US ? 
• New “Render Tree” ( an abstract DOM ) 
• All about JavaScript, no HTML ( Yes, If you do not like to write HTML ) 
• Modifiers control everything 
• Very GOOD performance 
• A little bad semantic structure of DOM 
• Make sure the render result are all the same in the browsers
「Easy to learn, easy to build, easy to maintain!」 
– Jeff Pope, Sencha.
HOW ABOUT FAMO.US 
• Easy to learn 
• Easy to build 
• Easy to maintain
CHALLENGE 
div class=container 
div class=animate cube style=width: 100px; 
height: 100px; background-color: #3366ff; 
span class=textJSDC/span 
/div 
/div 
.cube { 
animation-duration: 3s; 
animation-iteration-count: infinite; 
animation-name: rotate; 
} 
@keyframes rotate { 
from { 
transform: rotate(0deg); 
} 
to { 
transform: rotate(180deg); 
} 
} 
JSDC 
JSDC
IN FAMO.US 
var initialTime = Date.now(); 
/** 
* ( 180 * Math.PI / 180 ) / 3 
*/ 
var Modifier = new Modifier({ 
transform: function() { 
return Transform.rotate(0, Math.PI / 3 * 
(Date.now() - initialTime) % 3, 0); 
} 
}); 
var Surface = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
JSDC 
JSDC
CHALLENGE 
div class=container 
div class=animate cube1 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
div class=animate cube2 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(120deg); 
div class=animate cube3 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(240deg); 
span class=textJSDC/span 
/div 
/div 
/div 
/div 
I’m JSDC 
a 
cube. 
$(‘.cube1’).on(‘click’, function(event) { 
$(this).css(‘transform’, ‘rotateZ(180deg)’); 
}); 
$(‘.cube3’).on(‘click’, function(event) { 
$(this).css(‘transform’, ‘rotateZ(120deg)’); 
}); 
cube. 
JSDC 
I’m a
IN FAMO.US 
var Modifier1 = new Modifier({ 
transform: Transform.rotate(0, Math.PI / 3, 0) 
}); 
var Surface1 = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
Surface1.on(‘click’, function() { 
Modifier1.transformFrom(Transform.rotate(0, 
Math.PI, 0)); 
}); 
I’m JSDC 
a 
cube. 
cube. 
JSDC 
I’m a
CHALLENGE 
div class=container 
div class=animate cube1 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
span class=textJSDC/span 
/div 
div class=animate cube2 style=width: 100px; 
height: 100px; background-color: #3366ff; transform: 
rotateZ(120deg); 
span class=textJSDC/span 
/div 
/div 
var $elem = $(‘.cube1’); 
$({deg: 0}).animate({deg: 120}, { 
duration: 2000, 
step: function(now) { 
$elem.css(‘transform’, ‘rotateZ(‘ + now + ‘deg)’); 
} 
}, function(event) { 
$(‘.cube2’).css(‘transform’, ‘rotateZ(180deg)’); 
}); 
JSDC 
JSDC 
JSDC 
JSDC
IN FAMO.US 
JSDC 
JSDC 
JSDC 
JSDC 
var Transitionable = new Transitionable([0, Math.PI / 
3, 0]); 
var Modifier1 = new Modifier({ 
transform: Transitionable 
}); 
var Surface1 = new Surface({ 
classes: [‘cube’], 
content: ‘JSDC’ 
}); 
Transitionable.set( 
Transform.multiply(Transitionable.getFinal(), 
Transform.rotate(0, Math.PI * 2 / 3, 0)), 
2000, 
function() { 
/* Rotate the Cube 2 */ 
} 
);
All JavaScript, 
NO HTML. 
(If you want)
RENDER TREE
http://en.wikipedia.org/wiki/File:Person-tree.jpg#mediaviewer/File:Person-tree.jpg
IN HTML WAY 
div class=container 
div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; transform: 
rotateZ(60deg); 
span class=textJSDC/span 
/div 
/div 
JSDC 
All in DOM
IN FAMO.US WAY 
JavaScript 
var mainContext = Engine.createContext(); 
var mod = new Modifier({ 
size: [100, 100], 
transform: Transform.rotateZ(60 * Math.PI / 180) /* radians = degrees * (pi/180) */ 
}); 
var surf = new Surface({ 
classes: ['animate', 'cube'], 
content: 'span class=textJSDC/span', 
properties: { 
backgroundColor: ‘#3366ff' 
} 
}); 
var view = new View(); 
view.add(mod).add(surf); 
mainContext.add(view);
IN FAMO.US WAY 
All in DOM 
body 
/body
IN FAMO.US WAY 
div class=famous-container 
div class=famous-surface animate cube style=width: 100px; height: 100px; -webkit-transform-origin: 0% 
0%; -webkit-transform: matrix3d(0.5, 0.866025403784439, 0, 0, -0.866025403784439, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 
0, 1); background-color: #3366ff;” 
span class=textJSDC/span 
/div 
/div 
JSDC 
After render
All JavaScript, 
NO HTML. 
(If you want)
DEMO PLEASE 
http://codepen.io/hinablue/pen/itpuf
RENDER TREE STRUCTURE 
Context 
Surface 
Context 
Modifier 
Surface 
Context 
Modifier 
ScrollView 
Surface 1 Surface 2
RENDER TREE PERFORMANCE 
• Keep DOM structure simple and clean 
• Less Reflows and Repaints in browser 
• Use EventsHandler to handle all the events 
• Calculate with JavaScript, paint and animate with CSS3 
• Math Library 
• Provide a Physics Engine to do more simulate feature
RENDER TREE IN DOM 
Container 
Group 
Surfaces 
Context 
Modifier 
BODY
REFLOWS  REPAINTS 
• Very fast Reflows and Repaints 
• No Repaints, if not necessary
RENDER TREE IN ACTION 
Scroller 
Reflows 
Repaints
HOW TO FAMO.US?
COOL TOOLS 
• Famous/Browserify-Seed 
• Famous/generator-famous 
• Famous-Webpack-Seed
DEMO PLEASE
MODIFIER IS KING!
MODIFIERS 
• Modifier can modify EVERYTHING 
• Modifier can modify modifiers with Modifier Chain 
• Modifier can modify modifiers and modify his own children of modifier with 
Modifier Chain 
• Modifier and ModifierChain are little different between Famo.us and famo.us- 
Angular
MODIFIER IS ATTRIBUTE 
Container 
Group 
Modifier 
style=“transform: 
matrix(…);”
MODIFIER IS WAT !?
MODIFIER’S WAT! 
• Modifier MUST have a context, like Surface or etc 
• Modifier can NOT allocate 
• Modifier can only use the Transitionable or the object in roles 
• Modifier and StateModifier is MORE different from Famo.us ~0.2.x 
• Modifier in the render tree is an RenderNode just the same with others but 
“isModifier” property is “true” 
• RenderNode usually can get the Modifier, if use “.get()” method
DEMO PLEASE 
http://jsfiddle.net/arayi/gjdgbrfr/
EVENT HANDLER 
• Defined your own events 
• Use pipe/subscribe to transmit the events 
• Not depend on DOM 
• Multiple events
EVENT IN RENDER TREE 
EventsHandler 
Subscribe Pipe 
EventsHandler
DEMO PLEASE 
http://codepen.io/hinablue/pen/itpuf
VIEW AND WIDGET 
• Modifier + Surface 
• Modifier + View 
• Modifier + Widget 
• Modifier + ElementAllocator 
• View + View 
• View + Widget
CREATE YOUR OWN VIEW 
Container 
Group 
Modifier 
Surfaces
DEMO PLEASE 
http://famous.hinablue.me/SlideShow/
LIBRARY 
• Math 
• Transform 
• Transition 
• Physics Engine 
• Device Input 
• Element Allocator
DEMO PLEASE 
http://periodic.famo.us/?source=NL_062314
WAT, WAIT, AGAIN !?
INTERGRATIONS
FAMOUS-* 
• Famous-Angular 
• Famous-React
FAMOUS-ANGULAR 
• Not very good documentation (Actually, you can find more in source code) 
• You must follow the Famo.us render tree rules. 
• `fa-` directive is not really compatible with others. 
• `fa-` Events and `ng-` Events can use together, but not recommend. 
• Customize directive in Famo.us is too hard to use if you are Angular beginner.
DEMO PLEASE 
http://goo.gl/5fMRKc
FAMOUS-REACT 
• Not stable for now
DEMO PLEASE 
http://famous.github.io/famous-react/
MORE INTEGRATION DEMOS 
• MeteorJS + famo.us 
• Famono 
• famous-views for Meteor 
• Pete Hunt, famous-react 
• Firebase with Famo.us 
• Backbone, source code from famous demo 
• [Video] famo.us + D3.js 
• [Video] Leap Motion
FUTURE
中⽂文社群 FAMOUS.TW 
https://www.facebook.com/groups/famous.tw
THANK YOU
LINKS 
• Web App Performance, a story of becoming famo.us 
• Unlike Facebook, Famo.us thinks HTML5 rocks. Here is why. 
• Famo.us Cracks The Secret Of High-Performance Apps By Tapping Another Dimension 
• Famo.us Reveals More Details About Its HTML5 Turbo-Charger 
• Famo.us describes how it created a magical user interface for the web
LINKS 
• Viewing Chrome's Paint Cycle 
• Minimizing browser reflow 
• Rendering: repaint, reflow/relayout, restyle 
• REFLOWS  REPAINTS: CSS PERFORMANCE MAKING YOUR JAVASCRIPT SLOW? 
• Improve Rendering Performance with Chrome Dev Tools 
• Scrolling Performance
LINKS 
• http://codepen.io/befamous/ 
• https://hackpad.com/Famo.us-links-kPsHMaDFboE 
• https://github.com/famous 
• http://famous-bird.herokuapp.com/ 
• http://www.famospace.com 
• http://codepen.io/hinablue/pen/itpuf 
• https://famo.us/blog/modifiers-affect-subtrees/ 
• http://periodic.famo.us/ 
• http://demo.famo.us/lightbox/ 
• http://demo.famo.us/paper/ 
• http://famous.hinablue.me/SlideShow/
LINKS 
• https://github.com/zackbrown/flickrous 
• http://thomasstreet.com/famous-angular-google/ 
• https://github.com/continuata/fa_tutorial1/ 
• https://github.com/hinablue/famous.tw 
• https://github.com/hinablue/famous.tw/issues 
• https://www.facebook.com/groups/famous.tw

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Vue JS Intro
Vue JS IntroVue JS Intro
Vue JS Intro
 
How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developers
 
Vue.js
Vue.jsVue.js
Vue.js
 
Vue.js for beginners
Vue.js for beginnersVue.js for beginners
Vue.js for beginners
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue Material
 
Vue business first
Vue business firstVue business first
Vue business first
 
Scalable Front-end Development with Vue.JS
Scalable Front-end Development with Vue.JSScalable Front-end Development with Vue.JS
Scalable Front-end Development with Vue.JS
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
 
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsVue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.js
 
Vue.js Getting Started
Vue.js Getting StartedVue.js Getting Started
Vue.js Getting Started
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
 
Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJS
 
Room with a Vue - Introduction to Vue.js
Room with a Vue - Introduction to Vue.jsRoom with a Vue - Introduction to Vue.js
Room with a Vue - Introduction to Vue.js
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
 

Similar a Famo.us - New generation of HTML5 Web Application Framework

JavaScript For People Who Don't Code
JavaScript For People Who Don't CodeJavaScript For People Who Don't Code
JavaScript For People Who Don't Code
Christopher Schmitt
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
Andrea Verlicchi
 

Similar a Famo.us - New generation of HTML5 Web Application Framework (20)

Using RequireJS with CakePHP
Using RequireJS with CakePHPUsing RequireJS with CakePHP
Using RequireJS with CakePHP
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
REACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScriptREACT.JS : Rethinking UI Development Using JavaScript
REACT.JS : Rethinking UI Development Using JavaScript
 
DNN Database Tips & Tricks
DNN Database Tips & TricksDNN Database Tips & Tricks
DNN Database Tips & Tricks
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
Into The Box 2018 Ortus Keynote
Into The Box 2018 Ortus KeynoteInto The Box 2018 Ortus Keynote
Into The Box 2018 Ortus Keynote
 
Rencore Webinar: Developing Secure and Performant JavaScript for SharePoint
Rencore Webinar: Developing Secure and Performant JavaScript for SharePointRencore Webinar: Developing Secure and Performant JavaScript for SharePoint
Rencore Webinar: Developing Secure and Performant JavaScript for SharePoint
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!Django Rest Framework and React and Redux, Oh My!
Django Rest Framework and React and Redux, Oh My!
 
Really Rapid Admin Application Development
Really Rapid Admin Application DevelopmentReally Rapid Admin Application Development
Really Rapid Admin Application Development
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
The Expanding Nature of SEO (MarTech 2016)
The Expanding Nature of SEO (MarTech 2016)The Expanding Nature of SEO (MarTech 2016)
The Expanding Nature of SEO (MarTech 2016)
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTERSINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
 
JavaScript For People Who Don't Code
JavaScript For People Who Don't CodeJavaScript For People Who Don't Code
JavaScript For People Who Don't Code
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 

Más de Hina Chen (7)

生在幸福的 JS 年代
生在幸福的 JS 年代生在幸福的 JS 年代
生在幸福的 JS 年代
 
Webconf 2013 - Media Query 123
Webconf 2013 - Media Query 123Webconf 2013 - Media Query 123
Webconf 2013 - Media Query 123
 
JSDC.tw lighting talk
JSDC.tw lighting talkJSDC.tw lighting talk
JSDC.tw lighting talk
 
3sss book
3sss book3sss book
3sss book
 
Min book
Min bookMin book
Min book
 
Layout presentation
Layout presentationLayout presentation
Layout presentation
 
960 grid system simple howto
960 grid system simple howto960 grid system simple howto
960 grid system simple howto
 

Último

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 

Último (20)

Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 

Famo.us - New generation of HTML5 Web Application Framework

  • 1. FAMO.US New generation of HTML5 Web Application Framework
  • 2. ABOUT ME ˖ )JOB$IFOBLBꟐ⯕崡 ˖ !IJOBCMVF ˖ '3.3 :4'3.3 ˖ +4%$ -JHIUJOH5BML ˖ 1)1$POG 8FC$POG ˖ */,*OD1BSUOFS ˖ #PVOUZ)VOUFS$50
  • 3. WHAT IS FAMO.US? Is it famous? In Taiwan, NO.
  • 4. ABOUT 2 YEARS AGO HTML5DevConf 2012 http://www.slideshare.net/befamous/html5-devconf-oct-2012-tech-talk
  • 5. Steve Newcomb - CEO Co-funder, Famo.us.
  • 6. WHAT IS FAMO.US? • A framework for web application • New way to handle the HTML Elements • Simplify the DOM render in the browser • Solve the performance of DOM/CSS and JavaScript • Solve the difference in browsers • Easy to develop the web app
  • 9. parsing DOM tree construction Render Tree construction Layout of Render Tree RENDER ENGINE IN WEBKIT Simplified render Render Tree painting
  • 11. Physics Engine Render Engine Rules Framework THE FAMO.US WAY famo.us render engine
  • 12. parsing DOM tree construction Render Tree construction Layout of Render Tree Render Tree painting Physics Engine Render Engine Rules Framework WebCore Famo.us
  • 13. WHY FAMO.US ? • New “Render Tree” ( an abstract DOM ) • All about JavaScript, no HTML ( Yes, If you do not like to write HTML ) • Modifiers control everything • Very GOOD performance • A little bad semantic structure of DOM • Make sure the render result are all the same in the browsers
  • 14. 「Easy to learn, easy to build, easy to maintain!」 – Jeff Pope, Sencha.
  • 15. HOW ABOUT FAMO.US • Easy to learn • Easy to build • Easy to maintain
  • 16. CHALLENGE div class=container div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; span class=textJSDC/span /div /div .cube { animation-duration: 3s; animation-iteration-count: infinite; animation-name: rotate; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(180deg); } } JSDC JSDC
  • 17. IN FAMO.US var initialTime = Date.now(); /** * ( 180 * Math.PI / 180 ) / 3 */ var Modifier = new Modifier({ transform: function() { return Transform.rotate(0, Math.PI / 3 * (Date.now() - initialTime) % 3, 0); } }); var Surface = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); JSDC JSDC
  • 18. CHALLENGE div class=container div class=animate cube1 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); div class=animate cube2 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(120deg); div class=animate cube3 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(240deg); span class=textJSDC/span /div /div /div /div I’m JSDC a cube. $(‘.cube1’).on(‘click’, function(event) { $(this).css(‘transform’, ‘rotateZ(180deg)’); }); $(‘.cube3’).on(‘click’, function(event) { $(this).css(‘transform’, ‘rotateZ(120deg)’); }); cube. JSDC I’m a
  • 19. IN FAMO.US var Modifier1 = new Modifier({ transform: Transform.rotate(0, Math.PI / 3, 0) }); var Surface1 = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); Surface1.on(‘click’, function() { Modifier1.transformFrom(Transform.rotate(0, Math.PI, 0)); }); I’m JSDC a cube. cube. JSDC I’m a
  • 20. CHALLENGE div class=container div class=animate cube1 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); span class=textJSDC/span /div div class=animate cube2 style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(120deg); span class=textJSDC/span /div /div var $elem = $(‘.cube1’); $({deg: 0}).animate({deg: 120}, { duration: 2000, step: function(now) { $elem.css(‘transform’, ‘rotateZ(‘ + now + ‘deg)’); } }, function(event) { $(‘.cube2’).css(‘transform’, ‘rotateZ(180deg)’); }); JSDC JSDC JSDC JSDC
  • 21. IN FAMO.US JSDC JSDC JSDC JSDC var Transitionable = new Transitionable([0, Math.PI / 3, 0]); var Modifier1 = new Modifier({ transform: Transitionable }); var Surface1 = new Surface({ classes: [‘cube’], content: ‘JSDC’ }); Transitionable.set( Transform.multiply(Transitionable.getFinal(), Transform.rotate(0, Math.PI * 2 / 3, 0)), 2000, function() { /* Rotate the Cube 2 */ } );
  • 22. All JavaScript, NO HTML. (If you want)
  • 25. IN HTML WAY div class=container div class=animate cube style=width: 100px; height: 100px; background-color: #3366ff; transform: rotateZ(60deg); span class=textJSDC/span /div /div JSDC All in DOM
  • 26. IN FAMO.US WAY JavaScript var mainContext = Engine.createContext(); var mod = new Modifier({ size: [100, 100], transform: Transform.rotateZ(60 * Math.PI / 180) /* radians = degrees * (pi/180) */ }); var surf = new Surface({ classes: ['animate', 'cube'], content: 'span class=textJSDC/span', properties: { backgroundColor: ‘#3366ff' } }); var view = new View(); view.add(mod).add(surf); mainContext.add(view);
  • 27. IN FAMO.US WAY All in DOM body /body
  • 28. IN FAMO.US WAY div class=famous-container div class=famous-surface animate cube style=width: 100px; height: 100px; -webkit-transform-origin: 0% 0%; -webkit-transform: matrix3d(0.5, 0.866025403784439, 0, 0, -0.866025403784439, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); background-color: #3366ff;” span class=textJSDC/span /div /div JSDC After render
  • 29. All JavaScript, NO HTML. (If you want)
  • 31. RENDER TREE STRUCTURE Context Surface Context Modifier Surface Context Modifier ScrollView Surface 1 Surface 2
  • 32. RENDER TREE PERFORMANCE • Keep DOM structure simple and clean • Less Reflows and Repaints in browser • Use EventsHandler to handle all the events • Calculate with JavaScript, paint and animate with CSS3 • Math Library • Provide a Physics Engine to do more simulate feature
  • 33. RENDER TREE IN DOM Container Group Surfaces Context Modifier BODY
  • 34. REFLOWS REPAINTS • Very fast Reflows and Repaints • No Repaints, if not necessary
  • 35. RENDER TREE IN ACTION Scroller Reflows Repaints
  • 37. COOL TOOLS • Famous/Browserify-Seed • Famous/generator-famous • Famous-Webpack-Seed
  • 40. MODIFIERS • Modifier can modify EVERYTHING • Modifier can modify modifiers with Modifier Chain • Modifier can modify modifiers and modify his own children of modifier with Modifier Chain • Modifier and ModifierChain are little different between Famo.us and famo.us- Angular
  • 41. MODIFIER IS ATTRIBUTE Container Group Modifier style=“transform: matrix(…);”
  • 43. MODIFIER’S WAT! • Modifier MUST have a context, like Surface or etc • Modifier can NOT allocate • Modifier can only use the Transitionable or the object in roles • Modifier and StateModifier is MORE different from Famo.us ~0.2.x • Modifier in the render tree is an RenderNode just the same with others but “isModifier” property is “true” • RenderNode usually can get the Modifier, if use “.get()” method
  • 45. EVENT HANDLER • Defined your own events • Use pipe/subscribe to transmit the events • Not depend on DOM • Multiple events
  • 46. EVENT IN RENDER TREE EventsHandler Subscribe Pipe EventsHandler
  • 48. VIEW AND WIDGET • Modifier + Surface • Modifier + View • Modifier + Widget • Modifier + ElementAllocator • View + View • View + Widget
  • 49. CREATE YOUR OWN VIEW Container Group Modifier Surfaces
  • 51. LIBRARY • Math • Transform • Transition • Physics Engine • Device Input • Element Allocator
  • 55. FAMOUS-* • Famous-Angular • Famous-React
  • 56. FAMOUS-ANGULAR • Not very good documentation (Actually, you can find more in source code) • You must follow the Famo.us render tree rules. • `fa-` directive is not really compatible with others. • `fa-` Events and `ng-` Events can use together, but not recommend. • Customize directive in Famo.us is too hard to use if you are Angular beginner.
  • 58. FAMOUS-REACT • Not stable for now
  • 60. MORE INTEGRATION DEMOS • MeteorJS + famo.us • Famono • famous-views for Meteor • Pete Hunt, famous-react • Firebase with Famo.us • Backbone, source code from famous demo • [Video] famo.us + D3.js • [Video] Leap Motion
  • 64. LINKS • Web App Performance, a story of becoming famo.us • Unlike Facebook, Famo.us thinks HTML5 rocks. Here is why. • Famo.us Cracks The Secret Of High-Performance Apps By Tapping Another Dimension • Famo.us Reveals More Details About Its HTML5 Turbo-Charger • Famo.us describes how it created a magical user interface for the web
  • 65. LINKS • Viewing Chrome's Paint Cycle • Minimizing browser reflow • Rendering: repaint, reflow/relayout, restyle • REFLOWS REPAINTS: CSS PERFORMANCE MAKING YOUR JAVASCRIPT SLOW? • Improve Rendering Performance with Chrome Dev Tools • Scrolling Performance
  • 66. LINKS • http://codepen.io/befamous/ • https://hackpad.com/Famo.us-links-kPsHMaDFboE • https://github.com/famous • http://famous-bird.herokuapp.com/ • http://www.famospace.com • http://codepen.io/hinablue/pen/itpuf • https://famo.us/blog/modifiers-affect-subtrees/ • http://periodic.famo.us/ • http://demo.famo.us/lightbox/ • http://demo.famo.us/paper/ • http://famous.hinablue.me/SlideShow/
  • 67. LINKS • https://github.com/zackbrown/flickrous • http://thomasstreet.com/famous-angular-google/ • https://github.com/continuata/fa_tutorial1/ • https://github.com/hinablue/famous.tw • https://github.com/hinablue/famous.tw/issues • https://www.facebook.com/groups/famous.tw