.NET 8 was a huge deal for Blazor. It brought us interactive render modes, static SSR for entire apps and a whole lot more. Now, .NET 9 is on the horizon (November 2024 if history is an indication) and while it might not be as flashy, it's definitely packing some serious punches for developers. What's new in Blazor .NET 9? Let's break it down:
Remember how in .NET 8 we had to choose one rendering mode for the entire app? Well, that's so last year! In .NET 9, we can mix and match rendering modes on a per page basis. So, if you want a lightning -fast SEO-friendly static page here and a super-interactive page there - go for it! This kind of flexibility is a game-changer, and it's way easier to set up with the new ExcludeFromInteractiveRouting attribute.
If you're a Blazor Server fan, get ready for a smoother ride. WebSocket compression is enabled by default, meaning your data will zip back and forth faster than ever. Plus, the reconnection experience is way better - no more annoying waits when you navigate back to a disconnected app.
Adding authentication to a Blazor WebAssembly project used to be a bit of a headache, but not anymore! New APIs like AddAuthenticationStateSerialization and AddAuthenticationStateDeserialization are here to save the day. They make managing authentication state between the server and client a breeze.
Moving your Blazor projects from older .NET versions to .NET 9 shouldn't be too much of a hassle. Here's the gist of it:
While .NET 9 might not be a massive overhaul, it's clear that the Blazor team is listening to developers and focusing making this whole webdev thing easier. There's still a lot more to come, like improvements to persistent state, prerendering and authentication.
Overall, .NET 9's Blazor updates are like a well-tuned engine; not a radical redesign but a series of refinements that make the whole thing run smoother and more efficiently. Keep an eye on this space - the best is yet to come!
Shameless plug: we have a bunch of Blazor nerds over here at GAP who are ready to help if you need it. We can upgrade your old stuff or help you build new stuff too.