Settings

Theme

Backbone that can run on both the Client and the Server

1 points by ameyakarve 13 years ago · 0 comments · 1 min read


So, I have been working on an implementation of Backbone that would work irrespective of whether you use it on Node or through a regular browser. What I have hacked together so far is similar in theory to Rendr by the AirBnB people. There are a few changes in the philosophy though. I want to be able to use the Model event bindings if possible on the client; it doesn't make too much sense using those server-side. Ideally, whatever I render through the server should contain no Javascript whatsoever; The same Backbone app should be runnable client-side too. Also, I will want to handle events on the client only, which won't be a part of the server implementation. Another concept I want to explore is API calls. On the server, I can simply connect to the database and fetch stuff; On the client, I will have to make an XHR call. Currently, I am thinking of using some conditional code mixed in to the custom Backbone objects. Would you have any good ideas for achieving this?

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection