User tests: Successful: Unsuccessful:
The jquery-migrate.js
outputs this to the browsers console:
JQMIGRATE: Migrate is installed, version 1.4.1
This is useless and should not happen on a production environment.
This PR removes the console.log output when jQuery.migrateMute
is true.
jQuery.migrateMute
is true by default in the minified jquery-migrate.min.js
(which is the one that gets loaded if debugging is off).
Check the browser's console before and after this PR
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript |
It isn't a library file that will ever get updated anyway.
We are stuck with that version (seeing we are also stuck with the version of jQuery).
So why not improve it?
I agree with the principle but I really wish there were a way to do it without modifying third party code
Only way is to override the whole script via the template.
So a non-core way.
But that is no use to the bulk of the users.
Perhaps an issue should be opened against upstream https://github.com/jquery/jquery-migrate?
It's been requested there a couple of times. But they don't want to remove it. As they say the migrate script should be a temporary solution while you fix your scripts to work with jQuery 3.
Clearly Joomla 3 does use it as a permanent solution.
But they don't want to remove it.
@regularlabs that's a correct approach, migrate was created as a helper for developers to easily upgrade their scripts. Joomla made a wrong decision to force that script in every request that jQuery was needed. I guess we have to live with it till Joomla 4 where migrate won't be delivered by default (also by default core will NOT be using jQuery
As they say the migrate script should be a temporary solution while you fix your scripts to work with jQuery 3.
In 4.0 we aren't turning on jQuery Migrate by default anymore, it'll be up to extensions who need it to do so. So in that regard, while we're still giving devs the ability to use it, we aren't leaning on it ourselves going forward.
Clearly Joomla 3 does use it as a permanent solution.
We had to because of the B/C breaks jQuery 1.9 introduced, otherwise we would've been stuck on shipping jQuery 1.8 with core for the full lifecycle. And it's not so much the jQuery code that ships with core that's an issue, rather knowing that extensions are shipping all sorts of versions of plugins which may or may not have dealt with those compatibility problems at the time. Looking back, I almost wish we would've defaulted Migrate to off when first introduced and forced devs who need it to enable it, but hindsight's 20/20.
So I guess this is a dead end and a close?
I'll just solve it with ReReplacer for my own sites by removing the whole migrate script :)
Search (Regular Expressions):
<script src="[^"]*/jquery-noconflict\.js[^"]*" type="text/javascript"></script>(\s*<script src="[^"]*/jquery-migrate(\.min)?\.js[^"]*" type="text/javascript"></script>)
Replace:
<script type="text/javascript">jQuery.noConflict();</script>
This also inlines the noConflict line.
closed for reasons stated above
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-05 15:35:09 |
Closed_By | ⇒ | brianteeman | |
Labels |
Added:
?
|
Whilst I agree it's not ideal on production, I'm also mildly nervous about hacking up more third party libraries :/