question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simultaneous Blazor Hosting Models and switching at runtime

See original GitHub issue

Is your feature request related to a problem?

I would like to host my blazor application differently depending on client attributes and needs, but it appears I must choose between server or client.

Describe the solution you’d like

Ideally it would be interesting to have a bootstrap step on the initial load that can decide whether to run the application in server-side mode or wasm mode from the client. For instance, perhaps I check a localstorage variable to see if I have already loaded the version of the wasm bundle I need. If so, I’ll go ahead and run as wasm, otherwise I can choose to run as server-side for a quicker startup.

In addition, if I choose to run server-side, I can also choose to request the wasm hosting bundle in the background. The idea being, while the client is up and running on the server-side hosting, the application is preparing itself to be able to switch to wasm mode once all the resources are downloaded.

The end result is an attempt for a best-of-both-worlds scenario. You get the speed of a quick server-side startup and the flexibility of a full wasm hosted application without changing the experience for the user.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
hez2010commented, May 26, 2022

I’m building a solution that uses server-side blazor at first while loading wasm blazor in the background, and when wasm resources are ready, switch the server-side blazor to wasm blazor at the runtime. I can already achieve switching hosting model at the runtime, but I am struggling with keeping the previous states (both the application states and render tree) after switching. I hope blazor can add support for passing states and render tree from server to client and applying them to the client.

1reaction
Hellevarcommented, Dec 7, 2019

Check this repository description

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor: switching Server and WebAssembly at runtime
NET runtime (Blazor WebAssembly) or server-side in ASP.NET Core (Blazor Server), but these two models cannot be used at the same time.
Read more >
ASP.NET Core Blazor hosting models
Blazor is a web framework for building web UI components (Razor components) that can be hosted in different ways. Razor components can run ......
Read more >
Switching asp.net Core Blazor hosting models [closed]
I am interested to find out how difficult would be to switch from server-side Blazor hosting model to client-side and other way arround?...
Read more >
Blazor: Switching Server and WebAssembly At Runtime
In this article you'll find out how Blazor: Switching Server and WebAssembly at runtime. ASP.NET Core Blazor is a web framework designed to...
Read more >
Blazor in .NET 8: Full stack Web UI
In this post I talk about the changes coming to Blazor in .NET 8 with the move to full stack web UI.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found