Running Blazor in Production, Lessons Learned

Поділитися
Вставка
  • Опубліковано 23 тра 2023
  • Calm down... the thumbnail is to grab your attention =D
    Since we started using Blazor in 2019, it's been an excellent tool for our team of C# developers. Even when Blazor was brand new, we used it in our latest project, which really helped us. Seeing other people in our field, I can say that Blazor was a key to our project's success.
    Our journey with Blazor has mostly been easy, but we have still learned a lot along the way. In this video, I will share some tips and lessons we have picked up. I will also discuss how to make smart choices and avoid problems when you're changing your existing project to use Blazor.
  • Наука та технологія

КОМЕНТАРІ • 82

  • @jluisxp8553
    @jluisxp8553 11 місяців тому +20

    I already created a web application in Blazor, the best things, it works perfectly!!! and in production!!!

    • @ODSD_EXCITEMENT
      @ODSD_EXCITEMENT 11 місяців тому +4

      Agreed! Our move to Blazor for our new production website was amazing easy and it performs very well. Super pleased.

  • @blackpaw29
    @blackpaw29 9 місяців тому +3

    "Its not Highlander" - lol, perfect :)

  • @OeHomestead
    @OeHomestead 11 місяців тому +20

    I'd take Blazor over any JS/TS/npm tech any time of day. It's so much easier to just use C# across the whole stack. I have backends in production, written in Java, communicating with Blazor Server apps through SignalR and it works like a charm.

  • @SamWashkansky
    @SamWashkansky 9 місяців тому +1

    I'm working with Blazor, and I love it

  • @remontunasdotru
    @remontunasdotru 11 місяців тому +7

    Blazor is great!

  • @DigitalNomadOnFIRE
    @DigitalNomadOnFIRE 8 місяців тому +1

    My first computer was a ZX Spectrum 48K+, also did the coding loop. The fact you got a command prompt and could start coding when you switched it on was great...

  • @farhadsu
    @farhadsu 11 місяців тому +8

    I already use Blazor WASM to develop e-commerce application. Thanks for the exciting book about Blazor!

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому

      Thank you, happy to hear you like it =)

  • @imadabab
    @imadabab 11 місяців тому +9

    Mr. Jimmy. Thanks a million for thos beautiful useful introduction. I bought your brilliant book, it's amazing from zero to hero. Actually Blazor was my dream as a full stack developer using C#. All my new projects are on Blazor and working perfectly.

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому +2

      Thank you, happy to hear you like it =)

  • @Tamer_Ali
    @Tamer_Ali 11 місяців тому

    Thanks a lot Mr. Jimmy for this awesome video, I really like the way you explain Blazor

  • @rkarimabadi
    @rkarimabadi 10 місяців тому

    We also use blazor wasm in our projects as mercantile exchange company. Thank you for sharing your knowledge.

  • @2005Azm
    @2005Azm 11 місяців тому +3

    I Just discovered this channel!!! I love your passion! I wish I was working with such a team!
    Maybe Blazor will save my dev career... I mean put me back on track!

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому

      Thank you, I appreciate that :)

  • @thindal
    @thindal 11 місяців тому +5

    I recently started working with Blazor but I've been loving every second of it. For an old webforms dev it comes really naturally. I'm trying to do it with WASM from day one though.

  • @EldonElledge
    @EldonElledge 9 місяців тому +1

    I am currently designing and developing a application as a contractor that is Blazor WASM for the UI.

  • @mubarekabdi
    @mubarekabdi 7 місяців тому

    You’ve really explained well everything around Blazor. ❤

  • @TheCameltotem
    @TheCameltotem 10 місяців тому

    För övrigt bra presentation! Täcker de mesta man skulle vilja veta.
    Visste inte att de var så stort bland större företag, har själv kört det i lite olika bolag som jag konsultat hos men de är inga top 10 ställen.

  • @Jeff-gt2xu
    @Jeff-gt2xu 4 місяці тому

    I am learning Blazor now; well, that and C# and bootstrap at the same time.

  • @parko1965
    @parko1965 4 місяці тому

    At 9:25 when he started to explain the flow between the browser dom and the backend, I decided to keep watching. Explained very well.

  • @JacobSnover
    @JacobSnover 8 місяців тому

    Love Blazor! Have a couple small sites running it, and also have production code at work. Server side, WASM, and looking forward to the hybrid model in .Net 8!
    I didn't mind vanilla JS but never wanted to learn a framework. Looked at Xamarin but never did WinForms and then Blazor saved my life!

  • @sephyshen2510
    @sephyshen2510 11 місяців тому +4

    Maybe it is time to start using Blazor for upcoming projects. Give it a try.

  • @gunnars04
    @gunnars04 11 місяців тому +3

    Really cool stuff, very well explained

  • @francoislepron2301
    @francoislepron2301 11 місяців тому +3

    I am really happy to hear that because today I work with PHP and React, and this is a daily pain for refactoring or adding features.
    I beleived strongly in Blazor since the beginning because the coding strucure is awesome and clean. I hope that more and coders and companies will move on Blazor since this a really game changer to my opinion.

    • @CodingAfterWork
      @CodingAfterWork  7 місяців тому

      I see more and more companies move over to Blazor. Large companies that I wouldn't have thought would jump on the train this "early".
      But it does take a lot of effort to rebuild an existing site so I would guess Blazor has a pretty good adoption rate especially companies moving from WebForms/MVC/RazoPages.

  • @zc0rp10
    @zc0rp10 8 місяців тому

    Hi Jimmy, how do you deal with storing app-wide/persisted state in your production apps? Are you injecting your own statecontainer service or are you using any of the libs out there such as fluxor or blazor-state?

    • @EngstromJimmy
      @EngstromJimmy 8 місяців тому +1

      Injected my own class is the way I have done so far. I haven’t looked at Fluxor but I have heard great things.

    • @zc0rp10
      @zc0rp10 8 місяців тому

      @@EngstromJimmy Cheers Jimmy!

  • @reynaldoruizflores
    @reynaldoruizflores 8 місяців тому

    Is there a Contoso complete Example ?

  • @TheCameltotem
    @TheCameltotem 10 місяців тому

    Regarding code behind. I usually start off with c# in razor pages when they might be a small component or whatever. If its a huge baseclass with lots of dependencies and methods I have it as codebehind and move it under another file structure just to make it easier to work with since those razor pages usually have a lot of code inside them anyways.

    • @CodingAfterWork
      @CodingAfterWork  10 місяців тому +1

      This is what I do as well, but I rarely find myself having too much code, in many cases, I create additional components.

  • @charlinhos0824
    @charlinhos0824 11 місяців тому +1

    The only caveat I see, it is the need of an extra runtime layer in the browser, in case of Blazor Webassembly, because blazor does not create a webassembly executable(binary) directly, I think it is dotnet which does it, I think Blazor Server Side could be more approachable to Csharp Devs in this regard, I don't know if in the new AOT compilation probably blazor creates webassembly binaries directly, probably a good question to ask you, and another is what version of Blazor tastes would you prefer, WebAssembly, or Server Side Rendering taste??

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому +1

      AOT is WebAssembly but at the cost of a larger download. I prefer Blazor Server, simply because I have used it the most and the debugging is a tiny bit faster. But it really depends on the project. I use both in different projects.

  • @hillarysagwa5064
    @hillarysagwa5064 9 місяців тому

    No one is talking about this but the problem with blazor wasm is not the download size but the loading time esp on phones.
    prerendering solves the problem halfway as even with the page fully loaded, it remains unresponsive untill the wasm loads. during the loading time the user can neither navigate to a diferent page not click on any button

  • @betterlifeexe4378
    @betterlifeexe4378 7 місяців тому +1

    Blazor is so much cleaner then JS solutions and it's getting better all the time. Right now the thing that it needs the most is better interop with JavaScript. it would be really great if there was a way to interface with JavaScript API calls with little to no JavaScript. I hate working with JavaScript async, returning multiple values and having to serialize and deserialize data when it doesn't work.

    • @betterlifeexe4378
      @betterlifeexe4378 7 місяців тому +1

      This time last year I was saying that what blazor really needed was more free components but it's gotten better

  • @yashizuko
    @yashizuko 11 місяців тому +7

    34:52 YES 1000 times, i have seen alot more performance by using html+css is unreal, syncfusion, telerik, radzen all crap, pure html and css is your friend to actually save performance and time when you need to customize, Build your reusable components

  • @aguluman
    @aguluman 11 місяців тому +2

    Hi, could your viewers get a link to the source code?

  • @michaelswells
    @michaelswells 10 місяців тому

    What do you mean with adding a refresh button? Would you please explain (or show some code) of how to implement a refresh button.

    • @EngstromJimmy
      @EngstromJimmy 10 місяців тому

      Add a button that loads the data again (if it is something that changes frequently). What we want to avoid is our users to consider the data on the screen ”old” and therefore press F5 to refresh it. There is nothing special with the “refresh button” only a button that gets the data again. Hope that helps

    • @michaelswells
      @michaelswells 10 місяців тому +1

      @@EngstromJimmy That clarifies it for me.

  • @nagarajm889
    @nagarajm889 7 місяців тому +1

    Great stuff man. However, the memory consumption is not just due to F5. Blazor just keeps adding up the memory on every page navigation, but not releasing the memory that was consumed before. When hundreds of people use the website and move around different pages, blazor is ballooned up with huge memory and eventually goes out of memory. Any suggestion??

    • @CodingAfterWork
      @CodingAfterWork  7 місяців тому

      That is not the "normal" behaviour, the memory should be garbage collected as usual.
      Check your code so you are disposing database connections or any other resources that need disposing.
      You can also change the way the system garbage collects, you can configure the GC in workstation mode instead of server (this will more aggressively collect).
      I don't see the behaviour you describe in our applications so this shouldn't be a Blazor issue.

  • @S3Kglitches
    @S3Kglitches 11 місяців тому +1

    Wait isn't the whole component updated when it changes? Not just the h1 with Rulez -> Rules?

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому +1

      Only the actual changes gets pushed over signalr or via JS interop. Pretty cool isn’t it?

  • @vickychang7183
    @vickychang7183 11 місяців тому +1

    What blazor needs is a way to directly access browser / dom using c# and just bypass JavaScript. Blazor still clunky when it comes to working with dom. Also, they need a better way to create and work with API’s. They need something like like EF that will just create all the API for you.

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому +1

      WebAssembly don’t allow that, but it is in the works as I understand it :)
      Not aure about the API comment though, minimal APIs and open API client generation is pretty sweet.

  • @PrashantUnity
    @PrashantUnity 11 місяців тому

    Here goes one of my subs

  • @notoriouslycuriouswombat
    @notoriouslycuriouswombat 11 місяців тому +2

    the angular killer? lol way to set the bar high

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому

      As you may have seen, the point the video is making is that there are room for more than one =)
      But it is not a statement, it is a very common question/comment.
      If a new framework won't kill another, the new framework will never succeed, which is of course not true.

  • @manuelmq2043
    @manuelmq2043 11 місяців тому

    Hello Young. I have a system developed entirely in Blazor and Oracle. The detail is that it hangs from time to time and I have to restart the server. You say that blazor supports millions of users, I don't have 50 concurrent users and it crashes. What should it be?

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому +1

      I don’t have enough information to diagnose the problem. From my experience I haven’t seen any problem like that when it comes to Blazor.
      It can be how you connect to the database, if you don’t dispose the connections that might add to a problem. Check the memory usage.
      But in short something is going on, but my bet is that it is not Blazor related.

    • @manuelmq2043
      @manuelmq2043 11 місяців тому

      @@EngstromJimmy Thank you very much for the reply. My project is implemented with Radzen in the Fronted and Full API for the Backend. It is implemented in Windows 10 as a test. We are thinking of migrating to WebAssembly, and before doing so, could you give me any configuration recommendations for putting the system into production. Thank you again.

  • @ovarelac
    @ovarelac 11 місяців тому +2

    on the one hand Blazor is amazing, I can imagine things like: photoshop, protools, videogames, a ZX Spectrum emulator, etc. running in the browser, which is mind blowing.
    However in the other hand I understand the perspective of the person who told you: "never gonna be a thing"... because You can not generalize all web projects into a single way of working.
    I understand the power of Blazor for large projects BUT in light projects, the programmers like to be in control (including me), and not that there's a lot of "MAGIC" everywhere, because that implies that many things are going to happen behind the scenes, things that I don't see and can't debug, and that at some point are going to go wrong... Microsoft should have already learned that after the slow death of the web forms.
    I don't think the solution is to remove javascript or say you don't need it anymore... It's like to do a simple task (like a table CRUD) you need a spoon but Blazor is like carrying a big bulldozer... you don't need THAT much power for something so simple . I think that's what people at Microsoft can't see.

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому +4

      I use Blazor for small projects as well. If we just ignore the magic for a bit (everything is open-source so there are ways to know). Working with NPM, transpiling and all of those things make me super slow. Having one language that I know is simply going to be the best experience… for me. So it come down to the developer. The end user is not going to say ”ugh, this is written in JS pr WebAssembly” the end user don’t care.
      From my perspective, if you are a C# developer, there is no reason to not choose Blazor when it comes to the size of the project.

    • @ovarelac
      @ovarelac 11 місяців тому

      actually, there is a reason: I love javascript in the frontend... and debugging and working in my chromium-based browser.
      And I love C# in the backend... it's just the way I like to work...
      Cheers 😁👍

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому +3

      @@ovarelac ”no reason” was perhaps a bit harsh. What I meant was if you like JavaScript and is comfortable with what you already are working with, then you should continue. But if you enjoy C# and are not a fan of JavaScript then Blazor is a great alternative, and in my opinon, for all different project sizes :)

  • @arknu
    @arknu 11 місяців тому

    The problem with Blazor is that it is inherently inefficient. Either you have to have a persistent connection to the server, with associated latency. Or you have to download 1 mb of WASM data. It is just less efficient to translate between C# and JS than just running directly in JS. Now, that may be alright in many cases, but you have to be aware that you'll never be able to match Angular or React for download size. Now, .NET 8 may change with the ability to do server side rendering and sprinkle WASM where needed.

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому +6

      It depends how you see it. Development time is faster (for a C# team), 1mb is absolutelly more than any JS framework. But as I mention in the video, most sites has WAY more than a mb of JS.
      But it all depends on the application we arr building and (I would argue) even more importantly, the team.

    • @knightwriter2989
      @knightwriter2989 9 місяців тому

      "Inherently inefficient"? Comical.

  • @BunmJyo
    @BunmJyo 9 місяців тому

    哈哈哈👍

  • @vivekkaushik9508
    @vivekkaushik9508 11 місяців тому

    2x

  • @DigitalNomadOnFIRE
    @DigitalNomadOnFIRE 8 місяців тому +1

    It really does feel like cheating.

  • @jora5483
    @jora5483 11 місяців тому +1

    M$ products often is no capable of killing other tools, but itself. History proves it.

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому +1

      As you may have seen, the point the video is making is that there are room for more than one =)

    • @jora5483
      @jora5483 11 місяців тому

      @@CodingAfterWork Sorry. That's fine... tho I saw 'Angular killer' on the preview..

  • @vivekkaushik9508
    @vivekkaushik9508 11 місяців тому

    async void is blasphemy in dotnet world lol

    • @CodingAfterWork
      @CodingAfterWork  11 місяців тому

      I never write the code like that, I must have had a temporary moment of insanity :)

  • @chriswinslow
    @chriswinslow 11 місяців тому

    47:29 “…Blazor has to be able to handle millions of users…but it can’t!” Everyone developing a website/app hopes to reach as many people as possible, not being able to handle huge amounts of users is not a good sales pitch! So basically, if expect to one day reach millions of users you’ll need to switch to a MEAN OR MERN stack, so you may just as well use either JS stacks from the get go?

    • @ODSD_EXCITEMENT
      @ODSD_EXCITEMENT 11 місяців тому

      Wow, we aren't experiencing any problems with our internally developed test automation Workflow engine. We test thousands of real-time connections with ARM device testbed. We have real-time dashboard that tracks all test and this all works over the internet. No performance delayed at all. We are very impressed thus far. Lots of variables here so it most like depends on how you've Architected and implementated your application framework.

    • @EngstromJimmy
      @EngstromJimmy 11 місяців тому +3

      Blazor Server needs a continuous SignalR connection which adds constant load on the server. If you have millions of simultaneous users you should consider Blazor We Assembly (which works just as and other SPA Framework).
      In .NET 8 there will open up even more possibilities in this area with streaming updates, auto-switching and much more.

  • @adrianspikes6454
    @adrianspikes6454 10 місяців тому

    Waay too much time on something other than production. U forgot ur target audience

  • @Rogueixpresents
    @Rogueixpresents 11 місяців тому +3

    I dont think anything can kill javacript ecossytem in the frontend environment.