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
640
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
220
Sharing hardware with JavaScript
mulderp
1
210
Arduino October meetup
mulderp
0
120
Physical JavaScript with Johnny-5, Cylon and Tessel
mulderp
1
1.1k
Blogging and writing about JavaScript
mulderp
2
940
Minimum Viable Interactions
mulderp
3
620
Arduino July Meetup
mulderp
0
110
Other Decks in Programming
See All in Programming
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
11
3.6k
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
120
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7.4k
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
610
Duke on CRaC with Jakarta EE
ivargrimstad
0
270
dnx で実行できるコマンド、作ってみました
tomohisa
0
110
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
2.7k
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
130
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
260
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 1
philipschwarz
PRO
0
110
開発生産性が組織文化になるまでの軌跡
tonegawa07
0
200
OSS開発者の憂鬱
yusukebe
14
11k
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Automating Front-end Workflow
addyosmani
1371
200k
Documentation Writing (for coders)
carmenintech
76
5.1k
Building Adaptive Systems
keathley
44
2.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
11
940
How to train your dragon (web standard)
notwaldorf
97
6.4k
The Language of Interfaces
destraynor
162
25k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Rails Girls Zürich Keynote
gr2m
95
14k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
350
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!