frhagn / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
537 stars 132 forks source link

It's time to rewrite all TypeWriter project #333

Open Gambero81 opened 4 years ago

Gambero81 commented 4 years ago

microsoft annunce Source Generator: https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/

SamuelKupferschmid commented 4 years ago

@Gambero81 I would contribute to it. Looks really promising.

dev-buildableworks commented 3 years ago

@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.

s4m0r4m4 commented 3 years ago

@dev-buildableworks - agreed! A compile-time only replacement would not work as a replacement for typewriter.

JoshDiDuca commented 3 years ago

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.

dperetz1 commented 3 years ago

@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.

ReactiveThings commented 4 months ago

There is already a fork of Typewriter that leverage modern C# features like Source Generators and Razor syntax. https://github.com/ReactiveThings/Typezor