Monday, March 12th, 2007
One of the good changes is a sign of good community. Prototype was inspired by the CSS selector performance data that Jack Slocum and others have been talking about.
Now $$/Selector is up to 5 times faster depending on the task / browser.
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).
Posted by Dion Almaer at 7:50 am