Taritsyn / BundleTransformer

Bundle Transformer - a modular extension for System.Web.Optimization (also known as the Microsoft ASP.NET Web Optimization Framework).
Apache License 2.0
130 stars 19 forks source link

Support for `System.Text.Json` instead of `Newtonsoft.Json` on `BundleTransformer.Less`? #84

Closed julealgon closed 1 month ago

julealgon commented 1 month ago

We'd like to eventually migrate all of our projects to use System.Text.Json exclusively. Is there any chance BundleTransformer.Less could also be made to work with System.Text.Json as the serializer dependency instead of relying on Newtonsoft.Json?

Taritsyn commented 1 month ago

Hello, Juliano!

Is there any chance BundleTransformer.Less could also be made to work with System.Text.Json as the serializer dependency instead of relying on Newtonsoft.Json?

No. I will try to give a more detailed answer tomorrow.

Taritsyn commented 1 month ago

Hello, Juliano!

Bundle Transformer is first and foremost an modular extension for the Microsoft ASP.NET Web Optimization Framework. Microsoft ASP.NET Web Optimization Framework library has not been updated for 10 years. For this reason, Bundle Transformer is a legacy library that is now used by some very old CMS.

There are two reasons why I can't use System.Text.Json in the Bundle Transformer:

  1. Maintaining compatibility with .NET Framework 4.0.
  2. It is impossible to completely abandon Newtonsoft.Json because the Microsoft ASP.NET Web Optimization Framework library uses it (Microsoft.AspNet.Web.Optimization -> WebGrease -> Newtonsoft.Json).

Therefore, if you want to make your application free of unnecessary and very outdated dependencies, then I recommend you try to migrate to the dotless.AspNetHandler library.

julealgon commented 1 month ago

Your explanation and suggestion are appreciated @Taritsyn . Closing this.