JavaScript Only Web Apps With Meteor

25 Feb 2013

Javascript is great for a lot of reasons. It is ECMAScript so it is widely understood, it is event driven, the community is gigantic, and there are tons of libraries that can help serve any type of content that you'd want. When Ryan Dahl wrote Node, he had it in mind that Javascript can be effectively utilized not only in the DOM as most were used to, but as the singular language of a whole application.

The brilliant folks at Meteor are taking this idea a step further.

If you have built web applications in server side frameworks such as Ruby on Rails or Django, there are plenty of common problems that naturally plague every project, many caused by varying types of code in the stack. Until now, many of these problems weren't being actively solved, rather were just "the way it was".

Let's take a look at a few of the claims made by Meteor and see how they are disrupting web application development.

Write your entire app in pure JavaScript. All the same APIs are available on the client and the server — including database APIs! — so the same code can easily run in either environment.

This is the most obvious and forthright, but it's necessary to iterate again. Writing your entire application in one language is a huge help. It allows developers to work more closely with each part of the stack, and alleviates headaches stemming from incompatible code or misunderstood connections. Not to mention testing and bug fixing and API availability on client and server.

Update your app while users are connected without disturbing them. When you push a new version, the new code is seamlessly injected into each browser frame in which the app is open.

Just awesome. Seemless changes without having to worry about hiccups (and a bad user experience) is unbelievably convenient.

When a user makes a change, their screen updates immediately — no waiting for the server. If the server rejects their request or executes it differently, the client is patched up with what actually happened.

Another extremely important point geared toward consistently good user experience. The client and server working so well together is music.

The Meteor team has gone to great lengths to make their platform as accessible and usable as possible. Meteor is open source, maintains an MIT license meaning you can use it however you damn well please, and even their Smart Packages have very little dependencies.

There are four solid examples that you can try out yourself to get an idea of how Meteor works. They even host it for you so you can get started right away!

Here's their To-Do list example to give you an idea. Try it yourself!

Try it yourself

In about 3 minutes, you'll make your own copy of Todo List and deploy it live on the Internet for you and your friends to use. No programming knowledge required!

1) Install Meteor

$ curl | sh

2) Make a copy of this example

$ meteor create --example todos

3) Get it running

$ cd todos

$ meteor deploy [whatevernameyoupick]

4) Now open it up in your browser at [whatevernameyoupick]

Meteor already has a fairly popular tag running on StackOverflow if you have any questions not answered by their site. If you want to have any questions for the Meteor team personally or want to tell them how great you think Meteor is (and is going to be), you can send them a tweet @meteorjs.

I'm off to go hack around with this myself. I'm sure there will be an extended update and review after I work through a couple projects.