Print
Category: Did you know?
Hits: 14785
16Sep2019

You may not need the jQuery's Migrate plugin after all

Information
First published February 25, 2016
14785 hits - No rating

Migrate has been created to make jQuery code backup compatible with versions of jQuery prior to v1.9. It is packaged with the Joomla! framework (which will hopefully soon contain the latest version of the plugin) to ensure older scripts still work with jQuery without breaking your site.

In the ongoing race to speed up websites, reducing the number of script libraries that load on a page is a way to achieve just that. Should you try and prevent Migrate from loading all-together? Do you really need it? Do the jQuery scripts loaded on your site really use deprecated features?

There is one way to know for sure: just run the plugin in its 'non minified' state. When run that way, it outputs warning to the browser's console and informs you of the problems encountered in the scripts.

You can easily perform this test with jQuery Easy or jQuery Easy Profiles.

Step 1 Go to the basic options tab,

Step 2 Select the latest version of Migrate,

jQuery Migrate selection

Step 3 Use 'uncompressed',

Javascript compression

Step 4 Open the browser's console (nowadays, all browsers have such option),

Browser console with Migrate logs

Step 5 Navigate your site and particularly trigger functionality that requires jQuery,

Step 6 Check JQMIGRATE outputs.

You do not see any warning? You are in luck, it does mean that the scripts can work perfectly well with the version of jQuery you are using without Migrate.

Step 7 Un-select Migrate from jQuery Easy or jQuery Easy Profiles and set minification back to 'minified'.