Skip to content

Comment on Why I switched to Spine.js

Comments

Semi-related question for you experts out there: how do these frameworks fit into a multi-page web app (ie: a typical Rails app)? They all seem to target the single-app market and the examples are always so simple that I have yet to figure how to build a larger application with either Backbone, Spine or Ember.

Is the idea to treat each page as a unique application?

In backbone, I will create a new Router for each page (though sometimes you might reuse the same router for groups of pages that contain the same views).

Thanks! I'll give that a try.

Where a typical Rails app has a controller per model with all the crud actions for that model, we have used one Backbone router per model. It worked out so that there was one Backbone router per top level nav item.

For multi-page applications the problem becomes how to load and manage dependencies on the client-side. I use http://requirejs.org/ for this.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.