Latest / DevQuestions with Tim Corey / 262. Discussing Blazor with Dan Roth, PM of ASP.NET and Blazor
Transcript
- 0:00SPEAKER_02: If you were going to start a new uh web app with ACP.NET Core, I would absolutely recommend it.
- 0:04SPEAKER_02: Is there an area where you think, like, man, I wish people knew more about this?
- 0:08SPEAKER_02: We're doing a lot of work obviously in the.NET platform, but there's also a lot of effort happening in Welcome to a special episode of DevQuestions.
- 0:22SPEAKER_03: I'm here with Dan Roth.
- 0:24SPEAKER_03: Dan, thanks for joining me.
- 0:25SPEAKER_03: Hello, it's great to be here.
- 0:26SPEAKER_03: So you're the product manager for ASP.NET Core and Blazor?
- 0:30SPEAKER_03: That's right.
- 0:30SPEAKER_03: That's a lot.
- 0:32SPEAKER_03: So what does that entail?
- 0:33SPEAKER_02: Well, it entails making sure that uh people can build awesome web apps with uh.NET.
- 0:39SPEAKER_02: It's uh understanding the the the future of uh web development, uh what's happening in the web platform, um, and thinking about what how can we facilitate that with great.NET libraries for web development.
- 0:51SPEAKER_03: Excellent.
- 0:51SPEAKER_03: Uh before you jump into that, I would I'm curious how did you get to this point in life?
- 0:56SPEAKER_03: Like you don't you don't you're not born into Microsoft, right?
- 1:00SPEAKER_02: You poor thing down.
- 1:01SPEAKER_02: How did this happen to you?
- 1:02SPEAKER_03: Yes, exactly.
- 1:04SPEAKER_02: Well, I I've been at Microsoft now for quite a while and I've been working on.NET the entire time.
- 1:08SPEAKER_02: So I started back in like.NET Framework 2, I think was was about to go out the it was it was being worked on.
- 1:16SPEAKER_02: I think I think one one had just shipped, and we were now working on.NET uh.NET uh framework two.
- 1:22SPEAKER_02: Um so a couple decades I've been at Microsoft.
- 1:24SPEAKER_02: I was straight out of college.
- 1:26SPEAKER_02: Okay.
- 1:26SPEAKER_02: Um I was a computer science major and and uh so I uh it was actually an interesting decision point for me when I came out of college.
- 1:33SPEAKER_02: Was I gonna become a uh uh you know full-on developer, you know, just be write write code, or uh was I gonna do something uh more business related?
- 1:41SPEAKER_02: And I I had this desire to sort of balance wanting to do engineering also with having uh you know influence and impact on business decisions related to what we were what we were building.
- 1:52SPEAKER_02: And the product I mean at the time it was a program management, it wasn't product management yet at Microsoft, I've uh but uh they had this role where you could you know own the the conversations with the customers, understanding what requirements they had, and at the same time work on things that were for software developers, for engineers, people building software, and get your hands dirty with uh with code.
- 2:14SPEAKER_02: And so I ended up going the program management route at that time, and then later that that just got renamed basically to become product management.
- 2:22SPEAKER_02: Um so yeah, straight college to Microsoft and then living the dream ever since, working on.NET.
- 2:29SPEAKER_02: I started out on um uh soap services.
- 2:32SPEAKER_02: Like do you remember Asimx SOAP services, ASP.NET SOAP services?
- 2:37SPEAKER_02: Yep.
- 2:38SPEAKER_02: I remember them.
- 2:38SPEAKER_02: Yeah, I think not fondly, but I remember them.
- 2:41SPEAKER_02: I became one of those few people who could look at do you remember Wisdle documents?
- 2:45SPEAKER_02: There were these uh it was kind of like the XML version of Open API specs, honestly, is instead of JSON, it was it was XML and describing SOAP message formats, and I was one of those few people that could look at uh Wisdel documents and XML schema documents and actually understand what the heck they were saying, what was going on with them.
- 3:04SPEAKER_02: I worked on that for for years in WCF, came came later, Windows Communication Foundation.
- 3:08SPEAKER_02: And then I moved on to work on web with uh ASP.net, MV MVC, and uh ASPN Web API originally.
- 3:15SPEAKER_02: I started out kind of shifting from the back-end services space, then heading towards uh web development.
- 3:22SPEAKER_02: So SOAP services, then APIs, and then uh and then web UI.
- 3:26SPEAKER_02: Worked your way forward.
- 3:27SPEAKER_02: And then that blessed day came when uh we got Blazor with uh Steve Sanderson did his demo of uh of Blazor at NDC and in Oslo, and then I got to work with him on uh building out the the future of the web development uh web UI, at least uh part of the the A Spedit core stack, and that's that's been super fun.
- 3:45SPEAKER_02: Excellent.
- 3:46SPEAKER_02: So I mean you're a fan of Blazor.
- 3:48SPEAKER_02: I I do like it.
- 3:49SPEAKER_02: Yeah, I do enjoy it.
- 3:50SPEAKER_02: I've heard that.
- 3:50SPEAKER_02: I still remember sitting in front of the those early Blazor prototypes and and writing uh uh my first Blazor app and feeling like I I can do front end now.
- 4:01SPEAKER_02: Like I I I mean I knew some JavaScript, but I was I think of like a lot of people where uh you know I had uh just enough to be dangerous uh skills with JavaScript.
- 4:09SPEAKER_02: But I became with Blazor I could use my C sharp skills and you know what I knew about the web to build build uh rich interactive web apps, and that was just like you know heavenly.
- 4:18SPEAKER_02: It was just a great experience.
- 4:19SPEAKER_03: It is a wonderful experience to use Blazor.
- 4:21SPEAKER_03: Um so Blazor started off with just Blazor Server, which is the signal arc communication between the front end and the back end.
- 4:28SPEAKER_03: Um then we got WebAssembly.
- 4:30SPEAKER_03: Yep.
- 4:30SPEAKER_03: Um and we got hybrid in there shortly after, I believe, which is kind of a whole different thing with native apps, yeah.
- 4:38SPEAKER_03: Right.
- 4:38SPEAKER_03: Hybrid web and native together.
- 4:41SPEAKER_03: But then you moved on to Blazor Web Apps, which is kind of you put everything in one big pot, shook it up, and said, here's one template that can do everything.
- 4:49SPEAKER_02: Carefully crafted Tim.
- 4:51SPEAKER_02: Carefully crafted the pieces that we wanted to cut.
- 4:53SPEAKER_02: Yeah, Blazor web apps were an effort, I mean, yeah, you're you're right.
- 4:56SPEAKER_02: Like we started out with sort of this um you know collection of Blazor, we called them hosting models, right?
- 5:02SPEAKER_02: Actually, originally we didn't plan to start with Blazor Server.
- 5:04SPEAKER_02: We originally planned to start with Blazor WebAssembly.
- 5:07SPEAKER_02: That was the demo that uh Steve Sanderson originally did.
- 5:10SPEAKER_02: It was you know building a small.NET runtime in WebAssembly and then seeing, oh, well, can I do some interesting things with that?
- 5:15SPEAKER_02: Could I build a little web framework on top of that, kind of inspired by React and the other component-based uh uh front-end web uh web frameworks that were available, and that's how Blazor was originally born.
- 5:26SPEAKER_02: Um it took a little while for us to figure out how to um ship that.NET WebAssembly runtime.
- 5:32SPEAKER_02: Like which one are we gonna like there we had you know the mono uh based runtimes that were available, there was some work on the Core CLR, and so we're trying to figure out which uh runtime we wanted to use for doing that.
- 5:43SPEAKER_02: We ended up going with the the mono version uh and and getting that runtime ready for production loads took took some time.
- 5:51SPEAKER_02: In the interim was when we had this idea, it was like, well, we actually could take this component model and kind of run it remotely over the server through over a WebSocket connection and give you much of that same rich interactive experience in.NET and C sharp without needing the the WebAssembly runtime just yet.
- 6:07SPEAKER_02: And we can keep working on that and maybe ship it later.
- 6:10SPEAKER_02: Uh and so that shipped in like I think it was 2019, the first version of Blazor Server, which was stable.
- 6:16SPEAKER_02: And um WebAssembly came like in the middle of the next year, like mid-mid-2020.
- 6:20SPEAKER_02: Um but to this day, actually, the Blazor Server model is still the most popular Blazor model that we have.
- 6:26SPEAKER_02: People really uh enjoy the convenience of you know having your having the rich interactivity, but also having your code still have access to all the those server resources.
- 6:35SPEAKER_02: You want you want to talk to the database or get access to uh server-side things while you're already there.
- 6:40SPEAKER_02: Um you don't have to like you know stand up separate API endpoints and all those uh types of concerns.
- 6:45SPEAKER_02: So people do do enjoy that.
- 6:47SPEAKER_02: But we ended up then with these two different hosting models, and you kind of had to always pick.
- 6:51SPEAKER_02: And we had I had lots and lots of conversations with customers, like which should I use, Blazor Server or Blazor WebAssembly?
- 6:56SPEAKER_02: And you go through the decision matrix about the pros and cons of each of those models.
- 7:01SPEAKER_02: Blazor Web Apps was really an attempt to simplify that that choice.
- 7:06SPEAKER_02: Make it so it wasn't really a choice you had to make up front.
- 7:09SPEAKER_02: You could kind of choose on a on an even per component basis uh how you wanted that component to render.
- 7:14SPEAKER_02: Some components maybe you want to push down to the browser and leverage client-side capabilities of that user's machine and their CPU and their memory and their storage and whatever access they have over there, and some components you want to run on the server.
- 7:27SPEAKER_02: So Blazor Web Apps was kind of like, let's take Blazor Server, Blazor WebAssembly, and and merge them together into a unified app model.
- 7:35SPEAKER_02: So it's no longer a choice do I do Blazer WebAssembly or Blazor Server?
- 7:38SPEAKER_02: You just say you build a Blazor Web app and then you decide which how different parts of your app you want to be architected.
- 7:45SPEAKER_02: And we also then introduced like static server-side rendering, sort of the traditional old school way of building or even web forms, right?
- 7:54SPEAKER_02: Like where you just you know you send a request to the server, you run some.NET code, and you get some HTML back.
- 7:59SPEAKER_02: Well, Blazor can do that now too.
- 8:01SPEAKER_02: So we added that into the mix.
- 8:03SPEAKER_02: So you really have the full suite of capabilities that you uh might want for building a modern, you know, richly interactive web application.
- 8:12SPEAKER_02: That was the idea.
- 8:13SPEAKER_02: So hopefully the answer for most people now is just build a Blazor web app and then think about where should the what where does it make sense for the code to run?
- 8:21SPEAKER_02: Like how what are you trying to do and uh what might makes the most sense for your scenarios?
- 8:25SPEAKER_03: Yeah, I like the the idea of not making that choice up front.
- 8:29SPEAKER_03: Um because I don't know how many times I've built a website where I'm like, let's go back and redo this.
- 8:35SPEAKER_03: Yeah.
- 8:35SPEAKER_03: Uh let's let's let's change this over now.
- 8:37SPEAKER_03: You need to make some changes.
- 8:38SPEAKER_03: And the idea that you can start off with that fully server side and just say, fine, we'll do a static site.
- 8:44SPEAKER_03: We'll do a fully static side or server side rendered, and then you say, but I really want that one component.
- 8:50SPEAKER_03: You know, and you just drop that one component in and all of a sudden that lights up as a client-side thing.
- 8:56SPEAKER_02: Like a little island, I need a little island of interactivity here, and this one would be best if it was really running on the client, or this one would be best if it's running on the server.
- 9:04SPEAKER_02: Blazor gives you that uh that flexibility.
- 9:06SPEAKER_02: And I and I wouldn't I wouldn't knock also the like traditional static server-side rendering approaches.
- 9:11SPEAKER_02: Like the beauty of of that style of rendering is it's it, you know, in terms of load performance, it loads super fast.
- 9:17SPEAKER_02: Sure.
- 9:18SPEAKER_02: You're not downloading any any JavaScript to get anything running.
- 9:21SPEAKER_02: You're just rendering, you know, using your hype, you know, all the resources that you have available on the server to produce whatever UI you want, the HTML, get that down to the client and then immediately render it.
- 9:32SPEAKER_02: So that's in some sense, that's the optimal spot to land for the end user experience.
- 9:37SPEAKER_02: Um, and then you kind of light up interactivity as you need it, is is kind of how we think about things, and that's how we've structured the like the default Blazor web app template now.
- 9:45SPEAKER_02: It's a primarily static server-side rendering with a, you know, you then add interactivity where you want it.
- 9:52SPEAKER_03: Yeah, because you know, requirements never change after you first launch Website.
- 9:56SPEAKER_03: So um but yeah, I really like that.
- 9:58SPEAKER_03: I like the idea that you know it's performance first, it's SEO first, it's you know, all these things up front first, and then you get to choose later, I want to tweak something, or I want to have you know something be interactive later.
- 10:12SPEAKER_03: I really like that.
- 10:12SPEAKER_02: Um it's worth it's worth mentioning that it is actually even a little richer than that.
- 10:16SPEAKER_02: Because like with static server-side rendering, traditional static server-side rendering, you know, you make the request and you're done.
- 10:21SPEAKER_02: We did also add these uh enhancements to that model in Blazor.
- 10:25SPEAKER_02: We have this notion of um enhanced navigation, enhanced form handling, where we do actually load some like some framework JavaScript on the on the client, and we can then you know take those page navigations, take those form posts, and and and basically make them more richly interactive.
- 10:42SPEAKER_02: Like we can uh intercept a navigation, and instead of doing a full page load, we can just do a fetch request, get the updated uh uh DOM elements from the server.
- 10:51SPEAKER_02: The server still does uh you know effectively static server-side rendering to produce the HTML.
- 10:55SPEAKER_02: But then on the client, Blazor can look at that DOM, uh what what's in the DOM and what was just sent and do its DOM diffing tr uh magic uh as as part of loading that page.
- 11:05SPEAKER_02: So you get this more fluid uh navigation experience instead of the page going completely away then coming back.
- 11:11SPEAKER_02: Uh similar thing with uh with form posts, like we can intercept the form post, uh do a fetch request instead, get the response HTML and patch that into the DOM.
- 11:20SPEAKER_02: So it it actually feels very spa-like, even though there's there's um it's not a traditional spa app in that you're like downloading a big bundle of JavaScript to run everything.
- 11:29SPEAKER_02: So you can actually get really far just with those two features and static server-side rendering.
- 11:35SPEAKER_02: When you need more interactivity, then of course you can you know do the use the other models.
- 11:39SPEAKER_03: Go from there.
- 11:40SPEAKER_03: Excellent.
- 11:41SPEAKER_03: Um so let's ask some of the elephant in the room questions.
- 11:45SPEAKER_03: Um so the first one is you know, we're we're talking about Blazor and it has changed.
- 11:50SPEAKER_03: Like you said, 2019.
- 11:51SPEAKER_03: It's been around for a while now, that's six years.
- 11:53SPEAKER_03: It's gotten kind of mature.
- 11:55SPEAKER_02: Like I know people some for many, many years people would say, like, uh, so but Blazor's new.
- 11:58SPEAKER_02: But it's almost new, right?
- 12:00SPEAKER_02: I'm like, it's not so new anymore.
- 12:01SPEAKER_02: Like this is this has been around a while and it's being uh uh used.
- 12:05SPEAKER_02: It's been really fun actually talking to people here at Build about all the awesome scenarios that they're doing with Blazor and the places that the the places that they've deployed it.
- 12:13SPEAKER_02: Uh yeah, so it's it's uh it's been around a little while.
- 12:15SPEAKER_02: It's it's a bit proven at this point.
- 12:17SPEAKER_03: True.
- 12:18SPEAKER_03: So we've got the Blazor Server, Blazor WebAssembly.
- 12:20SPEAKER_03: Now you have Blazor Web App.
- 12:22SPEAKER_03: Are we thinking that's where it's kind of settling in in that Blazor Web App kind of project type and just going forward, we're building on that, making it more and more mature?
- 12:30SPEAKER_02: Yes, absolutely.
- 12:31SPEAKER_02: Yeah, that's there's there's no big like new Blazor, I don't know.
- 12:35SPEAKER_02: Blazer V next kind of thing or Blazor AI or something coming next.
- 12:40SPEAKER_02: Um we are actually um we have quite a bit of focus this release on the server-side rendering parts of uh of Blazor, uh, but it fits within the Blazor web app model.
- 12:48SPEAKER_02: So you'll you know you're not having to like there's no I mean even honestly, even when we introduced Blazor Web Apps, uh we still support the older Blazor Server and Blazor WebAssembly models.
- 12:57SPEAKER_02: You can still just update those apps to.NET 8,.NET 9, and you will be able to do again in.NET 10, and they still work and still function as is.
- 13:05SPEAKER_02: Um you if you just you you you switch them over to the Blazor Web App model if you wanted to get the new features, like if you wanted the more flexibility and control over which render mode that you're using per component.
- 13:15SPEAKER_02: Um in 10, we're focusing mostly on the server.
- 13:19SPEAKER_02: There's some WebAssembly stuff as well, but one of the big investments is actually um helping with uh uh state persistence.
- 13:26SPEAKER_03: Okay.
- 13:26SPEAKER_02: Um when you're doing server-side rendering, particularly interactive server-side rendering, uh that uh that's a effectively a stateful programming model.
- 13:34SPEAKER_02: Like you're maintaining state for each connected user to your app.
- 13:37SPEAKER_02: Um and right now that state is just held in memory.
- 13:40SPEAKER_02: So if anything happens to it, uh then the uh uh the user goes into this disconnected state and their their whatever they were in the middle of gets interrupted.
- 13:49SPEAKER_02: Um this can happen, for example, if uh like if the user connection gets dropped uh and the server decides to evict the circuit.
- 13:56SPEAKER_02: Like maybe maybe the the user put the tab in the background or they swipe away from the app on their phone.
- 14:02SPEAKER_02: Often browsers, when they're in that state, they'll decide to close all the connections to like save power or just you know reduce resource usage on the client.
- 14:09SPEAKER_02: Um so then this the connection goes down on the server, the server has this circuit that it's holding on to, and we will hold on to it for a little while in case the user comes back and reconnects.
- 14:18SPEAKER_02: Um but at some point the server will decide, well, I guess that user's gone, so I'm just going to evict this circuit.
- 14:24SPEAKER_02: And then if the user had just gone to lunch and then they come back from lunch and they try to reopen their app and they're in the middle of a like a big form or whatever, they uh might see like, hey, your your state's lost, like refresh the page to get started again.
- 14:35SPEAKER_02: Um in 10, we're gonna give you uh the ability to um persist the circuit state before it gets evicted and then be able to reload it again when the client comes back.
- 14:45SPEAKER_02: So even if you have these like long disconnected uh uh situations that happen, um the user's uh experience won't get as as rudely interrupted as it might have been uh previously.
- 14:56SPEAKER_02: Um we think this will also potentially help with um like scalability.
- 15:00SPEAKER_02: You know, a stateful model like Blazor Server means that you have to maintain all these server resources for each user that's connected.
- 15:07SPEAKER_02: Um and some of those uh circuits uh might be uh might even be not being used.
- 15:12SPEAKER_02: Like maybe the user did go to lunch and the that circuit is just idle and sitting there and not doing anything.
- 15:17SPEAKER_02: Uh you might decide as an app policy, well, I'm just gonna persist that circuit and sort of put it in storage, and then when the user start wants to use it again, I'll rehydrate it again.
- 15:26SPEAKER_02: Um or maybe like the the user's client that the what the user was looking at is no longer visible, and you could send like a signal to the server to say, hey, the user's not gonna be doing anything with this because the the client the browser's not even uh you know shown on the screen.
- 15:37SPEAKER_02: Go ahead and save it.
- 15:38SPEAKER_02: You can you can implement policies like that to improve the scalability of your apps.
- 15:42SPEAKER_02: Um we're not gonna that one we probably won't do anything automatic.
- 15:46SPEAKER_02: Like that one will probably be something you implement yourself.
- 15:48SPEAKER_02: Like we'll give you the APIs to decide when circuits get persisted and evicted, so you can implement what policy you'd like.
- 15:54SPEAKER_02: Um that way you'll have the the tools to do to do what makes sense for your for your app.
- 15:58SPEAKER_02: Yeah.
- 15:59SPEAKER_02: Um but the eviction case where the the user was disconnected for a long period of time, that one we're thinking that that will be an option that we'll just provide out of the box so that your um Blazor server style apps are more resilient.
- 16:10SPEAKER_03: Excellent.
- 16:11SPEAKER_03: I love it.
- 16:12SPEAKER_03: Um so the other question that comes up a lot is you know, Microsoft it is known for eating its own dog food.
- 16:21SPEAKER_03: Where are you using Blazor?
- 16:23SPEAKER_02: We actually do use Blazor quite a bit internally.
- 16:27SPEAKER_02: Um now to be fair, like it is it is true that most of uh most of our large like public-facing properties, like um, I don't know, like Microsoft uh uh Microsoft 365, Office, Office Online, for example, um many of those are not actually using Blazor today, or dynamics or Teams, these types of types of things.
- 16:45SPEAKER_02: Uh in part because a lot of those apps were were built before Blazor even existed.
- 16:49SPEAKER_02: So they had a long-standing existing code base that they had to move forward with.
- 16:54SPEAKER_02: Um so there's quite a bit of, like, for example, React is is is fairly heavily used at Microsoft.
- 17:01SPEAKER_02: But internally, like lots of teams internally are using Blazor for uh line to business applications inside the company for you know fairly business critical and substantial things.
- 17:11SPEAKER_02: Um the way we manage our like employee identities at Microsoft, uh like when you need to reset your password or whatever, like all that stuff is built uh using using Blazor.
- 17:21SPEAKER_02: Interesting.
- 17:22SPEAKER_02: The Bing team uses Blazor for their like experimental platform that they use for managing, like flighting out uh releases onto the to the internet to like Bing.com.
- 17:30SPEAKER_02: Um Xbox has various uh you know internal tools and things that they use uh that are implemented in Blazor.
- 17:36SPEAKER_02: The app that we use to like uh compensate our field, uh that whole thing, which has uh you know uh thousands, tens of thousands of users that come in at certain uh spikes of of traffic at certain times of the year, uh, that's implemented with Blazor.
- 17:48SPEAKER_02: So we do actually use Blazor quite a bit uh internally at Microsoft.
- 17:51SPEAKER_02: Um but you know, we're a big company, there's lots of technologies that we use internally, it's not just Blazor.
- 17:57SPEAKER_02: Um really cool engagement that we've just started, and it's really early on this, so this is not something that's been like deployed.
- 18:03SPEAKER_02: Um but uh the we've been talking with the the Bing team that manages Bing.com.
- 18:08SPEAKER_02: Um Bing.com actually quite a bit of that is implemented, uh the front end is implemented in.NET.
- 18:13SPEAKER_02: Uh it is running on ASP.NET Core, but it's using like um it's kind of a like a custom Razer view engine that they built that had sort of their own component model on top of it in order for rendering the Bing.com uh pages.
- 18:25SPEAKER_02: Um they would really like to move on to something that's more kind of first class in the in the box.
- 18:30SPEAKER_02: They've supported that they don't have to maintain them themselves, and so they're very interested in moving that to to server-side rendered Blazor, and we're currently uh in early explorations with them on that.
- 18:40SPEAKER_02: So who knows?
- 18:41SPEAKER_02: Maybe Bing.com in the future might end up being uh uh Blazor-based as well.
- 18:45SPEAKER_02: Um we'll still have to see how that engagement goes.
- 18:47SPEAKER_02: They have a lot of views, so that's uh not a short-term term project.
- 18:51SPEAKER_03: Yeah, the idea that you can change overnight is a little bit laughable.
- 18:55SPEAKER_02: Well, maybe maybe some AI, right?
- 18:56SPEAKER_02: Just throw some AI at it and say, turn this all to Blazor and uh poof.
- 19:01SPEAKER_02: I'm sure someone's tried that.
- 19:04SPEAKER_03: So you know, you're looking at what you have now with Blazor, and you know, you can do a fully server-side rendered site.
- 19:11SPEAKER_03: Yeah.
- 19:11SPEAKER_03: But yeah, you can rend you can turn things on and get to that client side when you want.
- 19:17SPEAKER_03: Um the other alternatives in the ASP.NET Core suite are you know RazorPages, MVC.
- 19:25SPEAKER_03: Where do you see those fitting in long term compared to Blazor?
- 19:29SPEAKER_02: So MVC and RazerPages still fully supported, they're part of ASP.NET Core, and we have lots of users that use those frameworks every month to get their job done.
- 19:38SPEAKER_02: Those are, like we were saying earlier, traditional static, server-side rendered uh frameworks.
- 19:43SPEAKER_02: They get a request, generate some HTML, and then they're they're done.
- 19:46SPEAKER_02: Anything you want to do in terms of like interactivity, you write some JavaScript in order to handle that.
- 19:52SPEAKER_02: Um Blazor is our most comprehensive and complete web UI offering that we have in ASP.net Core.
- 19:57SPEAKER_02: And it's part of ASP.NET Core.
- 19:59SPEAKER_02: Like the component model is in is in the framework right alongside MVC and RazorPages.
- 20:03SPEAKER_02: Sometimes I feel like I it's probably partially my fault.
- 20:06SPEAKER_02: I almost talk about Blazor as if it's this separate thing, but it's really part of our broader ASP.NET Core web framework offering.
- 20:12SPEAKER_02: Uh and it's our recommended web UI offering at this point.
- 20:15SPEAKER_02: Like if you were going to start a new uh web app with ASP.core, I would absolutely recommend using Blazor because it can do uh all the things that like an MVC or Razer Pages style app can do, and so much more.
- 20:28SPEAKER_02: Like it can handle all the client-side interactivity, it gives you the flexibility to use the render mode that makes the most sense for your app.
- 20:35SPEAKER_02: If you want to then take those components and use them to build a uh native application, you can you know use uh Blazor hybrid to embed them in like a.NET MAUI application or WPF or WinForms or whatever.
- 20:45SPEAKER_02: So it's the most flexible offering that we have, uh, and that's really where we're spending our time and investment.
- 20:51SPEAKER_02: Um VC and Razor Pages are still supported, we still like that you it you'll still get like all the new C sharp language features, the new.NET framework, you know, platform features.
- 20:59SPEAKER_02: They will continue to ride uh the platform, but they're not really where we're investing.
- 21:03SPEAKER_02: Blazor is where we're spending our time there, and that's where I would generally point people to.
- 21:07SPEAKER_02: Um front-end JavaScript is also perfectly fine as well.
- 21:10SPEAKER_02: I know we have lots of AceNet core developers that build their front ends in JavaScript, and there are lots of great uh front-end JavaScript frameworks to choose from.
- 21:17SPEAKER_02: That's also perfectly fine.
- 21:19SPEAKER_02: Obviously, Microsoft does that, and you can too.
- 21:21SPEAKER_02: Um you should not feel like you know if you're doing Angular or React or View or whatever that you have to like move to Blazor.
- 21:27SPEAKER_02: Like, no, that's there there are actually, in some cases, good reasons uh to use those frameworks instead of Blazor.
- 21:33SPEAKER_02: Um for example, if you really care about like every millisecond of load time performance on your web application for like a consumer facing site, then I might consider using JavaScript instead of Blazor for that.
- 21:44SPEAKER_02: Blazor's not gonna be as as fully optimized for the the load time performance like those frameworks were would be if you need that kind of interactivity.
- 21:53SPEAKER_02: Excellent.
- 21:54SPEAKER_03: So so yeah, so we have the long term support for Razor Pages and MVC, that's not gonna weigh.
- 22:00SPEAKER_03: What we're saying.
- 22:00SPEAKER_03: But um which I I really love the fact that, you know, I I hear a lot, well, Microsoft dumps products.
- 22:06SPEAKER_03: And it's like I've been that Microsoft space for a very long time, and I've seen the the total opposite of that.
- 22:12SPEAKER_03: You know, where MVC's been around since two.NET Framework Two or is it three?
- 22:17SPEAKER_02: Oh like the original ASP.NET Framework has been around for a long time.
- 22:20SPEAKER_03: Which is basically, you know, I mean and it just kind of continues that support over and over for years and years and years, and um you can build a product on it knowing that it's not going anywhere.
- 22:30SPEAKER_03: You've got that support.
- 22:32SPEAKER_02: Even ASP ASP MVC on on.NET Framework, that is still support.
- 22:36SPEAKER_02: You can still still build your app and get uh get fixes for that.
- 22:39SPEAKER_02: In fact, we've done uh uh a couple fixes for that uh not not that long ago.
- 22:43SPEAKER_02: Um yeah, we I mean we do we do our best to to support our customers where where they're at.
- 22:48SPEAKER_02: Like if we have lots of users, we want to you know uh keep our that that that Microsoft promise of of support that we're not gonna just abandon you.
- 22:55SPEAKER_02: Do some things get cut, obviously.
- 22:58SPEAKER_02: We can all name our stories of the our favorite uh product or feature that got got cut.
- 23:02SPEAKER_02: I often get reminded about Silverlight whenever I'm uh talking to people about Blazer.
- 23:09SPEAKER_02: You know, it's kind of funny actually.
- 23:10SPEAKER_02: The in some sense um Blazor helped resurrect uh uh Silverlight because there's a great community project called OpenSilver that is a Silverlight port that runs on top of the.NET WebAssembly runtime that uh we use for for Blazor.
- 23:24SPEAKER_02: There's a couple of of web UI frameworks uh that use that same runtime to to do different programming models like Uno and uh Avalonia and open OpenSilver.
- 23:33SPEAKER_02: So I guess in some sense Open Blazor brought Silverlight back, I guess you could say if you really like that model.
- 23:40SPEAKER_02: But uh Blazor is kind of nice because it gives you the you get HTML, CSS in C sharp, so you get the you you write hands-on with the web platform, but also get to use your your.NET skills.
- 23:50SPEAKER_03: Yeah, love it.
- 23:52SPEAKER_03: Um so you know, we've talked a little bit about this, but there's some new things coming out in.NET 10.
- 23:57SPEAKER_03: Uh, what's most exciting for you in.NET 10?
- 24:01SPEAKER_02: So there's a lot a lot of great stuff in town.
- 24:03SPEAKER_02: I we already talked about the state persistence work.
- 24:04SPEAKER_02: That's that's kind of the big thing that we're really working on on the Blazor side.
- 24:09SPEAKER_02: Other things in uh ASP.NET Core and in Blazor that we're working on for uh Blazor WebAssembly users, we're doing a lot of work on diagnostics uh so that you can do like performance profiling, get memory diagnostics, get uh like perf counters, metrics from your Blazor WebAssembly apps.
- 24:26SPEAKER_02: Um today there's really not a great way to do that.
- 24:29SPEAKER_02: You're you have this.NET code running on this WebAssembly runtime inside the browser.
- 24:33SPEAKER_02: It's hard to get information out of there.
- 24:35SPEAKER_02: We are instrumenting the runtime and providing infrastructure so that you can do CPU sampling and get a uh like a NetTrace file out of the browser or get a GC dump out of the browser so you can uh do memory analysis and performance um uh analysis as well.
- 24:50SPEAKER_02: So that's that's one big one that we're uh we're working on.
- 24:53SPEAKER_02: Um there's a lot of work happening around security in in.NET 10.
- 24:57SPEAKER_02: Um obviously security is more important than ever before, and Microsoft has been uh uh heavily investing in security recently with our Secure Future initiative.
- 25:06SPEAKER_02: Um in ASP.NET Core, we're adding PASCE support to um ASP.NET Core identity.
- 25:11SPEAKER_02: So you can you know have passwordless uh authentication using the uh our built-in authentication system.
- 25:18SPEAKER_02: Um we're also uh uh looking uh for for people who want to use uh like intra-based authentication in their Blazor web apps, that's been kind of a gap in our tooling story.
- 25:27SPEAKER_02: We used to just have this checkbox that you could say like file new project, create a you know Blazor server or MVC or RazerPages app with uh with entra auth.
- 25:35SPEAKER_02: Uh we don't really have that tooling experience for Blazor web apps yet.
- 25:39SPEAKER_02: Uh what we're doing is we're working with um the Web Tools team on a new intra auth scaffolder that's based off of the new.NET Scaffold tool, um, which is fairly fairly recently uh shipped.
- 25:50SPEAKER_02: .NET Scaffold is a really nice uh interactive CLI experience for uh generating code into your existing projects.
- 25:57SPEAKER_02: And there are a bunch of scaffolders that are already already shipped with it that you can you can use today.
- 26:00SPEAKER_02: Like there's a the Blazor, we call it the CRUD scaffolder, like you pointed, we create create read update delete pages.
- 26:06SPEAKER_02: Um that one already is is there.
- 26:08SPEAKER_02: Uh we want to add one for adding intra auth to your, well, any of your ASP.net core apps, but including your Blazor web app.
- 26:14SPEAKER_02: So that's something we're working on uh right now.
- 26:16SPEAKER_02: Um bunch of performance work.
- 26:18SPEAKER_02: Um for ASP.net core, we're work doing work on Kestrel so that uh the Kestrel memory pool can now free up memory.
- 26:26SPEAKER_02: Um Kestrel has this uh memory pool that it uses to uh uh reuse memory so it doesn't have to allocate so that it you know it gets more efficient and more more more performant.
- 26:36SPEAKER_02: Um but it doesn't actually currently uh ever release memory out of the memory pool, uh, which for many apps is perfectly fine.
- 26:43SPEAKER_02: Like the way the way that functions is is nor is is is not uh usually an issue.
- 26:48SPEAKER_02: But when you use it at hyperscale, uh it can sometimes be an issue.
- 26:51SPEAKER_02: Uh the Azure App Service folks actually uh approach us because they they occasionally get you know spikes in traffic, and when the traffic spikes, the memory pool expands, and then it would stay at that high watermark, and they handle like literally billions of requests using ASP.net core every day.
- 27:07SPEAKER_02: Um so they were like, hey, it would be really nice if we could reduce that memory again, because we're we have we're using a lot of memory.
- 27:13SPEAKER_02: Uh so we've been working with them on that and experimenting with different approaches for freeing up that memory.
- 27:18SPEAKER_02: Um and uh we've actually been like flighting you know different strategies into production with them so we can uh test them out.
- 27:24SPEAKER_02: Uh and we've made really great progress there.
- 27:26SPEAKER_02: Um that should be coming to uh.NET 10 preview uh pretty soon.
- 27:30SPEAKER_02: Um and I think it's a it's a great example of where, because Microsoft uses ASP.NET Core so heavily internally, like it all our big services on the back end are definitely based on.NET.
- 27:40SPEAKER_02: So you know, Microsoft 365, Teams, uh Copilot, Xbox, most of our Azure services are all built in.NET.
- 27:48SPEAKER_02: Because we use ASP.NET Core uh at hyperscale so much, uh you get the benefit as as users of of knowing that this has been tested and proven that uh you know uh under under heavy load.
- 28:00SPEAKER_02: So that's another thing that that's coming.
- 28:02SPEAKER_02: Um yeah, a bunch of stuff.
- 28:04SPEAKER_02: I don't know.
- 28:05SPEAKER_02: That's just a few.
- 28:05SPEAKER_02: Uh and I know and there's got obviously new C sharp language features that are coming and uh improvements to the the core libraries.
- 28:12SPEAKER_02: Um you can see the uh full list of what's new in.NET 10 uh in the uh on Microsoft Learn in the in the.NET docs.
- 28:20SPEAKER_02: There's the what's new in.NET 10 doc, and we are keeping that update uh uh updated with each preview that we ship so you can see the what's currently there, and that will just keep getting longer as we uh approach our final.
- 28:32SPEAKER_02: It gets overwhelming, but I love that list.
- 28:34SPEAKER_03: I love seeing the list of of all the things that change.
- 28:37SPEAKER_03: Um yeah, it's great.
- 28:38SPEAKER_03: Um I I really I do like the fact that yes, you're using it heavily, you're you're investing in your own tools, and you're saying, you know, we're we're slamming this, and so here's how we can make it better.
- 28:49SPEAKER_03: Um because that just kind of trickles down to all of us and uh we get the benefit from from those changes.
- 28:54SPEAKER_03: Um so yeah, I appreciate you being here.
- 28:57SPEAKER_03: Um if you uh if you look over, and man, I'm putting you on the spot here, but if you look over all of the the usage patterns you've probably seen, you know, you've probably seen the metrics of who uses what and how.
- 29:09SPEAKER_03: Um is there an area where you think, like, man, I wish people knew more about this, or I wish people had um known about this feature or this system or way of doing things that maybe you think is underutilized?
- 29:21SPEAKER_02: Underutilized features, things that you that are cool that you might not know about.
- 29:26SPEAKER_02: Ah I don't know.
- 29:28SPEAKER_02: That's I'm trying to think here.
- 29:30SPEAKER_02: What's well, I mean, I hope people know about these things, but you know, news sometimes takes time in the.NET ecosystem and enterprises to trickle out.
- 29:39SPEAKER_02: Like, you know, I uh we're doing a lot of work obviously in the.NET platform, but there's also a lot of effort happening in like.NET Aspire and.NET AI to augment your.NET development experience.
- 29:51SPEAKER_02: Those are areas of investment that aren't directly in like.NET 10 itself.
- 29:55SPEAKER_02: They kind of ship out of band and separately because they're honestly moving faster, like they're doing more innovation.
- 30:00SPEAKER_02: Um, if you haven't used.NET Aspire with ASP.NET Core, you should.
- 30:05SPEAKER_02: Every ASP.NET Core developer should be trying out.NET Aspire.
- 30:09SPEAKER_02: It's not I I think I think many um ASP.net core ASP.NET Core developers have sort of a maybe a misconception that Aspire is somehow some a separate thing, that's a different programming model that you you do you do that oh that's I'm not an Aspire develop developer, I'm an ASP.NET Core developer.
- 30:24SPEAKER_02: That's actually exact it's actually exactly the opposite.
- 30:27SPEAKER_02: Like Aspire I think of as like an extension to ASP.NET Core.
- 30:31SPEAKER_02: It is a whole bunch of tooling and features and integrations that make your life as an ASP.net Core developer so much better.
- 30:40SPEAKER_02: Like all the all these things that we have in ASP.core that uh are there but you have to like wire up and configure, Aspire just will like handle those things for you.
- 30:50SPEAKER_02: When you're building you know an ASP.net Core app and it you know goes beyond just a single process and you know you've got like you know ten projects you've got to get them all running if you want to run the entire app locally Aspire just handles that for you getting getting your metrics and your logs and traces like yeah all that data's there but you have to go read the docs to figure out how to see them and why am I not seeing the logs for feature X?
- 31:09SPEAKER_02: Oh I gotta go configure that.
- 31:11SPEAKER_02: Aspire just sets that all up and gives you an awesome dashboard for viewing all that data.
- 31:15SPEAKER_02: So I think that for me that's probably one of the the big ones.
- 31:18SPEAKER_02: Like I would really love to see more people take advantage of what Aspire has to offer.
- 31:23SPEAKER_02: You can add Aspire to any ASP.NET Core app.
- 31:27SPEAKER_02: Anyone just there are templates that you just right click and say make this an Aspire app.
- 31:31SPEAKER_02: And uh you don't have to change how you deploy it.
- 31:34SPEAKER_02: You don't have to change how you're doing your development.
- 31:36SPEAKER_02: It just adds goodness to your app.
- 31:39SPEAKER_02: So I would encourage people to use that whether you're doing Blazor or web APIs or minimal APIs, anything with ASP.net core, Aspire adds a lot of value.
- 31:47SPEAKER_02: So that that would be a big one.
- 31:48SPEAKER_03: Love it.
- 31:49SPEAKER_03: Excellent.
- 31:50SPEAKER_03: Well thanks for being here I appreciate it.
- 31:52SPEAKER_03: And thanks for watching as always I am Tim Corey.
- 31:55SPEAKER_00: Thank you for joining us for this episode of Dev Questions.
- 31:58SPEAKER_00: When you're ready to learn to think and code like a professional developer head over to I am Timcorey.com and enroll in a course