Deprecate jquery.once and use the new once lib

Created on 18 November 2020, almost 4 years ago
Updated 16 July 2024, about 2 months ago

Deprecate and replace all instances of jQuery.once in core

HOW TO REVIEW

There are 2 branches:

  • The branch 3183149-jquery-once-review-friendly is the one to commit to. This holds all the change on top of the automated replacements, The diff between auto fix and manual changes.
  • The branch 3183149-auto-replace holds all the automated replacements (no human intervention on the code of this branch, see below for the list of replacement that are made automatically). It is used for reference, so please do not commit to it.

The human code is on the branch 3183149-jquery-once-review-friendly and the majority of manual changes are in this commit: https://git.drupalcode.org/project/drupal/-/merge_requests/513/diffs?com...

The Merge request for core is !513

The majority of the patch was made thanks to a custom codemod, automated replacement are:

The patch in #21 show all the automated replacements. Then a manual step was necessary to replace the once calls on $(window) and $(document) as well as replacing calls to $.each by .forEach when possible. The interdiff in #23 show the manual changes.

From there the creation of the merge request was based on patch #29 with updates to the once lib files and a fix for the library dependency of autocomplete.

📌 Task
Status

Fixed

Version

9.3

Component
Javascript 

Last updated 1 day ago

Created by

🇫🇷France nod_ Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024