Generators.Blazor
Generators.Blazor copied to clipboard
Source generators should implement IIncrementalGenerator instead of ISourceGenerator
The following source generators implement the "V1" API and use a syntax receiver, which requires reprocessing the entire project after every edit to a source file. This behavior quickly and unavoidably overwhelms the IDE for medium to large projects.
Switching to IIncrementalGenerator allows for incremental processing of syntax to avoid this overhead.
This Visual Studio Developer Community issue was root caused to this: https://developercommunity.visualstudio.com/t/visual-studio-is-near-2022-uselessly-slow-for-me/1638239.
Thanks for raising this. I can see why incremental generators are superior and wish they had been a thing from earlier on. Unfortunately I don't have the time to transition this project to using them, but I'm happy to review PRs that do so.
Side note: the usefulness of this project of this project is unfortunately limited, since one has to make the trade-off between the razor source generator and this library. Both cannot be used simultaneously, which is a huge shame.