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

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

Patrick God

10 месяцев назад

7,031 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@TrOgaN_
@TrOgaN_ - 12.12.2023 17:02

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.

Ответить
@sledzeppelin
@sledzeppelin - 12.12.2023 17:47

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.

Ответить
@debonagiovanni
@debonagiovanni - 12.12.2023 18:53

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<App>()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Counter).Assembly, prerendering: false);

Ответить
@FearGod123
@FearGod123 - 13.12.2023 00:51

Thank you Patrick for this timely tutorial !

Ответить
@kevinlloyd9507
@kevinlloyd9507 - 13.12.2023 05:13

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.

Ответить
@Sander-Brilman
@Sander-Brilman - 13.12.2023 13:08

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?

Ответить
@johnhershberg5915
@johnhershberg5915 - 13.12.2023 14:56

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.

Ответить
@bennyadiwijaya1606
@bennyadiwijaya1606 - 13.12.2023 19:39

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

Ответить
@comroec
@comroec - 15.12.2023 13:32

how to use Crystal Reports with Blazor

Ответить
@nurhanshaban1829
@nurhanshaban1829 - 15.12.2023 23:04

Example Selenium automatic unit test

Ответить
@andreasnelefelt3430
@andreasnelefelt3430 - 18.12.2023 11:22

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!

Ответить
@ivcbusinesssystems6613
@ivcbusinesssystems6613 - 19.12.2023 02:10

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!

Ответить
@picturesofplaces
@picturesofplaces - 26.12.2023 23:03

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 - 02.01.2024 22:45

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

Ответить
@Reaper7mk
@Reaper7mk - 03.01.2024 23:32

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

Ответить
@adam-xt8te
@adam-xt8te - 05.01.2024 01:16

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

Ответить
@codermallu
@codermallu - 15.02.2024 21:29

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

Ответить
@jairvieirajunior1897
@jairvieirajunior1897 - 07.03.2024 23:16

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

Ответить
@AmerBakeer
@AmerBakeer - 13.04.2024 13:51

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?

Ответить
@songperformer_NET
@songperformer_NET - 24.04.2024 15:17

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

Ответить
@AlexandreBeli
@AlexandreBeli - 01.05.2024 23:29

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

Ответить
@BarneyMyBoy
@BarneyMyBoy - 23.05.2024 18:29

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

Ответить
@pol8038
@pol8038 - 29.08.2024 12:29

Just what I needed! 🙏

Ответить
@rpg007
@rpg007 - 20.09.2024 19:40

Soooo Helpful!! Thanks a lot

Ответить