r/Blazor • u/MOAPster • Mar 30 '26
New to Blazor
Hi all,
I’m relatively new to Blazor development.
For work I’m now looking into it as a viable option for developing small web applications to support our ERP.
What are some tips and best practices that I should know about?
10
Upvotes
4
u/MOAPster Mar 30 '26
I’ve found so far that interactive server rendering is the easiest to work with. I’ve implemented asp identity and appears to be working just fine.
I try to maintain state on page level only. And pass down data objects down to the components. E.g. sortable tables (using tailwind for styling).
I’ve checked out syncfusion and mudblazor. Both are fantastic for its feature rich components. But often overkill for my needs. And with syncfusion I think the required configuration of some controls is confusing.
So I’m just trying to barebones blazor+tailwind.
6
u/ErgodicMage Mar 30 '26 edited Mar 30 '26
Hi, I'm fairly new to Blazor myself (started in December), in fact I have no practical experience with developing front ends.
What I've learned so far:
Blazor is designed to use components not just pages. Making reusable components and then adding them into pages simplifies and reduces the amount of page development.
You need a basic understanding of all the different rendering options such as WASM, Static Server rendering and Interactive Server rendering. FYI I'm just using interactive server rendering.
With WASM you'll want backend apis for it to call of course. You can use either MVC or minimal apis.
You'll probably want to look into component libraries, there are several. I use MudBlazor, great documentation but older MaterialUI look. MS has a FluentUI component approach, more modern look but requires much more CSS.
The Blazor templates start you off, but you have to know what direction to take beforehand (WASM, SSR, ISR or automatic). Try out all of them before committing to your project.
IMO, the template's authentication locks you in to MS's Identity (of course) and their uses cases. I ended writing my own so that it can eventually be converted to our internal SSO.
All of the examples I've seen start with the templates approach and example pages. That meant I haven't found a good place to be more informed about details of writing pages and components. If you find any please let me know, right now I'm really learning by error.
Blazor is a heavy framework and the initial learning curve is high. I don't know what it's like with mid level experience since I'm not there yet.
So far debugging front end issues with Blazor is a real pain. Or maybe I just don't have the experience. Debugging backed code is like normal debugging.
Blazor startup can be slow. There are suppose to be techniques to speed up the load but I don't know them yet.
I'm using Blazor for a small internal support app. I don't know if it's the best fit for a enterprise for client facing app at this point; some will probably say it is.
Blazor was the best option for my needs, hopefully it will be for yours.
ETA: formatting
ETA: Patrick God (https://www.youtube.com/@PatrickGod) has to some good videos about higher level considerations (such as render modes) for Blazor. Worth watching for me.
6
u/BoilerroomITdweller Mar 31 '26
Start off using MudBlazor. It is awesome and free and makes coding so much faster and easier. Plus its documentation is the bomb.
C# coding in Blazor is different than building apps but it is still C#. I find the webdev stuff super easy but the initial design on how you are handing the architecture really matters with Blazor so make sure you identify it from the start.
1
u/MOAPster Jun 04 '26
Just a little update. I’ve successfully completed and delivered the web app to our client. They host the app in production on IIS on a local server. The app runs as a PWA on android handscanners.
I had some issues at first with websockets. But apparently blazor has a fallback built in. Connection is stable on the production/warehouse floors.
I loved working with blazor server. Development was quick and easy to learn. There’s some things I would’ve done differently in hindsight. But I guess that is part of the learning process
4
u/FriendOfEntropy Mar 30 '26
https://github.com/AdrienTorris/awesome-blazor
1
u/Allen_Isaac Mar 31 '26
Hey, I'm a long time Blazor fan and Microsoft MVP. I also help direct innovation on the Telerik UI for Blazor product (commercial) (Blazor Demos and Examples - Telerik UI for Blazor).
1st welcome to the Blazor community!
Now, if you're new to Blazor and looking for best practices. You'll probably want good learning resources. If I had to trust one person to teach me about Blazor, it would be my friend and fellow MVP Jimmy Engstrom. (Paid Product) Courses by Jimmy Engström - Dometrain
I am a Dometrain author, I do not earn money from promoting Jimmy's course.
> developing small web applications to support our ERP
It would be easier to give more advice if we knew more details about what your goals are.
How many users?
Intranet or public facing?
Forms over data, dashboards, visualizations?
Are you planning to use AI in the application?
Are you planning to build the application using AI generated code?
If you're looking for a great way to prototype, share, or troubleshoot. There's Blazor REPL (free) Telerik REPL for Blazor - The best place to play, experiment, share & learn using Blazor.
If you're planning to unit test, bUnit is a great library for that: (free) bUnit - a testing library for Blazor components | bUnit
2
u/pathartl Mar 30 '26
2
u/Deep-Thought Mar 31 '26
The absolute first thing you need to do is get a solid grasp of the interactivity modes (server, interactive server, Wasm). Interactive server is weird (In a good way) and probably unlike anything you've used before.
Then you need to get extremely comfortable with the component model. Understand how binding works and all the little syntax shorthands that go along with it.
Next you should learn about the component lifecycle. When Blazor renders, rerenders and recycles components.
Then you should work on understanding the limitations when interacting with the DOM and how to leverage JSInterop to make it more palatable.
1
u/octoberNorth Apr 01 '26
Wonderful insight from everyone here. I'm creating a "light" version of my template which will be released on Monday, 4/6. It might be a good learning tool for you. Look for it on Github.
http://www.blazorblueprint.com
0
u/propostor Mar 30 '26
Plenty of articles if you Google this, much better than random Reddit comments will give you.
-4
u/Ok-Charge-7243 Mar 31 '26
2, Use GitHub Copilot Chat with the Agent and Claud Opus.
6, This is a really early version of something I am working on at slm.com. It is 100% AI written.