Skip to content
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

Better caching for RazorSourceGenerator when SuppressRazorSourceGener… #23358

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

pranavkm
Copy link
Contributor

…ator changes

In VisualStudio SuppressRazorSourceGenerator changes when it's being invoked by the EnC and tooling.
In our current implementation, while we no-op the operation, when SuppressRazorSourceGenerator=true,
the code also evicts the valid previously cached results when SuppressRazorSourceGenerator=false by returning null values,
causing us do work the next time its false.

Fixes dotnet/aspnetcore#32867

@dotnet-issue-labeler dotnet-issue-labeler bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label Jan 10, 2022
@pranavkm pranavkm requested review from a team, captainsafia and chsienki January 10, 2022 22:55
…ator changes

In VisualStudio SuppressRazorSourceGenerator changes when it's being invoked by the EnC and tooling.
In our current implementation, while we no-op the operation, when SuppressRazorSourceGenerator=true,
the code also evicts the valid previously cached results when SuppressRazorSourceGenerator=false by returning null values,
causing us do work the next time its false.
@pranavkm pranavkm force-pushed the prkrishn/razor-caching branch from a0393ef to 5f7d579 Compare January 11, 2022 01:22
@pranavkm pranavkm enabled auto-merge (squash) January 11, 2022 01:23
@pranavkm pranavkm merged commit a9b8bed into main Jan 11, 2022
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retroactive approve.

/// For instance <c>dotnet msbuild /p:_RazorSourceGeneratorDebug=true</c>
/// </para>
/// </summary>
public bool WaitForDebugger { get; set; } = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any motivation for removing the debug flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We stopped using it when we migrated to the incremental APIs. You kinda need to break inside one of the steps for this to work reliably and we never did that.

@pranavkm pranavkm deleted the prkrishn/razor-caching branch January 11, 2022 16:46
pranavkm added a commit that referenced this pull request Jan 13, 2022
…ator changes (#23358)

In VisualStudio SuppressRazorSourceGenerator changes when it's being invoked by the EnC and tooling.
In our current implementation, while we no-op the operation, when SuppressRazorSourceGenerator=true,
the code also evicts the valid previously cached results when SuppressRazorSourceGenerator=false by returning null values, causing us do work the next time its false.

Contributes to dotnet/aspnetcore#32867
pranavkm added a commit that referenced this pull request Jan 25, 2022
…ator changes (#23358) (#23419)

In VisualStudio SuppressRazorSourceGenerator changes when it's being invoked by the EnC and tooling.
In our current implementation, while we no-op the operation, when SuppressRazorSourceGenerator=true,
the code also evicts the valid previously cached results when SuppressRazorSourceGenerator=false by returning null values, causing us do work the next time its false.

Contributes to dotnet/aspnetcore#32867
chsienki added a commit to chsienki/sdk that referenced this pull request Mar 24, 2022
@chsienki chsienki mentioned this pull request Mar 24, 2022
chsienki added a commit to chsienki/sdk that referenced this pull request Mar 25, 2022
@chsienki chsienki mentioned this pull request Mar 25, 2022
marcpopMSFT added a commit that referenced this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Net Core 6 Blazor Server Hot Reload is Slow for Big Projects
3 participants