Upgrade to Pro — share decks privately, control downloads, hide ads and more …

俺の望むライブラリがない!

 俺の望むライブラリがない!

JS ojisan #2

3aebd86547bfc5cdb451d5f2f95ed5d8?s=128

Koutarou Chikuba

May 29, 2014
Tweet

Transcript

  1. Զͷ๬ΉϥΠϒϥϦ͕ͳ ͍ʂʂʂ ---------------------------- @mizchi

  2. ࣗݾ঺հ 4 νϟϦͰ͖ͨ 4 Angular͕ݏ͍ 4 AltjsϚχΞ 4 ͙͙Ε

  3. ͋Δ೔ήʔϜΛ࡞͍ͬͯΔͱ ߏ੒ 4 CoffeeScript 4 brunch 4 cordova 4 snap.svg

    4 vue.js ͦͷ΁Μ
  4. ΄͍͠΋ͷ͕શવ଍Γͳ͍…

  5. ࠷ۙͷϑϩϯτΤϯυ։ൃελοΫ 4 Ϗϧυ؅ཧπʔϧ(grunt/gulp/brunch) 4 npm/bower 4 ϞδϡʔϧγεςϜ(require.js/browserify) 4 CSSύΠϓϥΠϯ(sass/compass/less)

  6. ϥΠϒϥϦબఆͲ͏͢Δ?

  7. ϥΠϒϥϦબఆͲ͏͢Δ? 4 ͱʹ͔͘αϯυϘοΫε࡞ͬͯࢼ͢

  8. αϯυϘοΫε࡞Γ·͘Δ mizchi-sandbox

  9. Θ͔Δ͜ͱ

  10. ੈͷதʹ͸

  11. Զ͕΄͍͠ϥΠϒϥϦ͕

  12. ͥΜͥΜͳ͍ʂʂʂ

  13. Ͳ͏͢Δͷʁ શ෦࡞Δ͔͠ͳ͍ʂ(ࡨཚ)

  14. ࡞ͬͨ 4 momic 4 libretto 4 warden 4 TypedCoffeeScript

  15. ΄͍͠΋ͷ 4 ϒϥ΢βετϨʔδͷActiveRecordΈ͍ͨͳ΍ͭ

  16. Momic

  17. Momic 4 IndexedDb/localStorageϥούʔ 4 rubyͷActiveModel෩API

  18. Momic user = new User user.name = 'mizchi' user.age =

    26 user.save().then => console.log 'save done!' User.find().then (users) => console.log users
  19. ݱঢ় ศརͳͷʹԶ͔͠࢖ͬͯͳ͍

  20. ΄͍͠΋ͷ1 4 Vue.jsͷϧʔλʔ

  21. Warden

  22. Warden 4 grapnel.jsΛchaplin.js෩ʹ֦ு 4 vue.jsͱҰॹʹ࢖͏ͷΛ૝ఆ(vue-router͕·ͩͳ͍) 4 vue.jsͷ࡞ऀʹ঺հͯ͠΋Β͑ͨͷͰˑ42

  23. # 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' ͜Μͳײ͡
  24. ݱঢ় 4 ศརry 4 ެࣜʹ঺հ͞ΕΔͱͦΕͳΓʹ࢖ΘΕΔͬΆ͍ʁʁ

  25. ଞʹ 4 ඇಉظίϯτϩʔϧϑϩʔ

  26. libretto

  27. libretto 4 ඇಉظίϯτϩʔϧ 4 ϢʔβʔͱͷΠϯλϥΫγϣϯ੍ޚ 4 εςʔτϚγϯ੍ޚ

  28. libretto Purchase = Libretto.extend steps: start: 'waitUserSelection' waitUserSelection: ['purchase', 'cancel']

    purchase: 'end' waitUserSelection: (context) => context.itemName = 'apple' 'purchase' purchase: (context) -> new Promise (done) => done()
  29. libretto ݱঢ়ɿந৅౓ߴͯ͘Զ͔͠࢖ͬͯͳ͍

  30. ΄͍͠΋ͷ 4 coffeescirptॻ͍ͯΔͱܕ͕΄͘͠ͳͬͯ͘Δ

  31. TypedCoffeeScript 4 ΍ͬͺܕ΄͍͠͡ΌΜʁͱ։ൃ։࢝ 4 coffeescriptͷΏΔ;Θจ๏ + TypeScriptతܕνΣοΫ 4 AST֦ுͯ͠੩తʹTypeCheck(ϥϯλΠϜνΣοΫ͡Ό ͳ͍ʂ)

    4 CoffeeScriptReduxͷ֦ு(jashkenasͷͰ͸ͳ͍)
  32. TypedCoffeeScriptͰͰ͖Δ͜ͱ1 double :: Int -> Int double = (n) ->

    n * 2 num1 :: Int = double 5 num2 :: String = double 5 # => TypeError
  33. TypedCoffeeScriptͰͰ͖Δ͜ͱ2 struct Point x :: Number y :: Number p

    :: Point = {x: 3, y: 3}
  34. TypedCoffeeScriptͰͰ͖Δ͜ͱ3 class X text :: String f :: Number ->

    Number f: (n) -> @text = n.toString()
  35. TypedCoffeeScriptͰͰ͖Δ͜ͱ࢒Γ 4 ςετίʔυಡΊ 4 https://github.com/mizchi/TypedCoffeeScript/blob/ master/test/type_checker.coffee

  36. ࠓޙͷల๬ 4 TypeScript Importer 4 ͦͷͨΊʹASTվળத 4 moduleγεςϜ 4 ܕͷΧόϨοδܭଌ

  37. ͦͷաఔ 4 CoffeeScriptReduxʹ͸super͕ͳ͍ʂ 4 ࣮૷ͯ͠ຊՈʹPRத 4 TypedCoffeeScriptͰ͸ಋೖࡁΈ

  38. ݱঢ় 4 ๩͗ͯ͢͠৮Εͯͳ͔ͬͨ 4 ֎ਓ͔Β͋Ε͜Ε΍ΕͬͯݴΘΕΔ 4 ։ൃʹؾ߹ͱ͕࣌ؒඞཁͰਏ͍

  39. ͞Βʹͭ͘Γͨ͘ͳͬͨ΋ͷ 4 TypeScriptͷlib.d.ts࢖͍͍ͨͳʁ

  40. dts-parser 4 TypeScriptͷASTΛಡΈ΍͍͢ײ͡ͰJSONͰग़ྗ

  41. dts-parser declare module Foo { export function fun(str?: number[]):void; export

    var a:number; export class Bar { x: any; } }
  42. dts-parser modules: - nodeType: Module moduleName: Foo modules: (empty array)

    classes: - nodeType: ClassNode className: Bar properties: ... ུ
  43. ৭ʑ࡞ͬͨײ૝

  44. ͭͬͯ͘Θ͔ͬͨ͜ͱ 4 υοάϑʔσΟϯάେࣄ 4 ࣗ෼Ͱ࢖͏ͱ଍Γͳ͍ϙΠϯτ͕Θ͔Δ 4 ΄ͬͱ͍ͯ΋ࣗ෼Ҏ֎࢖ͬͯ͘Εͳ͍

  45. ϥΠϒϥϦΛఏڙ͢Δʹ͸ 4 ૬खͷ؀ڥΛ੍ݶ͠ͳ͍(require.js/common.js) 4 ࣮࣭όχϥJS/CoffeeScript/TypeScript ― ศརͳϥΠϒϥϦ͕ͳ͍͜ͱΛ૝ఆ 4 jQuery/underscore͕͋Δͱࢥ͏ͳ 4

    ඞཁͳͷ͚ͩҠ২ 4 bower/npmύοέʔδԽ
  46. ࢖ͬͯ΋Β͏ʹ͸ 4 ʮӳޠͰʯdescriptionॻ͘ 4 Githubઓಆྗ/੓࣏ྗΛ্͛Δ 4 ࠾༻࣮੷࡞Δ(ݫ͍͠) 4 ςετΛॻ͘(ͩΔ͍) 4

    ςετΛͨ͘͞Μॻ͘(ΊͬͪΌͩΔ͍)
  47. Ұ൪େࣄͳ͜ͱ 4 ੓࣏ 4 ॳಈ͕ͳ͍ͱ୭΋ݟͯ͘Εͳ͍ 4 ͸ͯͿߥΒ͠ͱҰॹͰ࠷ॳʹWatcher͔ͭͳ͍ͱ୭΋Έͯ ͘Εͳ͍ʂʂʂ

  48. ͳΜͰ͜Μͳ͜ͱͯ͠Δͷʁ

  49. ͜͜·Ͱ΍ΔϞνϕʔγϣϯ 4 ٕज़ͷ୳ٻ(झຯ) 4 ωΠςΟϒฒͷΞϓϦ࡞ΕΔ͜ͱΛূ໌(ҙ஍) 4 ࢓ࣄΛָʹ͢Δ(࣮ӹ)

  50. ऴΘΒͳ͍ϠΫङΓΛܦͯ…

  51. Զୡͷઓ͍͸·ͩ͸͡·ͬͯͳ͍ʂ 4 ήʔϜ࡞ͬͯҰൃ౰ͯΔͧʁ

  52. ݴ͍͔ͨͬͨ͜ͱ 4 TypedCoffeeScriptͷίϛολืूͯ͠·͢