Chapter 6. Backbone Extensions

Backbone is flexible, simple, and powerful. However, you may find that the complexity of the application you are working on requires more than what it provides out of the box. There are certain concerns that it just doesn’t address directly, as one of its goals is to be minimalist.

Take, for example, views, which provide a default render method that does nothing and produces no real results when called, despite most implementations using it to generate the HTML that the view manages. Also, models and collections have no built-in way of handling nested hierarchies—if you require this functionality, you need to write it yourself or use a plug-in.

In these cases, there are many existing Backbone plug-ins that can provide advanced solutions for large-scale Backbone apps. You can find a fairly complete list of the available plug-ins and frameworks on the Backbone wiki. With these add-ons, there is enough for applications of most sizes to be completed successfully.

In this section of the book, we will look at two popular Backbone add-ons: MarionetteJS and Thorax.

MarionetteJS (Backbone.Marionette)

By Derick Bailey and Addy Osmani

As we’ve seen, Backbone provides a great set of building blocks for our JavaScript applications. It gives us the core constructs that we need to build small to midsize apps, organize jQuery DOM events, or create single-page apps that support mobile devices and large-scale enterprise needs. But Backbone is not a complete framework. ...

Get Developing Backbone.js Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.