There has been a lot of discussion on Whether Blazor will work properly in the wechat group today. Everyone is red in the face.
So taking advantage of boredom, water such a article.
I remember watching Blazor when Blazor was still in preview.
At the time, debugging Blazor required typing a bunch of commands into the browser address bar, which was inconvenient. The package is also large and the browser is clunky.
Here are a few reasons why I think Blazor can be used in small-scale, formal environments. And where Blazor is not suitable
1. The packet size
But now years have passed. Blazor went from a stack of several megabytes of libraries to version 5.0
Hello World’s package size has been reduced to around a hundred kilobytes. Of course, it still doesn’t compare to Vue NG, which can be reduced to less than 50KB. (This size does not affect the frame loading speed, I think)
2. Function comparison
An excellent SPA framework should also be excellent in all aspects. We can use Blazor to compare the functionality of vue.js.
Vue.js | Blazor | |
---|---|---|
The template | support | support |
State management | support | Does not support |
The animation component | support | Does not support |
Routing component | support | support |
Number of component libraries | more | less |
Component library quality | high | low |
Use the number | more | less |
Server rendering | support | support |
The plug-in | more | less |
The above comparison to my own personal subjective use.
One of the things that stood out to me in.NET 5.0 was the provision of a virtual scroll component: Virtualize is a feature that vue.js has not yet been officially implemented. But Blazor does. Here’s a thumbs up for Microsoft.
3. Applicable scenarios and inapplicable scenarios
According to The Blazor documentation, there is basically no good support for older browsers.
Browser environment
Do not select Blazor if you need to be compatible with IE10 or 11+ versions. Instead of selecting a browser environment, choose Blazor. Blazor can be selected for mobile TO B projects. To c be careful (after all, To C customers can’t ask others To change browsers)
CSS capability
Why did I make this point? The quality of Blazor’s UI component library is beyond description.
- Elder-blazor is in a broken state. It hasn’t been updated in months.
- The ant-Blazor website goes down all the time. Components also lag.
- The only BootStrapBlazor that feels good is that the UI style is a bit too old. You need to adjust the CSS yourself. (If the interface requirements are not high, can use.)
With Blazor components that require special functionality (such as color selectors, Cron selectors), it is not possible to find suitable third parties. You need to solve the problem of writing components yourself.
Many people who have been doing pure back-end work for a long time find it hard to write CSS. Not really, until about July of last year, I was also a CSS chicken. But I didn’t know what was going on last year. Want to use their own set of components out of the library. So I went back to CSS, and in my spare time I also stroked dozens of component libraries (later open source, written based on vue.js) that felt ok.
conclusion
If you’re making a simple backend system for internal use, that’s fine. If you are working on a complex project with long-term maintenance, it is recommended to wait for Blazor to be further optimized.
Welcome to follow my official account: Qingchengcoding
ASP.NET Core+ vue.js is a public account for Web development knowledge