Skip to content

Make it easy to transition from stateful prerendering to -> non-stateful prerendering #12630

@rynowak

Description

@rynowak

I think we need to come up with a strategy or some diagnostics to help people migrate from the preview 7 template to the preview 8 one.

Since we're removing stateful prerendering, there are two changes you need to make in your app:

  • In _Host.cshtml use RenderStaticComponentAsync
  • In Startup.cs add a mapping for the component to the <app> element

Before

app.UseEndpoints(endpoints =>
{
    endpoints.MapBlazorHub();
    endpoints.MapFallbackToPage("/_Host");
});

After

app.UseEndpoints(endpoints =>
{
    endpoints.MapBlazorHub<App>("app");
    endpoints.MapFallbackToPage("/_Host");
});

The problem is that it's really easy to get the first one of these right - but once you do, the app stops responding. You'll prerender just fine, but no websocket will be opened. There are literally NO diagnostics telling you that you forgot to do the second part of this.

We need to consider whether we have any good ideas to help people understand how to update preview 4->preview 8

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions