SlideShare una empresa de Scribd logo
1 de 20
.NET Conf Latinoamérica 2021
Novedades en Blazor
con .NET 6
Héctor Pérez - elcamino.dev
Miguel Teheran - Mteheran.dev
.NET Conf Latinoamérica 2021
Mejor rendimiento!
.NET Conf Latinoamérica 2021
Nueva plantilla para Blazor
• Implicit using por defecto
• Top-level statements por defecto
• Bootstrap 5.1 sin dependencia de javascript
• CSS isolated por defecto
.NET Conf Latinoamérica 2021
Puerto Aleatorio
.NET Conf Latinoamérica 2021
Hot Reload - Recarga automatica
Visual Studio 2022
.NET Conf Latinoamérica 2021
Error boundaries
Manejo de errores no controlados o excepciones dentro de los
componentes
<div class="main">
<div class="content px-4">
<ErrorBoundary>
@Body
</ErrorBoundary>
</div>
</div>
.NET Conf Latinoamérica 2021
PageTitle y HeadContent
Definición de títulos para páginas y Head Elements
<PageTitle>Index</PageTitle>
<HeadContent>
<meta name="description" content=".NET CONF"/>
</HeadContent>
.NET Conf Latinoamérica 2021
Required parameter - parámetro requerido
[Parameter]
[EditorRequired]
public string Title { get; set; }
[Parameter, EditorRequired]
public string Title { get; set; }
.NET Conf Latinoamérica 2021
Manipulación de Query String
[SupplyParameterFromQuery]
https://localhost:7087/counter?CurrentCount=22
.NET Conf Latinoamérica 2021
Render components from JavaScript
Podemos invocar componentes desde Javascript y renderizarlos
en cualquier momento
let containerElement = document.getElementById('my-counter');
await Blazor.rootComponents.add(containerElement, 'counter', {
incrementAmount: 10 });
.NET Conf Latinoamérica 2021
Render components from JavaScript
(Registro)
builder.Services.AddServerSideBlazor(options =>
{
options.RootComponents.RegisterForJavaScript<Counter>(identifier: "counter");
});
builder.RootComponents.RegisterForJavaScript<Counter>(identifier: "counter");
Blazor Server:
Blazor WebAssembly:
.NET Conf Latinoamérica 2021
Dynamically-rendered Components
Podemos cargar componentes de manera dinámica indicando el
tipo
<DynamicComponent Type="@componentType" Parameters="@parameters" />
@code {
private Type componentType = ...;
private IDictionary<string, object> parameters = ...;
}
.NET Conf Latinoamérica 2021
Focus an element on navigation
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
.NET Conf Latinoamérica 2021
Generate Angular and React components
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.RegisterForAngular<MyComponent>(); // Register for Angular
builder.RootComponents.RegisterForReact<MyComponent>(); // Register for React
Funcionalidad experimental para generar componentes
específicos para React.js y Angular
samples/samples/aspnetcore/blazor/JSComponentGeneration at main · aspnet/samples (github.com)
.NET Conf Latinoamérica 2021
AOT compilation (Without AOT)
.NET Conf Latinoamérica 2021
AOT compilation (With AOT)
.NET Conf Latinoamérica 2021
.NET Conf Latinoamérica 2021
.NET Conf Latinoamérica 2021
Datos de contacto
Miguel Teheran
mteheran.dev
@mteheran
Héctor Pérez
elcamino.dev
.NET Conf Latinoamérica 2021
¡Gracias!

Más contenido relacionado

La actualidad más candente (8)

3. Crear Formularios Web Forms
3.  Crear Formularios Web Forms3.  Crear Formularios Web Forms
3. Crear Formularios Web Forms
 
ASP.NET MVC - Introducción a ASP.NET MVC
ASP.NET MVC - Introducción a ASP.NET MVCASP.NET MVC - Introducción a ASP.NET MVC
ASP.NET MVC - Introducción a ASP.NET MVC
 
Python django
Python djangoPython django
Python django
 
Mvc
MvcMvc
Mvc
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Jsp
JspJsp
Jsp
 
ASP .NET MVC: Desarrollo web con el patrón MVC
ASP .NET MVC: Desarrollo web con el patrón MVCASP .NET MVC: Desarrollo web con el patrón MVC
ASP .NET MVC: Desarrollo web con el patrón MVC
 
3. crear formularios web forms
3.  crear formularios web forms3.  crear formularios web forms
3. crear formularios web forms
 

Similar a Mejoras en Blazor con .NET 6

Programación básica de html5
Programación básica de html5Programación básica de html5
Programación básica de html5
Coka Medel
 
2009 05-07-tutorial asp.net
2009 05-07-tutorial asp.net2009 05-07-tutorial asp.net
2009 05-07-tutorial asp.net
Sandy Contreras
 
HTML5 por Gustavo Vilchez
HTML5 por Gustavo VilchezHTML5 por Gustavo Vilchez
HTML5 por Gustavo Vilchez
Gustavo
 

Similar a Mejoras en Blazor con .NET 6 (20)

ASP.NET MVC Core
ASP.NET MVC CoreASP.NET MVC Core
ASP.NET MVC Core
 
ASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard TomàsASP.NET MVC Core by Eduard Tomàs
ASP.NET MVC Core by Eduard Tomàs
 
Codeigniter101
Codeigniter101Codeigniter101
Codeigniter101
 
Web matrix session2
Web matrix session2Web matrix session2
Web matrix session2
 
Presentación sobre Display Suite en el Drupal Day Valencia 2012
Presentación sobre Display Suite en el Drupal Day Valencia 2012Presentación sobre Display Suite en el Drupal Day Valencia 2012
Presentación sobre Display Suite en el Drupal Day Valencia 2012
 
Programación básica de html5
Programación básica de html5Programación básica de html5
Programación básica de html5
 
Dce2 ejercicios asp.net
Dce2 ejercicios asp.netDce2 ejercicios asp.net
Dce2 ejercicios asp.net
 
Más Mujeres en SEO Clase 2 - Paula Alvarez
Más Mujeres en SEO Clase 2 - Paula AlvarezMás Mujeres en SEO Clase 2 - Paula Alvarez
Más Mujeres en SEO Clase 2 - Paula Alvarez
 
01. Creando documentos HTML5
01. Creando documentos HTML501. Creando documentos HTML5
01. Creando documentos HTML5
 
Guía Practica conexión BD 2021
Guía Practica conexión BD  2021Guía Practica conexión BD  2021
Guía Practica conexión BD 2021
 
Primeros pasos Symfony PHPVigo
Primeros pasos Symfony PHPVigoPrimeros pasos Symfony PHPVigo
Primeros pasos Symfony PHPVigo
 
2009 05-07-tutorial asp.net
2009 05-07-tutorial asp.net2009 05-07-tutorial asp.net
2009 05-07-tutorial asp.net
 
Html basico
Html basicoHtml basico
Html basico
 
Etiquetas del html
Etiquetas del htmlEtiquetas del html
Etiquetas del html
 
Instalacion de Pentaho 5 con PostgreSQL 9.3
Instalacion de Pentaho 5 con PostgreSQL 9.3Instalacion de Pentaho 5 con PostgreSQL 9.3
Instalacion de Pentaho 5 con PostgreSQL 9.3
 
HTML5 por Gustavo Vilchez
HTML5 por Gustavo VilchezHTML5 por Gustavo Vilchez
HTML5 por Gustavo Vilchez
 
Corp. In. Tec. S.A. - Capacitaciones en Informática - Programación con CodeIg...
Corp. In. Tec. S.A. - Capacitaciones en Informática - Programación con CodeIg...Corp. In. Tec. S.A. - Capacitaciones en Informática - Programación con CodeIg...
Corp. In. Tec. S.A. - Capacitaciones en Informática - Programación con CodeIg...
 
2_4_Los_metadatos_El_elemento_head.pdf
2_4_Los_metadatos_El_elemento_head.pdf2_4_Los_metadatos_El_elemento_head.pdf
2_4_Los_metadatos_El_elemento_head.pdf
 
JqueryMobile
JqueryMobile JqueryMobile
JqueryMobile
 
jQuery Mobile :: Cuadros de diálogo
jQuery Mobile :: Cuadros de diálogojQuery Mobile :: Cuadros de diálogo
jQuery Mobile :: Cuadros de diálogo
 

Más de Miguel Angel Teheran Garcia

Más de Miguel Angel Teheran Garcia (20)

Pruebas Automatizadas con PlayWright sobre nuestras Google Cloud Functions
Pruebas Automatizadas con PlayWright sobre nuestras Google Cloud FunctionsPruebas Automatizadas con PlayWright sobre nuestras Google Cloud Functions
Pruebas Automatizadas con PlayWright sobre nuestras Google Cloud Functions
 
PlayWright, Cypress, Selenium Cual es la mejor opción para desarrolladores Ja...
PlayWright, Cypress, Selenium Cual es la mejor opción para desarrolladores Ja...PlayWright, Cypress, Selenium Cual es la mejor opción para desarrolladores Ja...
PlayWright, Cypress, Selenium Cual es la mejor opción para desarrolladores Ja...
 
Introduction to Blazor Hybrid
Introduction to Blazor HybridIntroduction to Blazor Hybrid
Introduction to Blazor Hybrid
 
La historia de api-colombia
La historia de api-colombiaLa historia de api-colombia
La historia de api-colombia
 
DevFest 2022 - El Arte de escribir sobre programacion.pptx
DevFest 2022 - El Arte de escribir sobre programacion.pptxDevFest 2022 - El Arte de escribir sobre programacion.pptx
DevFest 2022 - El Arte de escribir sobre programacion.pptx
 
RoadMap y herramientas de Azure DevOps que debes conocer
RoadMap y herramientas de Azure DevOps que debes conocerRoadMap y herramientas de Azure DevOps que debes conocer
RoadMap y herramientas de Azure DevOps que debes conocer
 
Taller de TDD con .NET y xUnit
Taller de TDD con .NET y xUnitTaller de TDD con .NET y xUnit
Taller de TDD con .NET y xUnit
 
Introduction to OpenTelemetry in .NET
Introduction to OpenTelemetry in .NETIntroduction to OpenTelemetry in .NET
Introduction to OpenTelemetry in .NET
 
PRISM con MAUI
PRISM con MAUIPRISM con MAUI
PRISM con MAUI
 
.NET MAUI Offline first
.NET MAUI Offline first .NET MAUI Offline first
.NET MAUI Offline first
 
MAUIConf - Adios Net Maui Essentials Bienvenida Integración de Plataforma
MAUIConf - Adios Net Maui Essentials Bienvenida Integración de PlataformaMAUIConf - Adios Net Maui Essentials Bienvenida Integración de Plataforma
MAUIConf - Adios Net Maui Essentials Bienvenida Integración de Plataforma
 
Servicios Nativos MAUI
Servicios Nativos MAUIServicios Nativos MAUI
Servicios Nativos MAUI
 
Aplicaciones para MacOS con .NET MAUI
Aplicaciones para MacOS con .NET MAUIAplicaciones para MacOS con .NET MAUI
Aplicaciones para MacOS con .NET MAUI
 
Primero pasos con Visual Studio for MAC
Primero pasos con Visual Studio for MACPrimero pasos con Visual Studio for MAC
Primero pasos con Visual Studio for MAC
 
Aplicaciones con web con Blazor + MudBlazor
Aplicaciones con web con Blazor + MudBlazorAplicaciones con web con Blazor + MudBlazor
Aplicaciones con web con Blazor + MudBlazor
 
Building Web Applications with Blazor and MudBlazor
Building Web Applications with Blazor and MudBlazorBuilding Web Applications with Blazor and MudBlazor
Building Web Applications with Blazor and MudBlazor
 
Tips para una entrevista Tech Exitosa
Tips para una entrevista Tech ExitosaTips para una entrevista Tech Exitosa
Tips para una entrevista Tech Exitosa
 
Metaverso y Microsoft Mesh
Metaverso y Microsoft MeshMetaverso y Microsoft Mesh
Metaverso y Microsoft Mesh
 
Apis with dotnet postgreSQL and Apsaradb
Apis with dotnet postgreSQL and ApsaradbApis with dotnet postgreSQL and Apsaradb
Apis with dotnet postgreSQL and Apsaradb
 
Microservices with Minimal APi and .NET 6
Microservices with Minimal APi and .NET 6Microservices with Minimal APi and .NET 6
Microservices with Minimal APi and .NET 6
 

Mejoras en Blazor con .NET 6

  • 1. .NET Conf Latinoamérica 2021 Novedades en Blazor con .NET 6 Héctor Pérez - elcamino.dev Miguel Teheran - Mteheran.dev
  • 2. .NET Conf Latinoamérica 2021 Mejor rendimiento!
  • 3. .NET Conf Latinoamérica 2021 Nueva plantilla para Blazor • Implicit using por defecto • Top-level statements por defecto • Bootstrap 5.1 sin dependencia de javascript • CSS isolated por defecto
  • 4. .NET Conf Latinoamérica 2021 Puerto Aleatorio
  • 5. .NET Conf Latinoamérica 2021 Hot Reload - Recarga automatica Visual Studio 2022
  • 6. .NET Conf Latinoamérica 2021 Error boundaries Manejo de errores no controlados o excepciones dentro de los componentes <div class="main"> <div class="content px-4"> <ErrorBoundary> @Body </ErrorBoundary> </div> </div>
  • 7. .NET Conf Latinoamérica 2021 PageTitle y HeadContent Definición de títulos para páginas y Head Elements <PageTitle>Index</PageTitle> <HeadContent> <meta name="description" content=".NET CONF"/> </HeadContent>
  • 8. .NET Conf Latinoamérica 2021 Required parameter - parámetro requerido [Parameter] [EditorRequired] public string Title { get; set; } [Parameter, EditorRequired] public string Title { get; set; }
  • 9. .NET Conf Latinoamérica 2021 Manipulación de Query String [SupplyParameterFromQuery] https://localhost:7087/counter?CurrentCount=22
  • 10. .NET Conf Latinoamérica 2021 Render components from JavaScript Podemos invocar componentes desde Javascript y renderizarlos en cualquier momento let containerElement = document.getElementById('my-counter'); await Blazor.rootComponents.add(containerElement, 'counter', { incrementAmount: 10 });
  • 11. .NET Conf Latinoamérica 2021 Render components from JavaScript (Registro) builder.Services.AddServerSideBlazor(options => { options.RootComponents.RegisterForJavaScript<Counter>(identifier: "counter"); }); builder.RootComponents.RegisterForJavaScript<Counter>(identifier: "counter"); Blazor Server: Blazor WebAssembly:
  • 12. .NET Conf Latinoamérica 2021 Dynamically-rendered Components Podemos cargar componentes de manera dinámica indicando el tipo <DynamicComponent Type="@componentType" Parameters="@parameters" /> @code { private Type componentType = ...; private IDictionary<string, object> parameters = ...; }
  • 13. .NET Conf Latinoamérica 2021 Focus an element on navigation <Router AppAssembly="@typeof(Program).Assembly"> <Found Context="routeData"> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <FocusOnNavigate RouteData="@routeData" Selector="h1" /> </Found> <NotFound> <LayoutView Layout="@typeof(MainLayout)"> <p role="alert">Sorry, there's nothing at this address.</p> </LayoutView> </NotFound> </Router>
  • 14. .NET Conf Latinoamérica 2021 Generate Angular and React components var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.RegisterForAngular<MyComponent>(); // Register for Angular builder.RootComponents.RegisterForReact<MyComponent>(); // Register for React Funcionalidad experimental para generar componentes específicos para React.js y Angular samples/samples/aspnetcore/blazor/JSComponentGeneration at main · aspnet/samples (github.com)
  • 15. .NET Conf Latinoamérica 2021 AOT compilation (Without AOT)
  • 16. .NET Conf Latinoamérica 2021 AOT compilation (With AOT)
  • 19. .NET Conf Latinoamérica 2021 Datos de contacto Miguel Teheran mteheran.dev @mteheran Héctor Pérez elcamino.dev
  • 20. .NET Conf Latinoamérica 2021 ¡Gracias!