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
俺の望むライブラリがない!
Search
Koutarou Chikuba
May 29, 2014
Technology
1
2.1k
俺の望むライブラリがない!
JS ojisan #2
Koutarou Chikuba
May 29, 2014
Tweet
Share
More Decks by Koutarou Chikuba
See All by Koutarou Chikuba
極限環境で最終ビルドを絞るためのフロントエンド設計
mizchi
15
4.8k
Server Side JavaScript のためのバンドル最適化
mizchi
5
6.5k
V8 as a container on CDN Edge worker
mizchi
6
1.9k
Edge Side Frontend という新領域
mizchi
34
14k
バンドル最適化マニアクス at tfconf
mizchi
7
4.2k
「たかがJavaScript」のその先 #TECHPLAY
mizchi
47
20k
Deno Node 両刀
mizchi
6
2.3k
「フロントエンド領域」を再定義する
mizchi
50
36k
光を超えるためのフロントエンドアーキテクチャ
mizchi
90
23k
Other Decks in Technology
See All in Technology
Fargateを使った研修の話
takesection
0
170
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
170
Exadata Database Service on Cloud@Customer セキュリティ、ネットワーク、および管理について
oracle4engineer
PRO
0
1.1k
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
540
福岡新卒エンジニアの会
teba_eleven
1
180
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Lambdaと地方とコミュニティ
miu_crescent
1
130
TinyGoを使ったVSCode拡張機能実装
askua
2
200
Engineering at LY Corporation
lycorp_recruit_jp
0
260
SREの組織類型に応じた リーダシップの考察
kenta_hi
PRO
0
620
LINEヤフー株式会社における音声言語情報処理AI研究開発@SP/SLP研究会 2024.10.22
lycorptech_jp
PRO
2
270
Microsoft Intune アプリのトラブルシューティング
sophiakunii
1
390
Featured
See All Featured
Done Done
chrislema
181
16k
Happy Clients
brianwarren
97
6.7k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Language of Interfaces
destraynor
154
24k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Code Review Best Practice
trishagee
64
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
GraphQLとの向き合い方2022年版
quramy
43
13k
Typedesign – Prime Four
hannesfritz
40
2.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Transcript
ԶͷΉϥΠϒϥϦ͕ͳ ͍ʂʂʂ ---------------------------- @mizchi
ࣗݾհ 4 νϟϦͰ͖ͨ 4 Angular͕ݏ͍ 4 AltjsϚχΞ 4 ͙͙Ε
͋ΔήʔϜΛ࡞͍ͬͯΔͱ ߏ 4 CoffeeScript 4 brunch 4 cordova 4 snap.svg
4 vue.js ͦͷΜ
΄͍͠ͷ͕શવΓͳ͍…
࠷ۙͷϑϩϯτΤϯυ։ൃελοΫ 4 Ϗϧυཧπʔϧ(grunt/gulp/brunch) 4 npm/bower 4 ϞδϡʔϧγεςϜ(require.js/browserify) 4 CSSύΠϓϥΠϯ(sass/compass/less)
ϥΠϒϥϦબఆͲ͏͢Δ?
ϥΠϒϥϦબఆͲ͏͢Δ? 4 ͱʹ͔͘αϯυϘοΫε࡞ͬͯࢼ͢
αϯυϘοΫε࡞Γ·͘Δ mizchi-sandbox
Θ͔Δ͜ͱ
ੈͷதʹ
Զ͕΄͍͠ϥΠϒϥϦ͕
ͥΜͥΜͳ͍ʂʂʂ
Ͳ͏͢Δͷʁ શ෦࡞Δ͔͠ͳ͍ʂ(ࡨཚ)
࡞ͬͨ 4 momic 4 libretto 4 warden 4 TypedCoffeeScript
΄͍͠ͷ 4 ϒϥβετϨʔδͷActiveRecordΈ͍ͨͳͭ
Momic
Momic 4 IndexedDb/localStorageϥούʔ 4 rubyͷActiveModel෩API
Momic user = new User user.name = 'mizchi' user.age =
26 user.save().then => console.log 'save done!' User.find().then (users) => console.log users
ݱঢ় ศརͳͷʹԶ͔ͬͯ͠ͳ͍
΄͍͠ͷ1 4 Vue.jsͷϧʔλʔ
Warden
Warden 4 grapnel.jsΛchaplin.js෩ʹ֦ு 4 vue.jsͱҰॹʹ͏ͷΛఆ(vue-router͕·ͩͳ͍) 4 vue.jsͷ࡞ऀʹհͯ͠Β͑ͨͷͰˑ42
# app/controllers/home-controller.coffee module.exports = class HomeController extends Warden.Controller beforeAction: (params)
-> @reuse Layout index: (params) -> home = @reuse HomeView $ -> router = new Warden router.match '', 'home#index' ͜Μͳײ͡
ݱঢ় 4 ศརry 4 ެࣜʹհ͞ΕΔͱͦΕͳΓʹΘΕΔͬΆ͍ʁʁ
ଞʹ 4 ඇಉظίϯτϩʔϧϑϩʔ
libretto
libretto 4 ඇಉظίϯτϩʔϧ 4 ϢʔβʔͱͷΠϯλϥΫγϣϯ੍ޚ 4 εςʔτϚγϯ੍ޚ
libretto Purchase = Libretto.extend steps: start: 'waitUserSelection' waitUserSelection: ['purchase', 'cancel']
purchase: 'end' waitUserSelection: (context) => context.itemName = 'apple' 'purchase' purchase: (context) -> new Promise (done) => done()
libretto ݱঢ়ɿநߴͯ͘Զ͔ͬͯ͠ͳ͍
΄͍͠ͷ 4 coffeescirptॻ͍ͯΔͱܕ͕΄͘͠ͳͬͯ͘Δ
TypedCoffeeScript 4 ͬͺܕ΄͍͠͡ΌΜʁͱ։ൃ։࢝ 4 coffeescriptͷΏΔ;Θจ๏ + TypeScriptతܕνΣοΫ 4 AST֦ுͯ͠੩తʹTypeCheck(ϥϯλΠϜνΣοΫ͡Ό ͳ͍ʂ)
4 CoffeeScriptReduxͷ֦ு(jashkenasͷͰͳ͍)
TypedCoffeeScriptͰͰ͖Δ͜ͱ1 double :: Int -> Int double = (n) ->
n * 2 num1 :: Int = double 5 num2 :: String = double 5 # => TypeError
TypedCoffeeScriptͰͰ͖Δ͜ͱ2 struct Point x :: Number y :: Number p
:: Point = {x: 3, y: 3}
TypedCoffeeScriptͰͰ͖Δ͜ͱ3 class X text :: String f :: Number ->
Number f: (n) -> @text = n.toString()
TypedCoffeeScriptͰͰ͖Δ͜ͱΓ 4 ςετίʔυಡΊ 4 https://github.com/mizchi/TypedCoffeeScript/blob/ master/test/type_checker.coffee
ࠓޙͷల 4 TypeScript Importer 4 ͦͷͨΊʹASTվળத 4 moduleγεςϜ 4 ܕͷΧόϨοδܭଌ
ͦͷաఔ 4 CoffeeScriptReduxʹsuper͕ͳ͍ʂ 4 ࣮ͯ͠ຊՈʹPRத 4 TypedCoffeeScriptͰಋೖࡁΈ
ݱঢ় 4 ͗ͯ͢͠৮Εͯͳ͔ͬͨ 4 ֎ਓ͔Β͋Ε͜ΕΕͬͯݴΘΕΔ 4 ։ൃʹؾ߹ͱ͕࣌ؒඞཁͰਏ͍
͞Βʹͭ͘Γͨ͘ͳͬͨͷ 4 TypeScriptͷlib.d.ts͍͍ͨͳʁ
dts-parser 4 TypeScriptͷASTΛಡΈ͍͢ײ͡ͰJSONͰग़ྗ
dts-parser declare module Foo { export function fun(str?: number[]):void; export
var a:number; export class Bar { x: any; } }
dts-parser modules: - nodeType: Module moduleName: Foo modules: (empty array)
classes: - nodeType: ClassNode className: Bar properties: ... ུ
৭ʑ࡞ͬͨײ
ͭͬͯ͘Θ͔ͬͨ͜ͱ 4 υοάϑʔσΟϯάେࣄ 4 ࣗͰ͏ͱΓͳ͍ϙΠϯτ͕Θ͔Δ 4 ΄ͬͱ͍ͯࣗҎ֎ͬͯ͘Εͳ͍
ϥΠϒϥϦΛఏڙ͢Δʹ 4 ૬खͷڥΛ੍ݶ͠ͳ͍(require.js/common.js) 4 ࣮࣭όχϥJS/CoffeeScript/TypeScript ― ศརͳϥΠϒϥϦ͕ͳ͍͜ͱΛఆ 4 jQuery/underscore͕͋Δͱࢥ͏ͳ 4
ඞཁͳͷ͚ͩҠ২ 4 bower/npmύοέʔδԽ
ͬͯΒ͏ʹ 4 ʮӳޠͰʯdescriptionॻ͘ 4 Githubઓಆྗ/࣏ྗΛ্͛Δ 4 ࠾༻࣮࡞Δ(ݫ͍͠) 4 ςετΛॻ͘(ͩΔ͍) 4
ςετΛͨ͘͞Μॻ͘(ΊͬͪΌͩΔ͍)
Ұ൪େࣄͳ͜ͱ 4 ࣏ 4 ॳಈ͕ͳ͍ͱ୭ݟͯ͘Εͳ͍ 4 ͯͿߥΒ͠ͱҰॹͰ࠷ॳʹWatcher͔ͭͳ͍ͱ୭Έͯ ͘Εͳ͍ʂʂʂ
ͳΜͰ͜Μͳ͜ͱͯ͠Δͷʁ
͜͜·ͰΔϞνϕʔγϣϯ 4 ٕज़ͷ୳ٻ(झຯ) 4 ωΠςΟϒฒͷΞϓϦ࡞ΕΔ͜ͱΛূ໌(ҙ) 4 ࣄΛָʹ͢Δ(࣮ӹ)
ऴΘΒͳ͍ϠΫङΓΛܦͯ…
Զୡͷઓ͍·ͩ͡·ͬͯͳ͍ʂ 4 ήʔϜ࡞ͬͯҰൃͯΔͧʁ
ݴ͍͔ͨͬͨ͜ͱ 4 TypedCoffeeScriptͷίϛολืूͯ͠·͢