-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Blazor] Fix scoped CSS hot reload #42137
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
Conversation
Thanks for your PR, @MackinnonBuck. |
internal static string ComputeIntegrity(string identity, string originalItemSpec) | ||
{ | ||
var file = File.Exists(identity) ? | ||
using var file = File.Exists(identity) ? |
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 When using the locally-built SDK, I wasn't able to reproduce the issue where the file was left in use between hot reload edits. But I've gone ahead and made this change anyway in case it was the culprit.
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 also confirmed that we do take this code path when making CSS changes:
(fingerprint, integrity) = (StaticWebAsset.ComputeFingerprintAndIntegrity(candidate.ItemSpec, originalItemSpec)); |
Which means that this extra
using
theoretically shouldn't make a difference.
But it could have been that for some reason this path was being taken earlier, when I observed that hot reload was breaking. And now that the other code path is taken, everything works.
05ce838
to
87e4aef
Compare
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
Fixes an issue where the CSS bundle wasn't getting regenerated when a change to a CSS file was made during a
dotnet watch
session.Fixes https://github.com/dotnet/AspNetCore-ManualTests/issues/2776