-
Notifications
You must be signed in to change notification settings - Fork 5k
Replace use of DAMT.All in ComponentModel with a more restricted set #114126
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
base: main
Are you sure you want to change the base?
Conversation
Note regarding the
|
Note regarding the
|
Tagging subscribers to this area: @dotnet/area-system-componentmodel-dataannotations |
@steveharter @eerhardt any opinion about re-annotating ComponentModel with a more restricted annotation? We used .All in multiple places of the framework whenever we needed to access private members in base type (e.g. At the time ComponentModel was annotated we didn't have The difference between .All and the replacement here is that .All means "all members, public and private, in bases and in implemented interfaces, and all implemented interfaces". The new annotation is "all members, public and private, in bases, and all implemented interfaces". I.e. we skip making members of interfaces available for reflection. So if someone previously did I reviewed uses of GetInterface/GetInterfaces here and doesn't look like we're affected. The only potential break here is that someone else could have taken a dependency on this being annotated .All. A mitigating factor right now is that |
The only public APIs where I see the new annotation flowing out of ComponentModel are:
I don't see any reason those APIs would need to support getting interfaces, so I'm in favor of taking the breaking change (especially with considering the mitigating factor you mentioned). |
@steveharter do you have any opinion about this? |
We're running out of time to make this change. If we don't do this for .NET10, we'll lose the mitigating factor I mentioned above (I'll repeat it below). The breaking change would be even more breaking. The measurements over at MichalStrehovsky/rt-sz#118 (comment) suggest this could be a 6.3% size savings for for our benchmark app TodosApi when using the options validator (see #106366 for context).
|
Draft for measurements. I assume this will need API review. This is technically a breaking change. Would fix #106366.