dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.27k stars 9.96k forks source link

Put blazor generated component code inside project #28762

Closed kamran65536 closed 3 years ago

kamran65536 commented 3 years ago

Summary

Put component's generatd code inside the project.

Motivation and goals

In order to create complicated blazor components you may need to code a lot and current intellisense performance is really annoying. Also if you put your code in code behind file you may also experience intellisense incompatibility between generated code and code behind.

It is suggested to push code generation to normal C# project compilation time to reduce incompatibilities and complexity between razor code generator and behind code.

Examples

In case of adding new component it is suggested to add the following files too:

.
+-- XComponent.razor
|    +--  XComponent.razor.cs
|    +-- XComponent.razor.design.cs

then trigger code generation for XComponent.razor on file save.

pranavkm commented 3 years ago

@kamran65536 thanks for your suggestion. This is unlikely a direction we're going to take with how Razor files are code generated.

current intellisense performance is really annoying

Have you tried using the Experimental Razor editor? If you continue seeing issues with this, we'd be interested in finding out more about your experiences. FYI @NTaylorMullen