The first release candidate for Prototype 1.5.1 is now available for download. Prototype 1.5.1_rc1 contains bug fixes, performance improvements, and a few new features. If you’re using Prototype 1.5.0 in your application, we urge you to upgrade to this release candidate and report any bugs you may encounter. Assuming no heinous bugs are found, you can expect the final version to be released sometime within the next couple of weeks.
Keep reading for an overview of what’s changed (or see the full CHANGELOG for more details).
- $$ no longer returns duplicates for certain selectors. [#7568]
- Hash#toQueryString no longer doubly encodes certain parameters. [#7421]
- $H no longer iterates over shadowed properties in Safari. [#7421]
- Form.Element#disable will now call blur(), removed blur() call from Form.Element#enable. [#6034]
- Fixed an issue with serializing empty array inputs. [#7516]
- Fixed a bug in the simulated hasAttribute for IE due to getAttributeNode sometimes returning null.
- Fixed that Form.Methods and Form.Element.Methods weren’t being applied correctly to forms and form elements in Safari. [#7358]
- Fixed setStyle with opacity: 0 to work correctly in IE.
- Fixed that Form.Element#activate shouldn’t raise an exception when the form or field is hidden.
New features and changes
- $$ now supports virtually all of CSS3, with the exception of some pseudo-elements (like ::first-letter) and some pseudo-classes (like :hover).
- Prototype now has support for JSON encoding and decoding built in. If you’ve had issues with the official json.js library extending Object.prototype, you can now use our implementation instead. Thanks Tobie!
- Element.extend can now take a tag name or array of tag names as its first argument to apply the given methods to specific tags.
- Added String#empty, String#blank, String#startsWith, String#endsWith, String#include, and String#times.
- Added Number#toPaddedString.
- Added Form#request, which uses the form’s action and method attributes, along with its serialized parameters, to create an Ajax.Request.
- Removed support for “throw $continue” in Enumerable iterators. If you were using this in your scripts, please replace it with “return” instead.
- $$ is now blazing fast. Seriously — try it out. If you’re using $$ at all, you owe it to yourself to upgrade! Element#down, Element#up, Element#previous and Element#next received performance boosts too (along with everything else that uses Selector).
- Element#getStyle and Element#setStyle are now faster.
- Array#uniq is faster. [#7417]
- String#escapeHTML now uses a cached div and text node, making it much faster. [#6937]
- Enumerable iteration is faster now that it incurs only one try/catch block instead of two (as a result of removing support for $continue).
The $$/Selector improvements come from Andrew and Christophe’s many hours of work, and were inspired by Jack Slocum’s DomQuery and Joe Hewitt’s CSS selector-to-XPath translation. Selector is now backed by XPath where available (Firefox and Opera 9), and is optimized to be 5x faster on average than the previous version in browsers without XPath.
Thanks to everyone who contributed to this release!