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
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
960
Minimum Viable Interactions
mulderp
3
640
Arduino July Meetup
mulderp
0
120
Other Decks in Programming
See All in Programming
ふつうのFeature Flag実践入門
irof
7
3.5k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
4
330
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.3k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.9k
さぁV100、メモリをお食べ・・・
nilpe
0
120
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
300
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
2
160
inferと仲良くなる10分間
ryokatsuse
1
330
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
Moments When Things Go Wrong
aurimas
3
140
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
17
5k
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
240
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Between Models and Reality
mayunak
4
320
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Building AI with AI
inesmontani
PRO
1
1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Docker and Python
trallard
47
3.9k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
The SEO identity crisis: Don't let AI make you average
varn
0
480
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!