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*)?
Vue. js, React, AngularJS, Angular 2, and Ember. js are the most popular alternatives and competitors to Backbone. js.
It is a Full Stack Framework js to create both the backend and frontend user interface of the application rapidly.
Meteor is a popular JavaScript web framework that did have a brief slowdown because of some changes inside the company. The framework is back in the game after some slowdown and can be seen having a bright future ahead of it.
However, instead of "meteor run" you will be building (meteor build) – your backend into a standard nodeJS app, and your mobile into a signed APK or IOS app. There have been rumors over the years that Meteor doesn't scale well.
That's right. The different parts of Meteor like Meteor.Collection
(the Mongo database API that also works on the client) and Template
(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.
////////// Tracking selected list in URL //////////
var TodosRouter = Backbone.Router.extend({
routes: {
":list_id": "main"
},
main: function (list_id) {
Session.set("list_id", list_id);
Session.set("tag_filter", null);
},
setList: function (list_id) {
this.navigate(list_id, true);
}
});
Router = new TodosRouter;
Meteor.startup(function () {
Backbone.history.start({pushState: true});
});
There is an existing meteorite smart package called meteor-router. Perhaps it can help you migrate your existing backbone code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With