Skip to content

[Blazor] Unify root components initialization paths. #64508

@javiercn

Description

@javiercn

When we initialize components (specially in Blazor Server) we have since 8.0 three different ways in which components get initialized.

  • First through ComponentHub.Start for old blazor.server.js.
  • Second through UpdateRootComponents by blazor.web.js.
  • Third through JS Root components via CircuitJSComponentInterop.cs.

This is problematic because it creates slight variations of our initialization logic that manifest themselves in bugs that are hard to track.

We should consider standarizing on UpdateRootComponents since that's the model Blazor Web uses. This would involve:

  • Update blazor.server.js to go through UpdateRootComponents (same as blazor.web.js).
    • This would mean we could get rid of the old blazor.server.js initialization code, as it would be handled by blazor.web.js.
  • Update JS root components to also go through UpdateRootComponents.
    • We would get rid of the JS interop associated with this functionality as it would be subsumed by UpdateRootComponents.
      • We would likely require expanding the RootComponentDescriptors to accept creating components with "client descriptors" which would be subject to the same restrictions JS Root Components have today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions