0

I've been confused about the three different options of Blazor; (Server-app, WebAssembly, and WebAssembly hosted). Although, This Post made it mostly clear.

However, it is still unclear for me, since we can benefit both the Client-side SinglePage experience and also the Server-side features over the Blazor Server-side app, why exactly we need to use the two other options (WebAssembly and WebAssembly-hosted)? I know that on the webAssembly-hosted option, the code will be interpreted over the webAssembly and dot.NetCore on the Client-side. On the other hand, on the Server-Side app, the request sends to the Server and will be rendered and then gets back to the browser.

So by using the Blazor Server-side app, I can either keep the way of coding like MVC.Net and having different .cshtml pages, and also having a single-page part on my project. (Please correct me if I'm wrong!)

UPDATE:

Let's ask it in this way:

  • On the WASM-hosted mode, the components (and its codes and other files) will be sent by the client (Browser) request, and then the browser gets (almost) all the components and files to render the pages (and also codes to be interpreted by Client-Side .Net core) on the Client-Side. So now, the only network activity will be the API requests and results.
  • On the Server-side app though, you can have the normal page loads (like how it happens on MVC.Net, however using SignalR instead of Ajax) and also you can have the Single-Page mode (for instance, on the Server-Side app template, the Profile pages, send and receive data to and from the server. However, the weatherForecast and the Counter page are still Client-Side and have no further Network activity). In this mode, again, the browser gets the files and components from the Server (Prerendered or not) and the transferred data is not as big as WASM mode and also the user is still experiencing a single-page web application which has no Network traffic since the user is working around this area.
Sam Axe
  • 33,313
  • 9
  • 55
  • 89
AminM
  • 329
  • 1
  • 3
  • 14
  • This might help: https://devblogs.microsoft.com/aspnet/blazor-server-in-net-core-3-0-scenarios-and-performance/ – cremor Oct 15 '19 at 11:33
  • @cremor Thank you for the link. Actually, I've already read this post. nut still this is not helpful. perhaps I need to update my question. :) – AminM Oct 15 '19 at 13:49

1 Answers1

1

Honestly, client is the way to go. The SignalR approach with the server side is a slightly better version of asp.net with postbacks.

If you can take the time to learn how to use client side Blazor I think you'll be able to offer a must faster and better user experience to the user.

This is only my opinion but I think it's correct.

Bob
  • 41
  • 2