Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
New version of jQuery has been released: https://blog.jquery.com/2021/03/02/jquery-3-6-0-released/.
Proposed resolution
Update our version of jQuery to the latest release.
Remaining tasks
API changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#5 | core-jquery-update-3211601-5.patch | 462.68 KB | nod_ |
#2 | core-jquery-update-3211601-2.patch | 462.15 KB | nod_ |
Issue fork drupal-3211601
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nod_files downloaded from https://code.jquery.com/
Comment #4
nod_I forgot to update
core.libraries.yml
…Comment #5
nod_new patch with lib version update looking into the failures
Comment #7
nod_not sure about the failures, I'll try again on monday.
Comment #10
bnjmnmThe failing tests appear to be due to this change https://github.com/jquery/jquery/pull/4765/files
I manually reverted the changes in that PR and the tests pass.
Additional discussion about this can be found here https://github.com/jquery/jquery/issues/4755. The changes were made as they were not needed for any jQuery supported browser, but it seems as if it was needed for keyboard events in FunctionalJavascript tests.
Comment #11
zrpnrSeems like the selenium2driver uses Syn to trigger the keyevent, and that fires which.
Coincidentally the latest release of Syn refers to the
which
property: https://github.com/bitovi/syn/issues/180I tested this by cloning the syn repo, running `npm run build` and replacing
vendor/behat/mink-selenium2driver/src/Resources/syn.js
with the current syn build indist/global/syn.js
In Selenium2Driver.php the trigger function calls
$script = 'Syn.trigger("' . $event . '", ' . $options . ', {{ELEMENT}})';
This has to be updated to
$script = 'syn.trigger({{ELEMENT}}, "' . $event . '", ' . $options . ')';
because the global is lowercased and the order of arguments has changed.With this, and the latest jquery in the MR these 3 tests pass. However this may not be a good solution here since it would require an upstream change to MinkSelenium2Driver.
Would a polyfill for this deprecated event property be better for now? It would only need to be loaded for the tests.
Comment #13
zrpnrMade a PR for updating Syn in MinkSelenium2Driver
https://github.com/minkphp/MinkSelenium2Driver/pull/333
Comment #14
zrpnrI tested the polyfill @bnjmnm added in the MR and it works. It's also exactly the same as the code that was removed from jQuery 3.6.0. It is only needed for FunctionalJavascript tests that use
keyPress
and is not loaded anywhere else in core except for the WebDriverTestBase.Added a link to the PR in the polyfill comment.
Comment #15
bnjmnm@zrpnr signed off on my changes, and I've reviewed + manually tested the changes from @zrpnr and @nod_ and did a comparison with my own copies of the files from https://code.jquery.com/ and confirmed they're identical.
Comment #17
catchCommitted/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!
Not sure about backporting this to 9.1.x - it'll help if there's a jQuery security release in the next six months, but otherwise it probably won't help much, so leaving RTBC there.
I think it'd be a good idea to open a follow-up to track https://github.com/minkphp/MinkSelenium2Driver/pull/333 and the removal of the polyfill, so tagging for that.
Comment #19
catchBoth me and xjm were ambivalent on backporting this to 9.1.x - it could make a security release easier, but we've had to deal with that before. We've now missed the last 9.1.x patch release anyway, so just going ahead and marking this fixed.
Still needs the follow-up for https://github.com/minkphp/MinkSelenium2Driver/pull/333
Comment #21
catchComment #23
quietone CreditAttribution: quietone at PreviousNext commentedI created the followup, #3315322: [upstream] Update Syn library used in MinkSelenium2Driver , removing tag.