Monthly Archives: April 2012

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 

Posted in Backbone, Javascript, Marionette, Underscore | 20 Comments

Executing A Project-Specific Node/NPM Package A-la “bundle exec”

It’s no secret that I love NodeJS, though I really haven’t blogged about it much (if at all). Frankly, I think Node and NPM are going to be eating Ruby, RubyGems and Bundler’s $25,000 lunch – at least on OSX. … Continue reading 

Posted in Command Line, Javascript, NodeJS, NPM | 8 Comments

WatchMeCode: Using LiveReload In Web Development

From all of the screencasts that I’ve produced at WatchMeCode so far, the number one question that I get is: What tool do you use to refresh your browser when you change a file in your editor? It’s LiveReload, and … Continue reading 

Posted in Screencast, WatchMeCode, Web Sockets | 2 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 

Posted in Backbone, Javascript, Marionette, Pusher, SignalR, Socket.IO, Web Sockets | 12 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 

Posted in Backbone, DOM, Javascript, JQuery, Marionette, Twitter Bootstrap | 36 Comments

ClassyObjects: A JavaScript Class-y Inheritance Example

I recently released a screencast that covers JavaScript Objects & Prototypes on my WatchMeCode site. In this screencast, I go through all of the basics of working with objects in JavaScript, including prototypal inheritance. Toward the end of the video, … Continue reading 

Posted in Backbone, Classy Inheritance, Ember, Javascript, Prototypal Inheritance | 3 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 

Posted in Backbone, DOM, Javascript, JQuery, Marionette, 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 

Posted in Backbone, Composite Apps, Design Patterns, Javascript, JQuery, JSFiddle, Marionette | 33 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 

Posted in Backbone, Composite Apps, Javascript, Marionette, Messaging | 22 Comments