-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Blazor: Combine server and client to get the best of two worlds #35358
Comments
incredible if it works, it would be ideal |
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. |
Related request: #17678 |
Thanks for contacting us. We're moving this issue to the |
For my team, this feature's absence is the only major factor preventing us from being able to use Blazor for our upcoming rewrite of our main app. Blazor WASM's frontloading MBs of assemblies is out of the question for our use case — users will simply leave if the questionnaire link they clicked on takes several seconds to load — and Blazor Server isn't going to scale well or provide sufficiently low-latency front-end interactivity. Until we have the ability to use both together (Server for landing page, switchover to WASM once assemblies loaded), Blazor is not an option for us. |
Any updates? Cannot wait to have this! |
Hi, I have been doing Blazor WASM development in .NET 6 for several months now and I want to make a general comment which is that I would really like the .NET team to advance this. I am the kind of developer that really appreciates quick start up of an app for debugging and for my users as it makes me more productive, and currently with WASM I feel that the app start-up time slows things down just a little too much. On a very fast PC it's not too bad but not all users have this. My idea of a "middle-way" is to have a server-based Blazor project which downloads some WASM up-front without the need to download the entirety of .NET. |
@positiveactionsvcs the challenge with this is that you still need the .NET runtime in place before anything can run in WASM. They've made some progress with this in .NET 6 and 7 (I forget what they call it, but I know it as "tree shaking") to have the client only download the parts of .NET that they need, but there are limits to how much size/speed this can save. Ultimately, even if the .NET WASM runtime that's downloaded on the client is twice as bloated as it optimally could be, the model proposed in this issue mitigates it quite well. |
Steve Sanderson just announced his Blazor United prototype: https://youtu.be/48G_CEGXZZM |
I think this is really important. The beauty of Blazor server, and web forms before it, is that you have a single entrance into a page to authenticate the user, rather than the MVC approach where you move all your page logic client side and then need to secure a bunch of web API endpoints which are all publicly accessible. I wonder if it is possible that the web assembly can be generated and secured in such a way that it can be trusted to communicate with whatever endpoints the API has, without each endpoint having to separately authenticate each request. Kind of like viewstate in web forms was encrypted so information could be stored and trusted. even though it was in plain sight. |
Unless you have a specific proposal, I don't think we have any new mechanisms than have existed for other client-side code scenarios for the last few decades (e.g., native apps or JavaScript browser apps). |
Blazor United related work is now tracked by #46636 |
Hi folks. Since we're planning to address this feedback with the Blazor United effort, I'm going to go ahead and close this issue as a duplicate of #46636. so that we can focus our attention there. |
@danroth27, @SteveSandersonMS I have seen no indications of this being addressed:
|
@Bartolomeus-649 That's fair. We do envision facilitating client-server data access for Blazor United apps, but it hasn't been decided yet what approach we will take, and I don't think we have a good tracking issue for this yet. There's lots to consider: What format/protocol should we use? How do we provide a strongly typed integrated .NET programming model without introducing tight coupling? How do we enable interoperability for when these endpoints aren't just for the frontend client anymore? How do we appropriately surface considerations when making network calls like network failures or latency? Is there tech we can just reuse without having to reinvent the wheel? Etc. Do you want to split this out as a separate issue and start the discussion on a proposal? |
Background
With Blazor Server you can be very productive , even though the use of HTML and CSS. You can code in a real programming language like C# and almost never need to deal with JavaScript.
The downside of Blazor Server is that the client needs to have an active network connection to the server, and network lag can be a problem on bad/unreliable network connections or if the "distance" between the server and client is too far.
With Blazor Client/WASM you are productive too, but no way near the productivity you have in Blazor Server where you have access to the full .NET Core API and can access databases and and other server side resources directly.
On the other hand, with Blazor Client you don't need an active network connection, and you can even run offline.
So, what if we could get the best of two worlds.
What if we could offload stuff to the client and only send back the important things to the server.
Html now has support for Web Components (Custom elements, Shadow DOM, templates, etc.), which makes it possible to add new tags to be used in html. New tags can be defined and provides encapsulation so they won't interfere with each other or with the html page where they are used.
Nicole has a prof of concept where she combines a normal web page with a WASM web component on medium.com:
https://medium.com/coinmonks/develop-w3c-web-components-with-webassembly-d65938284255
Feature request
Obviously in steps and not all at once
Also, but not part of this Feature request, Blazor really needs to become a first class citizen in Azure:
The text was updated successfully, but these errors were encountered: