6

Closed

Please add a jQuery 1.x package

description

Hi,

This will make it easier for people who need to stay on the 1.x branch. The main jQuery package can then be used in sites which can migrate to jQuery 2.x.

Thanks,
Kevin.
Closed Jan 25 at 1:15 AM by raspranav
At this point we will not be creating different JQuery packages for 1x and 2x.

comments

KevinKuszyk wrote Jun 11, 2013 at 8:47 AM

Hi Damian,

Would you accept a pull request for this? If so I'll put a package together for it.

Kevin.

KevinKuszyk wrote Sep 20, 2013 at 11:01 AM

It turns out we don't need this after all. I just discovered that NuGet has a feature which allows package versions to be constrained. My packages.config now has this line in it:
<package id="jQuery" version="1.10.2" targetFramework="net40" allowedVersions="(,2)" />
For more info on constraining package versions, see the NuGet docs.

patricker wrote Oct 4, 2013 at 2:51 PM

KevinKuszyk,

Adding this line didn't help me when I don't have jQuery in my project yet. According to the docs this is to constrain NuGet from upgrading certain packages, but it doesn't allow you to install older versions from NuGet, and manually selecting v2 and installing it will override this setting.

KevinKuszyk wrote Oct 7, 2013 at 8:12 AM

You need to use the package manager console in Visual Studio to install a specific version of a package. To install the latest from the V1 branch of jQuery today, this is the command:
Install-Package jQuery -Version 1.10.2
Once it's installed, you can then add the allowedVersions="(,2)" attribute in your packages.config file.

Hope that helps.

WalkerCodeRanger wrote Jan 22 at 3:43 PM

The allowed versions attribute is not sufficient. As suggested by the jQuery authors in http://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond/ it makes sense to run the two versions of jquery side by side (see the second question in the QA). If that is what you are doing, you need to install two versions of jQuery side by side. That can only be done if there are two different packages. However, someone has started a nuget package for the jQuery 1.x code line at http://www.nuget.org/packages/jQuery1/

I suggest you either work with the creator of that package to unify the maintenance or that this work item simply be closed.