Enable Binding inteceptors source generator by default#22856
Conversation
cb80320 to
1f1878d
Compare
…et-binding-inteceptors-sourcegen
|
|
||
| <!-- Enable BindingSourceGen --> | ||
| <PropertyGroup> | ||
| <_MauiEnableBindingInterceptors Condition=" '$(_MauiEnableBindingInterceptors)' == '' and '$(DisableMauiAnalyzers)' != 'true' ">true</_MauiEnableBindingInterceptors> |
There was a problem hiding this comment.
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
|
|
||
| _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.
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.
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.
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_MauiEnableBindingInterceptorstofalse.