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

Issue fork drupal-3211601

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lauriii created an issue. See original summary.

nod_’s picture

Status: Active » Needs review
FileSize
462.15 KB

files downloaded from https://code.jquery.com/

Status: Needs review » Needs work

The last submitted patch, 2: core-jquery-update-3211601-2.patch, failed testing. View results

nod_’s picture

I forgot to update core.libraries.yml

nod_’s picture

Status: Needs work » Needs review
FileSize
462.68 KB

new patch with lib version update looking into the failures

Status: Needs review » Needs work

The last submitted patch, 5: core-jquery-update-3211601-5.patch, failed testing. View results

nod_’s picture

not sure about the failures, I'll try again on monday.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

The 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.

zrpnr’s picture

Seems 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/180

I 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 in dist/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.

zrpnr’s picture

Status: Needs work » Needs review

Made a PR for updating Syn in MinkSelenium2Driver

https://github.com/minkphp/MinkSelenium2Driver/pull/333

zrpnr’s picture

I 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.

bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community

@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.

  • catch committed 0ed127e on 9.3.x
    Issue #3211601 by bnjmnm, nod_, zrpnr, lauriii: Update jQuery to version...
catch’s picture

Title: Update jQuery to version 3.6.0 » [backport] Update jQuery to version 3.6.0
Version: 9.3.x-dev » 9.1.x-dev
Issue tags: +Needs follow-up

Committed/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.

  • catch committed 0c07a31 on 9.2.x
    Issue #3211601 by bnjmnm, nod_, zrpnr, lauriii: Update jQuery to version...
catch’s picture

Version: 9.1.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Both 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

catch credited xjm.

catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

quietone’s picture

Issue tags: -Needs follow-up