In this second installment in the series, I’m using my lunch hour to take a look at Meteor. It’s another box filled with all kind of delicious candy that any web app developer will love to use. But is it worth your time?
This article is going to sound a lot like a comparison with the previously reviewed Opa platform. And there’s good reason for that. Meteor is a full stack web application framework. Just as Opa, it comes as a standalone package. Just as Opa, it blurs the distinction between client and server.
Major differences with Opa include: Meteor is absolutely not production ready and Meteor uses JavaScript.
First Impressions
I tried Meteor on a VirtualBox Ubuntu installation. Given the way it is installed, it looks very unlikely that Meteor will run on Windows without a lot of hacking, so I didn’t even bother.
The Meteor site blurs the lines between download and examples. By the time you have installed Meteor, you also have an example app. This feels a little strange at first, “where’s that download link?”, but it’s a pretty good idea to get you started right away.
The examples are good, yet they couldn’t help but implement another multiuser live-update system (not a chat this time, though). Again, I think this is a use case that only a very small percentage of developers will encounter in their lives.
JavaScript All the Way Down
<figcaption class="wp-caption-text">No, not turtles, to develop in Meteor, you’ll only need to know JavaScript.</figcaption></figure>
[tweetherder]Unlike Opa, Meteor uses the familiar JavaScript language[/tweetherder]. Just as Opa, it mixes both server-side and client-side code in the same files. The distinction between client and server is made through a simple “if” test. Meteor.is_client and Meteor.is_server tell you where the code is running.
As far as I understand, most existing JavaScript libraries are re-usable straight away. So while the standard API may be pretty limited, your options will be endless. There are about 10 popular web libraries included by default, Bootstrap and Underscore are a few that I will find useful.
It wasn’t immediately clear from the web pages, but Meteor is build on Node.JS.
Deploying to the Cloud
The built-in examples are a great way to get started right away. However, going over them, I’m a little confused how security works. You can just deploy to any servername you like, so I guess any one can overwrite this “live” version of the program. It’s neat to be able to get started right away, however if you happen to cross paths with some one else using the same name, it’s probably not so much fun.
Reading further it appears it is possible to set a password for the server, but by default there is none. It’s also possible to create a self-contained package that can be deployed to Heroku. Which is nice, although I’m going to need a little more explanation than provided before I can actually deploy it.
Storing and Viewing Data
<figcaption class="wp-caption-text">If you’re used to SQL, you’ll find MongoDB’s API very refreshing.</figcaption></figure>
Meteor’s default datastore is MongoDB and as far as I can see, it directly exposes MongoDB’s JavaScript API. Mongo uses a fairly intuitive interface, so even without experience, you’ll be able to write a simple CRUD application quickly.
Since there’s a lot client/server communications build into the API, it looks like it would be fairly difficult to replace MongoDB with your own choice.
On the view side, Meteor comes with Handlebars built in. It has a neat and very clean way of using helper functions to connect the template variables and events to the controller code. You can replace Handlebars with your choice of templating framework, but I see very little reason to.
Wrapping Up
Just shooting from the hip here while I wrap up my hour:
As far as I can see, there’s no dependency management. I’m not sure why they didn’t re-use what Node and NPM already offer.
Development is as “live” as it will get. You don’t need to even reload your browser. This all happens behind the scenes for you. An impressive productivity feat.
Meteor seems to use long polling client/server communication similar to Opa.
The documentation is clear and also give a good insight into how the magic works, which is important for an analytical guy like me.
Why Would You Use Meteor
[tweetherder]With Meteor, your development time will be spent almost 100% doing actual development work[/tweetherder]. No time lost compiling, deploying or restarting.
[tweetherder]Meteor is 100% JavaScript, a language pretty much any developer on the planet knows[/tweetherder]. You can be productive almost immediately.
Why Would You Not Use Meteor
Meteor is still extremely experimental. As far as I know, there are no production level apps online. It’s probably going to be at least a year before you will be able to deploy Meteor apps and sleep at night.