Running Blazor in production, lessons learned - Jimmy Engström - NDC London 2023

2024 ж. 10 Мам.
26 331 Рет қаралды

We have been running Blazor in production for over two years now.
Everyone in our team is a C# developer, so when we went into our latest project Blazor was a natural choice, even though Blazor was only a week old.
Looking at my peers working in the same space, I am convinced that it saved our project by switching to Blazor.
Even though it has been mostly smooth sailing we have learned a lot during the years.
In this session, I will give you some of the tips, tricks, and learnings we have collected over the years, when to choose what, and how to avoid pitfalls converting your exiting project to Blazor.
Check out our new channel:
NDC Clips:
@ndcclips
Check out more of our featured speakers and talks at
ndcconferences.com/
ndclondon.com/

Пікірлер
  • Great presentation. Thanks a lot Jimmy. I bought your book.it's amazing. As a dot bet senior developer, Blazor was my dream, I will never use any other frameworks for my new projects. Blazor is the best framework i have ever worked on.

    @imadabab@imadabab11 ай бұрын
  • Be careful with just throwing everything into components. There is a small overhead for each component. So if you have a 1000 component on a site, it will slow it down. I've been there myself. I've used blazor a couple of places in production :)

    @Panzerfury18@Panzerfury1811 ай бұрын
    • Is this a problem you would encounter using Angular components at the same rate?

      @michaelryce1200@michaelryce12004 ай бұрын
    • Component is razor page so I eat memory, same as any other component in react, bean or whatever if you use it.

      @SanongPenmongkol@SanongPenmongkol2 ай бұрын
  • Thank you for nice talk. However, I don't think that WASM footprint was compared properly. In my opinion, Blazor WASM example given is really abstract one. You did compare it with Facebook saying that Blazor is just 1MB vs 16MB on social network's side. Facebook is pretty heavy application by itself, so no doubts it has high payload. In such case, would be nice to see comparison with something similar created in Blazor WASM(in terms of complexity) and not just by comparing some abstract application.

    @dmitryborovych9135@dmitryborovych913511 ай бұрын
  • Always found front end tools a mess. Weird errors, difficult to debug. Nothing is obvious, too much magic. Blazor is front end development for back end developers.

    @Biker322@Biker32211 ай бұрын
    • Honestly, IMHO, the problems boil down to HTML and CSS. CSS is so full of side effects it amazes me that this ever passed muster and became a standard tool. HTML was designed to lay out academic papers, now it's being used to lay out 21st century web apps. It's like building a space station with clay bricks. JS is an ugly workaround to make these two old pieces of technology work on the modern web. What needs to happen, is the web needs to move to a modern standard.

      @tacticoolrick5562@tacticoolrick556210 ай бұрын
  • How does Blazor server handle things like drag and drop? Does it download some JS that it runs in the browser? Or do people still use some JS when using Blazor server pages? Seems like overkill to go back to the server for DOM manipulation when a little JS will do the job. I currently use vanilla JS, Razor, lots of AJAX to make the pages feel "live". Thinking of switching...but was surprised when he said mixing and matching razor and blazor wasn't a good idea b/c connections get dropped.

    @georgebeierberkeley@georgebeierberkeley11 ай бұрын
    • Exactly.... drag drop is just the tip of the iceberg. Just wait till you try to do something else than tutorials.

      @rentefald@rentefald11 ай бұрын
    • With .NET 8 the mix-and-match approach is likely to work quite well - with SSR (Server-Side-Rendering) it will create/drop SignalR connections as you move around an app. Not all pages are interactive so this makes perfect sense IMO. My home page (which is heavily hit) is currently a Razor Page because I don't want a SignalR connection for every user that hits it. With .NET 8 I can rewrite as a Razor Component but it will still be 'static' and have no connection.

      @Conficient@Conficient7 ай бұрын
  • Blazor is the future

    @erril8285@erril828511 ай бұрын
  • Blazor is \o/ - such productivity

    @Sebazzz1991@Sebazzz199111 ай бұрын
  • "Paul-Sebastian Manole" Yes. Dev experience maybe is not so good but I think the future on WASM and from all languages biggest abilities to shoot on Blazor

    @avisalon4730@avisalon473011 ай бұрын
  • After 30 minutes of just listening to how Blazor works and nothing about any lessons learned in production I stopper watching.

    11 ай бұрын
    • Wow I only made it 15 minutes.

      @seanmiller7889@seanmiller788911 ай бұрын
    • Starts at min 37

      @nickellis-gowland7982@nickellis-gowland798211 ай бұрын
    • Yeah there's this amazing thing where you can move the video forward instead of being a dick in the comments section.

      @tacticoolrick5562@tacticoolrick556210 ай бұрын
    • @@tacticoolrick5562 Should have told me that 15 minutes earlier.

      @seanmiller7889@seanmiller788910 ай бұрын
    • @@seanmiller7889 a developer that can't scroll a video or use the provided indexes in the video 🤦‍♂

      @JacobSnover@JacobSnover7 ай бұрын
  • Your experience with blazor seems not to be related to blazor, but rather with the shift on going to singel page applications.

    @ErnaSolbergXXX@ErnaSolbergXXX7 ай бұрын
  • I was interested on Blazor as an escape of the JS nightmares, but "unfortunately" (for good or bad), Blazor is going towards the same approaches. Honestly, the more you think, the more server side rendering makes sense for a good deal of web apps. That is why things like HTMX with Razor Pages look like a better option that I am more interesting on trying these days

    @XXnickles@XXnickles11 ай бұрын
    • JS nightmares are happening because you're not writing the code yourself, probably some 3rd party junk you believe you can't live without. Be a developer!!

      @rentefald@rentefald11 ай бұрын
    • @@rentefald just to be clear, I am calling nightmare to how polluted the JS ecosystem is. Even within the same language specification you find bunch of headaches, like the web components. I don’t know exactly what you refer to junk libraries, as I can put in that bag stuff like Angular, but I will give you the reason on the fact that plenty of times people uses libraries without even understanding what are they for

      @XXnickles@XXnickles11 ай бұрын
    • @@XXnickles- Junk libraries are javascript code written by some open source (script kiddies) org that you have ZERO control over, and that breaks all the time. The more libraries and JS dependencies you have, the less likely your code is EVER going to work properly in production. All the "frameworks" are junk compared to code I write.

      @foobarmaximus3506@foobarmaximus35064 ай бұрын
  • What I can't stand is the slow iterative feedback. Blazor feels like developing for Webforms compared to Vite + any JS frontend lib.

    @PaulSebastianM@PaulSebastianM11 ай бұрын
    • Big time. Debugging WASM feels like I'm running my parents' computer in 2001. Server isn't as bad but still, Hot Reload isn't amazing and my time to iterate is slow on Blazor in comparison to others.

      @rossimac@rossimac11 ай бұрын
    • I literally stopped a side project because hot reload stopped working and it was too frustrating to update the CSS.

      @goodjesse711@goodjesse71111 ай бұрын
    • Yeah, came from Xamarin as well and hoped for a good experience ... but still. You can develop much faster in Javascript space. Hot reload is such an important feature, if you have to reload all the time it will take hours... Also for a new beginner i wouldnt recommend blazor at all. Microsoft hasnt done well in the past for front end developers beside MVC. Rather take your journey directly with typescript and your favorite framework like angular, react or any other. If you come from an C# Background, you might get your hands easy on this but it will be hard to progress after you made 60% of the project.

      @rarepanda3766@rarepanda376611 ай бұрын
    • just today I lost 3h to Vue.js with Vite crashing on the main page with stack trace to a component that was not on the page. Fun stuff. No clean&rebuild would help. Do you know what helped? Switching branches to master and back to feature branch. Now it works. What a great experience, so vastly better than Blazor :)

      @Qrzychu92@Qrzychu925 ай бұрын
    • @@Qrzychu92 sounds like you have a tooling problem

      @PaulSebastianM@PaulSebastianM5 ай бұрын
  • you did not talk anything about prod -_-

    @daniel5040@daniel50404 ай бұрын
  • Im sure blazor has its uses, but ill pass for the moment. Actually working with javascript and other frontend tech has given me huge insights into programming. Skipping that would have been detrimental for me. Unfortunately, like with other autogen frontend stuff, i feel like this just puts a huge wizard of oz curtain in front of what you are trying to accomplish ( like linq to sql ) and leaves room for bad code and ineffiency.

    @justinbryson5275@justinbryson527511 ай бұрын
    • True insight from a junior developer, you're very special. Kind regards from a 20+ developer.

      @rentefald@rentefald11 ай бұрын
    • You don’t know anything brah.

      @fieryscorpion@fieryscorpion9 ай бұрын
    • @@rentefald 20+ ah that explains why your are against new technologies. Get with the times old man ;)

      @wboumans@wboumans5 ай бұрын
  • Actually there's 0 real lessons learned in this video. Don't waste your time

    @loudascloudloudascloud7540@loudascloudloudascloud7540Ай бұрын
  • Blazor is dead in 3 years. It is simply a mess, weird magic tags that produce stupid HTML. Just the idea that everything requires a constant connection to the server, imagine the resource cost.

    @rentefald@rentefald11 ай бұрын
    • like other SSR tech do it differently...

      @tecTitus@tecTitus7 ай бұрын
    • I don't have to imagine it, because we have production apps that don't cost very much and have been running for years with new additions all the time. Static Web apps can be deployed with very little overhead, and there's also multiple ways to run it outside of the server including WASM and PWA.

      @JacobSnover@JacobSnover7 ай бұрын
    • the ws connection is super cheap to maintain though

      @yarmgl1613@yarmgl16135 ай бұрын
  • Blazor Web Assembly has the same paradigm and problems as the OLD OCX controls. Downloading a full app is stupid. Might as well do desktop. Because it will not work correctly on any non-supported (phone) browser, and it will have security and version problems (DLL hell redux).

    @foobarmaximus3506@foobarmaximus35064 ай бұрын
  • Swedish Companies are using Blazor! So OK then. Good enough for me! lolol

    @foobarmaximus3506@foobarmaximus35064 ай бұрын
KZhead