News Roundup: Diffable, Def.js, Node servers, and more

Diffable

Diffable is a new project from a scrappy little web firm called Google. Here’s the idea behind Diffable: If a user has a version of your page’s Javascripts cached, the next time that user visits your page, they’ll only have to download any changes to those scripts.

Diffable was initially developed by members of the Google Maps team who have reduced their page-load times by ~1200ms for users who have the older versions of the Maps scripts in their cache. Granted, they get those kinds of results because they’ve got 300k worth of scripts, so you’re not likely to see that kind of a jump unless you’ve got a similar payload. That said, this is a great utility and one that’s certainly going to get a lot of attention.

Def.js

There are any number of libraries out there that build something like classical inheritance into Javascript. Most of them give you something that looks like Java or C++ classes. Def.js is a new library which implements classical inheritance using something a lot like Ruby’s syntax and object model, complete with automatically-invoked initialization methods.

As much as I love Ruby, I also really love Javascript, so I’m not necessarily keen to mix up their syntaxes (I’m also not in any particular hurry to forsake prototypal inheritance). That said, this is a clever hack, and I’m sure there are plenty of folks out there who will put it to good use.

(Hat tip to DailyJS)

Nodeload and Multi-Node

This week, a couple of awesome new Node.js server projects were unveiled. The first of these is Github’s Nodeload. Nodeload is now responsible for serving tarballs and zipped archives of code in Github repositories. The old system used multiple Sinatra & Resque instances to do the same task, but new(-ish) Githubber, Rick Olson, saw the opportunity to apply Node’s non-blocking I/O to replace all of those resources.

Another cool new Node server project is Multi-Node. Multi-Node lets you specify a number of node server instances to be created, along with a port to listen on, and then defers to the OS kernel to handle load-balancing between the nodes. Even better, rather than operating independently of each other, the nodes can communicate with each other allowing for Comet-like interactions between servers. Great stuff.

Defer

Defer is a new CoffeeScript extension that gives you a super-simple way to handle data from asynchronous processes (such as Ajax requests, HTML5 database access, etc.). Normally, in order to get data back from an asynchronous method, you’d need to do so through a callback that executed when the method returned. This is a common pattern, but it’s one that isn’t always terribly readable, and is fairly tough for new Javascripters to wrap their brains around. Defer gives you some CoffeeScript sugar (no pun intended, I assure you) to let you write familiar looking method calls and assign their return values to a variable, just like you’d do with a synchronous method. Very handy stuff, especially if you’re already using CoffeeScript.

windows 8 pro oem

(Hat tip: Badass Javascript)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit
  • TwitThis
  • Simpy
  • StumbleUpon



© webdevpublishing 2011