Skip to content

Blazor: minor tweaks to ensure shared state doesn't cross circuits #11849

Closed
@SteveSandersonMS

Description

@SteveSandersonMS

From #11791

The following static fields should be made readonly (assuming it's possible to do so):

  • EventCallbackFactoryBinderExtensions.ConvertToBool/ConvertToNullableBool
  • InputNumber._parser
  • InputNumber._stepAttributeValue

Also, UIEventArgs.Empty is a static shared thing. See if we can ensure it's immutable. If not, consider whether we should stop sharing a common instance.

Also, it's vital that RendererRegistry._globalRegistry is never used in server-side Blazor code paths. Currently it isn't, but we might make a mistake in the future. For safety, wrap it in some accessor that throws if !PlatformInfo.IsWebAssembly (possibly caching that info).

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor Componentstask

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions