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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mulderp
February 20, 2014
Programming
670
1
Share
From Backbone to Thorax
An overview on the MV* pattern, Handlebars and resulting in Thorax.
mulderp
February 20, 2014
More Decks by mulderp
See All by mulderp
Node.js for Embedded Systems
mulderp
1
2.8k
Nodebotsday
mulderp
1
150
I2C basics with Arduino
mulderp
0
240
Sharing hardware with JavaScript
mulderp
1
230
Arduino October meetup
mulderp
0
140
Physical JavaScript with Johnny-5, Cylon and Tessel
mulderp
1
1.1k
Blogging and writing about JavaScript
mulderp
2
950
Minimum Viable Interactions
mulderp
3
640
Arduino July Meetup
mulderp
0
120
Other Decks in Programming
See All in Programming
GoogleCloudとterraform完全に理解した
terisuke
1
190
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
20k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
140
Programming with a DJ Controller — not vibe coding
m_seki
3
820
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
250
My daily life on Ruby
a_matsuda
3
280
JCON - Create Agentic AI Apps, The Easy Way!
kdubois
1
110
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
AI時代になぜ書くのか
mutsumix
0
380
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1k
Featured
See All Featured
Believing is Seeing
oripsolob
1
120
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.3k
Between Models and Reality
mayunak
3
290
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
The Language of Interfaces
destraynor
162
26k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Side Projects
sachag
455
43k
Designing for Timeless Needs
cassininazir
0
220
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!