The final versions of Prototype 1.6.0, script.aculo.us 1.8.0, and the Prototype & script.aculo.us book are now available. Prototype 1.6.0 is the most significant update to the framework since its inception over two years ago. We’re very excited about the changes in this release, and what better way to celebrate than with an update to script.aculo.us and a book covering all the new goodness?
Prototype 1.6.0 released
This version of Prototype brings a number of major enhancements to the core APIs as well as the usual slew of bug fixes and performance optimizations. For the full story, see the CHANGELOG and the release notes for 1.6.0_rc0 and 1.6.0_rc1. API highlights include:
- Ajax transport objects are now automatically wrapped in an Ajax.Response object.
- The class API now includes full support for inheritance and superclass method calls. (See Mislav’s tutorial for more info.)
- Class objects now have an addMethods method for adding instance methods after creation.
- Elements can be created easily with the new Element(…) syntax.
- Element#insert provides a unified API to DOM element and HTML fragment insertion.
- Element#select is an alias for getElementsBySelector and is now the preferred way to find elements by class name.
- Element#wrap lets you easily wrap an element inside another element in place.
- Enumerable methods on Array are now backed by native Array#forEach implementations when possible.
- Enumerable#grep now calls the match method on its first argument, so you can use it to e.g. filter an array of DOM nodes by CSS selector.
- Event objects are now automatically extended with instance methods, so you can write e.g. event.stop() instead of Event.stop(event).
- Prototype’s event API now supports firing DOM-based custom events with Element#fire.
- The new dom:loaded custom event fires when the entire document has loaded and is ready for manipulation.
- Function#curry allows for partial application of function arguments.
- Function#wrap facilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
- Function#delay delays invocation of the function by the given number of seconds.
- Function#defer schedules the function to run as soon as the interpreter is idle.
- The Hash API has changed, and you must now use Hash#get and Hash#set instead of directly accessing properties on Hash instances.
- String#interpolate is a shortcut for instantiating a Template from the string and calling evaluate on it.
- Object properties can now be used in template replacement strings.
script.aculo.us 1.8.0 released
script.aculo.us 1.8.0 is fully compatible with Prototype 1.6.0 and includes several improvements since the last version; see the announcement on Thomas’ blog for more details. Here’s what’s new:
- Complete rewrite of the in-place editing controls.
- Full CSS inheritance support for Effect.Morph.
- Support for tweening between two values of an element property or method call with Effect.Tween.
- A new sound API for playing interface sound effect MP3s.
- Numerous bug fixes and performance improvements.
Prototype & script.aculo.us available in PDF
Core contributor Christophe Porteneuve’s book Prototype & script.aculo.us is now available for purchase from the Pragmatic Programmers. The “Bungee book” covers the final versions Prototype 1.6.0 and script.aculo.us 1.8.0, which is no small feat, considering many of the documented features were added in the five months since the book first went beta! You can get the final PDF instantly for $22; paper copies are $34.95 and will be shipping in the next few weeks. Every developer using Prototype and script.aculo.us will want to read this book.
One more thing…
I’m pleased to announce that Andrew Dupont and Tobie Langel now have commit privileges for Prototype trunk. They’ve contributed an abundance of good judgment in the form of patches and community interaction since the core team was formed in January, and I know they’ll be good keepers of the code. Welcome, Andrew and Tobie!
Download, report bugs, and get help
- Download Prototype 1.6.0
- Submit bug reports to Rails Trac
- Get Prototype help on the rails-spinoffs mailing list or #prototype IRC channel
- Interact with the Core Team on the prototype-core mailing list
As always, thanks to the core team and the many contributors responsible for making this release possible.