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
1
660
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
150
I2C basics with Arduino
mulderp
0
230
Sharing hardware with JavaScript
mulderp
1
220
Arduino October meetup
mulderp
0
130
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
630
Arduino July Meetup
mulderp
0
120
Other Decks in Programming
See All in Programming
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
220
20260315 AWSなんもわからん🥲
chiilog
2
160
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
140
How to stabilize UI tests using XCTest
akkeylab
0
130
The free-lunch guide to idea circularity
hollycummins
0
270
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.9k
Ruby and LLM Ecosystem 2nd
koic
1
1.1k
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
240
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Unsuck your backbone
ammeep
672
58k
Producing Creativity
orderedlist
PRO
348
40k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
Bash Introduction
62gerente
615
210k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
GraphQLとの向き合い方2022年版
quramy
50
14k
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!