The inclusion of jQuery version X makes it hard to develop Drupal pages that need to use jQuery version Y. Different versions of jQuery are usually not fully compatible (for example, 1.1 is not backwards compatible with 1.0 which is part of Drupal 5) so the web developer (me, to make things obvious :) ) must create a customized version of jQuery which means hacking jQuery library etc. (nothing pleasant, of course). As a general presumption, Drupal JS code changes much less often than jQuery code so it seems quite logical that Drupal should create a customized version of jQuery and not to force web developer to do so.

Ideal situation? Imagine Drupal comes with jQuery but the 'jQuery' object is replaced with 'jQueryDr' (or whatever) and in all code snippets, '$' is replaces with '$d' (or whatever). In page-specific scripts, it would be then trivial to include the jQuery library and use '$' as usual.

The suggested change to the core should should be quite easy search & replace task but I would like to discuss it first.

What do you think? I believe that the suggested change would ease the life of many many web developer at a cost of small inconvenience for Drupal core developers (they would need to follow the '$d' convention).

Comments

Steven’s picture

Status: Active » Closed (won't fix)

If you use Drupal 5, use jQuery 1.0. End of story. This was agreed upon when we included jQuery into core.

A customized version makes no sense (as the point of using jQuery was to offload some of the JS development load).

Borek-1’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

Hi Steven, thanks for your comment. Correct me if I'm wrong but it seems to me that Drupal community had to make a decision whether to support module developers or website developers. Baking in the standard distribution of jQuery means that module developers can use convenient '$' in their scripts but it also means that website developers are limited to a certain version of jQuery, which can be pain in the ass. I can imagine my company still useing Drupal 5.x in a year or so and I will have to use the slow and buggy jQuery 1.0 instead of brand new jQuery 2.1. But I understand that you had to make a tough decision and in some point of view, primarily supporting module developers makes a perfect sense as they will probably write more JS code than average CMS users.

But there is more to this topic. For example, I'm curious how will Drupal community deal with upgrading to a newer version of Drupal with jQuery X.Y baked in. This will introduce compatibility issues in almost every module using jQuery's dollar sign. Sorry, I didn't follow technical discussions when you decided to use standard jQuery so maybe there are some proposed solutions to these problems but for me, it actually makes a perfect sense to include special, version-specific distribution of jQuery into Drupal core as this would in advance solve many issues that still have to arise.

Please correct me if I'm wrong.

chx’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I do not get you who are the two different groups, but anyways, when Drupal 6 gets released then a lot of Drupal APIs will be changed so you need to upgrade your PHP code -- and because it is released with jQuery 1.1 you also need to up your JS. This is standard Drupal policy.

Borek-1’s picture

OK, thanks for your comments.