1bpbqw
Last Updated: February 25, 2016
·
3.776K
· michalkow

Starting with Backbone LayoutManager

I was planing to use Backbone for my next project. Because it was a large application, I did start looking into the Backbone frameworks out there.
I took a look at Thorax.js, Marionette.js and LayoutManager.

Choosing LayoutManager

I decided to go with LayoutManager. One day, maybe I will write something more about the other ones because they are good and interesting frameworks. But in the end, I chosen LayoutManager because it is simple. I has all the things I needed and nothing more.
LayoutManager is created by Tim Branyen and you can find source code on Github. One of the things that convinced me to use LayoutManager is clean and well made wiki page. Everything seems to be covered there. But that is where my troubles started.

Video Tutorial

I wanted to save myself some time and watch a screen-cast instead of reading, so that I can dive right into it. Everything was nicely explained, but there was no source code of the example covered in screen-cast.
No problem, I thought, I will just follow the video and code along. I replicated all the files, but it was not working. The example was using Twitter API to fetch some data. The request was to the old and not supported version of Twitter API. Also some of the LayoutManager functions were returning errors. That is when I noticed - the video is two years old!

boilerplate-handlebars-layoutmanager

After realizing my mistake I went back to the documentation. There was the link to example with LayoutManager with Handlebars. This kind of integration was covered in the screen-cast, so I thought it will be perfect. The seed project was based on Backbone Boilerplate project, so it took me while to familiarize myself with the concept. After installing few node modules and bower components I was ready to start. Kind of... I understood the structure of the app thank to the post author refereed to in the video, but I wanted some app example I could play with.

The Thing I Was Looking For

I went back to the documentation of the core Boilerplate project, thinking that I will start from there and later add the LayoutManager to the project. I followed link to their example app, which is github-viewer. Turns out it uses the LayoutManager!
I found what I wanted. The app example is very well-structured and I think a perfect place to start hacking with LayoutManager. My tip for anyone that wants to use this framework is to start there.