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
200
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
74
Stripping down your CSS
primozcigler
1
110
WordPress Themes 101
primozcigler
0
84
ProteusThemes: from early days till today
primozcigler
0
250
mod_pagespeed? You should use it too!
primozcigler
1
320
From Pet Project to Full Grown Business
primozcigler
4
140
Other Decks in Programming
See All in Programming
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
210
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.3k
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
290
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
130
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
170
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
570
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
350
OTP を自動で入力する裏技
megabitsenmzq
0
120
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.2k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
480
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
210
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
2
290
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Between Models and Reality
mayunak
2
240
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Practical Orchestrator
shlominoach
191
11k
Ruling the World: When Life Gets Gamed
codingconduct
0
180
How to Talk to Developers About Accessibility
jct
2
150
Leo the Paperboy
mayatellez
4
1.5k
The SEO Collaboration Effect
kristinabergwall1
0
400
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
86
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
150
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
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