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
require.js + CoffeeScriptでお幸せに
Search
Ian Lewis
June 08, 2014
Technology
1
5.1k
require.js + CoffeeScriptでお幸せに
Ian Lewis
June 08, 2014
Tweet
Share
More Decks by Ian Lewis
See All by Ian Lewis
Kubernetes Security Best Practices
ianlewis
38
26k
The Enemy Within: Running untrusted code in Kubernetes
ianlewis
0
1.2k
The Enemy Within: Running untrusted code with gVisor
ianlewis
4
1.1k
KubeCon EU Runtime Track Recap
ianlewis
3
1.6k
コンテナによるNoOpsオートメーション
ianlewis
2
140
Google Kubernetes Engine 概要 & アップデート @ GCPUG Kansai Summit Day 2018
ianlewis
2
880
Extending Kubernetes with Custom Resources and Operator Frameworks
ianlewis
10
3.7k
Kubernetesのセキュリティのベストプラクティス
ianlewis
12
17k
Scheduling and Resource Management in Kubernetes
ianlewis
2
1.4k
Other Decks in Technology
See All in Technology
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
530
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
210
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
250
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.2k
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
310
強いチームと開発生産性
onk
PRO
34
11k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Language of Interfaces
destraynor
154
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Building Adaptive Systems
keathley
38
2.3k
Building Applications with DynamoDB
mza
90
6.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
A better future with KSS
kneath
238
17k
The Invisible Side of Design
smashingmag
298
50k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Transcript
Script
お前だれよ
@IanMLewis
None
None
None
None
I like Python
I hate JavaScript
Why?
this
No classes
prototypes don't count
No comprehensions
Namespaces
Environment
Config
<script> var myconfig = “HOGE”; </script> <script src=”file1.js”></script> <script src=”file2.js”></script>
やめろ!
Testing
サーバーに持っていきたいの?
JS以外は知らないの?
他の言語勉強しましょう
None
Require.js + cs.js + CoffeeScript = ❤
class MyModule.MyClass ### My class ### hoge: -> console.log(“hoge”)
x = [fun(y) for y in lst if y ==
“hoge”]
define [“jquery”, “underscore”], ($, _) -> ### My module ###
MyModule = {} class MyModule.MyClass ### My class ### return MyModule
require [“cs!mymodule”], (MyModule) -> ### New Module ### NewModule =
{} class NewModule.SubClass extends MyModule.MyClass ### New sub-class ### return NewModule
<script> require([“cs!newmodule”], function(NewModule) { var instance = new NewModule.NewClass(); //
... }); </script>
define [“cs!newmodule”]
({ appDir: "../static/js", baseUrl: ".", dir: "../tmp/static/js", stubModules: ['cs'], modules:
[ { name: "app.js", exclude: ["coffee-script"] } ] })
node r.js -o build_profile.json
<script src=”require.js”></script> <script src=”app.js”></script> <script> require([“cs!newmodule”], function(NewModule) { var instance
= new NewModule.NewClass(); // ... }); </script>
お幸せに