This Blazor Issue Could Ruin Your Project 🔥 Learn How to Avoid It!

  Рет қаралды 8,374

Patrick God

Patrick God

Күн бұрын

Пікірлер: 24
@davidmorello9229
@davidmorello9229 25 күн бұрын
Great video. Around 9:50 is what was giving me a problem in a different video of yours!! I like how you come back to things in different videos.
@ertanylmaz7727
@ertanylmaz7727 Күн бұрын
Patrik I follow you with interest and look forward to more blazor related and current life projects
@dasfahrer8187
@dasfahrer8187 2 ай бұрын
Great info. The .NET8 changes have been biting us in the butt as we've been upgrading from 6.
@EricKing
@EricKing 2 ай бұрын
Prerendering should be 'off' by default, and opt-in. Having it default to 'on' has resulted in SO MUCH FRUSTRATION for so many people.
@julienbarach6620
@julienbarach6620 Ай бұрын
Great video, that's exactly the main issue with the new template. That's a lot of headache and people lost just for SEO , I hope they have better reasons. I think they just wanted to get rid of WASM/Server and wanted to unify them. But they forgot how incompatible Client rendering and Server rendering are, demanding developers to find tricks to make it working.
@mattiasengman1195
@mattiasengman1195 2 ай бұрын
It’s easy to pick up the prerendered data on the client, so that you don’t have to fetch it twice. I usually have that logic in a basecomponent. Another tip is to use Magic onion, then you don’t have to think about creating a server api, you can fetch your data the same way regardless of where your component is executed (on server or client) without dupplication of code.
@aldul728
@aldul728 2 ай бұрын
i just turn off prerendering bc it messes with CSS animations and can cause them to play twice sometimes, which is really annoying when you want to have some sort of loading animation
@zagoskintoto
@zagoskintoto 2 ай бұрын
Yeah I think this is just a big miss for Blazor and a shame. How are we expecting people to stop using Next/Nuxt/Angular when the framework has this fundamentals so confusingly implemented. Are there ways around it? Yes. You could fetch on after render instead on initialize (which, I know, defeats the purpose since you can do this without having a DOM) because there you can check if that is the first render. You could also use the HttpContext or some other variables to determine whether the code is currently being executed on the server or client. But again, this is just something kind of "advanced" to do, which definitely would deter new people from embracing the framework. I really love Blazor but this type of thing is one of those that really makes you hate Microsoft for butchering an opportunity to build something great.
@garyb1839
@garyb1839 2 ай бұрын
So basically only enable prerender on pages that will be crawled by the search engines. All other pages use a different method (SSR, Stream or Render). For the SEO pages, like you said it is strange for the server to make a service call to it's self, is it better to just have SEO pages live within server project?
@karlarsch7068
@karlarsch7068 2 ай бұрын
temperature in coulomb - interesting
@karlarsch7068
@karlarsch7068 2 ай бұрын
and in farad =)
@colllm
@colllm 5 күн бұрын
Nice video. But the music is a distraction. Any chance you can go back to not using it?
@szymonb5834
@szymonb5834 2 ай бұрын
I'm wondering why Blazor reloads already rendered page on the server... It has no change since load, isn't? It should switch to client side rendering just after first user interaction with the page. This is how Angular works (as far as I know).
@ivandrofly
@ivandrofly 2 ай бұрын
Thank you :)
@jorgepedraza1275
@jorgepedraza1275 2 ай бұрын
Excellent
@SiLeNzSky
@SiLeNzSky 2 ай бұрын
that means the uri needs to be hardcoded somewhere in the settings file does it? also, the api call for the data happens twice now, once for prerender and then wasm takes over and fetches the data again... i am currently doing this for wasm prerendering @using System.Runtime.InteropServices; @rendermode InteractiveWebAssembly @page "/blog" ... bool IsWasm = RuntimeInformation.ProcessArchitecture == Architecture.Wasm; bool? DataLoadedSuccessfully = null; // null for loading, false for error and true to display the f.e. table/grid of blogs, or image gallery protected override async Task OnAfterRenderAsync(bool firstRender) // or use oninitialized ... { if(firstRender) { if(!IsWasm) return; await LoadData(); } } what do you think
@bartlomiejuminski
@bartlomiejuminski 2 ай бұрын
How to cache server response that we will not make api call second time on the client. Only this part is missing in that video.
@geraldmaale
@geraldmaale 2 ай бұрын
Add output caching to your pipeline
@GaryJohnWalker1
@GaryJohnWalker1 2 ай бұрын
nice point
@Tony-dp1rl
@Tony-dp1rl 2 ай бұрын
Blazor ... making simple applications complex since 2019 :)
@coolstorybrooooo7643
@coolstorybrooooo7643 2 ай бұрын
Dont load the data in a lifecycle method that can run more than once. Simples.
@garyb1839
@garyb1839 2 ай бұрын
That is basically the same as disabling "prerender" mode. So why not disable it and use the full page cycle.
Was I Wrong About Blazor? | Coding Shorts 111
16:35
Shawn Wildermuth
Рет қаралды 31 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
What Is .NET Aspire and Why Is Everyone Talking About It?
27:36
Filip Ekberg
Рет қаралды 10 М.
Clean Architecture with ASP.NET Core 9
27:01
dotnet
Рет қаралды 40 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 738 М.
A Deep Dive into JVM Start-Up
22:03
Java
Рет қаралды 24 М.
The Blazor Competitor is Here!
15:08
Nick Chapsas
Рет қаралды 77 М.
LINQ Tutorial for Beginners 🚀 Full Course
27:55
Patrick God
Рет қаралды 3,4 М.
How To Handle Permissions Like A Senior Dev
36:39
Web Dev Simplified
Рет қаралды 336 М.
The Right Way To Use Feature Flags in .NET (targeting users explained)
17:44
The Fix For Your Database Performance Issues in .NET
9:12
Nick Chapsas
Рет қаралды 89 М.