Unpopular opinion?
Blazor WASM is just a mistake: too heavy, too slow.
I would have preferred Microsoft to do with C# what Google did with Dart: compile the code directly into JavaScript.
Unpopular opinion?
Blazor WASM is just a mistake: too heavy, too slow.
I would have preferred Microsoft to do with C# what Google did with Dart: compile the code directly into JavaScript.
@mihamarkic Hmmm....
"Currenly, the only supported target is WebAssembly. Other targets may be enabled in the future, but we are not investing work into them at present."
A little too early 😅
@mihamarkic A FrontEnd application essentially does DOM manipulation and event handling.
**At present**, WASM is not at all suited to this type of use. WASM was created for heavy calculations.
That's why JS is faster for a typical FrontEnd app.
https://krausest.github.io/js-framework-benchmark/2025/table_chrome_137.0.7151.55.html
(Blazor WASM is about 4 times slower than Lit, for example.)
I do agree, however, that there would probably be major limitations if C# code had to be compiled directly into JS.
@mihamarkic We investigated in Blazor WASM because sharing code between the backend and the frontend is great, and Razor components are nicer.
We ported the frontend of an app to form a concrete opinion. The feedback from our users was pretty bad: "Have you changed anything? It seems to be slower than before".
And that's what happened: event handlers went from 35ms to 200ms! Enough for users to notice.
The productivity/pleasure of developers is not a good reason to penalize end-users.
2/2
@mihamarkic "you shouldn't have spoiled them in the first place"
Hahaha 😂 Not wrong.
"ask them if they are willing to pay X more for the product and maintenance"
They don't pay for it: our apps are for internal use, our users are coworkers.
And frankly, they're not being kind to us.
"did you try server side blazor"
No, we haven't had the time yet.
@cedx Ah internal within the company, but still somebody is paying.
But hey, you should really try the server version. The only annoying point is that it loses connection after inactivity and a refresh is required.
"I'm sure this will change soon though." Yes, but unfortunately not yet. We'll probably have to wait a few years before WASM improvements hit our browsers.
"Do you really think this DOM WASM manipulation is really that bad for the end user?" Unfortunately… yes!
At work, we develop mostly Intranet/LOB/SPA applications. Our stack is ASP.NET Core/Minimal APIs for the backend, TypeScript/Lit/WebComponents for the frontend.
1/2
@cedx When AOT compilation becomes more mature, with fewer limitations, it will presumably allow more Blazor applications to be compiled to WebAssembly directly, rather than using interpreted bytecode.
It will be interesting to see what effect that has on performance.
@driggy
"you would have to translate everything still"
That's exactly what Google has done with Dart. And the produced JS is smaller and faster than the WASM produced by Blazor.
(Don't ask me how they managed this feat.)
WASM is **currently** not a good target for DOM manipulation and event handling. And that's most of what a FrontEnd application does.
There are a ton of languages that compile to JS (Dart, Haxe, Kotlin, etc.), which is why I think Microsoft could have done better.