Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

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

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#267
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski:fix-razor-generator-generating-when-suppressed

Conversation

@jasonmalinowski
Copy link
Copy Markdown
Member

dotnet/sdk#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 properly; dotnet/roslyn#61675 was put in as a tactical fix first.

@jasonmalinowski jasonmalinowski requested a review from a team as a code owner June 16, 2022 00:36
dotnet/sdk#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
properly; dotnet/roslyn#61675 was put in as a tactical fix first.
@jasonmalinowski
Copy link
Copy Markdown
Member Author

@chsienki Should I just be closing this now since you made the other fixes, or do we still need to track those changes getting to this repo?

@chsienki
Copy link
Copy Markdown
Member

The changes to the SDK version got merged over here. We don't have the specific end result change, but I believe its the same effect. Happy to add in the 'just in case' bail out too though, although the source got moved around again (sorry) so will need a rebase.

@jasonmalinowski
Copy link
Copy Markdown
Member Author

@chsienki Yeah, no reason to have a duplicate check I don't think. I had missed #292 when looking for the PR that updated this repo, so I'm going to close this then.

@jasonmalinowski jasonmalinowski deleted the fix-razor-generator-generating-when-suppressed branch July 13, 2022 18:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants