fix(build): register interceptor namespaces through the InterceptorsNamespaces property - #104
Merged
Merged
Conversation
…amespaces property - Set InterceptorsNamespaces instead of appending a second InterceptorsNamespaces entry to Features. - The compiler keeps only the last entry, so the Features form dropped the SDK generators namespaces and, when a project listed its own, the generated one.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
=======================================
Coverage 99.73% 99.73%
=======================================
Files 289 289
Lines 11533 11533
Branches 1259 1259
=======================================
Hits 11502 11502
Misses 18 18
Partials 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



What kind of change does this PR introduce?
Bug fix.
What is the new behavior?
The package registers its interceptor namespace through the
InterceptorsNamespacesMSBuild property.InterceptorsNamespaceslist holding the project's own namespaces, the generatedReactiveUI.Binding.Generated.Interceptorsnamespace, and the namespaces the SDK's own generators register.dotnet build.What is the current behavior?
The package appends
InterceptorsNamespaces=...to$(Features), which gives the compiler a second, conflicting entry.InterceptorsNamespacesentry, so the SDK's merged list is replaced and the configuration binder, request delegate and validation generator namespaces are dropped.$(Features)is split on;, so a project that lists its own interceptor namespaces keeps only the first one and losesReactiveUI.Binding.Generated.Interceptors, and its bindings fall back to the dispatch overloads.FeaturesrepeatsInterceptorsNamespaces(RIDER-142866).Reported in #81 (comment).
What might this PR break?
None
Checklist
mainbranchAdditional information
The only authored change is
src/ReactiveUI.Binding.SourceGenerators/build/ReactiveUI.Binding.SourceGenerators.targets.Csctask has taken theInterceptorsNamespacesparameter since .NET SDK 9.0.100, and interception is only enabled from Roslyn 4.13.