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.