backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 38 forks source link

[ONGOING] Keep jQuery 1.x and jQuery UI 1.x up to date. #2493

Open klonos opened 7 years ago

klonos commented 7 years ago

I think we should be keeping these two libraries up to date. Especially with minor releases of Backdrop CMS.

List of things to test each time we update:

Latest vs what we currently ship with is:

jQuery Core 1.12.4 / 1.11.0 jQuery UI 1.13.0 / 1.10.4

PS: it's been quite some time now that jQuery 2.x and 3.x are released. This is what I gathered from the net:

Versions of 2.x leave behind the older Internet Explorer 6,7, and 8 browsers. In return they are smaller, faster, and can be used in JavaScript environments where the code needed for old-IE compatibility often causes problems of its own. The jQuery team still supports the 1.x branch which does run on IE6/7/8. ...if you’re one of those lucky developers who has dropped support for IE6/7/8, grab jQuery 2.0 and don’t look back.

Perhaps now that we have decided to officially drop IE8 support (#214), we should upgrade to a version of jQuery that gets us speed improvements and smaller size. jQuery ninjas like @quicksketch are more qualified to tell if and how we'd benefit from such an update, so I leave it up to them.

quicksketch commented 6 years ago

As we have dropped IE8 support, we could in theory upgrade to the latest jQuery (3.2.1 currently). Browser support listed here: http://jquery.com/browser-support/

But I think the bigger issue with upgrading to 3.x of jQuery is the deprecation of the .bind() method (preferring .on() instead). And there are many API changes listed in https://jquery.com/upgrade-guide/3.0/

I think upgrading to 3.x would be a Backdrop 2.x task, considering the scope of APIs changed there. However, I do think we should do our best to make Backdrop core jQuery 3.x compatible.

quicksketch commented 6 years ago

We can still do minor updates for 1.8:

jQuery: Already the latest version 1.12.4, but system_library() reports the version incorrectly as 1.11.0. (see #2826.)

jQuery UI: Currently on 1.11.2. Can be upgraded to 1.12.1.

quicksketch commented 6 years ago

Upgrading jQuery UI to 1.12.1 looks like it's a doozy, and probably not suitable for 1.8.0 at this point. Drupal accomplished this but it requires a large amount of manual repacking and reorganization. Issue is at https://www.drupal.org/node/2809427. We could adopt their reorganization, or consider just combining all the libraries together as was suggested earlier in that issue, which will make for much easier maintenance in the future.

Filed an issue for fixing the version number of jQuery itself at https://github.com/backdrop/backdrop-issues/issues/2826.

jenlampton commented 6 years ago

Let's skip upgrading jQuery UI to 1.12.1 until we have time to thoroughly test it (bumping milestone to 1.9). I like the idea of easier maintenance in the future, so I'm all for combining all the libraries together.

quicksketch commented 6 years ago

This issue wasn't updated when we last did a jQuery update, we are currently on 1.12.4 (the last 1.x version), per #1362.

Moving onto the 3.x version of jQuery (the current supported branch) is going to be a bit challenging. As it includes API breaks. I think we may need to do a combination of A) including the jQuery Migrate library for several releases and B) updating core's JS to not use any of the deprecated/removed functionality.

We could remove jQuery Migrate either by system.core.js and entirely in the 2.x version of Backdrop.

quicksketch commented 6 years ago

I filed https://github.com/backdrop/backdrop/pull/2175 to upgrade jQuery UI to the latest version. leveraging the Drupal patch this only required minor file renaming to get working. This will need much manual testing and review. Please try out the sandbox to check if everything works properly. Good candidates include CKEditor, Layout and Views UIs, and date elements.

olafgrabienski commented 6 years ago

I've tested CKEditor and other places of the user interface manually without any problems. Afterwards I saw however a few related messages in the DBlog (see below). Here's what I did:

CKEditor

Layout UI

Field UI

Date elements

Views UI

As I said, this worked without any problems. In the DBlog I saw however two jQuery related not found messages:

(There were also a Theme hook "" not found message. I guess that's not related to jQuery but to the date field, not sure!)

quicksketch commented 6 years ago

Thanks @olafgrabienski! That's very helpful. I filed a new issue for that jquery.form.min.map problem: https://github.com/backdrop/backdrop-issues/issues/3090

quicksketch commented 6 years ago

I've merged https://github.com/backdrop/backdrop/pull/2175 into 1.x for 1.10. Thanks @olafgrabienski!

quicksketch commented 5 years ago

We're up-to-date on jQuery (1.x) and jQuery UI as of 1.11.0 release time. Updating to jQuery 3.x is still desirable but it would take some work to update our JS throughout core.

klonos commented 5 years ago

...bumping to 1.13.0, since no new versions of jQuery 1.x or jQuery UI have been released. Also removed the "has PR", "needs review" and "needs feedback" tags.

indigoxela commented 2 years ago

This time I try it via issue, as the forum post wasn't the right thing.

My actual question is "hidden" in the last paragraph of that post:

I took a look at how jQuery UI gets pulled in, but didn't get far. Are there instructions regarding how that's done? Backdrop ships with individual compressed js files - which differ in naming from sources.

So, how does jQuery UI get pulled in? Is there a special build tool or helper script, I'm not aware of?

In Backdrop we have individual minified js files with filenames different from [jQuery UI sources, and in a different structure. How that?

@quicksketch do you remember how you did it back in 2018?

jenlampton commented 1 year ago

Related: https://github.com/backdrop/backdrop-issues/issues/5705

klonos commented 2 months ago

jQuery Ui v1.13.3 was released last month: https://blog.jqueryui.com/2024/04/jquery-ui-1-13-3-released

indigoxela commented 2 months ago

@klonos many thanks for keeping an eye on that. :pray: I created a new issue (jquery.ui usually needs lots of manual testing, so a dedicated space for comments seems important). https://github.com/backdrop/backdrop-issues/issues/6550