JS.Class 1.0 hits the shelves

After much sweating, coding, and documentaion site-building, the 1.0 release of JS.Class is upon us. Thanks to the current edge version of PackR, I’ve managed to keep the filesize down but add boatloads of new features. I’ve tried to cram as much of the Ruby way into it as I can, with a pinch of Java thrown in as well:

  • Ruby-ish singleton methods, with support for super
  • Method binding using object.method('name')
  • included and inherited hooks
  • Secure modules
  • Java-like interface support
  • Singletons

bindMethods has been removed as it produces objects that wasted bags of memory. You can now grab bound methods using object.method('someMethod'), which is more efficient and more Rubyish. Find out all about it, and download the code, over at the brand new docs site!

If you’ve enjoyed this article, you might enjoy my recently published book JavaScript Testing Recipes. It’s full of simple techniques for writing modular, maintainable JavaScript apps in the browser and on the server.