Open Gambero81 opened 4 years ago
@Gambero81 I would contribute to it. Looks really promising.
@Gambero81 I don't think source generator would be a replacement for Typewriter, because it runs at compile time. A major benefit of the Typewriter extension is to generate typescript on the fly, as C# files get modified in visual studio. For those of us programming in Angular, it's a must have feature to have typescript generated on the fly without having to trigger a compilation. Compiling would add one lengthy step.
@dev-buildableworks - agreed! A compile-time only replacement would not work as a replacement for typewriter.
Hi guys,
A quick note, I started to work on something like this for an experiment. I've stopped development on this for a break since I'm waiting on more features from source generators in the .NET 5 preview, and for the .NET preview date to be sooner. However, this project is similar but more extensible version of typewriter.
However, as mentioned above, at the moment it's only compile time. That's until source generators receive the RegisterForAdditionalFileChanges
function which is currently just in (documentation)[https://github.com/dotnet/roslyn/blob/master/docs/features/source-generators.cookbook.md]
https://github.com/JoshDiDuca/CodeSourceGenerator
Feel free to check out the code and requests are welcome.
@dev-buildableworks I think it's possible to add source-generator plugin without loosing the VS extension functionality, and for some use cases it's mendatory to have stable CI for it (ensuring ts <-> C# sync in certein models on CI). I would like to contribute too if it's a required issue.
There is already a fork of Typewriter that leverage modern C# features like Source Generators and Razor syntax. https://github.com/ReactiveThings/Typezor
microsoft annunce Source Generator: https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/