buunguyen / combres

ASP.NET and MVC performance optimization library ⛺
Other
123 stars 37 forks source link

Calls to CombresLink are case sensitive - could this be changed? #48

Open peterlukerow opened 7 years ago

peterlukerow commented 7 years ago

In my MVC project I have dynamic call like this in my Razor view: @(Html.CombresLink("publicCss" + Model.PublicSkinName))

The string passed in might resolve to "publicCssFubar", for example. If however the resource name in my Combres.xml config is called "publicCssFuBar" - notice the capitial B - then the example of "publicCssFubar" will fail with the exception of "Resource set 'publicCssFubar' cannot be found" in Combres.WebExtensions.GetResourceSet(string setName) +65"

Could it be changed to be case insensitive?

I'm using the nuGet package which says I'm on v2.2.2.5 of combres.mvc. I checked the version history since that release and there doesn't appear to be any indication of this being changed.

buunguyen commented 7 years ago

It is possible to change but it will be breaking change (because people might be relying on case sensitivity) and I'm not sure it's worth it. Isn't it possible to change your combres config or the variable?

peterlukerow commented 7 years ago

The problem for me is that my project is sold as a product and installed multiple times on different hosts and thus is configured by multiple different people and not under my control. When it breaks it just causes an exception in my product that results in a call to my colleagues who deal with support who then need to check the logs.

It would seem someone would have to be a bit masochistic to need/want to define 2 resource sets with the same name that differ only by case given that there is no compiler checking in this scenario, however I understand the desire not to want to introduce any compatibility issues.

How about adding a nameSensitivity attribute to <resourceSets> which has a default of true? This would then maintain the existing functionality but when set to false would treat name attributes as case insensitive?