This project is read-only.

jQuery - multiple versions - confused!

Topics: Business Logic Layer
Feb 20, 2015 at 4:58 PM
Last week I downloaded the latest source code version, commit 825c96036495, to update my slightly enhanced local version.
What is still confusing me are the multiple versions of jQuery that are still included in a variety of places:
1) "BlogEngine\BlogEngine.NET\Scripts\jquery-1.8.2.js"
2) "BlogEngine\BlogEngine.NET\Scripts\jquery-2.1.1.js"
3) "BlogEngine\BlogEngine.NET\Scripts\Auto\01-jquery-1.9.1.min.js"
4) "BlogEngine\BlogEngine.NET\Scripts\jQuery\01-jquery-1.9.1.min.js"
5) "BlogEngine\BlogEngine.NET\setup\upgrade\jquery-2.0.3.min.js"
6) "BlogEngine\packages\jQuery.2.1.1\Content\Scripts\jquery-2.1.1.js"

And then there is also a (incorrect) references in BlogEngineConfig.cs:
                new ScriptResourceDefinition
                    Path = "~/Scripts/jquery-1.9.1.min.js",
                    DebugPath = "~/Scripts/jquery-1.9.1.js",
                    CdnPath = "",
                    CdnDebugPath = ""
So could somebody please explain why there are so many versions, and which one is used for what?
Feb 20, 2015 at 7:34 PM
2.1.1 is latest update from Nuget so you see it in packages directory and deployed to /scripts. Normally we would require to update packages instead of keeping in repository, but some latest are broken so we keep all instead of mixing.
Setup has its own copy, it only updated when setup module itself is updated. Currently 2.0.3.
Some admin functionality depends on older version, so it has to use 1.8.2. jQuery removed bunch of stuff in 1.9 and even more in 2.0.
"Auto" directory used to auto-load jQuery and some themes relay on it. If your theme does not require it, you can safely remove it. All scripts in "auto" will be loaded for every page in alphabetical order, so you see "01-", "02-" etc.
scripts/jquery could be redundant, need to check if it still used anywhere.
code in config was likely added by patch or extension and was not updated when directory structure changes. Also, need to check out.
I know seems messy, but this kind of "cleaning" usually ends up with complains that app no longer works for specific theme with specific extensions installed.