-
Notifications
You must be signed in to change notification settings - Fork 6k
Document the Blazor WebEventDescriptor.EventArgsType breaking change #23000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
abb7f20
Document the Blazor WebEventDescriptor.EventArgsType breaking change
scottaddie 87493cb
Apply suggestions from code review
scottaddie 524d24c
React to Youssef's feedback
scottaddie d1d2473
Merge branch 'scottaddie/web-event-descriptor' of https://github.com/…
scottaddie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
docs/core/compatibility/aspnet-core/6.0/blazor-eventargstype-property-replaced.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] | ||
| --- | ||
scottaddie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # 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` | ||
|
|
||
| --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.