-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove unneeded file writes in Razor source generator #15958
Conversation
@@ -36,16 +36,6 @@ internal class RazorSourceGenerationContext | |||
/// </summary> | |||
public bool WaitForDebugger { get; private set; } | |||
|
|||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep this if it helps debugging. It's not enabled in the IDE which is primarily what they were concerned about. If you'd like we can rename this to have a TestOnly
prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late commentary, but I think we should reconsider this.
I think it's important to have the option to generate the source code, specially when it's disabled by default. Otherwise the current experience degrades a lot:
- There are important integration aspects that we are not able to test.
- Ourselves and customers look up at the generated code in many cases when we can't troubleshoot an issue.
What's the motivation behind completely removing it, I think a much better place is to leave it optional as it was up to now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiercn We'll be bringing this back -- but using the official compiler support for this feature instead of rolling our own file writes. We're tracking this in dotnet/aspnetcore#30302.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. Although it's not exactly the same since I believe that triggers generation for all the source generators, not just the blazor one.
@@ -159,27 +152,13 @@ private static IReadOnlyList<TagHelperDescriptor> ResolveTagHelperDescriptors(Ge | |||
Parallel.For(0, files.Count, GetParallelOptions(GeneratorExecutionContext), i => | |||
{ | |||
var file = files[i]; | |||
if (File.GetLastWriteTimeUtc(file.GeneratedDeclarationPath) > File.GetLastWriteTimeUtc(file.AdditionalText.Path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go away
Part of dotnet/aspnetcore#30234.