Category Archives: Marionette

Make your Backbone applications dance with a composite application architecture! MarionetteJS.com

View Helpers For Underscore Templates

Underscore’s template engine lets you run any arbitrary JavaScript code that you want, within a template. You could write an entire JavaScript application within an underscore template if you want. But this is a really bad idea. Templates should be … Continue reading 

Also posted in Backbone, Javascript, Underscore | 16 Comments

Decoupling Backbone Apps From WebSockets

I’ve been doing a lot of work with web sockets lately, in my Backbone applications. And I’ve fallen in to a pattern that I really like, where my Backbone application doesn’t actually know anything about web sockets. All it knows … Continue reading 

Also posted in Backbone, Javascript, Pusher, SignalR, Socket.IO, Web Sockets | 9 Comments

Managing A Modal Dialog With Backbone And Marionette

My current client project is using Twitter Bootstrap, and I have to say I’m loving it. It provides a simple way to get started with common layout and design elements, and includes a handful of UI widgets and features that … Continue reading 

Also posted in Backbone, DOM, Javascript, JQuery, Twitter Bootstrap | 29 Comments

JavaScript Performance: Pre-Compiling And Caching HTML Templates

If you’re using HTML templates with a JavaScript application, you need to be caching the template’s raw text and/or pre-compiled version of the template. All of this spawned from a fun thread of discussion on a StackOverflow question. DOM Selection … Continue reading 

Also posted in Backbone, DOM, Javascript, JQuery, Performance | 7 Comments

Composite Views: Tree Structures, Tables, And More

One of the more recent features that I added to my Backbone.Marionette framework is the CompositeView. It’s actually been in the code for a while now, but in a recent version I extracted it out of the CollectionView and in … Continue reading 

Also posted in Backbone, Composite Apps, Design Patterns, Javascript, JQuery, JSFiddle | 23 Comments

Revisiting The Backbone Event Aggregator: Lessons Learned

It’s been a while since I originally talked about using an event aggregator in my Backbone applications. Since then, I’ve encapsulated the “vent” object in my Backbone.Marionette application and I’ve also realized that a lot of what I wrote originally … Continue reading 

Also posted in Backbone, Composite Apps, Javascript, Messaging | 17 Comments

Providing Synchronous / Asynchronous Flexibility With jQuery.when

I’ve quickly become a fan of jQuery’s Deferred / Promise features. They’ve been around for a little bit now, but I only recent started using them and they’ve helped me solve a number of problems with my asynchronous JavaScript code. … Continue reading 

Also posted in Async, Backbone, Javascript, JQuery | 8 Comments

Managing Layouts And Nested Views With Backbone.Marionette

I’ve received numerous questions about managing layouts and nested views in Backbone over the last few months. Until recently, though, I never had a great answer. Many of the applications that I’ve built had a lot of custom code to … Continue reading 

Also posted in Backbone, Composite Apps, Javascript | 18 Comments

Backbone.js And JavaScript Garbage Collection

A question was asked on Stack Overflow recently, and I provided an answer that I think is worth re-blogging here (while cleaning up the text / grammar). My answer goes in to a little bit of the idea behind a garbage … Continue reading 

Also posted in Backbone, DOM, Javascript | 9 Comments

Using jQuery, Plugins and UI Controls With Backbone

Most Backbone applications either use jQuery or Zepto as their DOM manipulation of choice. I tend to use jQuery as it’s supported across more browsers and has more features – though it is a little heavier in terms of download … Continue reading 

Also posted in Backbone, DOM, HTML5, Javascript, JQuery, KendoUI, Telerik, Tools and Vendors | 8 Comments