[wp-trac] [WordPress Trac] #51123: commonL10n and other JS globals removed without backwards compatibility
WordPress Trac
noreply at wordpress.org
Mon Aug 31 09:56:13 UTC 2020
#51123: commonL10n and other JS globals removed without backwards compatibility
--------------------------------------+-------------------------
Reporter: kbjohnson90 | Owner: ocean90
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 5.5.1
Component: Script Loader | Version: 5.5
Severity: normal | Resolution:
Keywords: needs-dev-note has-patch | Focuses: javascript
--------------------------------------+-------------------------
Comment (by omarreiss):
Reasons why I think 51123.diff should be committed for 5.5.1 (with the
missed vars @peterwilsoncc noted).
- It's a **no risk** change and solves the issues. Even takes into account
potential plugins who redefine the removed globals.
- Returning empty strings is fine. The worst thing that can happen is that
these strings (which shouldn't have been used by integrators in the first
place) render empty. Much better than breaking execution and actually
nudges integrators to update.
- A deprecation policy for JavaScript is definitely something that should
be worked on. Gutenberg already has one that seems to work fine:
https://developer.wordpress.org/block-editor/developers/backward-
compatibility/deprecations/. There's no reason this should block commit
though.
- The reason I defined most globals in `common.js` is to keep the fix as
simple as possible. `common.js` gets loaded mostly anywhere in the admin
and since these globals are deprecated, we don't have to worry about them
being overly present. The impact of that is negligible and it makes
cleanup later a more simple task. In places where only an `l10n` property
was removed instead of the entire global, I had to do it in the file where
that actually happens, since the global is still localized onto that
script.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51123#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list