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
AMD/RequireJS @2012.07.02
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shin-ichi Ueda
July 02, 2012
Technology
1
150
AMD/RequireJS @2012.07.02
Shin-ichi Ueda
July 02, 2012
Tweet
Share
Other Decks in Technology
See All in Technology
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
350
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
550
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
Webhook best practices for rock solid and resilient deployments
glaforge
1
280
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
220
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.7k
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
240
What happened to RubyGems and what can we learn?
mikemcquaid
0
280
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
250
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
GitLab Duo Agent Platform × AGENTS.md で実現するSpec-Driven Development / GitLab Duo Agent Platform × AGENTS.md
n11sh1
0
130
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
210
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
310
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Marketing to machines
jonoalderson
1
4.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to Talk to Developers About Accessibility
jct
2
130
Transcript
Module/Require.JS ϞδϡʔϧύλʔϯಋೖʹΑΔΤϨΨϯτͳ։ൃ 127݄2݄༵
Java Script ॻ͍ͯ·͔͢ʁ 127݄2݄༵
͜ Μ ͳ ͜ ͱ ʹ ͳ ͬ ͯ ͍
· ͤ Μ ͔ ʁ 127݄2݄༵
ϥΠϒϥϦͷڝ߹ 127݄2݄༵
ಡΈࠐΈࠈ <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.plugin1.js"></script> <script type="text/javascript" src="jquery.plugin2.js"></script>
<script type="text/javascript" src="jquery.plugin3.js"></script> <script type="text/javascript" src="jquery.plugin4.js"></script> <script type="text/javascript" src="jquery.plugin5.js"></script> <script type="text/javascript" src="jquery.plugin6.js"></script> <script type="text/javascript" src="jquery.plugin7.js"></script> <script type="text/javascript" src="jquery.plugin8.js"></script> <script type="text/javascript" src="jquery.plugin9.js"></script> <script type="text/javascript" src="jquery.plugin10.js"></script> <script type="text/javascript" src="jquery.plugin11.js"></script> <script type="text/javascript" src="jquery.plugin12.js"></script> <script type="text/javascript" src="jquery.plugin13.js"></script> <script type="text/javascript" src="jquery.plugin14.js"></script> ..... 127݄2݄༵
ͦΜͳوํͷͨΊͷ “Module” ὑ 127݄2݄༵
Module Paternͱʁ 127݄2݄༵
var myModule = function() { // Private Variable var privateVar
= ‘’; // Private Method var privateFunction = function() {}; return { // Public Variable publicVar: '', // Public Method publicFunction: function() {} } } (); // ಗ໊ؔ(͙͑͢ΔΑ͏ʹ͢Δ) http://yuiblog.com/blog/2007/06/12/module-pattern/ 127݄2݄༵
͔ΜͨΜͳྫ (ࢿྉԽ࣌ؒͳ͔ͬͨͷͰ…) 127݄2݄༵
ͦͨ͠ΒɺϞδϡʔϧ͕ ͍ͬͺ͍Ͱ͖ͪΌͬͨ 127݄2݄༵
ґଘؔͱ͔ ෳࡶ͗ͯ͢ϠόΠ A B C D E F ͝ʔΔ G
127݄2݄༵
͏Μ͟Γ 127݄2݄༵
ͦ͜ͰɺRequire.JS 127݄2݄༵
Require.JS 127݄2݄༵
Require.JS • Ϟδϡʔϧϩʔμʔ • ґଘؔνΣοΫ • ඇಉظಡΈࠐΈ • AMDͱ͍͏ઐ༻ܗࣜ 127݄2݄༵
AMD Asynchronous Module Definition 127݄2݄༵
Module Patern Λগ͔͑ͨ͠ͷ 127݄2݄༵
define([ID], [ґଘؔఆٛ], [FactoryMethod]); ϞδϡʔϧΛ࡞Δ (֤Ϟδϡʔϧʹهड़) Usage 127݄2݄༵
require([ґଘؔఆٛ], [FactoryMethod]); ϞδϡʔϧΛ͏ (ΞϓϦέʔγϣϯʹجຊ1ͭ) Usage 127݄2݄༵
͔ΜͨΜͳྫ (ͬͺΓࢿྉԽ࣌ؒͳ͔ͬͨͷͰ…) 127݄2݄༵
͜͜Ͱͷґଘؔ lib/jquery lib/ common blog/app main 127݄2݄༵
AMDʹରԠͯ͠ͳ͍ ϥΠϒϥϦ Ͳ͏͢Ε͍͍ͷʁ 127݄2݄༵
AMDԽ • ఘΊΔ • requirejsΑΓઌʹಡΉ • define()Ͱwrap • AMDରԠ൛Λ͏ 127݄2݄༵
·ͩΞϦ 127݄2݄༵
Ϟδϡʔϧ͕ ૿͑ͪΌͬͯ େมͰ͢ʼʻ 127݄2݄༵
r.js 127݄2݄༵
r.js • npm install -g requirejs • ґଘؔΛܭࢉͯ͠Ϟδϡʔϧ߹ମ • minified
• ϏϧυϓϩϑΝΠϧ(build.js) 127݄2݄༵
node r.js -o build.js Usage ͜Ε͚ͩʂ 127݄2݄༵
͔ΜͨΜͳྫ (ͬͺΓͬͺΓࢿྉԽ࣌ؒͳ͔ͬͨͷͰ…) 127݄2݄༵
One more thing... 127݄2݄༵
almond.js 127݄2݄༵
almond.js • require.jsͷػೳݶఆ൛ • ͍ܰ(1KB) • r.jsͰ࠷దԽͨ͠ޙͰ͏͜ͱ 127݄2݄༵
͓͠·͍ 127݄2݄༵