Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Falling in love with AMD & RequireJS
Search
Primoz
April 02, 2014
Programming
2
180
Falling in love with AMD & RequireJS
The talk for the Spring JS meetup Ljubljana, Slovenia.
Primoz
April 02, 2014
Tweet
Share
More Decks by Primoz
See All by Primoz
Beauties & Challenges of Remote Work
primozcigler
0
66
Stripping down your CSS
primozcigler
1
100
WordPress Themes 101
primozcigler
0
69
ProteusThemes: from early days till today
primozcigler
0
230
mod_pagespeed? You should use it too!
primozcigler
1
310
From Pet Project to Full Grown Business
primozcigler
4
120
Other Decks in Programming
See All in Programming
Laravel標準バリデーションでできること
hmb_ok
2
360
フロントエンドパフォーマンス 入門
shouta2
7
1.5k
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3.1k
15分間でふんわり理解するDocker @ Matsuriba MAX
ukwhatn
PRO
1
340
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
Enhancing Applications with Accessibility API
kishikawakatsumi
3
980
LLMチャットボットのアプリケーション設計Tips
os1ma
4
660
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
270
オブジェクト指向は必要なのか / Is object-oriented needed?
kishida
27
19k
OpenAPI を守るのは難しい
ohmori_yusuke
1
140
Open Source Swiftc Workshop
kitasuke
1
290
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.2k
Featured
See All Featured
Robots, Beer and Maslow
schacon
PRO
154
7.9k
Music & Morning Musume
bryan
39
5.5k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Gamification - CAS2011
davidbonilla
76
4.5k
Unsuck your backbone
ammeep
661
56k
Atom: Resistance is Futile
akmur
258
25k
GitHub's CSS Performance
jonrohan
1023
450k
Automating Front-end Workflow
addyosmani
1353
200k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
153
14k
A designer walks into a library…
pauljervisheath
199
23k
Designing with Data
zakiwarfel
94
4.8k
The Power of CSS Pseudo Elements
geoffreycrofte
58
4.9k
Transcript
@primozcigler Falling in with AMD & RequireJS ❤
None
None
None
None
@primozcigler
Scuba diving Knife Sharpening Astrophysics Business & Management Photography Windsurfing
Kiting Astronomy Travelling Astrophotography Free diving & snorkeling Archery Skiing Snowboarding Fishing Pool
Why?
@primozcigler 27 HTML files
@primozcigler HARD to maintain
@primozcigler custom.js
@primozcigler jquery.js jquery-plugin.js jquery-plugin.js jquery-plugin.js custom.js
None
None
None
@primozcigler HARD to reuse
@primozcigler That’s why people hated JS
AMD!
None
YO DAWG VOTED UP!
None
None
@primozcigler Modules = easily reusable code
@primozcigler define(['jquery', 'dep2', 'dep3'], function ($, dep2) { /** *
Init of the class, setting up the options */ var MyClass = function(options) { this.defaults = $.extend({}, MyClass.DEFAULTS, options); }; /* … */ return MyClass; });
bit.ly/1fJXEux
Add-ons
@primozcigler Optimization tool
None
bit.ly/1krgkm3
@primozcigler Use Almond for production PROTIP
@primozcigler Configure RequireJS with Grunt PROTIP
Recap
@primozcigler Umm, why again? • no global variables • single
entry point to JS • more reusable blocks of code • easy to start • easy to build minified code
@primozcigler It’s SPRING!
@primozcigler It’s time for YOU to start falling in with
AMD & RequireJS ❤
@primozcigler Primož Cigler @primozcigler
[email protected]
@primozcigler Images • http://en.wikipedia.org/wiki/File:Asynchronous_Module_Definition_overview.png • http://fedgeno.com/meme-generator/uploads/152.png • http://s2.quickmeme. com/img/39/393a980a3c2a2a584363a5ddceb4420557d47bc36be20d7d23ba9ee92 2b86e62.jpg
• color palette: http://www.colourlovers.com/palette/867235/LoversInJapan