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
From Backbone to Thorax
Search
mulderp
February 20, 2014
Programming
1
590
From Backbone to Thorax
An overview on the MV* pattern, Handlebars and resulting in Thorax.
mulderp
February 20, 2014
Tweet
Share
More Decks by mulderp
See All by mulderp
Node.js for Embedded Systems
mulderp
1
2.8k
Nodebotsday
mulderp
1
130
I2C basics with Arduino
mulderp
0
210
Sharing hardware with JavaScript
mulderp
1
200
Arduino October meetup
mulderp
0
110
Physical JavaScript with Johnny-5, Cylon and Tessel
mulderp
1
1.1k
Blogging and writing about JavaScript
mulderp
2
870
Minimum Viable Interactions
mulderp
3
600
Arduino July Meetup
mulderp
0
94
Other Decks in Programming
See All in Programming
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
260
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
160
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
200
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
180
技術を根付かせる / How to make technology take root
kubode
1
110
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
4.7k
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
210
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
3
3.8k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
320
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
310
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
370
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
150
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
GitHub's CSS Performance
jonrohan
1030
460k
Become a Pro
speakerdeck
PRO
26
5.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
380
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Speed Design
sergeychernyshev
25
760
Writing Fast Ruby
sferik
628
61k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Transcript
From Backbone to Thorax MV* with 100% JavaScript Patrick Mulder
http://www.flickr.com/photos/the_foz/6219860966/
None
MV*
MVC pattern� http://amix.dk/blog/post/19615 user
View Collections/Models Subscribe UI Events Server RESTful DOM Templates Publish
Backbone MV*�
Demo 1� MV* basics
None
Why Thorax ?
Handlebars�
Backbone + handlebars
Demo 2� Handlebars MVC editor
Thorax.HelperView� {{#collection movies}} {{#link "details/{{_key}}" expand-tokens=true}} <li>{{title}}</li> {{/link}} {{/collection}}
itemFilter: function (model) { if (active) { return model.get('genre') ===
active; } else { return true; } } Supports filtering�
Thorax.Layout� layout.setView( ... ) <div class=“container"> {{layout-element}} </div>
subviews� <div class="header"> {{view header}} </div>
events� var listView = new Thorax.View({ el: "#movies", events: {
collection: { 'all': function(ev) { console.log(ev) }, filter: function(ev) { } } } }
model binding� $(event.target).model();
Demo 3� Thorax fiddles
Fiddles� • Filtering collections: – http://jsfiddle.net/mulderp/Q4aMh/3/ • LayoutView: • http://jsfiddle.net/mulderp/e8RzY/
The Thorax Generator
None
|-js! |! |---libs! |-----backbone! |-----impress! |-----masonry! |-----jquery! |-----jquery-fileupload! |-----jquery-ui! |-----require!
|-----underscore! |! |---modules! |! |! |-templates! |---dashboard! |---directory! |---shared! development production HTTP Loading JS Modules�
RequireJS�
Bower Yeoman
None
And more, e.g. for testing�
„Chef‘s choice“�
Development API server�
BUILD PROCESS
Demo 3� workflow automation�
Root View Thanks !
Let‘s discuss ! http://github.com/mulderp/thorax_sandbox! http://thinkingonthinking.com! http://pipefishbook.com! ! ! @mulpat!