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
190
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
68
Stripping down your CSS
primozcigler
1
100
WordPress Themes 101
primozcigler
0
77
ProteusThemes: from early days till today
primozcigler
0
240
mod_pagespeed? You should use it too!
primozcigler
1
310
From Pet Project to Full Grown Business
primozcigler
4
130
Other Decks in Programming
See All in Programming
GAEログのコスト削減
mot_techtalk
0
120
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.2k
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
220
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
120
ARA Ansible for the teams
kksat
0
150
Immutable ActiveRecord
megane42
0
140
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
Ruby on cygwin 2025-02
fd0
0
140
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
120
技術を根付かせる / How to make technology take root
kubode
1
240
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
300
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Documentation Writing (for coders)
carmenintech
67
4.6k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Language of Interfaces
destraynor
156
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Gamification - CAS2011
davidbonilla
80
5.1k
How to Ace a Technical Interview
jacobian
276
23k
Designing Experiences People Love
moore
139
23k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Site-Speed That Sticks
csswizardry
3
370
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