#88 ✓resolved
Ross Kaffenberger

env.js + jQuery 1.4: compatability issues

Reported by Ross Kaffenberger | January 18th, 2010 @ 03:24 PM | in 1.2.x

We'd like to move to jQuery 1.4 but we're being held up by compatibility issues in our javascript spec suite. The specs use the blue-ridge framework which leverages jQuery, Screw.Unit and env.rhino.js to run enable them to run on command line.

As far as I can tell, Blue Ridge uses Envjs to set the window context from a spec file and triggers the "load" event on $(window) to initialize the callback to the Screw.Unit suite. When we load jQuery-1.3.2 to the environment, the tests run as expected. Running the suite with jQuery-1.4 in the browser also behaves as expected. When running the suite on the command line (Rhino) with jQuery-1.4, window event does not fire and the tests fail to run at all. Debugging reveals the window object appears to be null altogether.

Without having dug too far into the new jQuery code and env.rhino.js, there appear to be some compatability issues between the two where certain calls to $(selector) do not behave as expected in the Rhino environment. Anyone else reporting issues? Ideas for follow up?

Thanks,
Ross Kaffenberger
Weplay

--I also posted this question to the jQuery discussion forum

Comments and changes to this ticket

  • Thatcher

    Thatcher February 3rd, 2010 @ 05:08 PM

    • State changed from “new” to “open”
    • Assigned user changed from “John Resig” to “Thatcher”
    • Milestone set to 1.2.x

    sorry for the delayed response, janruary was overloaded for me because of a release for http://loc.gov/pictures/ so I'm just now playing catch up after a big refactor of Envjs. I'll be attempting to align the jQuery 1.4 unit tests into our suite tests this week. I suspect we have either already fixed it or will be able to easily detect where we break with our new testing framework.

    Please contact me personally or hit the envjs mailing list if you hit a project blocker like this. Sorry for the delay.

    Thatcher

  • gleneivey

    gleneivey February 7th, 2010 @ 05:49 AM

    Not sure that this is the same problem that Ross is experiencing, but: just tried to run a widget (fancybox) that requires jQuery under env.js (the 1.1RC/Rhino) with jQuery v1.4.1. During jQuery's initialization, it attempts to execute cloneNode() on a DOCUMENT_FRAGMENT-type node, which env.js doesn't support. Haven't looked into what it would take to clone fragment nodes like we do the rest, but this will definitely have to be done before we can support the current version of jQuery.

  • Thatcher

    Thatcher February 7th, 2010 @ 03:00 PM

    • Tag set to jquery 1.4, clonenode, documentfragment

    glen thanks for looking into this. I have found and fixed many subtle dom issues are there are undoubtly more. I was hoping this was the issue but I added a test in the dom spec for DocumentFragment.cloneNode and everything seemed ok. Of course this is in trunk (1.2.x). I think there are some remaining issues with cloneNode in general, in particular I dont think we are cloning shallow properties thoroughly.

    I'm still focusing on adding as many tests to the dom spec as possible because I do think this is how we'll build the strongest basics that everything else depends on. I need to look over my commits, but it may well be that I only added DocumentFragment support in the refactor.

  • Thatcher

    Thatcher February 7th, 2010 @ 03:10 PM

    ps, I'm going to build out the jquery 1.4 test suite integration now, and start tracking down the issues for envjs 1.2.x, ading tests to the specs as I to to make sure this is resolved as a priority issue.

  • Thatcher

    Thatcher February 8th, 2010 @ 02:49 PM

    been a busy day, but I got jquery 1.4.1 loading along with unit tests straight from git. Found lots of issues stemming from over focusing on unit tests not complimented with real world integration tests. The tests are loading simply via straight rhino+ env.rhino.js with window.location pointing to locale jquery test index.html.

    tests are not running yet but scripts are loaded without error.

  • Thatcher

    Thatcher February 8th, 2010 @ 07:18 PM

    oh thank goodness, jquery tests are running again. I'll post the results when complete but Im hoping for about 85% as a baseline.

    The big issue once all the obvious bugs from the refactor were gone is still a bit of a mystery because I havent been able to reproduce the issue in the specs even when I tried. basically it was related to event registration on the window object and my best attempt to port glens java proxy implementation to rhino-flavor javascript where the proxy put/get was confused by the difference between 2 an 2.0

    I'll spend the rest of the evening making sure we get through 1.4.1 as best as possible.

    Again sorry for the delay getting jquery back into the integration loop, I dropped the ball.

    Thatcher

  • Thatcher

    Thatcher February 8th, 2010 @ 07:28 PM

    ok basically around 566 tests into it (obviously some fail prior) but we get a hang on closest:div until there is finally an OutOfMemory after several minutes. I'm going to lose the test and see where we go from there.y envjs

    This is one reason why envjs has a new focus on acid behaviors that are verified by firefox. I can almost guarantee this is a core dom issue that would have been discovered with better coverage.

  • Thatcher

    Thatcher February 9th, 2010 @ 04:30 AM

    I have committed the integration tests which can be run via bin/test-jquery.sh (this will test 1.4.1) I'm digging into the OutOfMemoryError with the rhino debugger.

  • Thatcher

    Thatcher February 11th, 2010 @ 06:11 PM

    • Tag changed from jquery 1.4, clonenode, documentfragment to jquery 1.4, qunit same, clonenode, documentfragment, jsdump, qunit
    • State changed from “open” to “resolved”

    This should be fixed in trunk. We are still making performance enhancements but in general we can 'make it thorough the tests'.

    1581 tests of 1761 passed, 180 failed.

    just run

    ./bin/test-jquery.sh

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

a javascript browser environment

Pages