-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Fix HotReloadManager accessibility in Server project by including shared source #63287
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
base: main
Are you sure you want to change the base?
Changes from all commits
9f7175f
941dcd7
af5307b
62e8bab
562666c
b2d6288
9916739
2859f25
993ba49
c74ec0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,17 +5,22 @@ | |||||
using System.Diagnostics.CodeAnalysis; | ||||||
using System.Reflection; | ||||||
|
||||||
#if COMPONENTS | ||||||
namespace Microsoft.AspNetCore.Components.Infrastructure; | ||||||
#else | ||||||
namespace Microsoft.AspNetCore.Components; | ||||||
#endif | ||||||
|
||||||
// A cache for root component types | ||||||
internal sealed class RootTypeCache | ||||||
{ | ||||||
private readonly ConcurrentDictionary<Key, Type?> _typeToKeyLookUp = new(); | ||||||
|
||||||
public RootTypeCache() | ||||||
{ | ||||||
} | ||||||
|
||||||
internal void Clear() | ||||||
{ | ||||||
_typeToKeyLookUp.Clear(); | ||||||
} | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't do You can set things up in the constructor since those types are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Look for places where you can make private RootTypeCache fields static if they aren't. Like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've implemented the requested changes. Removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've implemented the requested changes:
The implementation follows the same pattern used by |
||||||
public Type? GetRootType(string assembly, string type) | ||||||
{ | ||||||
var key = new Key(assembly, type); | ||||||
|
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.
@copilot undo this change
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.
Reverted the namespace declaration back to block-scoped format as requested (commit 993ba49).