DEV Community

loading...

Discussion on: Implement the "download file" feature on a Blazor WebAssembly app

Collapse
j_sakamoto profile image
jsakamoto Author

Are you saying that "Blazor is a pointless technology"!?

If you ask me, that's too short-sighted.

This article is not describing the whole of Blazor.
This article is only about "getting users to download content", which is a very limited scoped topic.

Blazor is undoubtedly one of the strongest options for implementing SPAs for those who benefit from the development environment surrounding C# and C#.
The advantages of Blazor need to be understood as an overall application development ecosystem, including robust and easily understood package dependency management, reuse of existing .NET library assets, etc.

It's true that in some cases, as discussed in this article, we may need the help of JavaScript to implement the "let the content download" feature.

But that doesn't detract from the value of Blazor.

The power of Blazor benefits us when implementing the main body of the application, other than the "make the content download" feature.

Writing a little bit of JavaScript to implement the "let the content download" feature is trivial compared to the development load of the entire application and the benefits that can be gained by using Blazor for this purpose.

Of course, for those not relying on C# and the development environment surrounding C#, there is no reason to use Blazor, nor is there any appeal.

Yes, Blazor is not beyond JavaScript overall.

But the value of Blazor is providing a powerful alternative for a part of a group of developers (such as depend on C# strongly) for whom SPA development in only JavaScript (TypeScript) would be inefficient.
For these SPA developer groups, Blazor may be beyond JavaScript.

Collapse
intermundos profile image
intermundos

Shortsighted or not, yet, if you have to "go back" to JavaScript land and use it to complement Blazor for the missing functionality, in my shortsighted view, this is pretty inconvenient and does not provide much benefit. After all you can't write full SPA with Blazor alone and will have to mix and match things.

Again, I am not arguing that Blazor is a bad piece of technology, I am trying to understand why would one use it to build client side solutions knowing that, want it or not, you are bound to JS and other limitations coming along.

Thread Thread
j_sakamoto profile image
jsakamoto Author

you can't write full SPA with Blazor alone and will have to mix and match things.

That's right at all, and I agree.

But, I'm not sticking to using Blazor alone for implementing SPA, at all.

Again, (it looks like a point you are not trying to understand from previous my post, and it looks like a point we still disagree) the inconvenience I have to mix in with some JavaScript to implement a practical Blazor SPA is very small for me, compared to the benefits I get from using Blazor.

Regardless of how you feel about it, using Blazor in my work has allowed me to achieve higher quality and shorter development times than I've ever had with Angular for SPA development.

It is not a truth for everyone, but at least, it is true for me.

Of course, please don't forget that I'm developing with C# not only client-side but also server-side, and not an only web application but also console app and Windows GUI app.

This is a big reason why I can get big benefit by using Blazor when I implement SPA.

It provides high-level integration by using C# from database entities, server-side business logic, to client-side SPA.
Once I had annotated to a field of a model class to it should be "required field", it makes the database field is made "NOT NULL", server-side web API endpoint will check it has any values, and client-side Blazor will check the input field is not empty.

I can also write unit tests for client-side Blazor using the same unit test framework, test runner, technic, with what I always use for server-side.

Due to these backgrounds, I agree that the benefits are small if somebody using C# for the client-side only.

Again, I am not arguing that Blazor is a bad piece of technology

Sorry, I could not understand well the finer nuances you may have wanted to convey, at that time.
I felt what you said "pointless" is too harsh words for me.

I am trying to understand why would one use it to build client-side solutions knowing that, ...

To talk about that theme, using this comment field of this article is not appropriate, I think.
I hope you find any answers to that question in some days.