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

Chaplin.jsの話 #ten1club

Koutarou Chikuba
July 11, 2014
7.7k

Chaplin.jsの話 #ten1club

Chaplinの話!!!

Koutarou Chikuba

July 11, 2014
Tweet

Transcript

  1. Rails෩ͷߏ੒ ~/s/bwc (master) $ la app/ total 32 drwxr-xr-x 11

    mizchi staff 374B 7 11 16:33 . drwxr-xr-x 10 mizchi staff 340B 7 11 16:33 .. -rw-r--r-- 1 mizchi staff 207B 7 11 16:33 application.coffee drwxr-xr-x 4 mizchi staff 136B 7 11 16:33 assets drwxr-xr-x 5 mizchi staff 170B 7 11 16:34 controllers -rw-r--r-- 1 mizchi staff 230B 7 11 16:33 initialize.coffee drwxr-xr-x 4 mizchi staff 136B 7 11 16:33 lib -rw-r--r-- 1 mizchi staff 45B 7 11 16:33 mediator.coffee drwxr-xr-x 3 mizchi staff 102B 7 11 16:33 models -rw-r--r-- 1 mizchi staff 75B 7 11 16:33 routes.coffee drwxr-xr-x 8 mizchi staff 272B 7 11 16:35 views ͋͘·ͰRailsʮ෩ʯͰ͋ͬͯͦͷ΋ͷͰ͸ͳ͍
  2. Controller/Composerͷྫ # controllers/home-controller module.exports = class HomeController index: -> layout

    = @reuse('layout', LayoutView) view = @reuse('home', HomeView) # controllers/foo-controller module.exports = class FooController index: -> layout = @reuse('layout', LayoutView) view = @reuse('foo', FooView) Home%&>%Foo%ͷભҠͰ%Layout%͸ফ͑ͳ͍
  3. Generatorͷ࢖༻ྫ ~/s/mizchi-bwd (master) $ scaffolt scaffold foo 11 Jul 16:36:34

    - info: init app/templates/foo 11 Jul 16:36:34 - info: create app/templates/foo/foo.jade 11 Jul 16:36:34 - info: create app/controllers/foo-controller.coffee 11 Jul 16:36:34 - info: create test/controllers/foo-controller-test.coffee 11 Jul 16:36:34 - info: init app/view-models/foo 11 Jul 16:36:34 - info: init test/view-models/foo 11 Jul 16:36:34 - info: init app/views/foo 11 Jul 16:36:34 - info: init test/views/foo 11 Jul 16:36:34 - info: init app/styles/foo 11 Jul 16:36:34 - info: create app/view-models/foo/foo-view-model.coffee 11 Jul 16:36:34 - info: create test/view-models/foo/foo-view-model-test.coffee 11 Jul 16:36:34 - info: create app/views/foo/foo-view.coffee 11 Jul 16:36:34 - info: create test/views/foo/foo-view-test.coffee 11 Jul 16:36:34 - info: create app/styles/foo/foo.sass
  4. chaplin.jsͷਏ͍఺ • ྑ͘΋ѱ͘΋paulmillrϫʔϧυ • brunch • scaffolt • ಠࣗcommon.js •

    શମతʹγϯάϧτϯͷmediatorʹີ݁߹Ͱ୯ମςετࠔ೉ • ࡞ऀ͋Μ·Γςετͯ͠ͳͦ͞͏ͳͷͰؾ͍ͮͯͳ͍…
  5. Backbone.s+ckit • NYT੡BackboneσʔλόΠϯυ • NYTimes/backbone.s2ckit bindings: { '#album': { observe:

    'Tomorrow\'s Harvest', destroy: function($el, model, options) { // Tear down any events or clean up. } } }