Skip to content
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

Document how to display a loading UI for interactive WebAssembly rendering #31048

Closed
danroth27 opened this issue Nov 15, 2023 · 1 comment · Fixed by #31145
Closed

Document how to display a loading UI for interactive WebAssembly rendering #31048

danroth27 opened this issue Nov 15, 2023 · 1 comment · Fixed by #31145

Comments

@danroth27
Copy link
Member

danroth27 commented Nov 15, 2023

[EDIT by guardrex to add the metadata]

We don't currently have a great way to display a loading UI for interactive WebAssembly rendering, but as @javiercn pointed out there is a way to do it:

  • Prerender a wrapper component that displays the placeholder on the page.
    • Inside the wrapper, render your component with prerender: false
  • Have the wrapper use @if(OsPlatform.IsBrowser()) to distinguish between SSR and WebAssembly and render your placeholder or the actual component.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/startup?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/startup.md

Document ID

11f8db3d-9988-e0a1-89c5-c3552ee47b93

Article author

guardrex

@guardrex
Copy link
Collaborator

@danroth27 ... Do you have an example of this? Also, the language of Javier's guidance doesn't make sense for routable Auto or WebAssembly components (with prerendering disabled). One wouldn't "Inside the wrapper, render your component with prerender: false" if the WASM/Auto component is found and loaded by the Blazor router, unless the wrapper component is wrapping the Blazor router in the Routes component, but I don't see how that's going to work. I need more info on both the scope and the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants