-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Default WebAssembly loading progress indicator doesn't apply in Blazor Web template #49056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Out of scope for .NET 8, but one possible design idea for the future is:
However if the "auto" mode becomes really mainstream then maybe this would not be a situation in the first place. |
Another use case is upgrading an existing ASP.NET Core hosted Blazor WebAssembly app to .NET 8 and switching from the static index.razor to server-side rendered component (Host.razor). Initially I find it's natural to disable prerendering of the App component when upgrading because many Blazor WebAssembly components aren't set up properly for prerendering (like the default FetchData component, which depends on an HttpClient service). But without prerendering you probably still want the loading indicator. You can disable prerendering as part of specifying the render mode for the App component, but then you don't have a way to render the loading progress indicator and have it later gets replaced. I can sort of work around this by using the old pattern of registering the App component as a root component with a CSS selector in Program.cs. As long as the HeadOutlet is still setup to use the WebAssembly render mode then blazor.web.js will still load the client app and setup the App component. It feels a bit hacky, but it seems to work. |
Reopening as this can be an issue for users migrating Blazor WebAssembly apps to the Blazor Web App model. |
In .NET 7 we added a built-in loading progress indicator for WebAssembly apps.
This continues to work in .NET 8 if you have a WebAssembly standalone project. However if you are using the new Blazor Web template, any WebAssembly components are added via
@rendermode
, and this will not cause the loading progress indicator to show up, because most of the time you wouldn't want to. You can have any number of small islands of WebAssembly-based UI anywhere, and it will normally be prerendered. And:This issue is just to track that we probably need to update some docs/guidance to avoid implying that people should or can always have a WebAssembly loading progress indicator. Also we might consider having some special new component that does render a loading progress indicator within the new architecture for people who really don't want to prerender their WebAssembly content.
The text was updated successfully, but these errors were encountered: