[wp-trac] [WordPress Trac] #51171: Properly deprecate removed JavaScript globals
WordPress Trac
noreply at wordpress.org
Fri Aug 28 09:09:55 UTC 2020
#51171: Properly deprecate removed JavaScript globals
--------------------------+--------------------
Reporter: joostdevalk | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5.2
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+--------------------
In WordPress 5.5 the following global JavaScript objects
[https://make.wordpress.org/core/2020/08/05/more-support-for-javascript-
i18n-in-wordpress-5-5/ were removed] without being deprecated:
* `wp.updates.l10n`
* `wpPointerL10n`
* `commonl10n`
* `userProfileL10n`
* `privacyToolsL10n`
* `authcheckL10n`
* `wp.themePluginEditor.l10n`
* `tagsl10n`
* `adminCommentsL10n`
* `tagsSuggestL10n`
* `wpColorPickerL10n`
* `attachMediaBoxL10n`
* `postL10n`
* `inlineEditL10n`
* `plugininstallL10n`
* `navMenuL10n`
* `commentL10n`
* `setPostThumbnailL10n`
This means that referencing these objects will now result in a JavaScript
error and will thus halt JavaScript execution.
Some of these objects were being used in very popular plugins. @omarreiss
and I have been researching where these were used. This
[https://docs.google.com/spreadsheets/d/1Vho7hJR4DMRyns38xcUMvVUj8SBov_J8_X4a7zwpmzo/edit?usp=sharing
Google sheet] shows the impact.
If we only count plugins with more than 100k installs or more, some of
these already have an incredible impact. We should patch this as soon as
possible. Our proposal is to make them fail silently: return an empty
string and throw a console warning. This makes sure that JavaScript
doesn't break, and also makes clear to plugin developers that they need to
adapt.
For the globals that are removed entirely, we can do the deprecation in
common.js. For the globals that were properties on another global, we have
to do the deprecation in the file that holds the parent global.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51171>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list