Prototype Essentials: just the essence

One of my recent efforts is Prototype Essentials. It is, pardon my pun, essentially Prototype stripped of its browser-specific parts such as Ajax, DOM stuff, selectors, form helpers, and an event system. Why would anyone want a stripped down version of Prototype?

The big idea is that sometimes your preferred JavaScript library or your JavaScript environment has an underpowered API when it comes to pure programming. I'll draw two of my personal examples. I find jQuery to be awesome for intuitive DOM traversal and manipulation, but when it comes to non-DOM objects, what jQuery can do is limited (and also, in my own opinion, not as intuitive). Drupal is a great platform to build web apps on, but its simplicity (bundling jQuery) comes with a cost, and I find myself constrained because of this. Not anymore.

My second example is when I'd like to throw together a quick and dirty shell script using JavaScript on Rhino. I frequently find myself in need of an intuitive way to get the last element of an array (Array.last in Prototype), interpolate strings (String.interpolate in Prototype), or construct ranges ($R or ObjectRange in Prototype). Now all I need to do now is load Prototype Essentials and I'd have a much richer set of utilities.

So please check out the website I set up for Prototype Essentials. I also plan to wrap this into a Drupal module so I can ease my pains (and hopefully those of others) in JavaScripting in Drupal.

I also agree that, for me, I

I also agree that, for me, I don’t consider jQuery a library just containing essentials. It’s interesting what the effect of marketing jQuery’s packed size has had on people thinking of it as a small library. In fact, if you pack Prototype in the same manner it comes out smaller than jQuery. The Prototype guys don’t agree with using obfuscated code (rightly I think) and use gzip compression on their scripts but it does mean they’ve missed out on being a micro framework :)