Skip to content

[Blazor] Finalize behavior of JavaScript initializers for Blazor Web apps #50187

Closed
@MackinnonBuck

Description

@MackinnonBuck

Open questions with JavaScript initializers:

  • Should we update the arguments to beforeStart to make it easier to detect which .NET runtime (Server/WebAssembly) is starting?
  • In the case of Blazor WebAssembly, should we wait to invoke beforeStart until we know for sure that Blazor WebAssembly is starting? Currently, beforeStart gets invoked during the Blazor WebAssembly loading procedure, but this doesn't always indicate that Blazor WebAssembly will be used (consider auto mode).
  • In the case of Blazor Server, should the afterStarted callback run each time a new circuit is created? We plan on closing circuits automatically if all Blazor Server components get removed from the page.
  • Should beforeStart execute immediately after Blazor.start() is called when using blazor.web.js? Currently, beforeStart only executes just before Blazor WebAssembly or Blazor Server starts up.
    • Or, alternatively, should the module be imported as soon as Blazor.start() gets called, but beforeStart only gets called when Blazor Server or WebAssembly starts?
  • Should we add arguments to the afterStarted callback to indicate which .NET runtime started?

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions