Blazor on .NET 8 - Ten Reasons why Blazor on .NET 8 is a Game Changer

Gavin Lon
10 Oct 202325:02

Summary

TLDRGavin Law's video discusses the transformative impact of .NET 8 on Blazer applications, highlighting 10 key advancements. The introduction of Service Side Rendering (SSR) for faster load times and improved SEO is a significant update. Streaming rendering ensures a smooth user experience even with long-running operations. Enhanced navigation and form handling maintain SPA responsiveness while leveraging SSR benefits. The ability to choose component rendering mode at runtime allows developers to integrate various technologies like WebAssembly and server-rendering into a single project. Quick Grid, a lightweight component for data display, supports pagination and customization. Authentication is streamlined with client-friendly endpoints, and Razor components can now be integrated into different types of applications. The new feature to generate static HTML content broadens use cases, including email generation. Sections in Blazer allow dynamic content changes based on user navigation, and JIT interpreter promises faster rendering and JSON serialization for WebAssembly components. These improvements signify a major leap forward for Blazer applications.

Takeaways

  • πŸš€ **Service Side Rendering (SSR)**: Introduced in .NET 8, SSR allows for faster load times and improved SEO by rendering web pages on the server before sending them to the client.
  • πŸ“‘ **Streaming Rendering**: Enhances the SPA experience by loading static parts of a page immediately and streaming dynamic content later, avoiding blank screens during long operations.
  • βš™οΈ **Enhanced Navigation and Form Handling**: .NET 8 improves navigation by updating only necessary parts of the DOM and maintains scroll position after form submission for a smoother user experience.
  • πŸ” **Choose Component Rendering Mode at Runtime**: Developers can select the rendering mode (Blazor WebAssembly or Blazor Server) for components at runtime, providing flexibility and optimizing performance.
  • πŸ“Š **Quick Grid Component**: A lightweight, fast grid for displaying data with support for pagination, sorting, filtering, and customization, included with .NET 8.
  • πŸ” **Improved Authentication**: .NET 8 simplifies authentication by removing the reliance on third-party components like Identity Server and introduces client-friendly endpoints for identity management.
  • 🧩 **Razor Component Result Integration**: Allows for the integration of Razor components into various application types, including MVC, Razor Pages, Angular, or React, through the ability to return a Razor component result.
  • βœ‚οΈ **Generate Static HTML Content**: Razor components can now be rendered outside of the ASP.NET environment, enabling the generation of static HTML content for scenarios like email generation.
  • π„ž **Introduction of Sections**: Similar to MVC, sections in Blazor allow for dynamic content changes in specific parts of a web application based on the user's navigation context.
  • ⚑ **JIT Interpreter**: .NET 8 includes limited JIT support for Blazor WebAssembly components, resulting in significant runtime speed improvements, including faster UI rendering and JSON serialization.

Q & A

  • What are the two available technologies for creating and rendering HTML in previous versions of .NET before .NET 8?

    -The two available technologies for creating and rendering HTML in previous versions of .NET are Blazor WebAssembly and Blazor Server. Blazor WebAssembly runs the application's code logic within the user's browser using WebAssembly technology, while Blazor Server maintains a persistent connection between the client and server through a SignalR connection.

  • How does Service Side Rendering (SSR) differ from Blazor Server and Blazor WebAssembly?

    -Service Side Rendering (SSR) does not require the code to run inside the user's browser like Blazor WebAssembly. Instead, the entire webpage is rendered on the server and then streamed to the user's browser via an HTTP response. This means no WebAssembly or SignalR connection is needed, and it can improve SEO and provide faster load times.

  • What is the advantage of Streaming Rendering in Blazor applications?

    -Streaming Rendering allows parts of a page to be loaded asynchronously in the user's browser via an HTTP response. This means that static parts of the page can load immediately, while dynamic parts that may take longer to render can be streamed later, maintaining the SPA (Single Page Application) effect and user experience.

  • How does enhanced navigation in Blazor on .NET 8 improve the user experience?

    -Enhanced navigation ensures that only the necessary parts of the webpage are downloaded from the server to the browser upon navigation. This means the browser's DOM is updated with only the required changes, avoiding a full page refresh and preserving the user's scroll position for a smoother and faster navigation experience.

  • What is the significance of being able to choose the component rendering mode at runtime in .NET 8?

    -The ability to choose the component rendering mode at runtime allows developers to select whether a page uses Blazor Server technology, streaming rendering, or Blazor WebAssembly. This flexibility enables developers to optimize the performance and user experience based on the specific needs of different parts of their application.

  • What is the Quick Grid component in .NET 8 and how does it benefit Blazor applications?

    -The Quick Grid component in .NET 8 is a fast, lightweight component designed to display data in a grid format. It supports pagination, sorting, filtering, and customization through CSS. It's particularly useful for displaying large datasets with virtualization, providing the appearance of continuous scrolling while only rendering the visible rows for optimal performance.

  • How has authentication been improved in .NET 8 for Blazor applications?

    -In .NET 8, authentication has been simplified by removing the dependency on a full OIDC (OpenID Connect) solution like Identity Server for many SPA applications. Microsoft has introduced client-friendly endpoints for identity management, allowing applications to obtain Bearer tokens, set up cookies, and query identity data stores more easily. Additionally, developers are no longer restricted to Razor Pages templates for authentication UI, enabling them to customize authentication flows using Blazor or other frontend frameworks like Angular or React.

  • What does the ability to return a Razor Component Result in .NET 8 allow developers to do?

    -The ability to return a Razor Component Result in .NET 8 allows developers to integrate Blazor components into other types of applications, such as MVC, Razor Pages, Angular, or React apps. This is achieved by returning the component result from a Minimal API or an MVC controller action, enabling the rendering of Blazor components instead of traditional views.

  • How can Blazor components be used for generating static HTML content in .NET 8?

    -In .NET 8, Blazor components can be rendered completely outside the context of HTTP requests, meaning they can be rendered as a string or stream. This allows developers to use Blazor components for templating HTML, which is particularly useful for generating static HTML fragments for scenarios like email generation.

  • What is the role of sections in Blazor applications in .NET 8?

    -Sections in Blazor applications in .NET 8 allow developers to change the content in certain parts of a component, such as a header, depending on the current webpage displayed to the user. This provides a way to dynamically update the UI based on the user's navigation context, enhancing the user experience.

  • What performance improvements are expected with the Just-In-Time (JIT) interpreter for Blazor WebAssembly components in .NET 8?

    -The Just-In-Time (JIT) interpreter for Blazor WebAssembly components in .NET 8 is expected to bring significant runtime speed improvements, including 20% faster UI rendering and 2x faster JSON serialization, enhancing the overall performance of Blazor WebAssembly applications.

Outlines

00:00

πŸš€ Introduction to Blazer in .NET 8

Gavin Law introduces the video and sets the stage for discussing the transformative aspects of Blazer in .NET 8. He explains the previous versions of .NET and the two available technologies for rendering HTML for Razor components: Blazer Web Assembly and Blazer Server. The former runs code logic in the user's browser using web assembly, leading to fast responsiveness, while the latter runs code on the server and communicates with the client through a SignalR connection. Gavin also teases the new features and enhancements in .NET 8, aimed at improving the user experience and application performance.

05:02

🌐 Service Side Rendering (SSR) in .NET 8

The video delves into the new feature of Service Side Rendering (SSR) in .NET 8 for Blazer applications. Unlike previous technologies, SSR doesn't require code to run inside the user's browser, leading to faster load times and smoother transitions. Gavin discusses the SEO benefits of SSR, its ease of indexing by search engines, and the more accurate user metrics it provides. He also explains how SSR is ideal for static web pages and social media optimization, and how it uses a stateless HTTP request-response model.

10:03

πŸ”„ Enhanced Navigation and Streaming Rendering

Gavin explores the enhanced navigation feature in .NET 8, which allows for content to be server-rendered while maintaining SPA responsiveness. The feature ensures that only necessary parts of the webpage are downloaded from the server to the browser upon navigation, avoiding full page refreshes. Additionally, streaming rendering is introduced to handle long-running operations without causing users to stare at a blank screen, by loading static parts of the page immediately and streaming dynamic content once it's ready. The summary also covers how form handling is improved to maintain the user's scroll position post-form submission.

15:05

πŸŽ›οΈ Component Rendering Mode at Runtime

The video explains the flexibility of choosing the component rendering mode at runtime in .NET 8 Blazer applications. Developers can select between Blazer Server, streaming rendering, or Blazer Web Assembly for specific pages or components by using an attribute. This allows for a mix of technologies within one project, leveraging the benefits of faster initial loads from server-side rendering and the responsiveness of web assembly. The 'auto' render mode is also introduced, which starts with server-rendering and can transition to web assembly in the background for subsequent interactions.

20:05

πŸ“Š Quick Grid Component and Improved Authentication

Gavin introduces the Quick Grid component in .NET 8, a lightweight and fast way to display data in a grid format with support for pagination, sorting, filtering, and custom styling. He also discusses the improvements in authentication, with the removal of Identity Server from templates and the introduction of client-friendly endpoints for identity management. This allows for more straightforward authentication setups and the ability to customize authentication UIs without being tied to Razor Pages templates.

🧩 Integration and Static HTML Generation

The video highlights the ability to integrate Razor components into various types of applications, including MVC, Razor Pages, Angular, or React, by returning a Razor component result. It also covers the new capability to generate static HTML content with components, which can be useful for scenarios like email generation. This feature also lays the groundwork for future static site generation capabilities in Blazer.

πŸ“ˆ Introduction of Sections and JIT Interpreter

Gavin discusses the introduction of sections in Blazer, allowing for dynamic content changes in specific parts of a webpage based on user navigation context. He also mentions the Just-In-Time (JIT) interpreter for Blazer Web Assembly components in .NET 8, which significantly improves runtime speed, including faster UI rendering and JSON serialization. The video concludes with a recap of the 10 reasons why Blazer on .NET 8 is a game-changer, emphasizing the massive improvements and enhancements in the framework.

Mindmap

Keywords

πŸ’‘Blazor

Blazor is a web framework developed by Microsoft for building interactive web UIs using C# instead of JavaScript. In the video, it is central to the discussion as the presenter talks about how Blazor on .NET 8 introduces new features that can potentially change the game for web development.

πŸ’‘WebAssembly

WebAssembly is a binary instruction format that allows high-performance execution of code on the web. In the context of the video, WebAssembly is mentioned as a technology that enables Blazor applications to run C# code within the user's browser, leading to fast and responsive web pages.

πŸ’‘SignalR

SignalR is a library that allows bi-directional communication between server and client in real time. The video discusses how SignalR is used in Blazor Server applications to maintain a persistent connection, which is not required in Blazor WebAssembly applications.

πŸ’‘Service Side Rendering (SSR)

SSR is a technique where web pages are rendered on the server before being sent to the client. The video highlights SSR as a new feature in .NET 8 for Blazor apps, which can improve load times, SEO, and provide more accurate user metrics.

πŸ’‘Streaming Rendering

Streaming Rendering is a method where parts of a web page are loaded and displayed to the user while the rest of the page continues to load in the background. The script mentions that with streaming rendering, the static parts of a page can be displayed quickly, and the dynamic parts can be streamed later, maintaining the SPA experience.

πŸ’‘Enhanced Navigation

Enhanced Navigation is a feature in Blazor on .NET 8 that allows for efficient content loading and updating during navigation without needing to refresh the entire page. The video explains that this feature maintains the SPA responsiveness while leveraging the benefits of SSR.

πŸ’‘Component Rendering Mode

Component Rendering Mode refers to the ability to choose how a Blazor component should be rendered, either on the server, as WebAssembly, or through an auto mode that combines both. The video discusses how this feature provides developers with flexibility and the ability to optimize the user experience.

πŸ’‘Quick Grid

Quick Grid is a component introduced in .NET 8 that provides a fast and lightweight way to display data in a grid format. The video script describes its use for scenarios where pagination, sorting, filtering, and customization of data display are needed.

πŸ’‘Authentication

Authentication is the process of verifying the identity of users. The video talks about improvements in authentication in .NET 8, allowing for more straightforward identity management and the use of client-friendly endpoints for tasks like getting Bearer tokens or setting up cookies.

πŸ’‘Razor Components

Razor Components are a type of component in Blazor that allows for the creation of reusable UI elements. The video mentions the ability to integrate Razor Components into different types of applications, like MVC, Razor Pages, Angular, or React, showcasing the versatility of Blazor.

πŸ’‘Static Site Generation

Static Site Generation is a technique where web pages are pre-rendered into HTML on the server. The video script discusses how this feature, which will be available in future releases, can improve the speed of web page retrieval and user experience by serving pre-rendered pages.

πŸ’‘JIT Interpreter

JIT (Just-In-Time) Interpreter is a component of the .NET runtime that compiles code during execution. The video highlights that .NET 8 introduces limited JIT support for Blazor WebAssembly components, which can lead to significant performance improvements in UI rendering and JSON serialization.

Highlights

Blazor on .NET 8 introduces Service Side Rendering (SSR), which allows for faster load times and improved SEO.

SSR enables more accurate user metrics and is ideal for static web pages and social media optimization.

Streaming rendering in .NET 8 helps maintain a fast user experience by loading static parts of a page first and streaming dynamic content later.

Enhanced navigation and form handling in .NET 8 provide a smooth and fast user experience without full page refreshes.

Developers can choose the component rendering mode at runtime, offering flexibility between server-side rendering and client-side rendering.

Quick Grid component in .NET 8 offers a fast, lightweight way to display data in a grid with support for pagination, sorting, and filtering.

Authentication in .NET 8 has been improved with client-friendly endpoints and removal of the dependency on Identity Server for simpler authentication needs.

Razor components can now be integrated into other types of applications like MVC, Razor Pages, Angular, or React.

Components can generate static HTML content, useful for scenarios like email generation or static site generation.

Introduction of sections in Blazor allows for dynamic content changes based on the user's navigation context.

Blazor WebAssembly components in .NET 8 will see significant runtime speed improvements with the inclusion of a JIT interpreter.

Blazor applications can now leverage the benefits of both WebAssembly and Server technologies within a single project.

The use of the 'auto' render mode in components allows for an initial load via a SignalR connection and subsequent behavior like a WebAssembly component.

Virtualization in Quick Grid provides the appearance of continuous scrolling through large data sets with only the visible rows being rendered.

For more complex grid functionality, Blazor can integrate more sophisticated components like the Sync Fusion Data Grid.

.NET 8 allows for the customization of authentication-related UIs without being tied to Razor Pages templates.

Razor Component Result can be returned from various application types, allowing for the integration of Blazor components into different application frameworks.

Static site generation in Blazor, although not included in .NET 8, is set to be available in future releases, promising faster webpage retrieval speeds.

Transcripts

play00:01

hi everyone and welcome I'm Gavin law

play00:05

before we look at 10 reasons why Blazer

play00:07

onet 8 is a game changer let's

play00:10

understand Blazer before net 8 in

play00:13

previous versions of net 8 for example

play00:16

Net 7 which is currently the latest

play00:18

stable release of net there were two

play00:21

available technologies that can be

play00:23

chosen for how the HTML for razor

play00:26

components is created and rendered and

play00:29

updated in the users browser these

play00:31

options are Blazer web assembly and

play00:33

Blazer server very basically with blazer

play00:37

web assembly all of the code Logic for

play00:39

the relevant Blazer application as well

play00:42

as the runtime are downloaded to the

play00:45

browser so the code logic runs on the

play00:48

users's browser so the C code is run

play00:51

within the users's browser which is made

play00:53

possible through the web assembly

play00:57

technology when changes to a web page

play00:59

Pages content are made through user

play01:03

interactions with the web page only the

play01:05

changes are updated within the Dom so

play01:07

the entire page is not refreshed every

play01:10

time a page needs to change this makes

play01:13

web page responsiveness extremely fast

play01:16

and gives the user a great user

play01:18

experience ux when the Blazer server

play01:21

technology is used the same Spa effect

play01:24

if you like is achieved where the same

play01:27

kind of spa responsiveness is

play01:28

experienced by the user so only the

play01:32

necessary change is updated in a web

play01:34

page as a result of the user interacting

play01:37

with the web page and the entire web

play01:39

page does not need to be refreshed which

play01:42

could result in the user staring at a

play01:44

blank page for a relatively long period

play01:46

of time before the desired rendered

play01:49

content appears within the user's

play01:51

browser so with both the Blazer web

play01:54

assembly technology and the Blazer

play01:56

server technology The Spar

play01:58

responsiveness effect if you like is

play02:01

experienced by the

play02:03

user where only the changes through user

play02:06

interactions with the relevant web page

play02:08

are updated within the users's browser

play02:11

resulting in a smooth responsive ux

play02:14

however with blazer server applications

play02:17

the code runs on the server and not on

play02:20

the client as is the case with blazer

play02:22

web assembly applications so for example

play02:24

when a change to a web Page's content is

play02:27

made through a user interacting with the

play02:29

relevant page page code logic is run on

play02:32

the server the relevant change that

play02:34

needs to occur within the browser is

play02:36

calculated on the server and

play02:38

subsequently sent to the browser via a

play02:40

signal R connection so a websocket

play02:43

connection between the client and server

play02:45

is maintained for Blazer server

play02:47

applications this persistent connection

play02:50

between the client and server can be

play02:52

described as a circuit this circuit is

play02:55

not required in Blazer web assembly

play02:57

applications because the C code runs on

play03:00

the web assembly technology within the

play03:02

browser note that in Blazer web assembly

play03:05

applications the applications data is

play03:07

typically stored on the server but is

play03:10

passed to the client when needed via a

play03:13

typical HTTP request response model and

play03:16

does not use a signal R connection as is

play03:19

the case with blazer server

play03:21

applications so this is how Blazer

play03:23

worked in previous versions of net the

play03:26

spa application's responsiveness was

play03:29

made possible

play03:30

through the web assembly technology or

play03:32

through a persistent websocket

play03:33

connection a signal R connection note

play03:37

that the functionality we have just

play03:39

discussed Blazer web assembly and Blazer

play03:41

server still works in much the same way

play03:44

on net 8 but new features and

play03:47

enhancements have been

play03:49

made to support the Channel please hit

play03:52

the like button and please consider

play03:54

subscribing please also ring the bell so

play03:57

that you'll be notified of future

play03:58

content please feel feel free to share

play04:00

this content with anyone you feel May

play04:02

benefit from its content if you'd like

play04:04

to thank me by buying me a coffee you

play04:06

can do this through my buy me a coffee

play04:07

web page at this URL it will of course

play04:10

be greatly appreciated I love reading

play04:12

your comments so please feel free to

play04:14

engage with me in the comments section

play04:17

so here are my top 10 reasons why I

play04:19

think Blazer on net 8 is a game

play04:22

changer and they are in no particular

play04:25

order number one service side rendering

play04:28

SSR with net 8 service side rendering

play04:32

has been introduced to Blazer

play04:33

applications so how does this technology

play04:36

differ from Blazer server and Blazer web

play04:38

assembly with SSR the code does not need

play04:41

to run inside the user's browser like in

play04:43

a web assembly Blazer application so the

play04:46

relevant files containing the relevant

play04:48

code logic and the necessary runtime

play04:50

does not need to be downloaded into the

play04:52

user's browser a signal R connection or

play04:55

a circuit does not need to be maintained

play04:57

like is the case with blazer server

play04:59

application ations with SSR a typical

play05:01

HTTP request response model is used

play05:04

where HTTP request is made by the

play05:06

browser to the server the relevant web

play05:09

page is rendered in its entirety on the

play05:11

server and then streamed to the users

play05:13

browser via a HTTP response service side

play05:17

rendering is currently used for both MVC

play05:20

and razor Pages apps but is new to

play05:22

Blazer apps with the release of net 8 so

play05:26

what are the advantages of service side

play05:28

rendering fast Lo times which includes

play05:31

the initial loading of your website or

play05:33

web application as well as faster page

play05:36

transitions within your website or web

play05:38

application SSR is great for boosting

play05:41

your SEO search engine

play05:44

optimization because it indexes your

play05:47

pages before they are loaded in the

play05:49

browser with service side rendering

play05:51

content is theoretically easier to crawl

play05:53

and be indexed indexing SSR sites is

play05:57

much easier for search engines than

play05:59

clients site rendered sites the content

play06:01

is rendered before the page is loaded so

play06:03

JavaScript does not need to be run to

play06:06

read and index the relevant Pages more

play06:10

accurate user metrics unlike CSR client

play06:13

side rendering

play06:15

SSR will inform the server as users move

play06:18

between your web pages evaluating how

play06:21

your users navigate your site and

play06:23

interact with your content will help you

play06:26

continually improve the user interface

play06:29

you are

play06:30

and user experience ux SSR is ideal for

play06:34

static web pages as it is faster to

play06:37

pre-render a static page on the server

play06:40

before sending it to the

play06:42

client SSR is excellent for social media

play06:46

optimization this means previews of your

play06:49

website can be easily

play06:51

presented with the relevant page title

play06:54

description and image wherever your web

play06:57

Page's content is shared on social media

play07:01

platforms so with SSR the relevant web

play07:04

page is stateless and a typical HTTP

play07:08

request response model is used to handle

play07:10

the requests between the client and the

play07:12

server with web assembly and Blazer

play07:15

server state is maintained in the case

play07:18

of web assembly the state is maintained

play07:20

on the client and with blazer server the

play07:23

state is maintained between client and

play07:25

server through a circuit made possible

play07:28

through a signal R connection maintained

play07:31

between the client and the

play07:33

server number two streaming rendering so

play07:37

you might be thinking okay great we've

play07:40

got all these advantages with service

play07:41

side rendering but what happens if the

play07:44

page that is

play07:45

requested involves a long running

play07:47

operation for example a data retrieval

play07:49

operation that causes the page to be

play07:52

relatively slow to

play07:54

render this could result in the user

play07:56

staring at a blank screen for a

play07:58

frustratingly long period of time in

play08:01

this case doesn't this defeat the

play08:03

purpose of creating a spa application in

play08:05

the first place where you would

play08:07

typically use a spa technology to create

play08:10

a fast and smooth user experience well

play08:13

this is where streaming rendering can be

play08:15

so effective in maintaining the spa

play08:18

effect if you like where the static part

play08:20

of the page is loaded for example the

play08:22

header the hero section and the footer

play08:24

almost immediately after the relevant

play08:26

page is accessed and then the done

play08:29

dnamic part of the page hindered by the

play08:31

long running data retrieval operation

play08:33

can be streamed later to the user

play08:35

browser once it has been appropriately

play08:37

rendered on the server note that a web

play08:40

socket connection does not need to be

play08:41

created for streaming rendering to occur

play08:44

so signal R connection does not need to

play08:46

be maintained between client and server

play08:49

the dynamic part of the web page can be

play08:51

sent in the same HTTP response stream

play08:55

but at a later time so for example from

play08:57

a user's perspective they header hero

play08:59

section and footer would appear in the

play09:01

user's browser almost immediately after

play09:03

the relevant web page is accessed and

play09:06

perhaps a loading indicator is displayed

play09:08

to the user while the relevant Dynamic

play09:11

content is being rendered once the

play09:13

relevant Dynamic content is rendered it

play09:15

is sent via the HTTP response to the

play09:18

browser and subsequently replaces the

play09:21

loading indicator in the user's

play09:23

browser so with serice side rendering

play09:25

and streaming rendering part of the page

play09:28

can be loaded asynchronously in the

play09:30

users browser via a HTTP response this

play09:33

means the advantages of service side

play09:36

rendering can be leveraged in Blazer

play09:38

applications and the responsive nature

play09:40

inherent in Spa applications is still

play09:43

maintained number three enhanced

play09:46

navigation and form handling Blazer

play09:49

on.net 8 comes with an enhanced

play09:51

navigation feature this magic if you

play09:54

like is switched on through a reference

play09:56

to an enhanced version of the blazer.

play09:58

web. JS Javascript file which is

play10:01

referenced from within your Blazer

play10:03

projects app. Riser

play10:05

file as discussed there are many

play10:08

advantages to leveraging service side

play10:10

rendering but we don't want to at the

play10:13

same time cancel out the responsiveness

play10:15

features inherent in this Spa technology

play10:19

enhanced navigation means that content

play10:21

is still service ID rended but the

play10:24

result is when a navigation is performed

play10:26

only what is needed is downloaded from

play10:29

the server to the

play10:32

browser with enhanced navigation a fetch

play10:35

request is made and only updates the Dom

play10:39

with the necessary changes so any files

play10:42

and content that is already present in

play10:45

the browser does not need to be

play10:46

refreshed in the browser window when a

play10:48

navigation is performed from one web

play10:50

page to another Blazer intercepts the

play10:53

request when a navigation is performed

play10:55

from one web page to another Blazer

play10:58

intercepts the request and updates the

play10:59

Dom with only the parts of the web page

play11:02

that need to be changed this results in

play11:04

a smooth fast navigation

play11:07

effect so benefits we have discussed

play11:11

regarding service side rendering are

play11:12

leveraged while at the same time the ux

play11:15

responsiveness you would expect when

play11:17

leveraging a spar technology is

play11:19

maintained form handling is another

play11:21

benefit delivered in net 8 for Blazer

play11:24

applications where for example if a user

play11:27

fills in a form whereby the user needed

play11:30

to scroll down the page to reach the

play11:32

relevant form when the user submits the

play11:35

form with service ID rendering this

play11:38

would typically result in a complete

play11:40

page refresh where the page would reload

play11:43

and the user would lose the user's

play11:45

scroll position within the page so with

play11:48

enhanced form handling only the parts of

play11:50

the web page that need to change as a

play11:53

result of the user submitting the form

play11:55

to the server are changed and the scroll

play11:58

position on the web page experienced

play12:00

before the user pressed the submit

play12:02

button is maintained even after the form

play12:05

is submitted this ultimately results in

play12:07

a smooth experience for the user you can

play12:10

test the effect of enhanced navigation

play12:12

and form handling by commenting out the

play12:15

reference to the blazer. web.js file

play12:17

within the app. Riser file testing your

play12:21

application and then commenting back in

play12:23

the blazer. web.js file and retesting

play12:26

the relevant

play12:27

functionality number four choose

play12:30

component rendering mode at

play12:33

runtime so we've discussed server side

play12:35

rendering and streaming rendering this

play12:38

is great for initial page loads we have

play12:40

also discussed enhanced navigation and

play12:42

form handling which gives our

play12:44

application the advantages of service

play12:46

side rendering while maintaining the

play12:47

responsiveness effect expected when

play12:50

using a spar technology like blazer with

play12:53

net 8 we are also able to leverage the

play12:55

Blazer web assembly technology and the

play12:57

Blazer server technology within our

play12:59

Blazer applications running onnet we can

play13:03

in fact include service side rendering

play13:05

streaming rendering Blazer web assembly

play13:07

components and Blazer server components

play13:09

within one project within our net 8

play13:12

Blazer applications by applying an

play13:15

appropriate attribute at the top of a

play13:18

razor page we can for example explicitly

play13:20

choose that the relevant web page

play13:23

leverage the Blazer server technology

play13:25

which means a signal R connection is

play13:27

created automatically to handle relevant

play13:30

client server interactions we could

play13:32

explicitly change the relevant attribute

play13:35

appropriately so that streaming

play13:36

rendering is used for a particular page

play13:39

which means a signal R connection will

play13:42

not be used and a typical HTTP request

play13:44

response model is instead used note that

play13:47

it is not recommended that you always

play13:50

bind a particular page to a render mode

play13:53

this should be done

play13:54

sparingly it is

play13:56

recommended that such choices should be

play13:59

done through applying the render mode

play14:01

attribute to elements that denote the

play14:03

inclusion of the relevant razor

play14:05

component as a child component with an

play14:07

apparent razor component this will give

play14:10

you more flexibility regarding the

play14:12

context in which the relevant component

play14:14

is

play14:15

rendered so a component can be rendered

play14:18

for example as a web assembly component

play14:20

or a Blazer server component and this

play14:23

Choice can be implemented through the

play14:25

use of the random mode attribute

play14:26

included appropriately within the Rel

play14:29

element that denotes a razor component

play14:32

you can also choose the auto render mode

play14:36

for a component which for example would

play14:39

mean that a component is initially

play14:40

loaded via signal R connection which

play14:43

means it behaves initially like a Blazer

play14:45

server component while the page is

play14:47

loading via a signal R connection the

play14:50

runtime and relevant files containing

play14:52

the code logic could be downloaded in

play14:54

the background so that subsequently this

play14:58

component can can behave like a web

play14:59

assembly component the advantage of this

play15:02

is you can leverage the faster initial

play15:04

load times inherent in the Blazer server

play15:07

technology as well as the inherent

play15:10

faster responsiveness to user

play15:12

interactions inherent in the Blazer web

play15:14

assembly technology so you can get the

play15:17

best of both worlds if you like through

play15:19

an appropriate implementation of the

play15:21

auto mode random mode number five quick

play15:24

grid also shipped with net 8 is the

play15:27

quick grid component

play15:29

so a use case for the quick grid

play15:31

component is that you want a fast

play15:33

lightweight component that can display

play15:36

your data in a grid perhaps you want to

play15:39

display your data across a number of

play15:40

pages quick grid supports pagination for

play15:43

information about what functionality is

play15:46

provided in the quick grid component you

play15:48

can navigate to the quick grid demo site

play15:51

at this

play15:52

URL you can see here we have pagination

play15:55

functionality you can include and

play15:57

exclude the fields you want to display

play15:59

within your grid not only can you

play16:02

include text based data you are also

play16:04

able to include images within your

play16:08

grid you can sort the rows by clicking

play16:11

on the relevant column

play16:14

headers you can filter the data within

play16:16

the rows using textbase search criteria

play16:20

you can customize the look and feel of

play16:22

the grid using CSS

play16:25

stylesheets so it's a basic grid that

play16:27

you can Leverage for quickly displaying

play16:29

your data within a grid you can also

play16:32

easily customize your grid for example

play16:34

by adding functionality for sorting the

play16:35

data filtering the data styling the grid

play16:38

using CSS and include pagination you can

play16:42

even Leverage The virtualization

play16:45

functionality virtualization provides

play16:47

the appearance of continuous scrolling

play16:50

through an arbitrarily large data set

play16:53

while only needing to fetch and render

play16:55

the rows that are currently in the

play16:57

scroll viewport

play16:59

this can provide excellent performance

play17:02

even when the data is vast quick grids

play17:05

virtualization feature is built on

play17:07

Blazers built-in virtualized component

play17:10

so it shares the same capabilities

play17:12

requirements and limitations so quick

play17:15

grid provides you with basic grid

play17:17

functionality for more complex

play17:19

functionality quick grid might not be

play17:20

the component to use and perhaps you

play17:23

could use a more sophisticated grid

play17:25

component for example the sync Fusion

play17:27

data grid component component for more

play17:29

information on how to use the sync

play17:31

Fusion data grid component please

play17:33

navigate to this URL where I demonstrate

play17:36

how to use the sync Fusion data Grid in

play17:38

the context of developing a sales

play17:40

management application using Blazer

play17:46

server number six improved

play17:49

authentication prior to net 8 a

play17:51

thirdparty component dend identity

play17:54

server was used for setting up

play17:55

authentication for spa applications

play17:59

for many Spa applications a full open ID

play18:02

connect server solution is way more than

play18:04

is required to satisfy authentication

play18:07

concerns dend identity server is a great

play18:10

component but may not be appropriate for

play18:13

all Solutions in net 8 dend identity

play18:16

server has now been removed from the

play18:18

authentication related templates dend

play18:21

provides templates for your applications

play18:23

if you do need a full oidc solution and

play18:27

in these scenario Microsoft recommends

play18:29

that you use their templates for this

play18:31

purpose in net 8 Microsoft has

play18:34

introduced client-friendly endpoints for

play18:36

identity management for example where

play18:39

your applications can get Bearer tokens

play18:41

or setup cookies and query the identity

play18:44

data stores for information about the

play18:46

users the other authentication related

play18:48

Improvement that comes with net 8 is

play18:51

that prior to net 8 you were restricted

play18:53

to razor Pages templates for

play18:56

implementing uis for the integration of

play18:58

authentication functionality into your

play19:00

web applications so for example if you

play19:04

want to include login and registration

play19:05

forms in your web applications you would

play19:08

include the appropriate login and

play19:10

registration razor pages in your

play19:12

application at the end of this video

play19:15

where I demonstrate creating a sales

play19:17

management application using Blazer

play19:19

server I demonstrate integrating

play19:22

identity into the application where the

play19:24

relevant login and registration razor

play19:26

pages are included in the relevant

play19:29

project for authentication

play19:31

purposes as discussed in net 8 you can

play19:34

use the new client-friendly web API

play19:36

endpoints to get Bearer tokens or setup

play19:39

cookies and query the identity data

play19:41

stores for information about the users

play19:44

with net 8 you are therefore not reliant

play19:47

on these razor Pages templates for the

play19:49

integration of authentication into your

play19:51

web applications so you won't be tied to

play19:54

the razor Pages technology for this

play19:56

purpose and can custom ciz for example

play19:59

in your Blazer applications your login

play20:01

and registration forms using Blazer not

play20:04

only is this great for Blazer spy

play20:06

applications you can also use these

play20:08

authentication related web API

play20:11

endpoints and customize your own

play20:14

authentication related uis using angular

play20:16

or react in your angular or react

play20:20

applications number seven razor

play20:22

component result integrate razor

play20:25

components into other types of

play20:27

applications

play20:28

like MVC razor Pages angular or

play20:32

react new and.net 8 is the ability to

play20:36

return a razor component

play20:38

result which you can return from for

play20:41

example a minimal API or an MVC

play20:44

controller action so this means you can

play20:46

easily integrate Blazer components into

play20:49

for example existing MVC applications so

play20:52

for example instead of rendering an MVC

play20:55

view you could choose to render a Blazer

play20:57

component instead dead you can turn a

play21:00

Blazer component into a custom element

play21:02

and for example integrate your razor

play21:04

components into angular or react

play21:08

applications number eight generate

play21:10

static HTML content with

play21:14

components you can now render razor

play21:16

components completely outside of the

play21:18

context of HTTP requests so completely

play21:21

outside the asp.net

play21:24

environment so your razor component can

play21:27

be rendered Direct as a string or stream

play21:29

and therefore your razor component can

play21:31

be used for templating

play21:33

HTML so this is useful for scenarios

play21:36

where you just want to generate static

play21:39

HTML fragments that could be used for

play21:41

example for email generation so this is

play21:44

just added flexibility that is included

play21:47

with the release of net

play21:49

8 this functionality also lays the

play21:52

groundwork for static site generation in

play21:54

Blazer so this will mean that if the

play21:56

site can be generated into to HTML on

play21:58

the server for example for a web page

play22:01

the web page is already rendered so of

play22:03

course this increases the speed of

play22:04

retrieval of the web page and therefore

play22:06

results in a better ux static site

play22:09

generation will not be included in net 8

play22:12

but will be available in future releases

play22:15

ofet number nine the introduction of

play22:18

sections into Blazer in net 8 sections

play22:22

can be used within Blazer applications

play22:24

for those of you familiar with MVC

play22:26

you'll probably know how sections work

play22:29

you can use a section in your web

play22:30

application so that for example the

play22:32

content in a certain part of a header

play22:35

component changes depending on the

play22:37

current web page displayed to the user

play22:40

so if the user is currently navigated to

play22:43

for example a web page displaying a

play22:45

weather forecast for the week a section

play22:48

in the header of the web page could

play22:52

display for

play22:53

example the high and low temperature for

play22:56

the current day so the content in a

play23:00

defined section of the header changes

play23:02

according to the user's navigation

play23:03

context if you like so if for example

play23:06

the user is looking at a web page

play23:07

showing the latest news stories perhaps

play23:10

the latest breaking news headline is

play23:12

displayed in the relevant section in the

play23:14

header of the web page where the web

play23:16

content was displayed when the user was

play23:19

looking at the web page containing

play23:21

weather forecast data so you can see how

play23:23

this could be a useful feature to use

play23:25

within your web applications

play23:28

number 10 jit interpreter much faster

play23:32

web assembly

play23:33

components currently your Blazer web

play23:35

assembly apps run on an interpreter

play23:38

based

play23:39

runtime Limited jet support will be

play23:43

included for Blazer web assembly

play23:45

components in net 8 what this means is

play23:48

significant runtime speed improvements

play23:51

including 20% faster UI rendering and 2x

play23:56

faster Json

play23:59

serialization so these were just 10

play24:02

reasons why Blazer on net 8 is a

play24:05

GameChanger so massive improvements and

play24:07

enhancements are shipped with net 8 that

play24:09

will have a massive impact on your

play24:11

future Blazer applications this is very

play24:14

exciting

play24:15

indeed I hope you have enjoyed this

play24:17

video If you like this video please hit

play24:19

the like button and please consider

play24:21

subscribing please also ring the bell so

play24:23

that you'll be notified of future

play24:24

content please feel free to share this

play24:26

video with anyone you feel May benefit

play24:28

from its content if you'd like to thank

play24:30

me by buying me a coffee you can do this

play24:33

through my buy me a coffee web page at

play24:34

this URL it will of course be greatly

play24:37

appreciated I love reading your comments

play24:39

so please feel free to engage with me in

play24:40

the comments section I hope to see you

play24:43

soon thank you and take

play24:44

[Music]

play24:56

care

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Blazer WebAssemblyService Side RenderingStreaming RenderingEnhanced NavigationForm HandlingComponent Rendering ModeQuick GridAuthenticationRazor ComponentsStatic HTMLJIT Interpreter