-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enable Binding inteceptors source generator by default #22856
Enable Binding inteceptors source generator by default #22856
Conversation
cb80320
to
1f1878d
Compare
…et-binding-inteceptors-sourcegen
@@ -21,6 +21,15 @@ | |||
<Analyzer Include="$(MSBuildThisFileDirectory)Microsoft.Maui.Controls.SourceGen.dll" IsImplicitlyDefined="true" /> | |||
</ItemGroup> | |||
|
|||
<!-- Enable BindingSourceGen --> | |||
<PropertyGroup> | |||
<_MauiEnableBindingInterceptors Condition=" '$(_MauiEnableBindingInterceptors)' == '' and '$(DisableMauiAnalyzers)' != 'true' ">true</_MauiEnableBindingInterceptors> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to have a private MSBuild property to turn it off. 👍 Customers can opt out of the new source generator with _MauiEnableBindingInterceptors=false
if something goes wrong with their build.
04e81a8
to
8c5d218
Compare
docs/design/FeatureSwitches.md
Outdated
@@ -32,3 +33,31 @@ When disabled, MAUI won't look for implicit cast operators when converting value | |||
If your library or your app defines an implicit operator on a type that can be used in one of the previous scenarios, you should define a custom `TypeConverter` for your type and attach it to the type using the `[TypeConverter(typeof(MyTypeConverter))]` attribute. | |||
|
|||
_Note: Prefer using the `TypeConverterAttribute` as it can help the trimmer achieve better binary size in certain scenarios._ | |||
|
|||
## _MauiEnableBindingInterceptors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSBuild properties are tricky, as everything is public, but a kind of convention is to treat those starting with an '_' as private, or for internal usage. But documenting it make me feel like it's for public consumption... so I feel a mismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I initially wanted this to be a "private" flag but at the same time it seems like something that we should document at least in Preview builds, until we make sure the feature works well and there's no real need to disable the analyzer.
@jonathanpeppers what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the MSBuild properties listed here are private:
I think for feature switches, we should document them even if something is private.
Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
Description of Change
This is a follow-up to #21725, contributes to #22384
The binding interceptors generator can be disabled by setting the existing
$(DisableMauiAnalyzers)
property or by setting_MauiEnableBindingInterceptors
tofalse
.