Daniel Steward

On Blazor and front-end development with .Net 9

Planning a wedding has given me the perfect excuse for a project to try out some different tech. We wanted a simple, private website to help us share information and collect RSVPs.

Vue and Asp.Net MVC are my bread and butter for front-end, but I’ve been wanting to try out Blazor in a Server Side Rendering set-up for quite some time.

The experience was sadly a disappointing one: hot reload is essentially non-functional (at least when using Rider), massively slowing development, and it also misses a number of niceties that Vue supports.

The most surprising was a lack of built-in support for specifying additional classes for components at the point of use, like so:

<ButtonComponent class="mt-2 mb-4" ... />

When composing small components together, being able to easily specify additional classes is incredibly useful and eliminates pointless wrapping elements that often get in the way.

You can, of course, add support for this yourself in a component, but I think the issue is emblematic of the shortcomings and niggling issues that are currently present in Blazor.

I was also disappointed to discover that Blazor uses a synchronization context to keep requests on the same thread. A website under load would take a hit to latency as after awaiting, it has to wait for the original thread to yield back to it in order to continue rather than being able to use the first available thread.

The other Blazor modes hold limited appeal for me, either requiring a constant connection with or a very large payload - so I don’t see myself reaching for Blazor again any time soon.