-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANNOUNCEMENT: New maintainers wanted #42
Comments
For those interested, I think this project requires source generators which implements a package |
Here at Stack Exchange we've built our own bit of infrastructure that provides more or less the same API as Roslyn's |
I've used T4MVC for a long while now, and am an avid fan. I'd like to contribute to the project, and help with the MVC Core support. I spent some time mulling over the whole thing (starting with upgrading this project to the new .csproj format), and this is what I came up with so far:
<Target Name="T4MVCCore" BeforeTargets="Build">
<Exec Command=""$(MSBuildProjectDirectory)\..\..\src\T4MVCCoreLiteTool\bin\debug\net462\T4MVCCoreLiteTool.exe" "$(MSBuildProjectDirectory)"" />
</Target>
Both options would require a compiled executable that contains the generator code. I've decided to toy with a prototype to check the feasibility of the project, and so far it is quite successful. The prototype consists of two projects:
With this in mind, I'd suggest renaming this project to T4MVCCore. The main reason for that is that it makes it much more easily discoverable (similar name to T4MVC, will be found in search results when searching for it, and easily identifies as the package for ASP.NET MVC Core). Compared to that, R4MVC is unknown, and while it technically does use the Roslyn code analysis tools, it's by far the least important feature of the project. So far I have a very basic prototype that I started several hours ago just to test the theory. Going forward, I'd merge the general principles of what I have so far with the R4MVC source, since it already contains a good chunk of the groundwork. Looking forward to your feedback, would love the opportunity to help with the project |
@benjamin-hodgson First of all, love the great work that Stack Exchange is doing! I've only recently stumbled upon the StackExchange precompiler, and while I'm considering using it in some projects, I don't think that tying T4MVC/R4MVC to it is a great idea, for the same reason you listed. I think an alternative way to trigger the code gen would be much better, as I outlined above |
Oh yeah, I forgot to mention. The new project format is different, the file nesting is now happening automatically, based on the filename. As such, I think the best option here would be to keep the .generated.cs controller files next to the controllers themselves. This way this solves the issue of all the .generated files being visible in the project. One thing I didn't mention was the TagHelpers to generate the anchors in the razor files, but that's a trivial task. I'd probably create a |
@benjamin-hodgson @artiomchi thanks for your comments. I'd be reluctant to take any external dependencies for the hook to invoke R4MVC. I was thinking it should move to exposing a dotnet cli command, something like This would have the advantage that it's xplat, cli / build server friendly and can be built on in VS / VS Code etc. @artiomchi re. renaming the project. I take your point. Let's leave it as is for the moment. That gives some time to think it through before we publish the first beta on NuGet. We all know how hard naming things can be! I just updated the App Veyor config to use the VS 2017 image. If you're able to open a PR early then we will get some CI feedback on it. A good start would be updating the solution to VS 2017 and MVC Core 1.0 so that it builds again. Once that's done we can take contributions again and hopefully get a working beta out. |
@kevinkuszyk Sure, makes sense. Also, I've been digging more into it this weekend, and I have some bad news and some good news. My initial plan was to go the cli / powershell route. I started with removing the dependency to the As such, the only way to get this to work is to init a Workspace and run the project through the compiler to get these results. Which is definitely possible, but would be a heavier process. A simpler option would be to write this as a VS extension. From the context of a VS extension I can get access to the I've also peeked at Code Analysys extensions, which can be brought into a project through NuGet, but I don't think there's a simple way to trigger them to change the files. I'll take a deeper look into this, and what powers them. Now to the good news - since with RTM Microsoft brought back the .csproj format, T4 templates are working just fine! So the simplest solution would be to just upgrade the t4 template that is used in T4MVC, and just use that. It will be comfortable and familiar to use for existing users of T4MVC, and you can have a (at least partial) code reuse between the projects. This is what I concentrated on in the last couple of days - analysing the existing t4 template. Currently it hangs when being triggered against a ASP.NET MVC Core project, but it's just a matter of time until I get it working. In any case, I've made some changes to the R4MVC codebase with an upgraded project structure and it's compiling against the latest runtime, but it doesn't do much of course. I'll commit my changes anyway to my artiomchi/R4MVC fork I've started some experiments with a clean project at artiomchi/T4MVCCoreLite to test some concepts before I apply them in the R4MVC project, so you can see what I was talking about. I've added Lite to the end of the title just to separate it in my project list, and to indicate it's far from the full solution :) The P.S. You have a good point about the cli route being build server friendly, but since generating T4 templates is a design time task, I think it's not important at all, since all the generated files have to be created in advanced and committed to the repo for the project to compile in the first place. Compatibility with VS Code on the other hand is a very strong factor in this, which makes the cli option more appealing. The nice thing is that cli / VS Extension would use (mostly) the same codebase. As such, both of these options can be provided with almost no extra effort at all. The cli option would be made available through a Nuget To be perfectly honest, I'm OK to continue with either path that you think would work better (cli that starts a |
Some background...
@wwwlicious and I started this project with the support of @davidebbo back in the in the heady days of the K runtime, DNX, and the MVC 6 betas. Things were moving fast and we were unable to keep up with the changes.
We have some working code from the ~beta4 timeframe. Since then there have been many changes to the framework. Most notably for this project the
ICompileModule
hook was dropped at some point.Where next?
Due to time constraints and other commitments @wwwlicious and I haven't had the time to dedicate to this project to move it forwards. Today we are officially asking for new maintainers to take it forward.
Please post a comment here if you're interested and I'll give you push access to the repro. Later I'll open admin access to the new maintainer(s).
Thanks to everyone who's shown interest in the project to date.
The text was updated successfully, but these errors were encountered: