Uh oh!
There was an error while loading. Please reload this page.
Create source generator for configuration binding - #82179
Conversation
ghost
commented
Feb 15, 2023
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue Details
|
d27439a to
6c9f2edCompare6c9f2ed to
2020a35Comparelayomia
commented
Feb 21, 2023
We have the green light from API review to proceed with this implementation. Still need to resolve CI failures but it's ready for a first look. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| (node, _) => node is InvocationExpressionSyntax invocation, | ||
| (context, cancellationToken) => new BinderInvocationOperation(context, cancellationToken)); | ||
| IncrementalValueProvider<(KnownTypeData, ImmutableArray<BinderInvocationOperation>)> inputData = compilationData.Combine(inputCalls.Collect()); |
There was a problem hiding this comment.
Why do we need to call Combine here? Assuming you have an application with 500 BinderInvocationOperation locations, then changing just one would result in all 500 of them being aggregated and recalculated.
Assuming there is no strong performance reason behind consolidating one parser for all operations, I would recommend keeping these independent as an IncrementalValueSProvider<(KnownTypeData, BinderInvocationOperation)>. IncrementalValuesProvider also has a RegisterSourceOutput which can be triggered independently for each of its components without forcing recalculation of the others.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| namespace Microsoft.Extensions.Configuration.Binder.SourceGeneration | ||
| { | ||
| internal sealed record SourceGenerationSpec( | ||
| HashSet<TypeSpec> TypesForBindMethodGen, |
There was a problem hiding this comment.
💡 This was my solution:
DotNetAnalyzers/StyleCopAnalyzers@253d408
If there is a better solution I'm interested to know.
Thanks for reviewing this PR folks. I've opened issues to address feedback not resolved in this PR. They are linked above and also tracked by #79527. I'll merge this PR now to make preview 3 & because additional changes will require more review & churn. I believe the current implementation is viable for users to try as-is. W.r.t risk to the product caused by issues/bugs in the feature:
Here are the follow up items I'll try to address in preview 3 (snaps on Monday 3/20, cc @carlossanlop): |
Uh oh!
There was an error while loading. Please reload this page.
davidfowl
commented
Mar 19, 2023
How do I enable the source generator? |
@davidfowl see layomi's comment above:
Make sure that the latest available |
Uh oh!
There was an error while loading. Please reload this page.