To Prerender or Not To Prerender 🔥 .NET 8 & Blazor Server/WebAssembly/Auto Render Mode

Поділитися
Вставка
  • Опубліковано 19 вер 2024

КОМЕНТАРІ • 27

  • @sledzeppelin
    @sledzeppelin 9 місяців тому +10

    MS did not handle this feature well. The syntax is a mess, changed right before release, and they seem to have not bothered to prepare people for it with sufficient docs and examples. When the actual template sample page (Weather) displays the problematic behavior and doesn’t offer a fix, that’s quite an oversight.

    • @XXnickles
      @XXnickles 9 місяців тому +2

      I agree with you! As a matter of fact, I am just skipping all the render modes and using only SSR with old JS. After this release, I am seeing that "dream" of dotnet in the (web) client farther than closer. Perhaps I will take a look to client interactivity once web assembly works natively with the DOM instead of use bunch of complicated abstractions.

  • @songperformer_NET
    @songperformer_NET 4 місяці тому +1

    Thanks, saved me having to work out what this was, well explained, I've been using Blazor for a few years now, sometimes forget to look at new features

  • @Sander-Brilman
    @Sander-Brilman 9 місяців тому +3

    Thanks for the video,
    You could possibly solve the problem by using a persistent state provider to store the loaded data from the prerendering and then load that same data when the interactivity hits.
    not useful in this weather page case but could be a good thing when SEO is needed but you dont want to load the data from the database twice.
    maybe a good video idea to explore the persistent state provider?

  • @pol8038
    @pol8038 21 день тому +1

    Just what I needed! 🙏

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

    I would add that the rendermode is inherited by all components unless otherwise specified in the component itself. Nonetheless I would have added the ability to disable it at the assemplies level. Something like app.MapRazorComponents()
    .AddInteractiveWebAssemblyRenderMode()
    .AddAdditionalAssemblies(typeof(Counter).Assembly, prerendering: false);

  • @BarneyMyBoy
    @BarneyMyBoy 3 місяці тому +1

    Hi Patrick, love your teaching approach, thank you so much.

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

    So good videos, I just found your channel! The ability to keep advanced and broad koncepts simple brings so much quality. This has helped me alot were i needed to transition to Angular within my job. If I were to make a request, I would love to see an updated version of a simple .NET project with an Angular client. It would be valuable to see such a project now that Angular's latest version includes new control flow, standalone components, and signals!

  • @AlexandreBeli
    @AlexandreBeli 4 місяці тому +1

    Hi Patrick. Thank you so much for the tip. Appreciate it !

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

    Thank you Patrick for this timely tutorial !

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

    I'm becoming a big fan of your channel Patrick. Thanks for sharing your vast knowledge.

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

      Awesome, thank you so much! It really means the world to that you think that way. ❤

  • @AmerBakeer
    @AmerBakeer 5 місяців тому +2

    Unfortunately, as you've mentioned in the video, disabling/bypassing Pre-rendering harms SEO and prevents search engines from seeing/indexing page content, even though the solution is useful from a UX point of view.
    I eventually had to re-enable it because search engines saw pages as empty.
    Are you aware of a better solution that still allows prerendering to remain enabled?

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

    @PatrikGod In this mode the PageTitle not showing, did you notice that??

  • @bennyadiwijaya1606
    @bennyadiwijaya1606 9 місяців тому +2

    Hi, with .net8 new architecture in blazor web app.. where we put custom javascript? in Server project or Client project?

  • @jairvieirajunior1897
    @jairvieirajunior1897 6 місяців тому

    Thanks Patrick for the video.
    Could you make a video showing hot to use local storage with blazor 8?

  • @TrOgaN_
    @TrOgaN_ 9 місяців тому +2

    You have to wonder why Microsoft would release something so broken, it's like they released it hoping no one would notice the obvious flaw. In short interactive modes don't work without being hacked which in turn creates problems elsewhere in your application.

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

    Will you update your *E-Commerce Website with Blazor WebAssembly* at some point?
    I know it's a time issue, so I'm just asking!

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

    Yikes...these comments are harsh. Lol. For me, the positives far outweigh the negatives with Balzor 8.
    They packed a LOT in this release so some combinations or features have questionable defaults...ok.
    With the alternatives of waiting till .NET 9, I think they made a great call.

    • @oktjona
      @oktjona Місяць тому

      sometimes negative comment are positive for future development

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

    Thanks for the great video! Couple of questions here.
    First, what's the situation where you do want pre-render? It's the default option, so I'm assuming they thought most pages would use it? But this data-fetching problem would be incredibly common I would think
    Second, I don't understand how to juggle the webassembly and SSR. Here you have the same weather page on both WASM and SSR. But what if you want to mix them? It seems weird to me that we have to do a websocket roundtrip request to change state on the server, when it's something like toggling a button that only matters on the frontend.

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

      Yeah a lot of the new auto features don't seem thought out. We are over a month after the release and microsoft doesn't even have an example beyond creating the project. Maybe I'm spoiled by Nuxt, they provide an actual fetch service that handles the server/client differentiation for you. If the API call is done on the server it sends the response payload to the client instead of the client doing a second external call, it just fetches the data asynchronously from the server payload instead. From my experience with Blazor I found you need to implement that caching functionality yourself, and then make it generic because as you said this is a common problem in 99% of your data fetching calls. Oh and don't forget your HTTP client needs different implementations too because the client attaches cookies to the request and it won't on the server lol.

  • @adam-xt8te
    @adam-xt8te 8 місяців тому

    I wish you could tell something about preparing Blazor page for SEO.
    I assume it has something in common with rendermode's 'first load'.

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

    Hi Patrick, I'm new to your channel and the Blazor world. Great content! Hoping you can answer this question - regardless of the rendering mode, I've noticed when you Network > Preview, that there is "An unhandled error has occurred. Reload" message, which is hidden from the user. Does anyone know what is the cause of this and how to fix?

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

    This concept doesn't seem to stick for me. I am unsure whether to build with Server, WASM, or AUTO.

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

    Example Selenium automatic unit test

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

    how to use Crystal Reports with Blazor