[wp-trac] [WordPress Trac] #37110: Update to jQuery 3.*
WordPress Trac
noreply at wordpress.org
Thu Aug 6 23:45:01 UTC 2020
#37110: Update to jQuery 3.*
-------------------------------------------------+-------------------------
Reporter: jorbin | Owner: (none)
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 5.5
Component: External Libraries | Version:
Severity: critical | Resolution:
Keywords: early has-patch needs-testing | Focuses: javascript
needs-screenshots has-dev-note commit |
-------------------------------------------------+-------------------------
Comment (by desrosj):
I just posted a lengthy summary of some more research I did with @Clorith
in #core. I am posting here for anyone that is not in Slack or following
#core.
> I have been doing some experimenting and testing on different plugins
that were flagged in the
[https://wpdirectory.net/search/01EF25266C24AHENKPW7RYWYRK list of ~11k as
potentially breaking] when jQuery Migrate is not loaded. As I started to
dig in, though, there were a ton of false positives.
>
> The original plugin search was flagging 9 different functions/patterns
that may cause issues. This paints a complete picture of everything that
could break when jQuery gets upgraded to 3.x. But that's not what we need
to be looking at right now. We need to be looking at what plugins or
themes could break if jQuery Migrate is not loaded and jQuery 1.12.x is
loaded (the version currently shipping with WordPress).
>
> That whittles down the list of functions/patterns to 6. These will cause
deprecated notices in the console, but they will not break sites until
jQuery is upgraded to 3.x. This only
[https://wpdirectory.net/search/01EF2Y84Y3SXK8KZH6SMGJ1XFA decreases the
number of results by a few hundred]. However, there are still a very large
number of false positives.
>
> There are two uses for load, a way to inject content from a remote
source is removed in 1.9, but the same function used as a shortcut for
.on('load') is not removed until 3.x. The latter needs to be weeded out of
the results. Also, Colorbox (a common lightbox script back in the day) is
packaged with many plugins and themes. But this library contains a
compatibility check, only using load incorrectly if jQuery <1.9 is being
loaded.
>
> I was just working with @clorith, and he was able to massage the regex
search to account for these false positives. This results in
[https://wpdirectory.net/search/01EF31985CZ46Q1QTEHPSR0JZB ~2400 plugins
with the potential to break] when jQuery Migrate is disabled upon
upgrading to 5.5.
>
> There are still some Colorbox false positives for plugins and themes
that have slightly older versions of the library, and some compatibility
checks (I spotted 3-4 on a quick scan of the first page of results), but
this is significantly less than the original list that we have been using
in the discussions so far, and there are NO plugins with over 1m active
installs on the list (the only one there is a false positive).
>
> For themes, these changes to the search bring the results from
[https://wpdirectory.net/search/01EF034N6A2CCQ0WQ08P8Z3BXW ~2600 themes]
to [https://wpdirectory.net/search/01EF30MTKX3AKK868EYJRBJHFC ~250
themes], with only 5 having more than 10k active installs.
>
> With this updated information in mind, I think that we are on the right
path for proceeding as is (disabling jQuery Migrate in 5.5). We should
still make it easy for plugin/theme developers to re-add Migrate if they
need more time. The plugin that is being built should still be released
and plugin devs/site owners can still install this if they need more time
updating their code (and don't want to re-enqueue it themselves) or
experience any issues upon upgrading to 5.5.
>
> But I wanted to summarize this information here for further discussion,
just in case @clorith and I are misinterpreting something.
With all this in mind, I think [attachment:"37110-add-dependency.3.diff"]
is a low risk way to add a way for devs to re-enable jQuery Migrate, and
can be complicated with the jQuery Tester plugin that @Clorith and @azaozz
are working on (for non-devs, and those that don't want to add a code
snippet). [attachment:"37110-add-dependency.3.diff"] will not break
anything when we remove it along with the jQuery 3.x and jQuery Migrate
update in step 2.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37110#comment:176>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list