Blazor A new framework for browser-based .NET apps Ryan Nowak

Slides:



Advertisements
Similar presentations
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Advertisements

Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
Office 365 Development July 2014.
Ramping Up On The SharePoint Framework (SPFx)
Top 10 Entity Framework Features Every Developer Should Know
Introducing the Microsoft® .NET Framework
4/18/2018 1:15 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Office Add-ins: Make your solution a native part of Office
5/15/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
5/15/2018 5:43 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
DotnetConf 9/10/2018 7:49 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
What's new in the world of SharePoint development and deployment
Introduction to ASP.NET 2.0
ASP.NET Core: Web apps, cloud apps, and containers
TechEd /1/2018 7:56 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Office 365 Development July 2014.
The Modern ASP.NET Tech Stack!
SPC Developer 6/25/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Discover the New SharePoint Content Publishing Experiences
Visual Studio Tools for Office 2005
Presented by Kenny Duenke and Patrick Witbrod
Introducing ASP.NET Core 2.0
Microsoft Virtual Academy
Not Sure how you Should React
Microsoft Connect /17/ :55 PM
Introduction to SharePoint Framework (SPFx)
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
Myth Busting: Hosted Web Apps
Explore web development with Microsoft ASP.NET Core 1.0
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Microsoft Build /11/2018 2:12 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Microsoft Ignite NZ October 2016 SKYCITY, Auckland
Building Modern Web Apps with ASP.NET MVC 6
Explore web development with Microsoft ASP.NET Core 1.0
Slides and images stolen from “real” .NET Conf. presenters
Microsoft Build /14/ :29 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
The Application Lifecycle
Blazor C# in the Browser Derek codeopinion.com.
DotnetConf 11/17/ :06 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Web Development Using ASP .NET
Microsoft Virtual Academy
Office 365 Development July 2014.
SharePoint hosting 101 Where do I host my apps?
Learn. Imagine. Build. .NET Conf
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
Microsoft Connect /26/2018 6:08 PM
Microsoft Connect /1/2018 2:36 AM
TechEd /9/2018 4:17 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Introducing the .NET Framework
TechEd /18/ :08 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
SharePoint 2019 Overview and Use SPFx Extensions
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Office 365 Development.
2/24/2019 6:15 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
SharePoint Development
.NET Conf 2018 Keynote Jose Barbosa Aaron Amm Theeranit.
Azure Active Directory
Blazor C# running in the browser via WebAssembly
Introduction to ASP.NET Parts 1 & 2
Mark Quirk Head of Technology Developer & Platform Group
8/23/ :09 PM #DEV332 Building Modern, HTML5-Based Business Apps on Windows Azure and Office 365 with Visual Studio LightSwitch Andrew
The Future is Now with ASP.NET Core 3.0
Running C# in the browser
WebAssembly: The Browser is your OS
Visual Studio 2005 IDE Features
Presentation transcript:

Blazor A new framework for browser-based .NET apps Ryan Nowak 9/11/2019 11:44 PM Blazor A new framework for browser-based .NET apps Ryan Nowak Developer & Architect, ASP.NET Core @aVerySpicyBoi Demos and presentations Greet audience and intro self ASP.Net Core team Working on Blazor for over a year Part of Blazor experiment Excited to finally ship something that we can slap a “supported” label on © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

C# Blazor Build client-side web UI with .NET instead of JavaScript 9/11/2019 11:44 PM Blazor Build client-side web UI with .NET instead of JavaScript Write reusable web UI components with C# and Razor Share .NET code with both the client and the server Call into JavaScript libraries & browser APIs as needed What is Blazor? - Blazor is a new UI framework that’s simple and fun to use - Blazor is component-based, influence by JS frameworks, takes the parts that we think work well in C# - Blazor is the next step for Razor and adds new powerful capabilities - Gives you real .NET – use netstandard libraries C# © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Demo: Build client web UI with Blazor 9/11/2019 11:44 PM Demo: Build client web UI with Blazor [Start 2M] Show navigation without a refresh Create a new project and show the counter page Counter proves that we can handle events without a refresh Add increment count, show that we can write code Leave demo running and come back © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9/11/2019 11:44 PM .NET [Start 3M] Where Blazor began… WebAssembly means any language can run in the browser No plugins are requires Driven by web standards Supported in all modern browsers included mobile Low level instruction language like .NET’s Common Instruction Language What’s common today: compiling C/C++ or Rust to wasm How does .NET Plug in to this? (next slide) © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

How client-side Blazor works 9/11/2019 11:44 PM How client-side Blazor works https://... Razor Components DOM To make .NET work in the browser, we compile the Mono runtime to webassembly. This makes sense because Mono has been built with a lot of flexibility, it supports a variety of different execution environments. This means that your application dlls (for right now) don’t compile directly to web assembly, they are .NET IL. Go back to browser and show .NET dlls in the network tab. So what’s good about this? Well for starters, the fact that we’re running real .NET dlls means that we have a real .NET runtime. Features like reflection *just work*. However, we also have some limitations, and I want to convince you that’s a *good thing*. WebAssembly (and Blazor) runs in the browser’s security sandbox - No access to local filesystem, no ability to break the users computer - Your application has to get its data from remote services over HTTP .NET WebAssembly © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Demo: Server Side Blazor 9/11/2019 11:44 PM Demo: Server Side Blazor [Start 8M] Open the app and show how quickly it loads, point out that we don’t have “loading…”. Show the network tab and show how there are no dlls. Add a counter component and show the web socket traffic © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

One Framework – two hosting models 9/11/2019 11:44 PM One Framework – two hosting models Client-side Server-side https://... https... DOM Razor Components .NET WebAssembly ASP.NET Core DOM Razor Components .NET [start 12M] We’re building a programming model where the same components can run on the server or in web assembly. You might prefer one model or the other depending on your requirements Client-side Blazor has a slower loading time because it has to download the app, but once its downloaded it executes fully in the browser and can run offline Server-side Blazor has a faster loading time but requires a connection Client-side Blazor will ship in .NET 5 Server-side Blazor will ship in .NET Core 3.0 because CoreCLR is already great SignalR .NET 5!!! .NET Core 3.0 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

.NET 5 https://devblogs.microsoft.com/dotnet/introducing-net-5/ 9/11/2019 11:44 PM .NET 5 .NET 5 includes a grand unification of the best parts of Mono and https://devblogs.microsoft.com/dotnet/introducing-net-5/ © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Blazor for WebAssembly now in official preview! Build client-side web UI with .NET instead of JavaScript Write reusable web UI components with C# and Razor Share .NET code with both the client and the server Call into JavaScript libraries & browser APIs as needed Blazor for WebAssembly now in official preview! C#

Demo: Let’s learn some Blazor 9/11/2019 11:44 PM Demo: Let’s learn some Blazor [start 17M] Now we’re going to do some coding. That’s what you’re all here for right? I’m also going to lean on some new features that are being adding in 3.0 preview 6. Demo: create mat design TODO list with EF [start 17m] Checkpoint 1: Let’s write the UI for a simple TODO list on a single page with input and bind and a ul [start 23m] Checkpoint 2: Now that we have this, it might be good to refactor so we can clean up the UI. [start 27m] Checkpoint 3: So we refactored the code into components, let’s add some material design pizzazz. Explain the static files stuff [start 34m] Checkpoint 4: Now the UI looks great, let’s add a database. Now this is a normal SQL server database with EF core. Because we’re doing Blazor server-side we can *just* do that. [start 39m] Checkpoint 5: What’s not great about this is that we could see delays where the UI doesn’t update. Let’s dig into the material design components and add a progress bar. Break for now. © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Pages & Views with Components 9/11/2019 11:44 PM Pages & Views with Components ASP.NET Core Request https... DOM Page / View HttpContext SignalR [start 43m] UI events / DOM updates Component Response State © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Demo: Pages & Views with Components 9/11/2019 11:44 PM Demo: Pages & Views with Components [start 45M] Checkpoint 6: Now who out there has existing apps. Wouldn’t it be great if you could enhance your existing apps with new components features. Here we have a Razor Page that’s displaying the list of TODO items as a static page. The UI is pretty ho-hum, it would be nice if we could reuse something that we already created. [start 50M] Checkpoint 7: Let’s add authorization © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

One Framework – two hosting models 9/11/2019 11:44 PM One Framework – two hosting models Client-side Server-side https://... https... DOM Razor Components .NET WebAssembly ASP.NET Core DOM Razor Components .NET [start 53M] SignalR .NET 5!!! .NET Core 3.0 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Schedule .NET Core 3.0 Preview 5 - Now available! Preview 6 - *soon* 9/11/2019 11:44 PM Schedule .NET Core 3.0 Preview 5 - Now available! Preview 6 - *soon* Preview 7 (go-live) - July (more previews go here) GA - Sept Blazor for WebAssembly Updates with .NET Core 3.0, but will GA sometime later [start 53M] © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Build your own pizza store UI with Blazor If you want to learn more, the team have built a Blazor workshop – available through this link - Developed in the open over a period of 1+ years - Great community participation and feedback - Works with latest .NET Core Preview and Visual Studio Preview - Visual Studio Previews are side-by-side, easy to install and easy to remove - Show how many VS installs I have https://aka.ms/blazorworkshop

What’s coming in Preview 6 Authentication & authorization @namespace @code Directive attributes Embeded static content New `key` intrinsic for component/element preservation in lists

Try Blazor today! Blazor: https://blazor.net 9/11/2019 11:44 PM Try Blazor today! Blazor: https://blazor.net Docs: https://blazor.net/docs .NET Core 3.0: https://dot.net/get-core3 Visual Studio: https://visualstudio.com/preview Workshop: https://aka.ms/blazorworkshop © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9/11/2019 11:44 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.