DamianEdwards / RazorSlices

Lightweight Razor-based templates for ASP.NET Core without MVC, Razor Pages, or Blazor.
MIT License
297 stars 12 forks source link

Will this project support native AOT? #31

Closed albertwoo closed 1 month ago

albertwoo commented 1 year ago

Now dotnet 8 already support minimal api with AOT, it this project can also support that, it would be very cool.

DamianEdwards commented 1 year ago

I'd love for it to support native AOT! The types the Razor compiler currently generates from .cshtml files are "unspeakables" which complicates matters a bit but the type names are deterministic so it might be possible to make it work. I chatted with @davidfowl about it and we have a few ideas to experiment with.

DamianEdwards commented 1 year ago

I proved out that I can support native AOT in the aot branch. I need to now write a source generator to complete the story. Some notes/links to help: