jqueryproduction-environmentproductionjquery-migrate

Shouldn't we use jQuery Migrate in production environment?


I found the website below saying that jQuery Migrate should not be used in production environment.
https://forum.jquery.com/topic/jquery-migrate-plugin-in-production

I looked for the information for if it is true and why, but I could not find.
Could you please tell me the reasons? jQuery Migrate should be used only for fixing the deprecated features and behaviors?

I actually set the CDNs of newer jQuery and jQuery Migrate without fixing the deprecated methods and the code worked. So I thought there were no problems.


Solution

  • The migrate plugin is to help you migrate from one version to another. It's not to migrate for you.

    The idea is that you update your jquery, add the migrate and it tells you want you need to change.. So that you can...well... actually migrate to the new jquery.

    Also note that migrate only goes from one version to another, running two migrates is not supported as stated on jquery.com.

    So if you go from (for example) 1.3->2.0 then need to migrate from 2.0->3.0 (old versions used for examples) it will likely not work as expected.

    Finally, migrate works by dumping the information to the console.log - and that will also appear on the end-users' browser, which really won't look very good. (there's no doubt hacks around this, but that's missing the point).