How well does the jQuery migrate plugin deal with deprecated code?
Asked Answered
H

2

8

I will soon be tasked with upgrading to jQuery 1.9. That said I know a few places where we have live(); toggle(); hover(); and browser(); with a number of surprises on the way, -I'm sure.

If I add the migrate pluggin, will it continue to execute the old code -or just give me messages in the console to help me track down and fix things?

Has anyone made such a wide jump from 1.4.1 to 1.8 or 1.9? that has implemented the migrate pluggin and seen how well it works and the limitations?

Hustings answered 28/5, 2013 at 16:29 Comment(2)
Have you tried it yet?Apomict
Try first. Maybe you will probably get some erros if you're using hash change with jQueryBBQ.Metal
L
11

The oficial jQuery site describes it pretty well http://jquery.com/upgrade-guide/1.9/#jquery-migrate-plugin

The uncompressed development version of the jQuery Migrate plugin includes console log output to warn when specific deprecated and/or removed features are being used. This makes it valuable as a migration debugging tool for finding and remediating issues in existing jQuery code and plugins. It can be used for its diagnostics with versions of jQuery core all the way back to 1.6.4.

The compressed version of the plugin does not generate any log output, and can be used on production sites when jQuery 1.9 or higher is desired but older incompatible jQuery code or plugins must also be used. Ideally this would only be used as a short-term solution, but that's a decision for you to make.

Looselimbed answered 28/5, 2013 at 16:35 Comment(2)
So, while it's a good debugging tool will it keep old code working?Hustings
Yes, your old code should work. But there could be bugs as well as in any other software. It is intended just to help you migrate your old code. So do not rely on it in a production. Use it only for debugging.Looselimbed
E
2

jQuery Migrate Plugin works just fine as jQuery.

Any deprecated feature will display warnings on the browser's console (if using plugin's uncompressed version and for IE browsers use Firebug Lite for console). In most cases these messages are simply warnings; code should continue to work properly as long as the jQuery Migrate plugin is used, but it is recommended to change the code where possible to eliminate warnings so that the plugin does not need to be used.

To find entire list of warning messages see https://github.com/jquery/jquery-migrate/blob/master/warnings.md

Externality answered 28/11, 2013 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.