Hacker News new | ask | show | jobs
by woeye 2541 days ago
Isn't Blazor in ASP.NET basically what LiveView is in Phoenix?

https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=as...

1 comments

Not quite. Elixir code isn't set to the client as Blazor does with .Net IL. LiveView leverages a small runtime loaded onto the client which uses websockets to load deltas.

While it sounds expensive at first, the template engine has been extended to support delta tracking and the process model that Elixir inherits fits well for a heavily interactive system with thousands or millions of users. The end result is that it's a very lightweight client setup and outside of using the template system properly, there are no gotchas with learning which code runs where.

There's two distinct Blazor development models: Client side Blazor uses Mono (running as WebAssembly) to run C# code on the client side, but server side Blazor only updates the DOM via SignalR (like WebSockets), which works like LiveView.

I didn't use Blazor yet, but that's what I understand from the documentation.

Thanks for the correction and clarification. The early parts of the docs didn’t make this distinction clear so I assumed the WASM half was required.
I don't think that's correct. Blazor supports both client-side (what you are describing, sending IL to the client and running it as an app) and server-side (what LiveView is doing). More details here: https://docs.microsoft.com/en-us/aspnet/core/blazor/hosting-...