Avatar of yadavdep
yadavdepFlag for India

asked on 

Jquery migrate plugins in asp.net web form application

We have a asp.net web form application.
This has around 60 pages with one master page and tons of JS files.
Currently, we are using Jquery 1.9.1 and planning to update it to a newer version.
But we are not clear on how to use Jquery migrate plugin to update all the web forms and JS files.
All the examples we got are working on a single page only

Help needs how we update the Jquery in our entire application 

ASP.NETjQuery

Avatar of undefined
Last Comment
Scott Fell
ASKER CERTIFIED SOLUTION
Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of yadavdep
yadavdep
Flag of India image

ASKER

David,
We have a Jquery 1.91 Added to our project which we need to change to the latest 3.xx version.

We are referring to this article https://github.com/jquery/jquery-migrate/tree/1.x-stable#readme
This says to use Jquery migrate plugin to update Jquery.

So my question was related to this one.
Noted. Before use JQuery Migrate plugin 3.x JQuery migrate plugin for 3.x:
https://github.com/jquery/jquery-migrate/

Use the following steps to upgrade from a version of jQuery older than 1.11.0 or 2.1.0 to this new version 3.0:

Upgrade the version of jQuery on the page to the latest 1.x or 2.x version.
Add the uncompressed jQuery Migrate 1.x Plugin to the page.

Optional but recommended, update any plugins in use since later versions are usually the most compatible with recent versions of jQuery.

Test the page and resolve any warnings that appear on the console, using the JQMIGRATE 1.x warning documentation as a guide.

Remove the jQuery Migrate 1.x plugin and ensure that the updated jQuery code on the page continues to work properly with only the latest jQuery 1.x/2.x in use.

Upgrade the version of jQuery on the page to the latest 3.x version and add the uncompressed jQuery Migrate 3.x plugin to the page.

Test the page and resolve any warnings that appear on the console, using the JQMIGRATE 3.x warning documentation as a guide. Report any bugs in third-party plugins to the plugin author.

Remove the jQuery Migrate 3.x plugin and ensure that the page continues to work properly with only the latest jQuery 3.x in use.


Running both Migrate 1.x and Migrate 3.x simultaneously on the same page is not supported.

The uncompressed development version of the 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.

The compressed version of the Migrate plugin does not generate any warnings, although it does issue a solitary console message that it has been installed to simplify debugging. Migrate can be used on production sites when jQuery 3.0 or higher is desired but older incompatible jQuery code or plugins must also be used. Ideally this is only used as a short-term solution, since restoring old behavior may cause conflicts with new jQuery code that expects the new behavior.


More information:
jQuery Core 3.0 Upgrade Guide
https://jquery.com/upgrade-guide/3.0/
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

David,
We have a Jquery 1.91 Added to our project which we need to change to the latest 3.xx version.

We are referring to this article https://github.com/jquery/jquery-migrate/tree/1.x-stable#readme
This says to use Jquery migrate plugin to update Jquery.

A few things.  You said in your question you are already on 1.91 and the link you referred to is for moving from 1.x to 1.9x so that would be the wrong one and I think you would want to look at https://github.com/jquery/jquery-migrate/

On that link when it talks about v2x, v2 is just dropping support for very old internet explorer.

The jquery migrate plug in is not used to physically migrate the code and that may be confusing. It is used to fill in the gaps so when you go to the newer version of jquery, older code will not break.

I have not had to do this in a few years. What I found is by going cold turkey on a test site the number of changes I had to make was minimal and ended up just going through my code and also switching out plugins that were no longer under development.  That way I did not have to rely on jquery migrate and modernized my code slightly.

That is not the ideal solution for everybody, especially if you are short on time and heavily rely on the older code.  My own choice was just to clean things up and not use jquery migrate.

But we are not clear on how to use Jquery migrate plugin to update all the web forms and JS files.
All you are doing is loading the jquery migrate js file after the newer jquery js file. That's it. In theory, it fills in the gaps for any code you are using that was depreciated so it will continue to run.

My solution is to take the time to update the code base so you don't have to rely on it if possible. 

ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo