-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Clear caches on HotReload #62880
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
[Blazor] Clear caches on HotReload #62880
Conversation
src/Components/Components/src/Reflection/ComponentProperties.cs
Outdated
Show resolved
Hide resolved
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.
Pull Request Overview
This PR implements comprehensive cache clearing functionality for Blazor's Hot Reload feature to ensure that cached data is properly invalidated when code changes are applied during development. The changes address issue #43780 where various caches were not being cleared, leading to stale data during Hot Reload scenarios.
- Adds static constructors with Hot Reload event handlers to clear caches across multiple Blazor components
- Registers cache clearing callbacks for component properties, activators, binding converters, and routing tables
- Includes project file updates to ensure HotReloadManager.cs is available in required assemblies
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
ExpressionFormatter.cs | Adds Hot Reload cache clearing for expression formatting |
FieldIdentifier.cs | Adds Hot Reload cache clearing for field accessors |
EndpointComponentState.cs | Adds Hot Reload cache clearing for streaming rendering attributes |
RouteTable.cs | Adds Hot Reload cache clearing for route entry cache |
EventArgsTypeCache.cs | Adds Hot Reload cache clearing for event args type cache |
ComponentProperties.cs | Adds Hot Reload cache clearing for component properties |
PersistentStateValueProvider.cs | Adds Hot Reload cache clearing for property getters and serializers |
PersistentServicesRegistry.cs | Adds Hot Reload cache clearing for properties accessor cache |
DefaultComponentActivator.cs | Adds Hot Reload cache clearing for component type info |
ComponentFactory.cs | Adds Hot Reload cache clearing for component type info cache |
BindConverter.cs | Adds Hot Reload cache clearing for formatter and parser delegate caches |
AttributeAuthorizeDataCache.cs | Adds Hot Reload cache clearing for authorize data cache |
Microsoft.AspNetCore.Components.Endpoints.csproj | Includes HotReloadManager.cs in compilation |
Microsoft.AspNetCore.Components.Authorization.csproj | Includes HotReloadManager.cs in compilation |
…onentPropertiesCache
/ba-g Failure is #62672 |
/backport to release/10.0-preview7 |
Started backporting to release/10.0-preview7: https://github.com/dotnet/aspnetcore/actions/runs/16517930105 |
Clear more caches when HotReload deltas are applied.
Fixes #43780