General question about source gen #26
-
No discussions area, but this is more of a question really than any issue. Watching the YouTube from earlier and it is very interesting to me. This is somewhat along the lines of what I think of for code generation. Some common task, goal, boilerplate, which is going to repeat, so add the hooks that allow for CG, right. I've got a case where I define some CSharp first class Some other examples as of late along the lines of CG'ed regular expressions, I'm not even sure what use case that addresses, TBH. However, in this case what is the code upon which you trigger, and does it really vary that much from build to build? Contingent upon a js dependency, let's say, so, ostensibly, yes, it may vary sometimes. Can you simply not do some 'reflection' after a sort on the js itself to generate code? Also, why what is effectively a fancier T4 text replacement and not something like a Roslyn, where you CSharp-up the language level, or at least Intermeriate Language (IL) level, primitives around the same? If I understand the thing correctly. Thanks and great presentation earlier! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @mwpowellhtx, The source that is generated is currently dependent on this TypeScript type declaration: If you open that file and do a search for |
Beta Was this translation helpful? Give feedback.
-
Ah well I must say, about the 25:26 mark is what made me think of this being more of a boilerplate T4 text replacement approach than what I would think of as a true, using the Roslyn CSharp primitives to assemble your source approach. For comparison, have a gander at my BitwiseOperatorOverloadsPartialGenerator, curious to hear your thoughts on this sort of Roslyn approach. For which I also sometimes refer to the Roslyn Quoter quite frequently when I am deep diving in that regard, and pare things back a bit, taylor, factor, etc; but as a starting point, the Quoter is quite fantastic as a reference. Obviously with the Blazorators, there are a number of moving parts involved, if you will, considering the TypeScript (i.e. js), Blazor, CSharp, and moving parts in between. Cheers, man, and if we might collaborate, maybe there's a partnership in it for us in the future, who knows. |
Beta Was this translation helpful? Give feedback.
Hi @mwpowellhtx,
The source that is generated is currently dependent on this TypeScript type declaration:
If you open that file and do a search for
interface Storage {
, you'll find the declaration for it. It's different that T4 as it's not based on templates, and it uses Roslyn. Does that make sense?