SlideShare a Scribd company logo
Blazor
An Introduction
Before we begin
● Blog post from last week
○ https://bit.ly/2EujDZu
● Because self plagiarism is
cool
● But I just cited my source,
so is it self plagiarism?
What?! What is this?
What Is Blazor?
● New tech
● Web Assembly
● .NET in the browser!
heresy
● Pretty cool
● ASP.NET Core 2.1
● Is currently at version 0.1.0
○ 0.2.0 is due in around a week
○ Date subject to change, obvs
● Not really
● Based on .NET Anywhere
initial commit: Aug 28, 2010
● Was left for 6 years
most recent commit: Jan 23, 2012
● Steve Sanderson ran with it
● Early demo @ NDC Oslo 2017
How New?
Vague Timeline - Not To Scale
August 2010
.NET Anywhere
initial commit
March 22nd, 2018
Public Preview
Announced
May 25th, 2017
Steve Sanderson
Blazor initial commit
Sept 3rd, 2017
.NET Anywhere is
abandoned
Summer 2017
ASP.NET Core team
hold an internal
hackathon at Microsoft,
working on Blazor
June 2017
Steve Sanderson
shows Blazor off at
NDC Oslo
April 3rd, 2018
ASP.NET Community
Standup showing off
Blazor public preview
March 27th, 2018
Internal hackathon/lab
at work using Blazor
March 2017,
Web Assembly 1.0
released
Today
???
Steve Sanderson
discovers .NET
Anywhere
How? How does it work?
A Quick Reminder
How Does It Work?
● Web Assembly creates Mono env
● Mono env loads Your DLL
● Your DLL loads it’s dependencies
● Voila!
Kinda
With Pictures
Non-Pokémon Version
● ASP NET Core Middleware
○ app.UseBlazor<Client.Program>();
● Looks for
○ <script type="blazor-boot"></script>
● Is replaced at runtime by
○ blazor.js
● Which calls
○ Mono.js
● Which creates a WebAssembly instance
● Which loads the app
Process
Warning!
● Before .NET Core 2.1 Preview 1:
○ No IL Shaking
○ Blazor apps were HUGE!
● After .NET Core 2.1 Preview 1:
○ Full IL Shaking
○ Blazor apps are small
IL Shaking
● Bloody Clever
● Looks at referenced DLLS
● Re-builds them; only what you’re calling
● Serves them in place of “full” DLLs
UI? What About The UI?
How Do I UI?
● Blazor Components
● Looks like Razor
● Dealt with like TagHelpers/Angular Components
<div id="search-area">
<RandomPokemonSearch OnGetPokemon=state.GetPokemon/>
</div>
Dan Roth
● Senior Program Manager on the ASP.NET team
● Is Steve Sanderson’s boss
Steve Sanderson
● Program Manager on the ASP.NET team
● Invented Knockout.js
Blazor components are a little different [to Razor Pages]. They are similar to stuff that you do on the server in that they're
both using the Razor syntax. You're using C# and HTML to decide, like, what markup you want.
But on the server what's really happening is your basically generating HTML as, effectively, a string, then you're sending it
down to the browser and having the browser render that HTML doing it's normal thing.
With Blazor components it's actually a little different. We take the Razor files, these cshtml files, and just like on the server,
they do get compiled into a class, and it's the class that basically has the compile functionality for generating the
corresponding markup.
But in Blazor those classes get downloaded actually into the browser as a DLLs. Whereas on the server side you're just
download a string, with Blazor you're downloading the compiled classes.
And then client side in the browser the Blazor runtime will ask components to render and those components will render
their markup, using the logic that you specify, into a Rendering Tree. And then Blazor's runtime will handle updating the
DOM in the browser, based on off of that rendering tree.
And as components change, and they re-render themselves, [Blazor’s runtime] will diff the new Rendering Tree that the
component just created with the current one and update the DOM accordingly, making it very efficient so you're not
touching the DOM too much. Like, you're basically doing it as little as you can.
It’s About to Get Technical
<div id="search-area">
<RandomPokemonSearch OnGetPokemon=state.GetPokemon/>
</div>
<div class="row">
<div class="ui two column centered grid">
<input type="text" @bind(PokemonId) />
</div>
<div class="ui two column centered grid">
<button @onclick(() => OnGetPokemon(PokemonId)) type="button" class="ui
secondary button">Search</button>
</div>
</div>
@functions
{
public Func<string, Task> OnGetPokemon { get; set; }
public string PokemonId { get; set; }
}
public class PokeState {
public Pokemon PokemonSearchResult { get; private set; }
public bool SearchInProgress { get; private set; }
public event Action OnChange;
private readonly HttpClient http;
public PokeState(HttpClient httpInstance) { http = httpInstance; }
public async Task GetPokemon(string id) {
SearchInProgress = true;
NotifyStateChanged();
PokemonSearchResult = await
http.GetJsonAsync<Pokemon>($"https://pokeapi.co/api/v2/pokemon/{id}/");
SearchInProgress = false;
NotifyStateChanged();
}
private void NotifyStateChanged() => OnChange?.Invoke();
}
Code Show Me The Codes!
PokeBlazor
Requirements? What Do I Need In Order To Blazor?
Tooling
● .NET Core SDK 2.1.300 Preview 1
○ OR .NET Core SDK 2.1 Preview 2
● dotnet new -i Microsoft.AspNetCore.Blazor.Templates
● Visual Studio 15 (2017) Preview
● ASP.NET Core Blazor Language Services (visx)
● That’s about it
Clients
● Any “Modern” Browser
○ Although IE and Edge don’t run Blazor at full speed
Why? What Is It Good For?
What Is Blazor Good At
● Single Page Applications
● Esp. if there’s an API to talk to
● Totally RAD and epically Agile
● I’m building a blogging engine with it!
○ Am I mad?
○ Yes!
○ Will it work?
○ Maybe!
Pitfalls Don’t Fall For These!
Lookout Below!
● Client => Make a change
● Server => stop and start
● There is no live reload
○ AKA Hot Module Replacement
○ Supposed to be in the 0.2.0 preview
○ “One update for the Blazor 0.2.0 preview release: we've hit a snag getting live reload working
properly, so it's not going to make it into 0.2.0. We'll revisit it again for a future preview
release”
● Docker!
○ Client’s wwwroot dir needs to be included manually
○ Otherwise Static files middleware steps in, with it’s big soviet boots
What Can Blazor Do?
● Anything JS can do
○ I can do better/I can do anything better than...
○ Whoops, everyone’s looking
○ Quick! Act nonchalant
● You can’t create TCP connections in Blazor
○ That’s a great example
○ Shh! They’re reading this bit
Exceptional Exceptions
● Remember:
○ Your .NET code is running within WASM
● When an exception occurs:
○ Bubbles up to WASM
○ WASM converts it to a JS error
○ JS error is reported via mono.js
○ JS error is printed to the console
○ App continues to run
Resources? Where Can I Learn The Things?
Learning The Stuff
● https://www.youtube.com/watch?v=_b_fUq5DU0U
○ Last week’s community standup
● https://learn-blazor.com
● https://codedaze.io/tag/blazor/
● https://github.com/torhovland/realworld
○ Is a clone of Medium (the blogging engine)
○ Uses a whole bunch of different technologies
Blazor Examples
● https://pokeblazor.azurewebsites.net
○ Clearly the greatest app in the world
● https://blazor-whois.azurewebsites.net
○ Pre IL Shaking
○ Takes 40-70 seconds to download
● https://kojin.azurewebsites.net/
○ Colleague’s App
Questions? Are There Any?

More Related Content

What's hot

Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
Ritesh Mehrotra
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo Fadojutimi
Temitayo Fadojutimi
 
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
Blazor Full-Stack
Blazor Full-StackBlazor Full-Stack
Blazor Full-Stack
Ed Charbeneau
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net framework
Ashish Verma
 
Angular overview
Angular overviewAngular overview
Angular overview
Thanvilahari
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
React js
React jsReact js
React js
Rajesh Kolla
 
Javascript
JavascriptJavascript
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
Krishnaprasad k
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
SHADAB ALI
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
Christoffer Noring
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 
NEXT.JS
NEXT.JSNEXT.JS
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
Jonathan Goode
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
Rajkumarsoy
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
Thanh Tuong
 

What's hot (20)

Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo Fadojutimi
 
Reactjs
Reactjs Reactjs
Reactjs
 
Blazor Full-Stack
Blazor Full-StackBlazor Full-Stack
Blazor Full-Stack
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
 
Microsoft dot net framework
Microsoft dot net frameworkMicrosoft dot net framework
Microsoft dot net framework
 
Angular overview
Angular overviewAngular overview
Angular overview
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
React js
React jsReact js
React js
 
Javascript
JavascriptJavascript
Javascript
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
NEXT.JS
NEXT.JSNEXT.JS
NEXT.JS
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 

Similar to Blazor - An Introduction

You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
Igalia
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
Horacio Gonzalez
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
Horacio Gonzalez
 
2016 stop writing javascript frameworks by Joe Gregorio
2016 stop writing javascript frameworks by Joe Gregorio2016 stop writing javascript frameworks by Joe Gregorio
2016 stop writing javascript frameworks by Joe Gregorio
David Zapateria Besteiro
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
Neoito
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
Alive Kuo
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
Slobodan Lohja
 
Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
Women in Technology Poland
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
Bruce Li
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
Women in Technology Poland
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
Ontico
 
KharkivJS: Flaws of the Web Components in 2019 and how to address them
KharkivJS: Flaws of the Web Components in 2019 and how to address themKharkivJS: Flaws of the Web Components in 2019 and how to address them
KharkivJS: Flaws of the Web Components in 2019 and how to address them
Vlad Fedosov
 
BDD using behat
BDD using behatBDD using behat
BDD using behat
Pascal Larocque
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
Mario García
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
Chui-Wen Chiu
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD Pipelines
Drew Hansen
 
Devoxx France - Web Components, Polymer et Material Design
Devoxx France -  Web Components, Polymer et Material DesignDevoxx France -  Web Components, Polymer et Material Design
Devoxx France - Web Components, Polymer et Material Design
Horacio Gonzalez
 
Dust.js
Dust.jsDust.js
MyReplayInZen
MyReplayInZenMyReplayInZen
MyReplayInZen
Viacheslav Eremin
 
Viacheslav Eremin interview about DOT NET (eng lang)
Viacheslav Eremin interview about DOT NET (eng lang)Viacheslav Eremin interview about DOT NET (eng lang)
Viacheslav Eremin interview about DOT NET (eng lang)
Viacheslav Eremin
 

Similar to Blazor - An Introduction (20)

You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
 
2016 stop writing javascript frameworks by Joe Gregorio
2016 stop writing javascript frameworks by Joe Gregorio2016 stop writing javascript frameworks by Joe Gregorio
2016 stop writing javascript frameworks by Joe Gregorio
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan KrausHTML, CSS & Javascript Architecture (extended version) - Jan Kraus
HTML, CSS & Javascript Architecture (extended version) - Jan Kraus
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
 
KharkivJS: Flaws of the Web Components in 2019 and how to address them
KharkivJS: Flaws of the Web Components in 2019 and how to address themKharkivJS: Flaws of the Web Components in 2019 and how to address them
KharkivJS: Flaws of the Web Components in 2019 and how to address them
 
BDD using behat
BDD using behatBDD using behat
BDD using behat
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD Pipelines
 
Devoxx France - Web Components, Polymer et Material Design
Devoxx France -  Web Components, Polymer et Material DesignDevoxx France -  Web Components, Polymer et Material Design
Devoxx France - Web Components, Polymer et Material Design
 
Dust.js
Dust.jsDust.js
Dust.js
 
MyReplayInZen
MyReplayInZenMyReplayInZen
MyReplayInZen
 
Viacheslav Eremin interview about DOT NET (eng lang)
Viacheslav Eremin interview about DOT NET (eng lang)Viacheslav Eremin interview about DOT NET (eng lang)
Viacheslav Eremin interview about DOT NET (eng lang)
 

Recently uploaded

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 

Recently uploaded (20)

Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 

Blazor - An Introduction

  • 2. Before we begin ● Blog post from last week ○ https://bit.ly/2EujDZu ● Because self plagiarism is cool ● But I just cited my source, so is it self plagiarism?
  • 4. What Is Blazor? ● New tech ● Web Assembly ● .NET in the browser! heresy ● Pretty cool ● ASP.NET Core 2.1 ● Is currently at version 0.1.0 ○ 0.2.0 is due in around a week ○ Date subject to change, obvs
  • 5. ● Not really ● Based on .NET Anywhere initial commit: Aug 28, 2010 ● Was left for 6 years most recent commit: Jan 23, 2012 ● Steve Sanderson ran with it ● Early demo @ NDC Oslo 2017 How New?
  • 6. Vague Timeline - Not To Scale August 2010 .NET Anywhere initial commit March 22nd, 2018 Public Preview Announced May 25th, 2017 Steve Sanderson Blazor initial commit Sept 3rd, 2017 .NET Anywhere is abandoned Summer 2017 ASP.NET Core team hold an internal hackathon at Microsoft, working on Blazor June 2017 Steve Sanderson shows Blazor off at NDC Oslo April 3rd, 2018 ASP.NET Community Standup showing off Blazor public preview March 27th, 2018 Internal hackathon/lab at work using Blazor March 2017, Web Assembly 1.0 released Today ??? Steve Sanderson discovers .NET Anywhere
  • 7. How? How does it work?
  • 9. How Does It Work? ● Web Assembly creates Mono env ● Mono env loads Your DLL ● Your DLL loads it’s dependencies ● Voila! Kinda
  • 11. Non-Pokémon Version ● ASP NET Core Middleware ○ app.UseBlazor<Client.Program>(); ● Looks for ○ <script type="blazor-boot"></script> ● Is replaced at runtime by ○ blazor.js ● Which calls ○ Mono.js ● Which creates a WebAssembly instance ● Which loads the app
  • 13. Warning! ● Before .NET Core 2.1 Preview 1: ○ No IL Shaking ○ Blazor apps were HUGE! ● After .NET Core 2.1 Preview 1: ○ Full IL Shaking ○ Blazor apps are small
  • 14. IL Shaking ● Bloody Clever ● Looks at referenced DLLS ● Re-builds them; only what you’re calling ● Serves them in place of “full” DLLs
  • 15. UI? What About The UI?
  • 16. How Do I UI? ● Blazor Components ● Looks like Razor ● Dealt with like TagHelpers/Angular Components <div id="search-area"> <RandomPokemonSearch OnGetPokemon=state.GetPokemon/> </div>
  • 17. Dan Roth ● Senior Program Manager on the ASP.NET team ● Is Steve Sanderson’s boss Steve Sanderson ● Program Manager on the ASP.NET team ● Invented Knockout.js
  • 18. Blazor components are a little different [to Razor Pages]. They are similar to stuff that you do on the server in that they're both using the Razor syntax. You're using C# and HTML to decide, like, what markup you want. But on the server what's really happening is your basically generating HTML as, effectively, a string, then you're sending it down to the browser and having the browser render that HTML doing it's normal thing. With Blazor components it's actually a little different. We take the Razor files, these cshtml files, and just like on the server, they do get compiled into a class, and it's the class that basically has the compile functionality for generating the corresponding markup. But in Blazor those classes get downloaded actually into the browser as a DLLs. Whereas on the server side you're just download a string, with Blazor you're downloading the compiled classes. And then client side in the browser the Blazor runtime will ask components to render and those components will render their markup, using the logic that you specify, into a Rendering Tree. And then Blazor's runtime will handle updating the DOM in the browser, based on off of that rendering tree. And as components change, and they re-render themselves, [Blazor’s runtime] will diff the new Rendering Tree that the component just created with the current one and update the DOM accordingly, making it very efficient so you're not touching the DOM too much. Like, you're basically doing it as little as you can.
  • 19. It’s About to Get Technical <div id="search-area"> <RandomPokemonSearch OnGetPokemon=state.GetPokemon/> </div>
  • 20. <div class="row"> <div class="ui two column centered grid"> <input type="text" @bind(PokemonId) /> </div> <div class="ui two column centered grid"> <button @onclick(() => OnGetPokemon(PokemonId)) type="button" class="ui secondary button">Search</button> </div> </div> @functions { public Func<string, Task> OnGetPokemon { get; set; } public string PokemonId { get; set; } }
  • 21. public class PokeState { public Pokemon PokemonSearchResult { get; private set; } public bool SearchInProgress { get; private set; } public event Action OnChange; private readonly HttpClient http; public PokeState(HttpClient httpInstance) { http = httpInstance; } public async Task GetPokemon(string id) { SearchInProgress = true; NotifyStateChanged(); PokemonSearchResult = await http.GetJsonAsync<Pokemon>($"https://pokeapi.co/api/v2/pokemon/{id}/"); SearchInProgress = false; NotifyStateChanged(); } private void NotifyStateChanged() => OnChange?.Invoke(); }
  • 22. Code Show Me The Codes!
  • 24. Requirements? What Do I Need In Order To Blazor?
  • 25. Tooling ● .NET Core SDK 2.1.300 Preview 1 ○ OR .NET Core SDK 2.1 Preview 2 ● dotnet new -i Microsoft.AspNetCore.Blazor.Templates ● Visual Studio 15 (2017) Preview ● ASP.NET Core Blazor Language Services (visx) ● That’s about it
  • 26. Clients ● Any “Modern” Browser ○ Although IE and Edge don’t run Blazor at full speed
  • 27. Why? What Is It Good For?
  • 28. What Is Blazor Good At ● Single Page Applications ● Esp. if there’s an API to talk to ● Totally RAD and epically Agile ● I’m building a blogging engine with it! ○ Am I mad? ○ Yes! ○ Will it work? ○ Maybe!
  • 29. Pitfalls Don’t Fall For These!
  • 30. Lookout Below! ● Client => Make a change ● Server => stop and start ● There is no live reload ○ AKA Hot Module Replacement ○ Supposed to be in the 0.2.0 preview ○ “One update for the Blazor 0.2.0 preview release: we've hit a snag getting live reload working properly, so it's not going to make it into 0.2.0. We'll revisit it again for a future preview release” ● Docker! ○ Client’s wwwroot dir needs to be included manually ○ Otherwise Static files middleware steps in, with it’s big soviet boots
  • 31. What Can Blazor Do? ● Anything JS can do ○ I can do better/I can do anything better than... ○ Whoops, everyone’s looking ○ Quick! Act nonchalant ● You can’t create TCP connections in Blazor ○ That’s a great example ○ Shh! They’re reading this bit
  • 32. Exceptional Exceptions ● Remember: ○ Your .NET code is running within WASM ● When an exception occurs: ○ Bubbles up to WASM ○ WASM converts it to a JS error ○ JS error is reported via mono.js ○ JS error is printed to the console ○ App continues to run
  • 33. Resources? Where Can I Learn The Things?
  • 34. Learning The Stuff ● https://www.youtube.com/watch?v=_b_fUq5DU0U ○ Last week’s community standup ● https://learn-blazor.com ● https://codedaze.io/tag/blazor/ ● https://github.com/torhovland/realworld ○ Is a clone of Medium (the blogging engine) ○ Uses a whole bunch of different technologies
  • 35. Blazor Examples ● https://pokeblazor.azurewebsites.net ○ Clearly the greatest app in the world ● https://blazor-whois.azurewebsites.net ○ Pre IL Shaking ○ Takes 40-70 seconds to download ● https://kojin.azurewebsites.net/ ○ Colleague’s App

Editor's Notes

  1. https://dotnetcore.gaprogmaxn.com/2018/04/05/blazor-you-want-to-run-net-where/
  2. .net anywhere repo: https://github.com/chrisdunelm/DotNetAnywhere NDC 2017: https://www.youtube.com/watch?v=MiLAE6HMr10
  3. Microsoft hackathon: https://github.com/aspnet/Blazor-Hackathon .NET Anywhere abandoned: https://github.com/chrisdunelm/DotNetAnywhere/commit/083b831656fa37f39f37a05b08ccc98d84919366 NDC 2017: https://www.youtube.com/watch?v=MiLAE6HMr10 ASP.NET Community Standup showing off Blazor: https://www.youtube.com/watch?v=_b_fUq5DU0U
  4. https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7 <- devs should get this https://codeshare.co.uk/blog/what-is-net-core-7-things-you-should-know/ <- point 7 (non-devs should get this)
  5. 1st gen: ASP.NET Core Middleware (UseBlazor<T>) 2nd gen: Looks for script tag (type="blazor-boot") 3rd gen: Is replaced by blazor.js 4th gen: Which calls Mono.js 5th gen: Which calls monno.wasm, creating a .NET platform 6th gen: Which calls your app
  6. Have Rider open, with Pokeblazor loaded Blazor.js loads Mono.js Mono.js loads Web Assembly (via mono.wasm) Web Assembly sets up a Mono environement Mono loads your compiled .NET binary You .NET binary loads all of it’s dependencies
  7. Two fire icons are Blazor.js (left) and Blazor runtime (right)
  8. Site: https://blazor-whois.azurewebsites.net/
  9. “The Blazor components look a lot like Razor Pages, are they the same?” For those who want to look it up, it’s at 22 minutes and 47 seconds https://www.youtube.com/watch?v=_b_fUq5DU0U
  10. Transition to https://pokeblazor.azurewebsites.net
  11. Transition to https://pokeblazor.azurewebsites.net
  12. Check out the code at https://github.com/GaProgMan/PokeBlazor
  13. Blazor in docker issue: https://github.com/aspnet/Blazor/issues/376