The If Works This dirt was a building before

JS.Class

When bugs become features

Been a while since we had a good rant, what with Zed calming down and Giles talking about winding up his blog. I had a great post lined up on browser performance and why all the advice you’ve heard is wrong and so on and so on, and I’d gathered tons of data and sunk [...]

Urgent bug fix release for JS.Class 1.6

Quick announcement: if you’re still running JS.Class 1.6, you’ll want to upgrade to the just-released 1.6.3 release which fixes a major bug introduced by Safari 4. This browser makes Function#prototype non-enumerable until it is overwritten by the user. This caused a check in JS.Class to fail, causing classes to become their own parents and cause [...]

New possibilities with modules in JS.Class 2.0

It’s been out and about a couple months now, and I’ve been putting it to good use in the upcoming release of Ojay. The new version (fingers crossed it’ll be out by the end of the month) features an extension to the custom event system that lets events published using Observable ‘bubble’ up the type [...]

Bug fix updates for Bluff and JS.Class

First off, let me say that the response to the release of Bluff over the last couple of weeks has been astonishing, due in no small part to a helpful link from John Gruber. Thanks to everyone who’s reported bugs and suggested features; some of these have now been fixed but others will need to [...]

Announcing Bluff, plus a few other project updates

I put out a few new software releases over the last few days, and thought I’d gather them into one post rather than lots of little ones. Let’s start with the biggest. Update: for those wishing to contribute bug reports (as failing test cases) and patches, Bluff is hosted on Github. In what can only [...]

JS.Class 2.0, now with even more Ruby-ness

A couple of months ago, I began a complete rewrite of JS.Class, as I’d become dissatisfied at some of its incompatibilities with Ruby, specifically with respect to module support. The 1.x series supported mixins in a reasonable way, but would not allow callSuper() to call methods from mixins. There were also a number of issues [...]

Inheritance, revisited

Late last year, I wrote a piece titled “Where’s my inheritance“, in which I argued against the inheritance implementation of various JavaScript libraries. I’ve recently been working on a rewrite of JS.Class that is much more Ruby-like, and it’s caused me to re-examine my thoughts on this issue. With JS.Class 1.x, I made the conscious [...]

Dispatching YouTube API events to individual JavaScript objects

Last week, I had the enviable task of creating a skinnable version of the YouTube player using JavaScript; something that would drop some HTML into the page that could be styled using CSS. Naturally, I wanted to package it up as a reusable class so you could, if required, create several videos on a single [...]

A plea to IE

Please, please implement getters and setters in your JavaScript engine. I cannot tell you how much I want to add this to JS.Class: var MagicMethods = { included: function(klass) { var define = function(object, name) { var shortName = name.replace(/^[gs]et[A-Z]/, function(s) { return s.charAt(3).toLowerCase() }); if (/^get[A-Z]/.test(name)) object.__defineGetter__(shortName, function() { return this[name]() }); if (/^set[A-Z]/.test(name)) [...]

JS.Class 1.6.0: Forwardable, State, and Ruby

A little update: JS.Class 1.6.0 is now out. The main new features are a port of Ruby’s Forwardable module for method delegation, an implementation of the State pattern (which I’m using heavily for building UI code), and JS.Ruby, which is something I wrote about a few weeks back. Also, I’ve implemented the extended hook to [...]

← Before After →