Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Other Picplum cofounder here -- hope to write an in-depth post about the particulars of our Backbone usage. We've been working on something that was quite a big app refactor. Complete with require.js modules (require 2.0 just came out, had to fork requirejs-rails to get it working https://github.com/stammy/requirejs-rails)

Anything in particular you guys would like to know about our Backbone usage?



How did you guys where to place the cutoff between having a single application "page" vs having normal server-side rendered pages? It seems like you guys have somewhat of a mix here I'm just curious what percentage of the rendering is done server side vs client side. What are the relative tradeoffs between the two?

Perhaps not related to backbone but how are you encoding the different "views" in your single page application? Does the client download all of the templates upfront or how does that work? Also does the client know which template to render for a given api call or is that passed down from the server as well?

I'd be very interested in reading a blog post demonstrating how you strung all of this together! Pretty cool!

Thanks!


Client side vs server side rendering is pretty straight forward for us. Anything that is static, like the homepage, pricing, about is rendered server side. These pages don't change that often. Almost anything that is dynamic is client side. I would say 80% of the rendering is client side. Although the server does all the JSON handling and template rendering (handlebar pre-compiled templates).

Initially we had inline handlebar.js views wrapped around script tags. Now we precompile all templates into JS objects (http://handlebarsjs.com/precompilation.html). These templates are compressed and Gziped into one file and downloaded on page load. We will have two sets of templates now (common views used across the site and application specific views like account profile).

Blog post coming soon :)


Were there any issues with swapping out Backbone's built in templating for handlebarjs?


Backbone does not have built in templates. Underscore templates are very basic for our needs.


He mean't to say "No problems!" :)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: