High-level goal for Blazor in .NET 8

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we talk about the high level goal for Blazer in net 8 but before we do that let's take a step back and discuss how we built web apps in Net 7 first we used static server rendering or serers side rendering to build server render web applications with Frameworks like razor pages and MVC in this model the browser sends a request to the server on the server the request is routed to an endpoint such as a Razer page and the Razer page executes on the server to dynamically render HTML and that HTML is added to the response and sent back to the client browser and the browser then displays the web page now static server rendering has the following benefits first the app loads faster because all the work is already done on the server and the client has to Simply display the HTML second the app can easily access server resources such as databases and finally the site is also easily indexed but there are a few drawbacks too the first is that the cost of processing and memory use are concentrated on the server and the second one is for every user interaction a round trip to the server is required and one issue with Frameworks like razip padis and AMC is that they lack a component based programming model for building reusable pieces of web UI so that was static server rendering what if we wanted to build interactive web applications in Net 7 well we had the Blazer framework Blazer is a web framework for building web UI components called razor components and these razor components can be hosted in different ways first we have the Blazer server hosting model where the razor components are hosted on the server in an asp.net core application on the client a Blazer script called blazer. server.js establishes a signalr connection with the server and any UI updates event handling and JavaScript interop calls are handled over this signal R connection Blazers server has the following benefits first the app loads faster because the download size is very small second the app can take advantage of server features and the use of net apis and Blazer server can work with thin clients for example browsers that don't support web assembly and finally the applications code is not served to clients so it cannot be tampered with blazer server has some drawbacks too first there is some latency involved because every user interaction needs to go to the server second there is no offline support and third server resources are required if you want to scale the app and finally an asp.net course server is needed to serve the app so for example it is not possible to deliver the app from a Content delivery Network next we have the Blazer web assembly hosting model in this model the Razer component executes on the client inside the browser on a web assembly based net runtime so here a script called blazer. webassembly doj downloads the webassembly based. net runtime the required net assemblies and the dependencies from the server and then the application starts executing on the client inside the browser Blazer web assembly has the following benefits first for Standalone Blazer web assembly apps the app is functional even if the server goes offline next the capabilities of the client are fully leveraged and also work is offloaded to the client and finally an asp.net go server is not needed to serve a standalone Blazer web assembly app Blazer web asmbly has a few drawbacks too first is the clients need web asmbly support and also the app takes longer to load because code has to be downloaded and executed on the client Net 7 provides us with two main templates for building Blazer apps the first is a Blazer server app template which is used for building Blazer server applications the second is is a Blazer web assembly app template which is used for building Blazer web assembly apps so that was Net 7 from what we learned so far we can identify three issues the first is that razor bers and MEC lack a component model the second is what if we wanted to use static server rendering for the homepage of our site but then add interactivity to individual parts of our site to do this in Net 7 we have to combine multiple Frameworks like razor Pages or or MC and Blazer and the final issue is that when we need to build a Blazer app we need to make an upfront decision on which hosting model to use and once we make the decision the entire application will now be either a Blazer server app or a Blazer web assembly app now Blazer and net 8 combines the benefits of Razor Pages MVC and Blazer and provides us with a consistent component based programming model for building full stack web uis and in order to support this new features are added to Blazer and these are static server rendering and Progressive enhancements such as enhanced navigation and form handling streaming rendering and the ability to add interactivity using Blazer server or Blazer web assembly on a per component basis all these features are supported with the new blazer web app template so let's talk about that next
Info
Channel: CodeGanesh
Views: 58
Rating: undefined out of 5
Keywords:
Id: MMyyHFE_lws
Channel Id: undefined
Length: 5min 25sec (325 seconds)
Published: Wed Apr 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.