Tropical Software Observations

21 June 2013

Posted by Heath Basurto

at 6:45 PM

0 comments

Meteor js: Initial Impressions

I've had the opportunity to use Meteor for a small project.  For those of you who may not know, Meteor is a Javascript web framework built around node.js.   It's not ideal (or even intended) for many purposes.  Meteor doesn't follow the conventions of other popular frameworks like Rails and Django.  Instead, it builds a complete platform with highly integrated client and server side architecture.

Why Meteor?


It's true that Meteor can be used to make just about any type of app, but the real gains come from the magic under the hood which makes it an absolute pleasure to develop real-time single page web apps. The more real time interactivity required for the app, the more likely Meteor is a fit.  A great example would be game-like apps.  Because of how easy it is to deploy to the free meteor service it's also great for proof of concepts, demos, and internal tools.  It's also fairly easy to deploy to heroku after converting the project to a node bundle.

Yet Another Web Server?


No, it's nothing like express, Sinatra, Rails, or any of the many other frameworks you've used.  This framework is very opinionated about what you should be doing and how you should be doing it. Meteor stays true its stated principles.  Here's a few that I think are worth really noting:

  1. You write your entire app in one language, defining models and code that can be used on the client or server without repeating yourself.
  2. Templates are done with handlebars.  Smart, live updates to the clients as the database changes are done automatically.  
  3. You write client code to get data through Javascript calls to mongodb.  No more getting data from REST API end points.
  4. The framework uses pre-emptive success on database transactions.  This gives the appearance of a zero latency connection as things begin to happen immediately and only revert if a change in the data is unsuccessful.

Limitations


Meteor is a very new framework.  Much of the API is changing.  Much is yet to be written.  Some simple tasks in other frameworks, like Ruby on Rails, are a nightmare or even impossible in Meteor.   An example of something quite difficult is defining a REST API to access data from 3rd party apps.   Or something as simple as using the index of the each loop in the template engine.  Because of the dynamic re-rendering it's a real challenge.   And because it's new software, the occasional bug will be found.

Stayed tuned for part 2 where I discuss using Meteor addons, creating your own and the community bundler Meteorite (mrt).