I’ve been using backbone recently as my client-side framework. On the server I use Express.js.
Still, I was reading about Meteor and realized that it was a rather interesting ‘full-stack’ framework.
Is the usage of Backbone and Meteor complementary, or with Meteor can one
simply ditch Backbone (or any other MV*)?
That’s right. The different parts of Meteor like
Meteor.Collection(the Mongo database API that also works on the client) andTemplate(the Handlebars style templates that automatically redraw when data changes) work together. So any time one user makes a change, all the other tabs that are allow access to that data will automatically redraw. If you’re using them, then you don’t need a separate library like backbone on the client.Backbone is built for an earlier style of application, where you have separate client and server code written with different APIs. In that model, the server side exposes a REST API and backbone’s job is to provide some structure on the client for how to query that API and draw the screen based on the data that comes back. But you still have to write all the data synchronization and model validation code by hand before you have a realtime app, and you have to do it twice: once on the client and once on the server.
There’s one exception: many of us do use backbone’s router in our Meteor applications. The code below is from the Todo List example.