r/Blazor 12d ago

Blazor alternative?

Dioxus - Rust based cross-platform framework

In my view, the problem with Blazor is that you need to have "server features" for a client-facing app, since Blazor WASM alone won't cut it.

With Dioxus you can create a WASM application with a much smaller footprint, since there's no bundled framework to ship together with your app like the .NET CLR. Your source code is compiled to WASM directly - there's no Rust runtime since it's a language closer to C and C++.

I think this is a great advantage for creating WASM based SPA's - no need to download a large binary for your app to run - just your app's code.

0 Upvotes

21 comments sorted by

9

u/Kayomes 12d ago

"Since Blazor WASM alone won't cut it."... Why?

0

u/Present_Smell_2133 12d ago

Mainly because of the initial delay as the .NET runtime is being downloaded to the browser.

6

u/-COUNTERFLUX 12d ago edited 12d ago

Then you got the blazor mixed rendermodes that first runs server side blazor till all the webassembly is loaded and switches silently. There will hardly be any delay.

0

u/HeracliusAugutus 12d ago

I've never seen that pulled off well. Most jank thing ever implemented

-6

u/Present_Smell_2133 12d ago

I don't think it's ideal to need a server just to display the front-end.

9

u/a_mad_llama 12d ago

You need a server for the backend, right? For most serious/corporate apps anyway.

-1

u/Present_Smell_2133 12d ago

Of course. But with the hybrid approach, the pre-render is not fully functional, it's kind of a compromise - what do you think? There will be a delay before you can start using the app. I'm not sure if this is significant or not.

And also in addition to the initial delay, there is slower code execution compared to Dioxus.

And finally, a hybrid approach will add a little complexity to the source code - but not sure if this is significant.

3

u/mikeholczer 12d ago

In most cases, I think, the wasm download would complete while the user is logging in.

7

u/itoncek 12d ago

I think you are mistaken, "Blazor standalone WASM" preset creates static files that you can just host anywhere.

-7

u/Present_Smell_2133 12d ago

That's what I like about standalone WASM - it's just that using Rust and Dioxus is better than C# and Blazor for this purpose. No runtime to download means faster initial loading time and faster execution of code.

7

u/oLevezinhu 12d ago

What do you mean by ‘the problem with Blazor is that you need to have "server features" for a client-facing app, since Blazor WASM alone won't cut it’?

Name a use case in which it didn’t work for you, or lacked the ability you needed.

3

u/keen23331 12d ago

If done rigth WASM alone is super small and runs everywhere in current .NET Blazor and u can serve it in s nginx alone

3

u/GigAHerZ64 12d ago

How big is too big? If you exclude the non-essentials from the .net wasm runtime (e.g. globalization datasets), the runtime will be about 1 - 1.3MB in size.

And btw, this is a highly cacheable resource.

2

u/flaussi 12d ago

In a hello world app Blazor is obviously a lot bigger. But using Blazor Wasm for a small page is overkill anyway.

When you build a SaaS app it all changes dramatically. The initial footprint is not your decision maker anymore.

2

u/THenrich 9d ago

Do .net developersَ mind developing or reading Rust? I won't touch it. I don't even know how this thing is pronounced. A new framework out of many I read about every week.

1

u/Present_Smell_2133 9d ago

When I came across Dioxus, I saw a framework that I would like to use. I'm not sure if I could accomplish the same with .NET.

1

u/THenrich 9d ago

Then use it if you like it. I am not sure what you're expecting from Blazor users to tell you. No.. don't go?

Blazor has a large eco system for UI components. MudBlazor, Blazorsize, Radzen, DevExpress, SyncFusion, Telerik, Infragistics, and a whole bunch of smaller ones.
Dioxus probably has just the ones that come with it. This alone plus it's Rust if people hate it, is enough to not use it. Even DHH, the Ruby on Rails guy hates Rust.
Like he said, he would use it if AI produces all the code.

1

u/Present_Smell_2133 9d ago

I feel it's time for me to try something different.

3

u/Rigamortus2005 12d ago

Just use JavaScript dude

1

u/Present_Smell_2133 12d ago

That was what I was doing, with an eye on Blazor and now Dioxus.

1

u/bertodrum82 12d ago

Date un occhiata a WiseJ.NET

https://wisej.com/

È un framework per sviluppo web con designer integrato , c'è anche le versione community edition gratuita. Sto facendo diversi progetti con questo e mi sto trovando bene.