Mastering .NET 8 Blazor: Server-side Rendering (SSR)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

ความคิดเห็น • 42

  • @bripowered
    @bripowered ปีที่แล้ว +2

    Thanks Bobby! I'm looking forward this.

    • @CoderFoundry
      @CoderFoundry  ปีที่แล้ว +1

      Glad it helps. More content on the way.

  • @rafapioli75
    @rafapioli75 ปีที่แล้ว +2

    Great content! I'm excited to use Blazor 8!

  • @osman3404
    @osman3404 11 หลายเดือนก่อน +4

    Honestly I would use Server Render + JavaScript for interactivity and stay away from Blazer Server and it’s SignalR dependency.

    • @CoderFoundry
      @CoderFoundry  11 หลายเดือนก่อน +2

      I think render mode auto with web assembly is going to be the way.

  • @andresbeltran5779
    @andresbeltran5779 9 หลายเดือนก่อน

    Very clear explanaition

  • @brianking8883
    @brianking8883 ปีที่แล้ว +2

    This powerful

  • @shameermulji
    @shameermulji ปีที่แล้ว +1

    Can students get through your bootcamp using a Windows on ARM laptop? I have an M2 MBA and I know MS now officially supports virtualization of WoA via Parallels for Mac.

    • @CoderFoundry
      @CoderFoundry  ปีที่แล้ว +2

      I use windows on Mac m2 hardware via parallels. it works great.

    • @shameermulji
      @shameermulji 10 หลายเดือนก่อน

      @@CoderFoundry If you don't mind me asking, what RAM and storage configuration is your M2 MBA?

    • @CoderFoundry
      @CoderFoundry  10 หลายเดือนก่อน

      32 gb of ram and external 2tb m2 ssd for code files.

  • @techreviews-j1o
    @techreviews-j1o 7 หลายเดือนก่อน

    Hi , i like what you are doing ,
    Please i have a question ,
    i have a APi that handle generating authentication with jwt access token , and all my logic is in this API , i want to use blazor as frontend with rendermodeAuto, how to use the JWT in this case?
    for WASM si I have no probleme , but with Blazor RenderModeAutho i am lost
    Thank you

  • @PortalUser2
    @PortalUser2 ปีที่แล้ว +3

    In that last part of the video (using javascript on the static rendered page) another alternative, compared to using javascript, would be to define a route such as /movies/{movieId} and if that route movieId value was supplied, you would render the modal. That way, you could let the progressive rendering work its magic. If the user clicked on a movie sending the browser to /movies/10123, the modal would be rendered, and if the click "close" it would send the user back to /movies. Each time the progressive rendering should just DOM update what needs to be modified on the page, so it should at least look nice.
    Of course it would not be as efficient because the browser would technically fetch the page each time, but it should DOM update only the modal if that was the only difference. Also you should be able to do it in a way that when running as WASM or traditional signalr server the same stuff happens without needing to change any code (and the client router should handle the navigations). One other benefit is you could directly link to the details with the modal open.

    • @CoderFoundry
      @CoderFoundry  ปีที่แล้ว

      I will try it out.

    • @jamisonr
      @jamisonr 11 หลายเดือนก่อน

      This is what seems intuitive to me. I'm trying to get away from Angular for my personal projects. It feels a bit like using an ng-template for placeholders until you get your xhr response back and then render in an ngFor. Only it's on server and not browser. If I'm going to have to write a lot of javascript, I'm going to do it with typescript and Angular!

  • @shjaaz4139
    @shjaaz4139 ปีที่แล้ว

    hey bobby , I hope you're all good. can you make portfolio review videos . Its been 4 month since the last one.

  • @wadecodez
    @wadecodez 9 หลายเดือนก่อน

    non c# dev looking into current state of blazor, does ssr and streaming mode work well with SEO? when I checked out blazor a few years ago it could only render to wasm which made it near impossible to rank on google.

    • @CoderFoundry
      @CoderFoundry  9 หลายเดือนก่อน +1

      SSR is server-side rendered. Each page has a predefined route and returns a complete page. So yes, this works for seo.

  • @chairmakerPete
    @chairmakerPete 6 หลายเดือนก่อน

    Seems like a kludge, but clearly explained 👍

    • @CoderFoundry
      @CoderFoundry  6 หลายเดือนก่อน

      Not sure what you mean. It's a feature built into Blazor.

  • @rpreviato
    @rpreviato 10 หลายเดือนก่อน

    Great video, lots of content that I didn't see in other videos from MS.
    My question is about your custom site.js file that you put it into you App.razor.
    Is it possible to do that with a per page js? Something like Index.razor.js and call a js function that is in that file? I pulling my hairs off trying to do that, even with RCL and I can't find a way to make that happen. I'm not a javascript guy :(
    I ended up doing the same thing that you did, but I don't think that is the best solution. For that reason I would like to create a per page js file with functions that regards with that page. Is something like having a @Section scripts { } in your page. I tried the new SectionOutlet and SectionContent, but that didn't work as well.

    • @CoderFoundry
      @CoderFoundry  10 หลายเดือนก่อน

      You can do isolated js. But you have to use an export and import pattern. I will make a video.

  • @dovh49
    @dovh49 9 หลายเดือนก่อน

    This seems like it would be a good to use with HTMX. The components, I'm assuming, called be rendered like partials and sent back down?

    • @CoderFoundry
      @CoderFoundry  9 หลายเดือนก่อน

      Htmx is not needed we have razor markup and can tell a component where to execute. Server side or client side

    • @dovh49
      @dovh49 9 หลายเดือนก่อน

      @@CoderFoundry Oh, that is really nice. I'll have to look into how that all works more. I've been a huge fan of HTMX and custom elements. But if I can element a dependency that is even nicer. And for business apps that actually need to be connected all the time, this pattern seems to be better and simpler.

    • @dovh49
      @dovh49 9 หลายเดือนก่อน

      ​@@CoderFoundry Reading Jon Hiltion's blog posts on Exploring Blazor Changes in .NET 8. It makes it sound like if you want interactivity you need Blazor Server. So, I guess I'm missing something - since I don't see how you can just use HTTP calls rather than resort to Web Sockets.
      Also, I'm not seeing how you can send events down from the server to trigger other interactivity on the front end.
      So, to me it appears that you still need HTMX (or html-form) to have good interactivity with scalability (AKA less resources).
      The Razor syntax is also a bit jarring. It looks a lot like JSX, which I don't like, as React creates a bit of a tag hell. I like sticking closer to the metal, as far as possible. But maybe if I tried it I would decide it isn't too bad. That's one gripe that I have with custom elements, they do have built-ins but for some reason Safari refuses to implement them.

    • @CoderFoundry
      @CoderFoundry  9 หลายเดือนก่อน +1

      You have 2 choices blazor server and web assembly. You also have enhanced navigation with forms.

  • @pokepython
    @pokepython 11 หลายเดือนก่อน

    Cant you just use Blazoredmodal for modals instead of JS?

    • @CoderFoundry
      @CoderFoundry  11 หลายเดือนก่อน

      If you want to sure. I have not tried it, but if it works well and you like how it is set up, go for it.
      This video is to show you how to create components and use javascript interopt. There are a lot of 3rd party libraries out there to support your Blazor apps. Which is another strong argument for why Blazor is going be adopted.

  • @RenanDuarteHB11
    @RenanDuarteHB11 ปีที่แล้ว +2

    Hi! what a great content! make some for blazor hybrid please

  • @louistheron3936
    @louistheron3936 10 หลายเดือนก่อน

    Hi, can you kindly update the repo to the new render modes. As the site does not compile anymore. Tx

    • @CoderFoundry
      @CoderFoundry  10 หลายเดือนก่อน

      We will uograde this to the latest .net 8 version.

    • @CoderFoundry
      @CoderFoundry  10 หลายเดือนก่อน

      We placed the .net 8 version on a net8-release branch in the repo

  • @vivekkaushik9508
    @vivekkaushik9508 ปีที่แล้ว

    I'd really appreciate if you could pls bump the code font by 2 pts.

  • @leander8247
    @leander8247 ปีที่แล้ว

    Is it correct that even tho using ssr there is still an active websocket connection?

    • @CoderFoundry
      @CoderFoundry  ปีที่แล้ว

      No. It's completely server rendered.

    • @JacobVisick
      @JacobVisick ปีที่แล้ว +3

      The only time there is an active websocket connection is when you use interactive server mode via SignalR - e.g. using auto mode or @attribute [RenderModeServer].
      In the case of this video, it's static server rendering or streaming rendering, neither of which uses an active websocket connection. The page is completely pre-rendered on the server and sent to the browser as static HTML. Streaming rendering leaves the response open until async tasks have completed on the server and then patches the results into the DOM, but it does not require any websockets.