Make it easy to transition from stateful prerendering to -> non-stateful prerendering
See original GitHub issueI 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
useRenderStaticComponentAsync
- 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Remove stateful prerendering #12245 - dotnet/aspnetcore
We should remove the functionality for stateful-prerendering from the server. We're not recommending it for use in any production scenario, and ...
Read more >how to stop rendering twice (for non-data retrieving ...
I have some variables that initialize in the code segment in a razor page and they are initializing twice when I started doing...
Read more >Server-Side Rendering (SSR) - byby.dev
SSR strategy can be stateful or stateless. Stateless server is more easily scalable because there is no per-client page data kept in the ......
Read more >Improve SEO of OutSystems reactive apps with prerendering
In this article, we describe how you can integrate the OutSystems platform with a third-party pre-rendering solution called prerender.io.
Read more >Transitioning from Prerender to Server-Side Rendering for ...
The concept of prerendering is essentially employing a headless browser to crawl client-side-rendered web pages in order to obtain their static ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You must also consider multiple “entry point” components for existing MVC/Razor pages projects. For example:
I have a razor page
Index.cshtml
, and I want to render a component in there, for examplewhile having a second page called
Whatever.cshtml
, in which I want to render a different component in there, like:Currently in preview 7 everything works fine when using
How will this work after the changes ?
Issue created: https://github.com/aspnet/AspNetCore/issues/12795
😀