Try removing possibly-unused overloads in WebEventCallbackFactoryEventArgsExtensions#28414
Conversation
|
@pranavkm @javiercn @ajaybhargavb As part of work on #17552, I'm looking into the end-to-end flow for events and how all the types work. I might be wrong, but it looks like the extension methods in I did a bit of archaeology and found a commit 2 years ago by @rynowak that first introduced them, with the commit message containing:
It's quite possible that these specialized extension methods were only intended to be a temporary step, and have long since ceased to be needed. But the other possiblity is something more subtle, like maybe they change how the overload resolution works in order to produce better compiler error messages in cases where people provide incorrect types, or maybe they are only intended to influence intellisense in the design-time code or something. It's hard to say since this build (without those extension methods) and its tests passes. If anyone here feels they know whether these extension methods or needed, or has a suggestion about how to determine that, please say so :) Since they are public, it's debatable whether we should obsolete them, remove them, or leave them alone, but regardless I'd still like to know what they are for and whether custom event args will somehow behave less well due to not having equivalent extension methods. |
|
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
|
Well, everything is still passing after removing these. It does not appear that they are used either in any of the code we'd generate, nor any code that we'd expect customers to write (or think they have any reason to want to write). As such I do propose to remove them. Marking as |
|
Why not obsolete these first? |
It's also worth considering whether these would have been targeted by previous combination of C# compiler + Blazor compiler. For instance I suspect these overloads would have been chosed by a pre-C# 7.3 compiler: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#improved-overload-candidates - if that code is out in the wild in compiled form it will not be binary compatible if these are removed. I think we both recall a time when the Blazor templates had to specify |
| Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem>.Placeholder.set -> void | ||
| Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem>.RefreshDataAsync() -> System.Threading.Tasks.Task! | ||
| Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem>.Virtualize() -> void | ||
| Microsoft.AspNetCore.Components.Web.WebEventCallbackFactoryEventArgsExtensions |
There was a problem hiding this comment.
The plan is to mark this type as Obsolete and remove it in a future release of ASP.NET Core.
|
As per comment above obsoleting instead, this PR is now retired in favour of one of the commits inside #29993 |
Trying to figure out if these are still ever used for anything.