Problem/Motivation
Libraries in core that are not the latest stable release of the library need to be updated prior to the release of 8.0.0, as per #2203431: [meta] Various asset (JavaScript) libraries have to be updated to a (minified) stable release prior to 8.0.0
This issue is marked as Critical because it is required for the completion of the parent issue, which is also Critical.
Proposed resolution
Update the jQuery UI library to the latest stable release: 1.11.2
Remaining tasks
Replace the jQuery UI library files in /core/assets/vendor/jquery.ui/ with the 1.11.2 release from jQuery GitHub repoUpdate core.libraries.ymlCorrelate Drupal JavaScript code with jQuery UI release notes to locate possible areas of concern- Perform manual testing
- Fix what broke
Minify JS files
User interface changes
None
API changes
- YAML files that use
stylesheets-overrideorstylesheets-removeto overwrite/remove jQuery UI files will need to be updated to use the new naming scheme (removing thejquery.ui.prefix from the file name) - Automated tests that directly refer to jQuery UI library file names/paths will need to be updated to use the new naming scheme
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | interdiff-2403269-13-15.txt | 929.57 KB | hampercm |
| #15 | update-jquery-ui-2403269-15.patch | 1.98 MB | hampercm |
| #13 | interdiff-no-libs-2403269-10-13.txt | 662 bytes | hampercm |
| #13 | update-jquery-ui-no-libs-2403269-13.patch | 43.36 KB | hampercm |
| #1 | update_jqueryui-2403269-1.patch | 3.07 MB | hampercm |
Comments
Comment #1
hampercm commentedHere's a patch that replaces the jQuery UI files in /core/assets/vendor/jquery.ui with version 1.11.2, and updates core.libraries.yml to match. Some files were renamed or moved between jQuery UI 1.10 and 1.11. jQuery UI 1.11 also includes a new widget named selectmenu, which I've added to core.libraries.yml as well.
No major malfunctions noticed yet.
Comment #2
idebr commentedI split the core/core.libraries.yml changes from the jQuery UI to make it easier to review.
Comment #3
idebr commentedComment #4
hampercm commentedGood call on splitting out the libraries from the rest.
During testing, I found that the name changes in the jQuery UI files was breaking an override of the jQuery UI CSS by the Seven theme's file /core/themes/seven/css/components/jquery.ui.theme.css. This was breaking the custom theming and making dialogs look very different. This patch moves that file to /core/themes/seven/css/components/jquery.ui/theme.css to fix this, and updates the corresponding YML file. This patch doesn't contain the updated jQueryUI libraries--combine with #3 to get the whole patch.
Dialogs still do look a little different at this point, compared to 8.0.x-dev. I'll continue to explore this and work out a fix.
interdiff was choking on the patches, so unfortunately none included.
Comment #5
hampercm commentedI've also explored the Upgrade Guide for 1.11 and Release Notes found on jqueryui.com, and examined the Drupal 8 JavaScript for correlations. It doesn't look like the upgrade to 1.11 has too many changes which will have an impact on Drupal 8.
Here are some potential points of concern I had from the jQuery UI Upgrade Guide. Perhaps some contributors with a fair amount of Drupal-jQueryUI experience will be able to chime in on them:
http://jqueryui.com/upgrade-guide/1.11/#switch-back-to-shuffling-z-index-but-only-look-at-ui-front-siblings
http://jqueryui.com/upgrade-guide/1.11/#stop-setting-ui-state-disabled-and-aria-disabled-by-default-when-the-disabled-option-is-set
Also, the change of file names for many jQuery UI files between 1.10 and 1.11 seems to be having some unexpected consequences (see my comment #4).
Comment #6
hampercm commentedBelated interdiff for #4.
Comment #7
idebr commentedThe final patch should include the minified version of jQuery UI, as noted by _nod in #2393125: Update underscore and backbone library to latest release in #2. I updated the issue summary accordingly.
Comment #8
nod_A bit tricker here because as far as I know, when downloading the production release of jquery ui we get all the scripts in the same file. We do want to keep separate files here.
We may need to manually (or script it) minifiy each file.
Comment #9
hampercm commentedYes, minification by us will be necessary. I'll go ahead and upload a minified patch shortly. I'm also working on fixing some CSS issues I've identified with dialogs.
Comment #10
hampercm commentedI've minified the jQuery UI library files and updated core.libraries.yml to match. This was done using uglifyjs (node-uglify 1.3.4-1) on my local Ubuntu machine.
I also found that the jQuery UI effects in core.libraries.yml hadn't been correctly updated by me previously. Those are also fixed. There are also two new effects: "puff" and "size", which were contained within the "scale" effect in jQuery UI 1.10. I added core.libraries.yml entries for those.
Some changes are also made to the Seven theme to compensate for the new file names in jQuery UI 1.11.
A few questions arose while I was minifying things: the JavaScript in the "external" subdirectories of the jQuery UI library doesn't seem to be used by Drupal 8. Does anyone know if it is actually used? Can the "external" subdirectory be removed from the Drupal 8 repo? Or, should it be left in and minified?
P.S.: The core.libraries.yml portion of the interdiff looks wrong at first glance. This is actually due to the way that
git diffis interpreting the changes to that file. I've double checked core.libraries.yml to make sure it is correct.Comment #11
hampercm commentedI've noticed during manual testing that dialog widgets don't appear to be getting positioned correctly with jQueryUI 1.11.2:
I've been attempting to work out what is going wrong, but no success yet...
Comment #12
hampercm commentedI think I've tracked down the source of the problems I'm seeing with dialogs. Working on a patch for it now.
Comment #13
hampercm commentedThe position object created in
resetPosition()in /core/misc/dialog/dialog.position.js was not properly positioning or repositioning the dialog widget. Explicitly setting the position of the dialog relative to$(window)fixes the problem.Comment #14
nod_Almost there. I tested the stuff we use jquery ui for: dialog are working. CKEditor admin is working but quickedit is kind of messed up but I don't think it's related to this patch. It uses jQuery UI for positions and that is working fine in quickedit.
of: $(window)without the jquery thing that works too:of: window.Drupal\system\Tests\Ajax\DialogTestline 140, the filename needs a -min added to it.Great work on updating all that, thanks!
Comment #15
hampercm commentedThanks @nod_. Made the changes recommended in #14. I also fixed a comment in core/themes/seven/css/components/jquery.ui/theme.css to list the new path.
One more question: Should the JSON files in core/assets/vendor/jquery.ui/ also be removed?
Comment #16
nod_Umm no those are OK, might need them for checking dependencies and other things, also there is author information in them so it's good to keep that around.
This is looking good though, thanks!
Comment #17
nod_Gave it another spin, everything works and I don't see leftover stuff.
Comment #25
alexpottThis issue is a critical task and is allowed per https://www.drupal.org/core/beta-changes. Committed c84e90c and pushed to 8.0.x. Thanks!