jQuery 1.1.4 was just released. See: http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-for...

Is it time to update? For the speed improvements alone I'd like to see the update.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrabeemer’s picture

It shouldn't be too hard. 1.1.3 is already in and if 1.1.4 doesn't break anything major, it should just drop in. The speed improvements are into the double digits, BIG improvements over 1.1.3 and even more so that 1.1.2! I'm stoked at the animation possibilities.

jrabeemer’s picture

FileSize
43.35 KB

I patched jquery.js 1.1.3.1 to 1.1.4 in HEAD. It seems to work fine since all the hard work was fixed for 1.1.3.1 earlier. I need more testers to see if this patch didn't break other modules....

jrabeemer’s picture

Status: Active » Needs review

Changing status to patch review...

KentBye’s picture

FYI: I submitted an earlier issue for upgrading the latest Drupal-dev to jquery 1.1.4 that has some reference links to the previous Drupal 6 upgrade to jQuery 1.1.3.1.

Also, these the degraded functions with jQuery 1.1.4 that I've summarized from the official release announcement:

Deprecated Selectors
  $(”div//p”) XPath Descendant Selector  -- replaced with CSS: $(”div p”)
  $(”div/p”) XPath Child Selector -- replaced with CSS:  $(”div > p”)
  $(”p/../div”) XPath Parent Selector -- replaced with: $(”p”).parent(”div”)
  $(”div[p]”) XPath Contains Predicate Selector -- replaced with: $(”div:has(p)”) 
  $(”a[@href]”) XPath Attribute Selector -- replaced with CSS: $(”a[href]”) 

Deprecated DOM Manipulation
  $(”div”).clone(false) -- replaced with: $(”div”).clone().empty()

Deprecated DOM Traversal
  $(”div”).eq(0) -- replaced with either: $("div").slice(0,1); -- $("div:eq(0)") -- $("div:first")
  $(”div”).lt(2) -- replaced with either: $("div").slice(0,2); -- $("div:lt(2)")
  $(”div”).gt(2) -- replaced with either: $("div").slice(3); -- $("div:gt(2)")

Deprecated Ajax functions
  $(”#elem”).loadIfModified(”some.php”) -- replaced with: $.ajax({url: "some.php", ifModified: true, success: function(html){$("#elem").html(html);}});
  $.getIfModified(”some.php”) -- replaced with: $.ajax({url: "some.php", ifModified: true});
  $.ajaxTimeout(3000) -- replaced with: $.ajaxSetup({timeout: 3000});
  $(…).evalScripts() -- is no longer needed at all

It'd be good to go through the Drupal javascript code and replace any deprecated methods with the suggested replacements -- if any instances exist.

One final note is that John Resig said here that he is taking the week off this week to try to get jQuery 1.2 out the door by September 3rd.

The deprecated functions listed above in 1.1.4 are in preparation for the 1.2 release, and so if there are no problems with upgrading to 1.1.4, then we should consider extending this issue to upgrade to 1.2 as soon as it is released.

jrabeemer’s picture

No reason to wait. 1.1.4 is less invasive than 1.2 will be. More testing will be needed for that version.

I did a massive grep against the HEAD D6 JS files in /modules and /misc I didn't find any of the deprecated JS you mentioned above.

None of the JS code uses XPath. The rest came up empty in my search.

Joe

dmitrig01’s picture

Deprecated Selectors
  $(”div//p”) XPath Descendant Selector  -- replaced with CSS: $(”div p”)
  $(”div/p”) XPath Child Selector -- replaced with CSS:  $(”div > p”)
  $(”p/../div”) XPath Parent Selector -- replaced with: $(”p”).parent(”div”)
  $(”div[p]”) XPath Contains Predicate Selector -- replaced with: $(”div:has(p)”)
Used by:
none
  $(”a[@href]”) XPath Attribute Selector -- replaced with CSS: $(”a[href]”)
Used by:
./modules/book/book.js
./modules/comment/comment.js
./modules/node/node.js
./modules/user/user.js

Deprecated DOM Manipulation
  $(”div”).clone(false) -- replaced with: $(”div”).clone().empty()
Used By:
none

Deprecated DOM Traversal
  $(”div”).eq(0) -- replaced with either: $("div").slice(0,1); -- $("div:eq(0)") -- $("div:first")
  $(”div”).lt(2) -- replaced with either: $("div").slice(0,2); -- $("div:lt(2)")
  $(”div”).gt(2) -- replaced with either: $("div").slice(3); -- $("div:gt(2)")
Used by:
none

Deprecated Ajax functions
  $(”#elem”).loadIfModified(”some.php”) -- replaced with: $.ajax({url: "some.php", ifModified: true, success: function(html){$("#elem").html(html);}});
  $.getIfModified(”some.php”) -- replaced with: $.ajax({url: "some.php", ifModified: true});
  $.ajaxTimeout(3000) -- replaced with: $.ajaxSetup({timeout: 3000});
  $(…).evalScripts() -- is no longer needed at all
Used by:
none
jrabeemer’s picture

Good catch dmitri. I did some testing and removed the @ Xpath selectors from [@ using the instances you stated. In user.js, the Pictures support radio fails to expand if I remove the @ from the selector in line #184...

$('div.user-admin-picture-radios input[@type=radio]:

It maybe deprecated but it still works as is. I would surmise that that rest of the other @ instances are the same. We should leave them untouched. Can anyone else confirm? If this is true, my patch still stands.

dmitrig01’s picture

Title: update drupal 6-dev to jquery 1.1.4 » Make Drupal 6 compatible with other JavaScript libraries, and upgrade to 1.1.4
FileSize
67.72 KB

This patch makes Drupal 6 compatible with other JavaScript libraries, upgrades it to 1.1.4, and it uses less DOM and more jQuery.

dmitrig01’s picture

Assigned: Unassigned » dmitrig01
Priority: Normal » Critical
FileSize
67.72 KB

b0rked autocomplete, fixed now

jrabeemer’s picture

Do you have Firebug installed dmitri? I patched my virgin D6 with your http://drupal.org/files/issues/jquery_1131_to_114_1.patch patch and I'm getting JS errors all over the place in FF2.

Drupal is not defined
[Break on this error] Drupal.behaviors.password = function(context) {
user.js (line 8)
Drupal is not defined
[Break on this error] Drupal.behaviors.textarea = function(context) {
textarea.js (line 4)
Drupal is not defined
[Break on this error] Drupal.toggleFieldset = function(fieldset) {
collapse.js (line 7)

dmitrig01’s picture

:x. I'm in the middle of working ATM, but I'll look into it soon. BTW, I forgot to say untested!

dvessel’s picture

subscribing..

Gábor Hojtsy’s picture

We had an issue to make this compatible with other libraries and there was some debate there. (Although closed with a reference to this issue). I don't think that basically moving the two things together is the best idea... These are also heavy changes, for which we are more and more late in the release cycle.

(Yes, I know every new jQuery release is mind-blowingly cool).

jrabeemer’s picture

If dmitrig01 can fix his bugs and demonstrate that his changes don't break any of the other scripts, I'm all for going with his patch. Otherwise, I'd say stick to my patch which was less-invasive and much safer to use.

chx’s picture

Folks please test http://drupal.org/node/170224#comment-294457 ie. #2 -- dmitri's patch is for D7 I would say.

KentBye’s picture

Title: Make Drupal 6 compatible with other JavaScript libraries, and upgrade to 1.1.4 » Update drupal 6-dev to jquery 1.1.4
Status: Needs review » Needs work

Changing the title back to the original intention of the thread which was to upgrade Drupal 6 up to the latest jQuery 1.1.4.

@GáborHojtsy: Upgrading to jQuery 1.1.4 shouldn't take a lot of heavy changes.

I agree w/ Gabor & chx that making jQuery compatible w/ other javascript libraries should be held off until D7 & that was a feature creep of this thread.

Most of the heavy lifting to get to 1.1.3.1 was done here, and upgrading to 1.1.4 should be more straight forward.

The Drupal javascript already looks pretty cleaned up in terms of the deprecated functions in jQuery 1.1.4 -- according to dmitrig01's audit there are only four Drupal core *.js files that use the deprecated XPath Attribute Selector of $("a[@href]") -- book.js, comment.js, node.js & user.js

We should double check that all "@" XPath selectors are indeed deprecated, and then replace them w/ them the CSS method (i.e. simply removing the "@").

FYI: There isn't any other deprecated functionality w/ jQuery 1.2, which should be coming out next week or soon thereafter. So any changes for 1.1.4 will get us ready to plug in 1.2

dvessel’s picture

Status: Needs work » Needs review
FileSize
46.59 KB

This is based on patch #2 and Dmitrig's findings. I did a quick double check of the depricated selectors and everything else. Nothing else was found.

This is really an easy drop in. I tested in FF2/Safari2/IE6/Opera9.. Checked for js errors and I found none.

jrabeemer’s picture

This is broken. As I said in #7, user picture radio is broken when you remove the @ sign in user.js. Please test.

dvessel’s picture

FileSize
43.35 KB

Hrm, okay.. See this post by Resig.

http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-for...

So, forget the deprecated selectors. momendo, you had the right idea. The "@" is back in and won't make sense until later versions.

btw, momendo, you have to diff from root.

dvessel’s picture

FileSize
43.34 KB

wwebernet and Bdragon mentioned the $Date$ and or $Rev$ tags could interfere when commited. So, here it is again without the $ signs.

jrabeemer’s picture

I tested the following in FF2 and found no problems or JS bugs.
- expanding grab boxes
- color picker in garland theme
- expanding/collapsing arrows
- autoselecting radios
- expanding user.js radio
- summary splitter in content
- checkall boxes
- user text field lookup checker

Can't test...
- Auto info cookie store in comment - submit has broken php/mysql

jrabeemer’s picture

Same tests as above on IE7, Opera 9.23 and Safari 3.0.3 for Windows on Vista Ultimate 64bit. No bugs found regarding the JS.

Stefan Nagtegaal’s picture

Status: Needs review » Reviewed & tested by the community

Tested with Safari 3b/Safari 2/FF2 and Opera 9 on a Mac..
Works as expected.. this is ready!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Glad to see it such an easy drop in. Committed to CVS HEAD.

KentBye’s picture

Just wanted to bump this thread again to point out that jQuery 1.2 has been released, and a new thread has been started to upgrade jQuery again here:
http://drupal.org/node/174708

Anonymous’s picture

Status: Fixed » Closed (fixed)