DOMAssistant 2.7 released: better performance, more features, smaller file size

April 9th, 2008 by Robert Nyman

After a lot of hard work, we’re more pleased than ever to present the new version of DOMAssistant: faster, less code, better support and improved stability. And more features, of course. :-)

While we have actually made the code file size smaller, at the same time we have added a number of useful features and improved CSS selector performance.

New features

Unicode support added

In this version, we focused a lot on delivering Unicode support, implying support for basically any source document language. The web is, as you know, very international and it felt a bit hindering to only support English properly.

Naturally, we also wanted to measure up to other JavaScript libraries, and therefore we created the Slickspeed Unicode test to show what we have accomplished. Hint: the DOMAssistant column is the one getting it right. :-)

Complete documentation in Chinese

In line with our Unicode support, we now also offer complete documentation in Chinese (and as of before, in French). These translations are available as downloads from the documentation section.

New methods: cssSelect, ajax, setStyle, setErrorHandling and first

A number of new useful methods, after getting feedback from users and the community, have been introduced with this release:

cssSelect

This method is used to perform a CSS selection on an already existing DOM element reference. Example:

$(document).cssSelect(".mandatory");
$$(DOMElementReference).cssSelect(".important[type=test]");).

ajax

The ajax method is a more detailed and precise way to perform AJAX operations, where the web developer can fine-tune a lot of settings. E.g.:

$("#container").ajax({
    url: "ajax.php",
    method: "POST",
    params : "name=DOMAssistant",
    callback: functionReference,
    headers : {
        "Content-type" :
        "application/x-www-form-urlencoded"
    }
});

setStyle

To apply direct inline styling to an element, to override CSS applied from a CSS file or if you need to change something dynamically, you can use the setStyle method. Example usage:

$("#container").setStyle("border", "10px solid red");
$("#container").setStyle({
   background : "#ffffa2",
   color : "#f00"
});

setErrorHandling

When using the DOMAssistant.DOMReady method to add functions/methods to run as soon as the DOM is loaded, there’s now an alternative to set an error handler if it fails:

DOMAssistant.DOMLoad.setErrorHandling(function (e) {
    // e is the error object passed in
});

first

This is a helper method to get a reference to the first item returned in a CSS selection, and adding all the DOMAssistant methods to that element as well. For example:

$("#navigation a").first();

Vastly improved CSS selector performance

Another thing that we in the DOMAssistant team is very important, and sometimes underrated by people, is performance and accuracy. With version 2.6 DOMAssistant had the overall fastest CSS selector performance, except for in Internet Explorer, where Ext JS had very impressive results performance-wise.

We took that as a challenge, and improved the code for most web browsers while also seeing to that DOMAssistant now generally has the fastest CSS selector performance in Internet Explorer as well (results may vary…).

Try the Slickspeed test to see the new results!

Fixes and accuracy changes

Another thing we have done is fixing the accuracy of some CSS selectors, and general method behavior has been modified to minimizing the risk for errors and delivering a more stable experience.

  • Fixed so a function for an event, applied with addEvent, couldn’t be added multiple times.
  • Fixed so a function in DOMReady couldn’t be applied multiple times.
  • Accuracy fixes for XPath’s ends-with() implementation of E[att$=value].
  • Accuracy fixes for nth-child selector.
  • Accuracy fixes for ~ selector and contains in Internet Explorer.
  • Fix for what’s allowed following a child/sibling combinator.
  • Fix for attribute selector to support values that contain spaces.
  • Fix for what’s returned from the prev and next methods, so it has the correct methods applied.

Give it a go!

We are very happy with this release and would love for you to download DOMAssistant and try it out.

Join us in the world DOMination! :-D

22 Responses to “DOMAssistant 2.7 released: better performance, more features, smaller file size”

  1. [...] new version of DOMAssistant, 2.7, is finally out and my impression is that it is a very stable and solid release. Faster CSS [...]

  2. Great work. Really appreciated. We are currently looking for a good selector engine which we could integrate into qooxdoo. Would really enjoy if we could work together on this field. Your results are impressive.

    I found a few errors when testing using Safari 3.1. Slickspeed reports three SYNTAX_ERR with DOM Exception 12. Don’t know what this mean. May I ask you to have a look at it?

  3. chenghong says:

    @Sebastian:

    We run both the Slickspeed and Slickspeed-unicode tests with Safari 3.1 for Windows and didn’t encounter the error you are seeing. Does this only happen on Mac? Otherwise, you could try refreshing the cache and run the tests again.

    Integration with qooxdoo sounds awesome! I’m sure Robert will be happy to talk to you on this.

  4. Robert Nyman says:

    Sebastian,

    Thank you!
    I think it sounds like a great idea to work together with using it for qooxdoo, and I will contact you via e-mail to talk about that.

    I’m running the test on Safari 3.1 and I’m not experiencing any errors either. I’m just guessing here, but could it be possible that you’ve visited the Slickspeed test page before and happen to have an older version of the file cached?

  5. Great work all. Do you have a list of websites using the library?

  6. [...] Nyman announced that DOMAssistant 2.7 was released today. They have some good competiton from jQuery, Prototype, MooTools, Ext and all the others. [...]

  7. Robert Nyman says:

    Mattias,

    Thank you. Unfortunately, we don’t have such a list at the moment, but I would like one. :-)

  8. [...] that DOMAssistant has a formal team behind it, the updates keep coming fast and furious. The team announced last night the release of DOMAssistant 2.7, with a host of new features and big improvements in CSS selector performance: After a lot of hard [...]

  9. Venu says:

    WOW Just ran the sleek speed test and none of the other library’s are even close to DOM Assistant. I think it is time for me look even more closely.

  10. Clearing the cache fixed the issue. Sorry about this.

    @Robert: I will contact you via email.

  11. Robert Nyman says:

    Venu,

    We think so at least. :-)
    Performance is one of the vital aspects for a JavaScript framework, and we have been working very hard to get where we are today.

    Sebastian,

    Glad to hear it was just a cache issue. :-)

  12. Chris says:

    Is DOMAsisstant compatible with other JS libraries or does it have a compatibility option like jQuery?

  13. Robert Nyman says:

    Chris,

    It doesn’t have an explicit option like the other libraries, but it is possibly to run side-by-side with them.
    It is explained more in detail in Compatibility with other JavaScript libraries.

  14. [...] 5 Wochen harter Programmierarbeit wurde die auch von mir oft genutzte DOMAssistant-Bibliothek in Version 2.7 veröffentlicht. Neben weiterer Geschwindigkeitsoptimierungen überzeugt das neue Release mit [...]

  15. dave.trudes says:

    Hej,

    first of all, great job dudes :-)

    I’ve run the SlickSpeed-Test in all my browsers with this results (final time):

    Safari: DA2.7: 4ms (28ms ExtJS Core 2.0.2)
    IE 5.5: DA2.7: 726ms (4ms jQuery 1.2.3)
    IE 6.0: DA2.7: 869ms (1001ms ExtJS Core 2.0.2)
    IE 7.0: DA2.7: 318ms (437ms ExtJS Core 2.0.2)
    Opera 9.02: DA2.7: 304ms (164ms Dojo 1.0.2, 213ms ExtJS Core 2.0.2)
    Firefox 2.0.0.14: DA2.7: 140ms (303ms Mootools 1.2b2)

    Greetz
    dave

  16. chenghong says:

    Thanks Dave!

    Comparing the timings of DA with jQ on IE 5.5 is misleading though, as jQ does not support this browser and it would return incorrect results.

    As a sidenote, DA 2.7 is the only js library that produces 100% accuracy in the slickspeed test, across all modern browsers.

  17. aim says:

    @chenghong: not true. I six tests it fails like the other js libaries. Well at least in FF 2.0.0.14 today.

  18. chenghong says:

    @aim: Could you provide more info on which are the selectors that fail, and what should be their expected values?

  19. Robert Nyman says:

    dave,

    Thanks!

    aim,

    As chenghong said, do you have any examples of what you find to be incorrect?

  20. [...] little over a month ago, we released the 2.7 version, which included a lot of new features and improvements. However, as with all releases and when [...]

  21. any changes coming ?

  22. hi… i didn’t agree with some of the things, nevertheless i do enjoyed the post in general… the article was actually suggested to me by a friend at myspace and she ended up being right. quite good read! Take care, Egypten Resor

Leave a Reply