ØREDEV @EdCharbeneau #Blazor
Ed Charbeneau Developer Advocate for Progress<Telerik> Author<T> Twitter.Where(user == @EdCharbeneau)
Hello Blazor @EdCharbeneau #Blazor
What if… @EdCharbeneau #Blazor
Client-side Web Was C#? @EdCharbeneau #Blazor
Previous Attempts • WebForms • Silverlight
C#/Razor + HTML Blazor is an new .NET web framework using C# and HTML that runs in the browser. Browser + Razor = Blazor
Just the FAQs What it is • Client Side C# • Web Standard Technologies • WebAssembly • .NET Standard What it’s NOT • A Plugin • ASP.NET WebForms • Trans-piled JavaScript
Key Differences Blazor • .NET Standard Libs • MS Build • C# JavaScript • NPM Packages • WebPack • TypeScript / JavaScript
@EdCharbeneau #WASM
WebAssembly (wasm) WebAssembly is a web standard that defines an assembly-like format for executable code in Web pages. It’s what makes Blazor possible.
© 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. PUBLISHING COMPONENT MODEL FORMS & VALIDATION DEPENDENCY INJECTION AUTO REBUILDUNIT TESTING JAVASCRIPT INTEROP SERVER-SIDE RENDERING DEBUGGING INTELLISENSE & TOOLING LAYOUTS ASSEMBLY TRIMMING COMPONENT PACKAGES ROUTING Blazor
13 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. Blazor: Client & Server https://... DOM Razor Components .NET WebAssembly https... DOM ASP.NET Core SignalR Razor Components .NET
14 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. How Client-Side Works https://... Engine Compiler Byte Code DOM Parser Foo.js
15 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. How Client-Side Works https://... DOM Engine Parser Compiler Byte Code Foo.wasm Parser Compiler
16 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. How Client-Side Works https://... DOM Enginemono.wasm .NET Runtime
17 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. How Client-Side Works https://... DOM.NET Runtime .NET Application App.dll
18 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. https... How Server-Side Works ASP.NET Core .NET Runtime SignalR Blazor.server.js DOM
19 © 2019 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. At a Glance Client-Side  Low-no server overhead  RESTful  Offline & PWA capable  Larger payload size  Disconnected Environment  Supported May 2020 Server-Side  Tiny Payload Size  Less Abstraction  Pre-Rendering  Supported Today  Connection Required  Server Resources
Components
Routing @page "/RouteParameter" @page "/RouteParameter/{text}" <h1>Blazor is @Text!</h1>
Dependency Injection @inject HttpClient Http @code { WeatherForecast[] forecasts; protected override async Task OnInititalizedAsync() { forecasts = await Http.GetJsonAsync<WeatherForecast[]>(uri); } }
@EdCharbeneau #Blazor
Prerequisites • .NET Core 3.1 Preview Latest • Visual Studio 2019 Preview
File > New Project • Blazor WebAssembly • Blazor Server
Demo Time @EdCharbeneau #Blazor
The Future @EdCharbeneau
Blazor on the desktop?
Ed Charbeneau
Twitch.tv/EdCharbeneau
Resources • Links – Blogs.Telerik.com – EdCharbeneau.com – Twitch.tv/EdCharbeneau – Blazor.net – codemag.com/Magazine/Issue/netcore3 • Twitter – @EdCharbeneau
Ed Charbeneau Developer Advocate for Progress<Telerik> Author<T> Twitter.Where(user == @EdCharbeneau)
Workshop Time @EdCharbeneau #Blazor aka.ms/blazorworkshop

Goodbye JavaScript Hello Blazor

Editor's Notes

  • #7 WebForms tried to be stateful web Silverlight didn’t conform to web standards
  • #11 Even if your not a .NET Developer, this is exciting
  • #13 Blazor is a fully featured single page application framework by Microsoft It has a huge ecosystem of .NET packages on NuGet because it’s compatible with .NET standard
  • #14 Blazor is independent of it’s hosting model This means we have options when hosting host Blazor applications. The most common options are Client-Side, and Server-Side hosting. Let’s discuss the two options starting with Client-Side Blazor.
  • #15 In a typical application JavaScript is downloaded by the browser It is then parsed, compiled, and turned into byte code before it can execute.
  • #16 A more modern approach is to use WebAssembly, which is a standard byte code browsers can execute. What makes WebAssembly different, is that it is parsed and compiled before it is delivered to the browser. Languages other than JavaScript, such as C++ can compile directly to WebAssembly byte code.
  • #17 Microsoft has taken the .NET runtime and compiled as web assembly. This makes it possible to run .NET code directly in the browser.
  • #18 This is how Blazor enables developers to write .NET code in a client-side web application. Because the .NET runtime is available on the client, we can utilize virtually any .NET Standard assembly.
  • #19 If we choose to host Blazor on the server
  • #27 Components - Data Binding - Code Behind - Http External Components BlazeDown
  • #34 Components - Data Binding - Code Behind - Http External Components BlazeDown