Skip to content

Ensure the Razor generator doesn't generate when it's suppressed#25833

Closed
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski:fix-razor-generator-generating-when-suppressed
Closed

Ensure the Razor generator doesn't generate when it's suppressed#25833
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski:fix-razor-generator-generating-when-suppressed

Conversation

@jasonmalinowski
Copy link
Copy Markdown
Member

#24928 made a change to the Razor generator to ensure that even if the generator is suppressed, it's still going to run and cache its outputs so later runs aren't a from-scratch run on a performance-critical path. However, a bug meant that if the generator was suppressed, it'd still run the first time it's invoked, and will still output files even though it was supposed to be suppressed.

The approach taken here is to suppress the addition of the files, but at the very end of the chain only -- the generation and walking in the middle of the incremental chain is left untouched, so that still has the existing caching behavior.

This fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1545938 but we're still considering dotnet/roslyn#61675 as a tactical fix instead.

dotnet#24928 made a change to the Razor
generator to ensure that even if the generator is suppressed, it's
still going to run and cache it's outputs so later runs aren't a
from-scratch run on a performance-critical path. However, a bug
meant that if the generator was suppressed, it'd still run the first
time it's invoked, and will still output files even though it was
supposed to be suppressed.

The approach taken here is to suppress the addition of the files, but
at the very end of the chain only -- the generation and walking in
the middle of the incremental chain is left untouched, so that still
has the existing caching behavior.

This fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1545938
but we're still considering dotnet/roslyn#61675
as a tactical fix instead.
@jasonmalinowski jasonmalinowski force-pushed the fix-razor-generator-generating-when-suppressed branch from 4dc8967 to 3c4c673 Compare June 16, 2022 00:23
@jasonmalinowski
Copy link
Copy Markdown
Member Author

Closing in favor of dotnet/razor-compiler#267 since this code just moved to another repo.

@jasonmalinowski jasonmalinowski deleted the fix-razor-generator-generating-when-suppressed branch June 16, 2022 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK Area-Infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants