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
75
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
Contemporary Test Cases
maaretp
0
140
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Jakarta EE meets AI
ivargrimstad
0
290
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.8k
Ethereum_.pdf
nekomatu
0
470
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
280
CSC509 Lecture 13
javiergs
PRO
0
110
Click-free releases & the making of a CLI app
oheyadam
2
120
C++でシェーダを書く
fadis
6
4.1k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How GitHub (no longer) Works
holman
310
140k
Designing for Performance
lara
604
68k
What's new in Ruby 2.0
geeforr
343
31k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Navigating Team Friction
lara
183
14k
Designing for humans not robots
tammielis
250
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Code Review Best Practice
trishagee
64
17k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
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