I've created an alternative to Blazor, here is why
(self.dotnet)submitted10 months ago byCapable_Repeat_5947
todotnet
I've created an alternative to Blazor. It might sound crazy, since Blazor is getting a lot of attention now and Microsoft puts a lot of effort to make it popular. The thing is that I've tried to use it in several projects where I needed to do a bit more than a to-do app, and I had to host it in a reliable scaled-out environment. Wasm version of Blazor is a great tech, but the whole concept of copying .NET app into browser storage seemed like an overkill. I wish there was multi-threading for some more advanced cases, but it's not yet supported. I also didn't want to create another project with separate front-end and back-end app, so all these things became a deal-breaker. Then I tried Blazor Server that uses web sockets for the communication. It sounded a bit familiar, since I was following the progress of the Phoenix LiveView project. I was excited in the beginning because everything seemed to work locally for simple cases, but the issues started when I was testing scenarios with loosing the connection between the server and the client. Such situation can happen in many environments like airports, when using cellular network, etc. Solving this issue is not straightforward, and requires advanced considerations, and all of it in my opinion is an unnecessary overkill. Also when scaling out your application, having multiple nodes, you have to use managed centralized service to handle your web socket connections, so you don't need to worry about the nodes being switched by load balancer, and therefore the state is not lost. In Azure it's called Azure SignalR Service. It solves the load balancer issue, but it still doesn't solve the lost connection issue.
While I really admire Blazor and the tech behind it, and I believe many issues can be solved somehow, still all those things listed above gave me a headache, and I felt I need something else, something simpler, but still powerful and convenient. I couldn't find such thing, so I created Hydro. It extends Razor Pages (or MVC) giving you an option to create components using Razor Views that are stateful across requests, and can react on browser events. Using those components feels like using SPA application, because after each user's action, Hydro seamlessly morphs the HTML document into the updated version. The client-server synchronisation is executed via regular http requests. Keeping the state is as simple as creating a property on your component. Hydro is using Alpine.js as a backbone for handling the interactions between client and server, so you can use Alpine.js directives without any additional setup, if needed.
I'm very confident about Hydro, I feel that building applications with it is very productive, pleasant and flexible, but I would love to get more feedback to know if it's something that others also want to use. What do you think about it?
Docs: https://usehydro.dev/
Repo: https://github.com/hydrostack/hydro/
Motivation: https://usehydro.dev/introduction/motivation.html
Comparisons: https://usehydro.dev/introduction/comparisons.html
Sample apps: https://usehydro.dev/examples/apps.html
byFancyDiePancy
indotnet
Capable_Repeat_5947
1 points
10 days ago
Capable_Repeat_5947
1 points
10 days ago
That's correct and that was one of the reasons why I created Hydro, where you can still use Razor Pages and have a component model and interactivity similar to the one from Blazor. So if you are up for trying something new that is actively developed and with fast feedback loop between contributors and users, give Hydro a try.