SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
Require.js
With a Side of Backbone.js
plus,BowerandGrunt
by: twitter: github:joefleming @w33ble w33ble
Hi, I'm Joe
Webdeveloper(8years&counting)
PHP&Node.js
LeadDev@Convrrt
WPCurrent
Contracting
Today's Agenda
BowerforFrontendLibs
Require.jswithBackbone
BuildprocesswithGrunt
ExamplesorAppfromscratch?
Caveats
Node.js
Windowsmaynotwork
Warning: Advanced Content
ASK QUESTIONS!
Let's talk evolution
Dark days of DOM
// DOM manipulation
document.getElementById('myElement');
// AJAX
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
Wrapper Libraries
Circamid-2000's
Dojo,Prototype,MooTools,jQuery,etc
// DOM manipulation
$('#myElement');
// AJAX
$.ajax(/* code here */);
There Can be Only One!
// FAIL
<script src="js/jquery.js"></script>
<script src="js/mootools.js"></script>
<script src="js/prototype.js"></script>
And Only One Version
// FAIL
<script src="js/jquery-1.6.4.js"></script>
<script src="js/jquery-1.7.2.js"></script>
<script src="js/jquery-1.8.3.js"></script>
Modules
CommonJS(formerlyServerJS)
AsynchronousModuleDefinition(AMD)
MV*
Backbone,Ember,js,Angular,Knockout,etc
Module Pattern
var someObject = { msg: 'Hello World' };
(function($, Obj, undefined) {
// Internally access jQuery as $
alert("Using jQuery verson " + $().jquery);
// Internally access someOtherObject as Obj
alert("Object says: " + Obj.msg);
})(jQuery, someObject);
AMD pattern
Asynchronouslyloads/js/classes/UserClass.js
andmakesthatmoduleavailableasUser
*AssumingabasePathof./js
// Require bootstrap
require(['classes/UserClass'], function(User) {
var Joe = new User('Joe');
alert('New user created: ' + Joe.getName());
});
User module
// User module, js/classes/UserClass.js
define(function() {
function User(name) {
this.name = name;
}
User.prototype.getName = function() {
return this.name;
}
return User;
});
JSFiddle
We'recoders
So Let's Code!
Thanks!
JoeFleming
Twitter:@w33ble
github.com/w33ble
slideshare.net/w33ble

Weitere ähnliche Inhalte

Was ist angesagt?

Enjoy Writing Modern Desktop Application in JavaScript
Enjoy Writing Modern Desktop Application in JavaScriptEnjoy Writing Modern Desktop Application in JavaScript
Enjoy Writing Modern Desktop Application in JavaScriptFred Chien
 
Cryptography implementation weaknesses: based on true story
Cryptography implementation weaknesses: based on true storyCryptography implementation weaknesses: based on true story
Cryptography implementation weaknesses: based on true storyVlatko Kosturjak
 
Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Tekno Paul
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for JavaCharles Anderson
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
GroovyFX - Groove JavaFX
GroovyFX - Groove JavaFXGroovyFX - Groove JavaFX
GroovyFX - Groove JavaFXsascha_klein
 
Web of Technologies
Web of TechnologiesWeb of Technologies
Web of Technologiesdynamis
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Quick Introduction to Node.js
Quick Introduction to Node.jsQuick Introduction to Node.js
Quick Introduction to Node.jsNaing Lin Aung
 
Devcast node.js e mongo db o casamento perfeito
Devcast   node.js e mongo db o casamento perfeitoDevcast   node.js e mongo db o casamento perfeito
Devcast node.js e mongo db o casamento perfeitoSuissa
 
Introduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyIntroduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyJonathan Holloway
 
20111029 qt勉強会スライド
20111029 qt勉強会スライド20111029 qt勉強会スライド
20111029 qt勉強会スライドshohaga
 
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...Amazon Web Services
 
Diving into Node with Express and Mongo
Diving into Node with Express and MongoDiving into Node with Express and Mongo
Diving into Node with Express and MongoAxilis
 
Compressed js with NodeJS & GruntJS
Compressed js with NodeJS & GruntJSCompressed js with NodeJS & GruntJS
Compressed js with NodeJS & GruntJSDavid Nguyen
 
.NET MicroFramework by Yulian Slobodyan
.NET MicroFramework by Yulian Slobodyan.NET MicroFramework by Yulian Slobodyan
.NET MicroFramework by Yulian SlobodyanDima Maleev
 

Was ist angesagt? (20)

Enjoy Writing Modern Desktop Application in JavaScript
Enjoy Writing Modern Desktop Application in JavaScriptEnjoy Writing Modern Desktop Application in JavaScript
Enjoy Writing Modern Desktop Application in JavaScript
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 
Cryptography implementation weaknesses: based on true story
Cryptography implementation weaknesses: based on true storyCryptography implementation weaknesses: based on true story
Cryptography implementation weaknesses: based on true story
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
 
NodeJS
NodeJSNodeJS
NodeJS
 
Groovy a Scripting Language for Java
Groovy a Scripting Language for JavaGroovy a Scripting Language for Java
Groovy a Scripting Language for Java
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
GroovyFX - Groove JavaFX
GroovyFX - Groove JavaFXGroovyFX - Groove JavaFX
GroovyFX - Groove JavaFX
 
Web of Technologies
Web of TechnologiesWeb of Technologies
Web of Technologies
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Quick Introduction to Node.js
Quick Introduction to Node.jsQuick Introduction to Node.js
Quick Introduction to Node.js
 
Tangram
TangramTangram
Tangram
 
Devcast node.js e mongo db o casamento perfeito
Devcast   node.js e mongo db o casamento perfeitoDevcast   node.js e mongo db o casamento perfeito
Devcast node.js e mongo db o casamento perfeito
 
Introduction to using MongoDB with Ruby
Introduction to using MongoDB with RubyIntroduction to using MongoDB with Ruby
Introduction to using MongoDB with Ruby
 
20111029 qt勉強会スライド
20111029 qt勉強会スライド20111029 qt勉強会スライド
20111029 qt勉強会スライド
 
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...
A story of Netflix and AB Testing in the User Interface using DynamoDB - DAT3...
 
Diving into Node with Express and Mongo
Diving into Node with Express and MongoDiving into Node with Express and Mongo
Diving into Node with Express and Mongo
 
Compressed js with NodeJS & GruntJS
Compressed js with NodeJS & GruntJSCompressed js with NodeJS & GruntJS
Compressed js with NodeJS & GruntJS
 
.NET MicroFramework by Yulian Slobodyan
.NET MicroFramework by Yulian Slobodyan.NET MicroFramework by Yulian Slobodyan
.NET MicroFramework by Yulian Slobodyan
 

Ähnlich wie Require.js With a Side of Backbone.js and Bower/Grunt

JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.jsRody Middelkoop
 
Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJSSylvain Zimmer
 
우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지Rhio Kim
 
State of Developer Tools (WDS09)
State of Developer Tools (WDS09)State of Developer Tools (WDS09)
State of Developer Tools (WDS09)bgalbs
 
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지KTH, 케이티하이텔
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013Alexandre Morgaut
 
Node js实践
Node js实践Node js实践
Node js实践jay li
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevFelix Geisendörfer
 
Node Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeNode Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeRick Chang
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS ExpressDavid Boyer
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiJackson Tian
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.jsguileen
 
Javascript in linux desktop (ICOS ver.)
Javascript in linux desktop (ICOS ver.)Javascript in linux desktop (ICOS ver.)
Javascript in linux desktop (ICOS ver.)Yuren Ju
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS drupalcampest
 
How dojo works
How dojo worksHow dojo works
How dojo worksAmit Tyagi
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)jeresig
 
Js everywhere (Georgy Bunin)
Js everywhere (Georgy Bunin)Js everywhere (Georgy Bunin)
Js everywhere (Georgy Bunin)Georgy Bunin
 
Bringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersBringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersCorey Clark, Ph.D.
 
Zepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksThomas Fuchs
 

Ähnlich wie Require.js With a Side of Backbone.js and Bower/Grunt (20)

JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS
 
우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지우리가 모르는 노드로 할 수 있는 몇가지
우리가 모르는 노드로 할 수 있는 몇가지
 
State of Developer Tools (WDS09)
State of Developer Tools (WDS09)State of Developer Tools (WDS09)
State of Developer Tools (WDS09)
 
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
 
Node js实践
Node js实践Node js实践
Node js实践
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Node Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeNode Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About Node
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Grooscript greach
Grooscript greachGrooscript greach
Grooscript greach
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
Javascript in linux desktop (ICOS ver.)
Javascript in linux desktop (ICOS ver.)Javascript in linux desktop (ICOS ver.)
Javascript in linux desktop (ICOS ver.)
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
How dojo works
How dojo worksHow dojo works
How dojo works
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
 
Js everywhere (Georgy Bunin)
Js everywhere (Georgy Bunin)Js everywhere (Georgy Bunin)
Js everywhere (Georgy Bunin)
 
Bringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersBringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkers
 
Zepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-FrameworksZepto and the rise of the JavaScript Micro-Frameworks
Zepto and the rise of the JavaScript Micro-Frameworks
 

Require.js With a Side of Backbone.js and Bower/Grunt