toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.5k stars 259 forks source link

Update for .NET 8.0, consider removing deprecated .NET versions #538

Open JohnCampionJr opened 7 months ago

JohnCampionJr commented 7 months ago

It would be good to update this to directly support .net8.0.

Should also consider removing support for pre .net6.0 versions (core 3.1, net5.0)

Happy to submit a PR to do this, but wanted to check first.

BC89 commented 6 months ago

Not that .net8 is LTS this would be awesome.

A9G-Data-Droid commented 6 months ago

NET8 brings a new way to render razor pages

So this could result in a major back end overhaul to a new Microsoft supported workflow.

blackholeearth commented 5 months ago

İ hope thşs doesn't remove .net 4.6 2 support.

Win7 forever....

GaryWayneSmith commented 5 months ago

İ hope thşs doesn't remove .net 4.6 2 support.

Win7 forever....

We have a lot of legacy apps using .Net 4.6.2. We are migrating libs over to dual .Net Framework 4.6.2/Standard 2.1 so we can do new projects with some shared functionality. I'm using the old RazorEngine that's been dead for a while. A lot of open-source developers seem dumping old .Net framework stuff which I think is bad for legacy apps that have been stable for years.

I have two libraries that I can no longer update because the next nuget update is incompatible (for no reason at all as I can download their source, just change it to Standard 2.0, and recompile (with maybe a minor conditional change).

I hope this project doesn't go that route as we're starting to use this as a replacement for the former engine.

A9G-Data-Droid commented 5 months ago

İ hope thşs doesn't remove .net 4.6 2 support.

Win7 forever....

I'm not sure why you would use 4.6 when 4.8, .NET5, and .NET6 were all supported on Windows 7. The OS itself is out of support and yet it still works. The same can be said for running .NET8 on Windows 7. It isn't supported but it might work. Really depends on what libraries you end up using.

https://github.com/dotnet/core/issues/7556

jzabroski commented 2 days ago

RazorLight should no longer really be needed now that NET8 brings a new way to render razor pages, as @A9G-Data-Droid noted.

jzabroski commented 2 days ago

What would you all still use RazorLight for?

ktb-dev commented 1 day ago

NET8 brings a new way to render razor pages

@A9G-Data-Droid , @jzabroski could you tell me how to render a template obtained from the database using a new way?

jzabroski commented 1 day ago

RazorLightEngine would just call the HtmlRenderer in net8.0 in an InvokeAsync context, as the linked sample suggests. Open to a PR that uses

#if NET8_0_OR_GREATER

#endif

Some review of caching may be required as Im not sure how the new approach by Microsoft disposes of compiled resources if the template changes a lot.