[フレーム]
Uploaded bybitovi
PPTX, PDF5,907 views

Canjs

This document summarizes the key features and components of the CanJS JavaScript library. It highlights that CanJS is fast, easy to use, and modular. It prevents memory leaks through its templated event system. It supports live data binding through observable objects and lists. Components include Can.Construct for classes, Can.Model for REST APIs, Can.Control for UI components, Can.Route for routing, and Can.View for templating. Overall, CanJS aims to be faster and lighter than comparable frameworks like Backbone, Knockout, and Angular while providing a flexible ecosystem through plugins.

Embed presentation

Downloaded 75 times
http://canjs.us @canjsus
Why? • Prevents Leaks • Ease of Use • Fast
What’s Inside • can.Construct • can.Observe • can.Model • can.Control • can.view • can.EJS • can.route
can.Construct(static, proto) var Person = can.Construct({ init : function (name) { this.name = name; } }); var curtis = new Person("Curtis"); curtis.name
new can.Observe(data) var person = new can.Observe({ name: 'josh'}); person.bind('name‟, function(ev,newVal,oldVal){ newVal //-> 'Josh Dean' oldVal //-> 'josh' }); person.attr('name') //-> 'josh' person.name //-> 'josh' person.attr('name','Josh Dean‟);
can.Model(ajax,proto) var Todo = can.Model({ findAll : '/todo', findOne : '/todo/{id}', destroy : 'POST /todo/destroy/{id}', update : 'POST /todo/{id}', create : '/todo' },{}); Todo.findOne({id: 5}, function( todo ) { todo.attr('name') });
can.Control(proto) var Tabs = can.Control({ init: function( el ) { // show first tab }, 'li click': function( el, ev ) { // hide other tabs // show selected tab } }); new Tabs('#tabs');
can.route(route, defaults) var Routing = can.Control({ ':type/:id route': function( data ) { } }) new Routing( document.body ); can.route.attr( { type : 'todos', id: 5 } )
can.view( idOrURL, data ) -> fragment <script type='text/ejs' id='messageEJS'> <h1><%= message %></h1> </script> can.view('messageEJS', { message : 'Hello World' }) //-> frag <h1>Hello World</h1>
EmbeddedJS Templates Favorite tag is <%= ‟<blink>Blink</blink>‟ %> -> My favorite tag is <blink>Blink</blink> Favorite tag is <%== ‟<blink>Blink</blink>‟ %> -> Favorite tag is Blink
EmbeddedJS Templates <% if( devs ) { %> <% for( var i = 0; i < devs.length; i++ ) { %> <li><%= arr[i] %></li> <% } %> <% } else { %> <li>No Developers</li> <% } %> can.view('devs.ejs',{devs: ['Andy','Fred']}) //-> frag <li>Andy</li><li>Fred</li>
EJS Live Binding <% if( devs.attr('length') ) { %> <% list(devs, function(dev){ %> <li><%= dev.attr(„name‟) %></li> <% }) %> <% } else { %> <li>No Developers</li> <% } %> var devs = new can.Observe.List([ {name : 'Andy'}, {name : 'Fred'} ]) can.view('devs.ejs',{devs : devs}) //-> frag <li>Andy</li><li>Fred</li>
Why? • Prevents Leaks • Speed • Flexibility + Libraries • Ease of Use • Features vs Size
A tooltip. Undo $('#undo').bind('mouseenter',function(){ $('<div>Undo</div>').tooltipFor(this) })
What’s Wrong? $.fn.tooltipFor = function(anchor){ var $el = this .appendTo(document.body) .offset( $(anchor).offset() ) $(anchor).bind('mouseleave',function(ev){ $el.remove() }) }
Leaks
Templated Events "{option} eventName"
Templated Events var Tooltip = can.Control({ init: function( el, options ) { el.appendTo(document.body) .offset( $(options.anchor).offset() ) }, '{anchor} mouseleave': function( el, ev ) { this.element.remove(); } }); new Tooltip($('<div>Undo</div>'),{ anchor : this });
Non-leaking Global Store Critical Due Today File Taxes Brush Teeth Write talk on CanJS Write talk on CanJS Emissions Test Check into flight
Non-leaking Global Store Awesome Developers
Easy To Use
Plugins • Validations • Getter / Setter • Serialize / Deserialize • Backup / Restore • Super • Proxy $("#todos").html( „todos.ejs‟, Todo.findAll() )
can.Control and Backbone.View http://jsperf.com/tabs-timing-test
Live Binding http://jsfiddle.net/JMWf4/5/
Live Binding *can.zepto.js, angular/ember not tested, ask me why http://jsperf.com/canjs-ejs-live-bind
Features vs Size CanJS 8.49kb - jQuery Backbone 8.97kb -jQuery +Underscore Knockout 13kb none Batman 15kb -pollyfills for ES5 none Angular 24kb -jQuery Ember 39kb +metamorph.js
Library Support
Questions? safer faster easier smaller library-er http://canjs.us @canjsus

More Related Content

Canjs
ODP
RequireJS
PDF
RequireJS
Railsbridge javascript
PDF
Railsbridge javascript
Casl. isomorphic permission management.pptx
PDF
Casl. isomorphic permission management.pptx
Requirejs
KEY
Requirejs
Build web application by express
PDF
Build web application by express
jQuery Foot-Gun Features
PPTX
jQuery Foot-Gun Features
AngularJS Routing
PPTX
AngularJS Routing
Canjs
RequireJS
RequireJS
Railsbridge javascript
Railsbridge javascript
Casl. isomorphic permission management.pptx
Casl. isomorphic permission management.pptx
Requirejs
Requirejs
Build web application by express
Build web application by express
jQuery Foot-Gun Features
jQuery Foot-Gun Features
AngularJS Routing
AngularJS Routing

What's hot

Human Talks Riot.js
PDF
Human Talks Riot.js
NodeJS in Windows Azure
PPTX
NodeJS in Windows Azure
jQuery in 15 minutes
PDF
jQuery in 15 minutes
Laravel 로 배우는 서버사이드 #5
PDF
Laravel 로 배우는 서버사이드 #5
Introduction to jQuery - Barcamp London 9
KEY
Introduction to jQuery - Barcamp London 9
OUTDATED (Encore)
PDF
OUTDATED (Encore)
hachioji.pm #40 : asynchronous in JS
PDF
hachioji.pm #40 : asynchronous in JS
Requirejs
PDF
Requirejs
Expressを使ってみた
KEY
Expressを使ってみた
Add loop shortcode
PDF
Add loop shortcode
Dive into AngularJS Routing
PPTX
Dive into AngularJS Routing
Angular JS Routing
PDF
Angular JS Routing
лукьянченко л.а. пос 10а
PPTX
лукьянченко л.а. пос 10а
Angular Promises and Advanced Routing
PDF
Angular Promises and Advanced Routing
Backbone.js
PPTX
Backbone.js
Jquery ui
PPT
Jquery ui
Criando um componente de busca com AngularJS
PDF
Criando um componente de busca com AngularJS
Damage Control
PDF
Damage Control
Ember: Guts & Goals
PDF
Ember: Guts & Goals
UI-Router
PPTX
UI-Router
Human Talks Riot.js
Human Talks Riot.js
NodeJS in Windows Azure
NodeJS in Windows Azure
jQuery in 15 minutes
jQuery in 15 minutes
Laravel 로 배우는 서버사이드 #5
Laravel 로 배우는 서버사이드 #5
Introduction to jQuery - Barcamp London 9
Introduction to jQuery - Barcamp London 9
OUTDATED (Encore)
OUTDATED (Encore)
hachioji.pm #40 : asynchronous in JS
hachioji.pm #40 : asynchronous in JS
Requirejs
Requirejs
Expressを使ってみた
Expressを使ってみた
Add loop shortcode
Add loop shortcode
Dive into AngularJS Routing
Dive into AngularJS Routing
Angular JS Routing
Angular JS Routing
лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
Angular Promises and Advanced Routing
Angular Promises and Advanced Routing
Backbone.js
Backbone.js
Jquery ui
Jquery ui
Criando um componente de busca com AngularJS
Criando um componente de busca com AngularJS
Damage Control
Damage Control
Ember: Guts & Goals
Ember: Guts & Goals
UI-Router
UI-Router

Viewers also liked

Bending the Rules: Community over Code over Policy.
PDF
Bending the Rules: Community over Code over Policy.
Open Development in the Enterprise, October 2013 edition
PDF
Open Development in the Enterprise, October 2013 edition
Open Source In Education
PDF
Open Source In Education
Dev cloud
PPTX
Dev cloud
Open Source enables Open Innovation
PDF
Open Source enables Open Innovation
Life in Open Source Communities, ApacheCon US 2009
PDF
Life in Open Source Communities, ApacheCon US 2009
Keynote apache bd-eu-nov-2016
PPTX
Keynote apache bd-eu-nov-2016
Hortonworks apache training
PPTX
Hortonworks apache training
Open Source at scale: the Apache Software Foundation
PDF
Open Source at scale: the Apache Software Foundation
Open-Source Collaboration Tools are Good for You - 2009 edition
PDF
Open-Source Collaboration Tools are Good for You - 2009 edition
Cloud stack for_beginners
PDF
Cloud stack for_beginners
Why Docker
PPTX
Why Docker
Gardler bosc2010 community_developmentattheasf
PDF
Gardler bosc2010 community_developmentattheasf
Successfully Profiting From Apache Brands
PDF
Successfully Profiting From Apache Brands
Improving Your Apache Project's Image And Brand
PDF
Improving Your Apache Project's Image And Brand
Practical Trademark Law for FOSS Projects
PDF
Practical Trademark Law for FOSS Projects
Bending the Rules: Community over Code over Policy.
Bending the Rules: Community over Code over Policy.
Open Development in the Enterprise, October 2013 edition
Open Development in the Enterprise, October 2013 edition
Open Source In Education
Open Source In Education
Dev cloud
Dev cloud
Open Source enables Open Innovation
Open Source enables Open Innovation
Life in Open Source Communities, ApacheCon US 2009
Life in Open Source Communities, ApacheCon US 2009
Keynote apache bd-eu-nov-2016
Keynote apache bd-eu-nov-2016
Hortonworks apache training
Hortonworks apache training
Open Source at scale: the Apache Software Foundation
Open Source at scale: the Apache Software Foundation
Open-Source Collaboration Tools are Good for You - 2009 edition
Open-Source Collaboration Tools are Good for You - 2009 edition
Cloud stack for_beginners
Cloud stack for_beginners
Why Docker
Why Docker
Gardler bosc2010 community_developmentattheasf
Gardler bosc2010 community_developmentattheasf
Successfully Profiting From Apache Brands
Successfully Profiting From Apache Brands
Improving Your Apache Project's Image And Brand
Improving Your Apache Project's Image And Brand
Practical Trademark Law for FOSS Projects
Practical Trademark Law for FOSS Projects

Similar to Canjs

A Very Biased Comparison of MVC Libraries
KEY
A Very Biased Comparison of MVC Libraries
Knockoutjs databinding
PDF
Knockoutjs databinding
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
KEY
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Introduction to Knockoutjs
PPTX
Introduction to Knockoutjs
Knockout.js
PPTX
Knockout.js
Viking academy backbone.js
PDF
Viking academy backbone.js
Knockout js
PPTX
Knockout js
MVVM Magic in SharePoint 2010 using Knockoutjs!
PPTX
MVVM Magic in SharePoint 2010 using Knockoutjs!
Knockoutjs
PPTX
CoffeeScript Design Patterns
PDF
CoffeeScript Design Patterns
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
PDF
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
A piece of sugar in your client-side development
PDF
A piece of sugar in your client-side development
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
PDF
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
Client-side MVC with Backbone.js (reloaded)
PDF
Client-side MVC with Backbone.js (reloaded)
Javascript frameworks: Backbone.js
ODP
Javascript frameworks: Backbone.js
Planbox Backbone MVC
PPTX
Planbox Backbone MVC
Sugarcoating your frontend one ViewModel at a time
KEY
Sugarcoating your frontend one ViewModel at a time
Client Best Practices
PPTX
Client Best Practices
Backbonejs for beginners
PPTX
Backbonejs for beginners
Client-side MVC with Backbone.js
PDF
Client-side MVC with Backbone.js
A Very Biased Comparison of MVC Libraries
A Very Biased Comparison of MVC Libraries
Knockoutjs databinding
Knockoutjs databinding
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Introduction to Knockoutjs
Introduction to Knockoutjs
Knockout.js
Knockout.js
Viking academy backbone.js
Viking academy backbone.js
Knockout js
Knockout js
MVVM Magic in SharePoint 2010 using Knockoutjs!
MVVM Magic in SharePoint 2010 using Knockoutjs!
Knockoutjs
CoffeeScript Design Patterns
CoffeeScript Design Patterns
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFG
A piece of sugar in your client-side development
A piece of sugar in your client-side development
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
Client-side MVC with Backbone.js (reloaded)
Client-side MVC with Backbone.js (reloaded)
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
Planbox Backbone MVC
Planbox Backbone MVC
Sugarcoating your frontend one ViewModel at a time
Sugarcoating your frontend one ViewModel at a time
Client Best Practices
Client Best Practices
Backbonejs for beginners
Backbonejs for beginners
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js

Recently uploaded

FastTrack CISSP Reference By Jobyer Ahmed
PDF
FastTrack CISSP Reference By Jobyer Ahmed
UiPath Veterans Day Acknowledgement and Benefits
PDF
UiPath Veterans Day Acknowledgement and Benefits
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
PDF
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
Managing SELinux Security - RHCSA (RH134).pdf
PDF
Managing SELinux Security - RHCSA (RH134).pdf
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
PDF
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
#MakeAIMatter for HR Professionals | AI Transformation Workshop by Tekdi Tech...
PDF
#MakeAIMatter for HR Professionals | AI Transformation Workshop by Tekdi Tech...
Discover - Assemble - and Gain Insights into your Content with SharePoint Con...
PPTX
Discover - Assemble - and Gain Insights into your Content with SharePoint Con...
Webinar: Introduction to LF Energy SEAPATH
PDF
Webinar: Introduction to LF Energy SEAPATH
Cyber Security Quiz 1st Year CSE CS Students
PPTX
Cyber Security Quiz 1st Year CSE CS Students
Dr. Robert Krug - Specializes In Predictive Modeling
PDF
Dr. Robert Krug - Specializes In Predictive Modeling
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
PDF
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Run Containers in RHEL - RHCSA (RH134).pdf
PDF
Run Containers in RHEL - RHCSA (RH134).pdf
Build Agentic AI Applications with Oracle AI Database Private Agent Factory
PDF
Build Agentic AI Applications with Oracle AI Database Private Agent Factory
Implement Advanced Storage in RHEL - RHCSA (RH134).pdf
PDF
Implement Advanced Storage in RHEL - RHCSA (RH134).pdf
Conserving precious peatland habitats using mobile apps - Esri UK Welsh Confe...
PPTX
Conserving precious peatland habitats using mobile apps - Esri UK Welsh Confe...
Building powerful web apps to improve productivity and engagement - Esri UK W...
PPTX
Building powerful web apps to improve productivity and engagement - Esri UK W...
Standardising and simplifying systems and data management - Esri UK Welsh Con...
PPTX
Standardising and simplifying systems and data management - Esri UK Welsh Con...
Career Blueprint: Mentor Tracks & Career Clinic - Part 2
PDF
Career Blueprint: Mentor Tracks & Career Clinic - Part 2
Osmosis webinar presentation Nov 2025:Empowering UK Nursing Education
PPTX
Osmosis webinar presentation Nov 2025:Empowering UK Nursing Education
byJisc
Tune System Performance - RHCSA (RH134).pdf
PDF
Tune System Performance - RHCSA (RH134).pdf
FastTrack CISSP Reference By Jobyer Ahmed
FastTrack CISSP Reference By Jobyer Ahmed
UiPath Veterans Day Acknowledgement and Benefits
UiPath Veterans Day Acknowledgement and Benefits
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
Manage Logical Volume in RHEL - RHCSA (RH134).pdf
Managing SELinux Security - RHCSA (RH134).pdf
Managing SELinux Security - RHCSA (RH134).pdf
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
Digital Garage Certification - Google - Viktor Huszag - Online Marketing Fund...
#MakeAIMatter for HR Professionals | AI Transformation Workshop by Tekdi Tech...
#MakeAIMatter for HR Professionals | AI Transformation Workshop by Tekdi Tech...
Discover - Assemble - and Gain Insights into your Content with SharePoint Con...
Discover - Assemble - and Gain Insights into your Content with SharePoint Con...
Webinar: Introduction to LF Energy SEAPATH
Webinar: Introduction to LF Energy SEAPATH
Cyber Security Quiz 1st Year CSE CS Students
Cyber Security Quiz 1st Year CSE CS Students
Dr. Robert Krug - Specializes In Predictive Modeling
Dr. Robert Krug - Specializes In Predictive Modeling
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Case Study: How LKQ Corporation Improved Training Efficiency & Delivery
Run Containers in RHEL - RHCSA (RH134).pdf
Run Containers in RHEL - RHCSA (RH134).pdf
Build Agentic AI Applications with Oracle AI Database Private Agent Factory
Build Agentic AI Applications with Oracle AI Database Private Agent Factory
Implement Advanced Storage in RHEL - RHCSA (RH134).pdf
Implement Advanced Storage in RHEL - RHCSA (RH134).pdf
Conserving precious peatland habitats using mobile apps - Esri UK Welsh Confe...
Conserving precious peatland habitats using mobile apps - Esri UK Welsh Confe...
Building powerful web apps to improve productivity and engagement - Esri UK W...
Building powerful web apps to improve productivity and engagement - Esri UK W...
Standardising and simplifying systems and data management - Esri UK Welsh Con...
Standardising and simplifying systems and data management - Esri UK Welsh Con...
Career Blueprint: Mentor Tracks & Career Clinic - Part 2
Career Blueprint: Mentor Tracks & Career Clinic - Part 2
Osmosis webinar presentation Nov 2025:Empowering UK Nursing Education
Osmosis webinar presentation Nov 2025:Empowering UK Nursing Education
byJisc
Tune System Performance - RHCSA (RH134).pdf
Tune System Performance - RHCSA (RH134).pdf

Canjs

  • 1.
  • 2.
    Why? • Prevents Leaks • Ease of Use • Fast
  • 3.
    What’s Inside • can.Construct • can.Observe • can.Model • can.Control • can.view • can.EJS • can.route
  • 4.
    can.Construct(static, proto) var Person = can.Construct({ init : function (name) { this.name = name; } }); var curtis = new Person("Curtis"); curtis.name
  • 5.
    new can.Observe(data) var person = new can.Observe({ name: 'josh'}); person.bind('name‟, function(ev,newVal,oldVal){ newVal //-> 'Josh Dean' oldVal //-> 'josh' }); person.attr('name') //-> 'josh' person.name //-> 'josh' person.attr('name','Josh Dean‟);
  • 6.
    can.Model(ajax,proto) var Todo = can.Model({ findAll : '/todo', findOne : '/todo/{id}', destroy : 'POST /todo/destroy/{id}', update : 'POST /todo/{id}', create : '/todo' },{}); Todo.findOne({id: 5}, function( todo ) { todo.attr('name') });
  • 7.
    can.Control(proto) var Tabs = can.Control({ init: function( el ) { // show first tab }, 'li click': function( el, ev ) { // hide other tabs // show selected tab } }); new Tabs('#tabs');
  • 8.
    can.route(route, defaults) var Routing = can.Control({ ':type/:id route': function( data ) { } }) new Routing( document.body ); can.route.attr( { type : 'todos', id: 5 } )
  • 9.
    can.view( idOrURL, data ) -> fragment <script type='text/ejs' id='messageEJS'> <h1><%= message %></h1> </script> can.view('messageEJS', { message : 'Hello World' }) //-> frag <h1>Hello World</h1>
  • 10.
    EmbeddedJS Templates Favorite tag is <%= ‟<blink>Blink</blink>‟ %> -> My favorite tag is <blink>Blink</blink> Favorite tag is <%== ‟<blink>Blink</blink>‟ %> -> Favorite tag is Blink
  • 11.
    EmbeddedJS Templates <% if( devs ) { %> <% for( var i = 0; i < devs.length; i++ ) { %> <li><%= arr[i] %></li> <% } %> <% } else { %> <li>No Developers</li> <% } %> can.view('devs.ejs',{devs: ['Andy','Fred']}) //-> frag <li>Andy</li><li>Fred</li>
  • 12.
    EJS Live Binding <% if( devs.attr('length') ) { %> <% list(devs, function(dev){ %> <li><%= dev.attr(„name‟) %></li> <% }) %> <% } else { %> <li>No Developers</li> <% } %> var devs = new can.Observe.List([ {name : 'Andy'}, {name : 'Fred'} ]) can.view('devs.ejs',{devs : devs}) //-> frag <li>Andy</li><li>Fred</li>
  • 13.
    Why? • Prevents Leaks • Speed • Flexibility + Libraries • Ease of Use • Features vs Size
  • 14.
    A tooltip. Undo $('#undo').bind('mouseenter',function(){ $('<div>Undo</div>').tooltipFor(this) })
  • 15.
    What’s Wrong? $.fn.tooltipFor = function(anchor){ var $el = this .appendTo(document.body) .offset( $(anchor).offset() ) $(anchor).bind('mouseleave',function(ev){ $el.remove() }) }
  • 16.
  • 17.
  • 18.
    Templated Events var Tooltip = can.Control({ init: function( el, options ) { el.appendTo(document.body) .offset( $(options.anchor).offset() ) }, '{anchor} mouseleave': function( el, ev ) { this.element.remove(); } }); new Tooltip($('<div>Undo</div>'),{ anchor : this });
  • 19.
    Non-leaking Global Store Critical Due Today File Taxes Brush Teeth Write talk on CanJS Write talk on CanJS Emissions Test Check into flight
  • 20.
    Non-leaking Global Store Awesome Developers
  • 21.
  • 22.
    Plugins • Validations • Getter / Setter • Serialize / Deserialize • Backup / Restore • Super • Proxy $("#todos").html( „todos.ejs‟, Todo.findAll() )
  • 23.
    can.Control and Backbone.View http://jsperf.com/tabs-timing-test
  • 24.
    Live Binding http://jsfiddle.net/JMWf4/5/
  • 25.
    Live Binding *can.zepto.js, angular/ember not tested, ask me why http://jsperf.com/canjs-ejs-live-bind
  • 26.
    Features vs Size CanJS 8.49kb - jQuery Backbone 8.97kb -jQuery +Underscore Knockout 13kb none Batman 15kb -pollyfills for ES5 none Angular 24kb -jQuery Ember 39kb +metamorph.js
  • 27.
  • 28.
    Questions? safer faster easier smaller library-er http://canjs.us @canjsus

Editor's Notes

  • #2 Hello, I&apos;m Justin Meyer from BitoviI&apos;m very proud that this is the second time Bitovi (formerly Jupiter) has sponsered JSConfThis year it comes at an important time for us. Not only are we announcing the rebranding at this conference (we are Bitovi now), we are releasing thenext version of JavaScriptMVC&apos;s MVC parts called CanJS.In this talk, I&apos;ll introduce what&apos;s inside CanJS and talk about why, despite a lot of great existing MVC libraries, we think CanJS is the best one the market.
  • #3 It will fix the memory leaks that you probably don’t even know you have.Fastest control initialization and live template binding. Your app will start fast and run fast.And it’s super easy to pick up, we documented the hello out of it.
  • #4 positivity
  • #5 A basic constructor function helper. Useful for providing inheritance. All of JMVC’s constructors inherit from it.
  • #6 A basic constructor function helper. Useful for providing inheritance
  • #7 A basic constructor function helper. Useful for providing inheritance hooks up observes to your back end with declarative service bindings
  • #8 A basic constructor function helper. Useful for providing inheritance
  • #9 A basic constructor function helper. Useful for providing inheritance - A special observe that is cross bound to the route - pretty urls
  • #11 ----- Meeting Notes (4/3/12 00:38) -----embedded js
  • #13 show changing the obseveralph giving the talk
  • #14 Leaking Event HandlersCleaning Data Stores
  • #15 Impossible to create memory leaksPeople don&apos;t know what they are doingCan see it in something as simple as a tool tip where you mouseover the elementand it shows the tooltip widget.You might use this tooltip widget like the following: listen on an anchor element, create the content for the tooltip call tooltipFor with the anchor
  • #18 can.Control fixes this with templated event handlersYou can bind events that will always be unbound auto-magically
  • #19 ----- Meeting Notes (4/3/12 00:38) -----cleaned up
  • #20 The next way CanJS helps with memory is through it’s non-leaking global store. Say we have 2 Todo lists, Critical Todos and today’s todos. These lists might get back data for the same instance of a todo. The problem happens when a user changes properties on a todo that exists in both lists. Both lists need to be listening to property changes on the same todo instance.Model needs to see that the data it retrieves belongs to the same instance and return the previously created instance instead of creating a new one.Most MVC libraries either ignore it or solve it with a model store that has all instances, when data is retrieved for an instance, it checks if the instance is already created and uses that instance instead of creating a new one.The problem with this is for long-lived applications, you are constantly collecting unused instances, which fills memory. The developer has to tell the store when to flush instances.CanJS solves this by keeping things in the store only when it knows you are interested in them. How do you express interest? Well by binding to the instance. So, Model keeps instances in the store only while they have event handlers.This, combined with templated event handling, means that simply by replacing the todo list ELEMENTs with a list of "Awesome Developers"&lt;li class="&lt;%= todo.attr(‘complete’) ? "done" :"" %&gt;" &gt;Very common, but tricky and critical problem for MVC.CanJS has a non-leaking global store, that allows it to solve the 2 ‘instance’ problem without permanently storing all model instances.
  • #21 All controls are torn down, when all controls are torn down, all event handlers are unbound. When an model instances event handlers are unbound, it’s removed from the store.If you don’t understand this, that’s ok ... the big take away is that it’s pretty much impossible to make a leaking CanJS app ... You bind and forget ....
  • #22 Set out to make CanJS the best documented library.Awesome overview page with it’s sweet navigation, underlying docs for every function, method, attribute, and demo applications for each component.Annotated SourceAnd hire us for training, support, or development
  • #28 deep bindingthe flexibility to switch between libraries without losing all your skills and even some of your (code)
  • #29 Hello, I&apos;m Justin Meyer from BitoviI&apos;m very proud that this is the second time Bitovi (formerly Jupiter) has sponsered JSConfThis year it comes at an important time for us. Not only are we announcing the rebranding at this conference (we are Bitovi now), we are releasing thenext version of JavaScriptMVC&apos;s MVC parts called CanJS.In this talk, I&apos;ll introduce what&apos;s inside CanJS and talk about why, despite a lot of strong competition, we think CanJS is the best MVC library on the market.

AltStyle によって変換されたページ (->オリジナル) /