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

Simultaneous Blazor Hosting Models and switching at runtime #17678

Closed
anorborg opened this issue Dec 7, 2019 · 8 comments
Closed

Simultaneous Blazor Hosting Models and switching at runtime #17678

anorborg opened this issue Dec 7, 2019 · 8 comments
Labels
affected-medium This issue impacts approximately half of our customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-boot-up ✔️ Resolution: Duplicate Resolved as a duplicate of another issue severity-major This label is used by an internal tool Status: Resolved
Milestone

Comments

@anorborg
Copy link

anorborg commented Dec 7, 2019

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.

@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Dec 7, 2019
@Hellevar
Copy link

Hellevar commented Dec 7, 2019

Check this repository description

@anorborg
Copy link
Author

anorborg commented Dec 7, 2019

@Hellevar, looks interesting, though you'd still be making the decision based on your first request. Perhaps you could wrap the logic a bit, but I'm not sure you could start the app running server side and simultaneously prepare and switch over to wasm when ready.

@MV10
Copy link

MV10 commented Dec 8, 2019

I don't personally have much interest in the client-side mode (doesn't seem like a good fit for enterprise dev, which is where I live now, and I'm not a fan of the slower pace of Xamarin), but it seems to me this could only work if the server side ran wasm, which might make it easier to transfer state to the client when your code decides to switch.

Otherwise what you propose would seem to require the ability to transfer state from the completely-different .NET Core-based runtime to the Xamarian runtime, which sounds unlikely.

Also bear in mind there are three more Blazor rendering models already in the pipeline (Electron, PWA, full-native)...

@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Dec 9, 2019
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Dec 9, 2019
@mkArtakMSFT
Copy link
Member

We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

@javiercn javiercn added affected-medium This issue impacts approximately half of our customers severity-major This label is used by an internal tool labels Oct 9, 2020 — with ASP.NET Core Issue Ranking
@genifycom
Copy link

This goes much further than the OPs request.

We need single deployments that can contain BOTH Blazor client side and server-side.

For example, recently ran into an issue in Bazlor WASM, so I need to change this component from client side to server side until I can work out a resolution. It is ridiculous to have to have two separate projects and have to move the component between the two!

We live in a production environment here not a test one. Options to move things around easily are VITAL for keeping a production system running.

There is NOTHING technically stopping both models from being supported in the same project. Please allow it urgently.

@pranavkm pranavkm modified the milestones: Backlog, .NET 7 Planning Oct 19, 2021
@pranavkm pranavkm added the Priority:2 Work that is important, but not critical for the release label Oct 28, 2021
@pranavkm pranavkm added k:2 and removed Priority:2 Work that is important, but not critical for the release labels Nov 5, 2021
@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 7 Planning, Backlog Nov 11, 2021
@ghost
Copy link

ghost commented Nov 11, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@hez2010
Copy link
Contributor

hez2010 commented 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.

@mkArtakMSFT
Copy link
Member

mkArtakMSFT commented Nov 15, 2023

Thanks for your patience, everyone.
I assume the new Auto render mode is exactly what you were looking for, isn't it, @anorborg: https://learn.microsoft.com/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0

Closing this as completed then. Please feel free to open a new issue if I've missed something.

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Nov 15, 2023
@ghost ghost added the Status: Resolved label Nov 15, 2023
@mkArtakMSFT mkArtakMSFT removed this from the Planning: WebUI milestone Nov 15, 2023
@mkArtakMSFT mkArtakMSFT added this to the 8.0.0 milestone Nov 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-medium This issue impacts approximately half of our customers area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-boot-up ✔️ Resolution: Duplicate Resolved as a duplicate of another issue severity-major This label is used by an internal tool Status: Resolved
Projects
None yet
Development

No branches or pull requests

8 participants