Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/core/compatibility/6.0.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: Breaking changes in .NET 6.0
description: Navigate to the breaking changes in .NET 6.0.
ms.date: 02/16/2021
ms.date: 02/24/2021
no-loc: [Blazor]
---
# Breaking changes in .NET 6.0

Expand All @@ -15,6 +16,7 @@ If you're migrating an app to .NET 6.0, the breaking changes listed here might a
- [Nullable reference type annotations changed](aspnet-core/6.0/nullable-reference-type-annotations-changed.md)
- [Obsoleted and removed APIs](aspnet-core/6.0/obsolete-removed-apis.md)
- [Blazor: Parameter name changed in RequestImageFileAsync method](aspnet-core/6.0/blazor-parameter-name-changed-in-method.md)
- [Blazor: WebEventDescriptor.EventArgsType property replaced](aspnet-core/6.0/blazor-eventargstype-property-replaced.md)
- [Kestrel: Log message attributes changed](aspnet-core/6.0/kestrel-log-message-attributes-changed.md)
- [Middleware: HTTPS Redirection Middleware throws exception on ambiguous HTTPS ports](aspnet-core/6.0/middleware-ambiguous-https-ports-exception.md)
- [Razor: RazorEngine APIs marked obsolete](aspnet-core/6.0/razor-engine-apis-obsolete.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Breaking change: Blazor: WebEventDescriptor.EventArgsType property replaced"
description: "Learn about the breaking change in ASP.NET Core 6.0 where the WebEventDescriptor.EventArgsType property is replaced by the EventName property."
author: scottaddie
ms.author: scaddie
ms.date: 02/24/2021
no-loc: [Blazor]
---
# Blazor: :::no-loc text="WebEventDescriptor.EventArgsType"::: property replaced

The <xref:Microsoft.AspNetCore.Components.RenderTree.WebEventDescriptor> class is part of Blazor's internal protocol for communicating events from JavaScript into .NET. This class isn't typically used by app code, but rather by platform authors.

Starting in ASP.NET Core 6.0, the <xref:Microsoft.AspNetCore.Components.RenderTree.WebEventDescriptor.EventArgsType%2A> property on `WebEventDescriptor` is being replaced by a new `EventName` property. This change is unlikely to affect any app code, as it's a low-level platform implementation detail.

## Version introduced

6.0

## Old behavior

In ASP.NET Core 5.0 and earlier, the property `EventArgsType` describes a nonstandard, Blazor-specific category name for groups of DOM event types. For example, the `click` and `mousedown` events were both mapped to an `EventArgsType` value of `mouse`. Similarly, `cut`, `copy`, and `paste` events are mapped to an `EventArgsType` value of `clipboard`. These category names are used to determine the .NET type to use for deserializing the incoming event arguments data.

## New behavior

Starting in ASP.NET Core 6.0, the new property `EventName` only specifies the original event's name. For example, `click`, `mousedown`, `cut`, `copy`, or `paste`. There's no longer a need to supply a Blazor-specific category name. For that reason, the old property `EventArgsType` is removed.

## Reason for change

In pull request [dotnet/aspnetcore#29993](https://github.com/dotnet/aspnetcore/pull/29993), support for custom event arguments classes was introduced. As part of this support, the framework no longer relies on all events fitting into a predefined set of categories. The framework now only needs to know the original event name.

## Recommended action

App code should be unaffected and doesn't need to change.

If building a custom Blazor rendering platform, you may need to update the mechanism for dispatching events into the `Renderer`. Replace any hardcoded rules about event categories with simpler logic that supplies the original, raw event name.

## Affected APIs

<xref:Microsoft.AspNetCore.Components.RenderTree.WebEventDescriptor.EventArgsType%2A?displayProperty=nameWithType>

<!--

## Category

ASP.NET Core

## Affected APIs

`P:Microsoft.AspNetCore.Components.RenderTree.WebEventDescriptor.EventArgsType`

-->
4 changes: 4 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
href: aspnet-core/6.0/obsolete-removed-apis.md
- name: "Blazor: Parameter name changed in RequestImageFileAsync method"
href: aspnet-core/6.0/blazor-parameter-name-changed-in-method.md
- name: "Blazor: WebEventDescriptor.EventArgsType property replaced"
href: aspnet-core/6.0/blazor-eventargstype-property-replaced.md
- name: "Kestrel: Log message attributes changed"
href: aspnet-core/6.0/kestrel-log-message-attributes-changed.md
- name: "Middleware: HTTPS Redirection Middleware throws exception on ambiguous HTTPS ports"
Expand Down Expand Up @@ -326,6 +328,8 @@
href: aspnet-core/6.0/obsolete-removed-apis.md
- name: "Blazor: Parameter name changed in RequestImageFileAsync method"
href: aspnet-core/6.0/blazor-parameter-name-changed-in-method.md
- name: "Blazor: WebEventDescriptor.EventArgsType property replaced"
href: aspnet-core/6.0/blazor-eventargstype-property-replaced.md
- name: "Kestrel: Log message attributes changed"
href: aspnet-core/6.0/kestrel-log-message-attributes-changed.md
- name: "Middleware: HTTPS Redirection Middleware throws exception on ambiguous HTTPS ports"
Expand Down