Re:Ask HN: What are the best technologies you've worked with...
by datapimp on Thursday December 30, 2010 @08:37PM
(#2054198)
I started work on this a little while ago, and shared a starter template on https://github.com/datapimp/backbone-express-mongoose-socket.... I am starting a new job in 2011 where we will be using this template heavily, so expect major updates in the first couple weeks of January.
Re:Ask HN: What are the best technologies you've worked with...
by nsm on Friday December 31, 2010 @12:51AM
(#2054670)
I'm doing something pretty similar to rumpetroll (it is fully functional rumpetroll now, but we will add more features) using Backbone Model View Collections as my 'Sprites'. The code isn't public yet, but me and a friend have some plans for it. The only thing different is that we've completely dropped use of Backbone.sync, for the sole reason that the method based approach does not fit very cleanly into what we are doing and websockets. So we have one model as a 'dispatcher' instead, to which all models send messages which are transmitted over websockets. All sprites communicate via attribute change events which is a really good use of Backbone. On the server a tiny node.js wrapper uses Redis pub-sub to relay messages out to other clients.
The code is 'out there' but private, so if you want to take a peek at it, please contact me directly.
Thanks for a great framework.
Re:Ask HN: What are the best technologies you've worked with...
by jashkenas on Friday December 31, 2010 @01:14AM
(#2054719)
I'd love to take a peek, if you want to mail an invite to jashkenas at gmail.
Replacing Backbone.sync is totally legit -- and is indeed what having Backbone.sync in a single place is intended for. There are many good paths to data persistence: REST/CRUD, RPC, aggregated JSON, CouchDB or Mongo, LocalStorage, and so on. Backbone.sync is just the default implementation for the common case.
I think that one of the more exciting things about JS development these days, is how open and flexible the patterns still are.
One client makes a change to a model -> changes are synced to the server -> other clients that currently reference that model have its attributes updated -> all the UI that displays the model is automatically re-rendered.
It's not critical for most applications, but is a really nice, nice-to-have for any JS app that displays the same editable data to more than one user at a time. Built-in conflict resolution mechanism for bonus points.