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
610
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
880
Minimum Viable Interactions
mulderp
3
610
Arduino July Meetup
mulderp
0
97
Other Decks in Programming
See All in Programming
SwiftDataのカスタムデータストアを試してみた
1mash0
0
130
The Implementations of Advanced LR Parser Algorithm
junk0612
1
860
By the way Google Cloud Next 2025に行ってみてどうだった
ymd65536
0
100
UMAPをざっくりと理解 / Overview of UMAP
kaityo256
PRO
1
650
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
120
Contribute to Comunities | React Tokyo Meetup #4 LT
sasagar
0
570
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
2
9.4k
Making TCPSocket.new "Happy"!
coe401_
1
2.2k
「影響が少ない」を自分の目でみてみる
o0h
PRO
2
1.2k
Java 24まとめ / Java 24 summary
kishida
3
510
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
2
820
fieldalignmentから見るGoの構造体
kuro_kurorrr
0
120
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
RailsConf 2023
tenderlove
30
1.1k
A Tale of Four Properties
chriscoyier
158
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Building an army of robots
kneath
305
45k
What's in a price? How to price your products and services
michaelherold
245
12k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Writing Fast Ruby
sferik
628
61k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Docker and Python
trallard
44
3.4k
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!