Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
df05d7c
feat: Make HybridWebView JS-to-.NET invocation trimming and AOT safe
simonrozsival May 13, 2026
ec9f97a
refactor: Remove BuildMethodCache fallback and legacy reflection path
simonrozsival May 13, 2026
b8a94f0
refactor: Use Microsoft.Maui.Controls.Generated namespace for interce…
simonrozsival May 13, 2026
05f97cb
refactor: Remove unnecessary [DynamicallyAccessedMembers] from SetInv…
simonrozsival May 13, 2026
493c334
fix: Restore BuildMethodCacheLegacy for obsolete SetInvokeJavaScriptT…
simonrozsival May 13, 2026
1b73fc3
refactor: Introduce IHybridWebViewInvoker abstraction
simonrozsival May 13, 2026
bd9063c
fix: Make IHybridWebViewInvoker public for source generator access
simonrozsival May 13, 2026
bb40829
fix: Clean up PublicAPI files — only add our new entries
simonrozsival May 13, 2026
6266be3
refactor: Replace [Obsolete] with RUC/RDC messages on legacy overload
simonrozsival May 13, 2026
37fc3cd
refactor: Use safer type check in generated interceptor
simonrozsival May 26, 2026
f136c18
fix: Update Core public API baselines for HybridWebView invoker
Copilot May 27, 2026
d28ca44
Fix HybridWebView AOT review feedback
simonrozsival Jun 15, 2026
8ef3631
Clarify HybridWebView source generator interception requirement
simonrozsival Jun 15, 2026
a0f6df0
Mark HybridWebView legacy reflection path unsafe for AOT
simonrozsival Jun 15, 2026
7eaa8f8
Use invoker attach model for HybridWebView
simonrozsival Jun 15, 2026
82285a2
Use public HybridWebView SetInvoker hook
simonrozsival Jun 15, 2026
462529a
Rename HybridWebView invoker base class
simonrozsival Jun 15, 2026
9c16fe8
Remove DAM from HybridWebView legacy type property
simonrozsival Jun 15, 2026
7884e32
Remove unnecessary HybridWebView AOT suppressions
simonrozsival Jun 15, 2026
08b502c
Clean up the API
simonrozsival Jun 15, 2026
aa183bc
Fix HybridWebViewInvoker platform PublicAPI baselines
Copilot Jun 16, 2026
1ddd3af
Merge remote-tracking branch 'origin/net11.0' into hybrid-web-view-ao…
Copilot Jun 16, 2026
8907b5c
Fix HybridWebView handler netstandard build after merge
Copilot Jun 16, 2026
64c143a
Fix HybridWebView source generator review issues
Copilot Jun 16, 2026
2a384d9
Merge branch 'hybrid-web-view-aot-safe' of github.com:dotnet/maui int…
simonrozsival Jun 17, 2026
1d7c16b
Remove RUC and RDC from HybridWebViewHelper
simonrozsival Jun 17, 2026
900bbc5
Fix packaging build error
simonrozsival Jun 17, 2026
0b5268c
Fix remaining unsafe serialization and deserialization APIs in Hybrid…
simonrozsival Jun 17, 2026
78de743
Delete unreachable code
simonrozsival Jun 17, 2026
3cd60c2
Suppress HybridWebView trim warning
simonrozsival Jun 17, 2026
7505c11
Move HybridWebView bindable property setup
simonrozsival Jun 17, 2026
8795b52
Add missing suppression
simonrozsival Jun 18, 2026
2133f42
Fix HybridWebView source generator interception
simonrozsival Jun 18, 2026
471995e
Report open generic HybridWebView invoke targets
simonrozsival Jun 18, 2026
f810379
Merge branch 'net11.0' into hybrid-web-view-aot-safe
simonrozsival Jun 18, 2026
ccd0ed7
Merge net11.0 into HybridWebView AOT PR
Copilot Jun 18, 2026
c7a6b74
Merge remote HybridWebView AOT PR updates
Copilot Jun 18, 2026
3c175ac
Address HybridWebView merge review feedback
Copilot Jun 18, 2026
2982cf9
Fix HybridWebView source generator edge cases
simonrozsival Jun 18, 2026
1012900
Fix HybridWebView raw invoke result marshalling
simonrozsival Jun 22, 2026
09cc1d3
Fix HybridWebView InvokeDotNet JSON result envelope
simonrozsival Jun 22, 2026
d3e5fb4
Merge remote HybridWebView AOT updates
simonrozsival Jun 22, 2026
7295de2
Restore HybridWebView InvokeDotNet test shape
simonrozsival Jun 22, 2026
6e4d84e
Fix HybridWebView source generator edge cases
simonrozsival Jun 22, 2026
2af4861
Preserve HybridWebView invoke target null getters
simonrozsival Jun 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Microsoft.Maui-dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 18.3.11408.92 d18.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "src\Core\src\Core.csproj", "{95BA42B5-B00E-4986-B9B5-517140378452}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.HybridWebViewSourceGen", "src\Core\src\HybridWebViewSourceGen\Core.HybridWebViewSourceGen.csproj", "{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core", "src\Controls\src\Core\Controls.Core.csproj", "{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{459BF674-83CB-46F6-881F-A2D2117DBF4D}"
Expand Down Expand Up @@ -281,6 +283,10 @@ Global
{95BA42B5-B00E-4986-B9B5-517140378452}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.Build.0 = Release|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Release|Any CPU.Build.0 = Release|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -690,6 +696,7 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{95BA42B5-B00E-4986-B9B5-517140378452} = {E8AD265B-3C67-4640-AC58-A522F9FB3361}
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A} = {E8AD265B-3C67-4640-AC58-A522F9FB3361}
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F} = {50C758FE-4E10-409A-94F5-A75480960864}
{E1082E26-D700-4127-9329-66D673FD2D55} = {459BF674-83CB-46F6-881F-A2D2117DBF4D}
{B8DC1324-977C-46F1-B697-9064ADE6099A} = {E1082E26-D700-4127-9329-66D673FD2D55}
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Maui-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj",
"src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\src\\HybridWebViewSourceGen\\Core.HybridWebViewSourceGen.csproj",
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Maui-windows.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj",
"src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\src\\HybridWebViewSourceGen\\Core.HybridWebViewSourceGen.csproj",
"src\\Controls\\tests\\Core.Design.UnitTests\\Controls.Core.Design.UnitTests.csproj",
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Maui.BuildTasks.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj",
"src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\src\\HybridWebViewSourceGen\\Core.HybridWebViewSourceGen.csproj",
"src\\Core\\src\\Core.csproj",
"src\\SingleProject\\Resizetizer\\src\\Resizetizer.csproj"
]
Expand Down
7 changes: 7 additions & 0 deletions Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ VisualStudioVersion = 17.0.31410.414
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "src\Core\src\Core.csproj", "{95BA42B5-B00E-4986-B9B5-517140378452}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.HybridWebViewSourceGen", "src\Core\src\HybridWebViewSourceGen\Core.HybridWebViewSourceGen.csproj", "{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Core", "src\Controls\src\Core\Controls.Core.csproj", "{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility", "src\Compatibility\Core\src\Compatibility.csproj", "{00A11C2F-969F-4964-8557-91ADF4B1523D}"
Expand Down Expand Up @@ -279,6 +281,10 @@ Global
{95BA42B5-B00E-4986-B9B5-517140378452}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95BA42B5-B00E-4986-B9B5-517140378452}.Release|Any CPU.Build.0 = Release|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A}.Release|Any CPU.Build.0 = Release|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -692,6 +698,7 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{95BA42B5-B00E-4986-B9B5-517140378452} = {E8AD265B-3C67-4640-AC58-A522F9FB3361}
{3649A4BE-24DE-4B1F-9FA4-84B3335A833A} = {E8AD265B-3C67-4640-AC58-A522F9FB3361}
{AF64451F-E2BD-41C2-B083-F60C26AE2A9F} = {50C758FE-4E10-409A-94F5-A75480960864}
{00A11C2F-969F-4964-8557-91ADF4B1523D} = {446EB407-57EB-441D-9ADB-1A006CBF672A}
{E1082E26-D700-4127-9329-66D673FD2D55} = {459BF674-83CB-46F6-881F-A2D2117DBF4D}
Expand Down
7 changes: 1 addition & 6 deletions docs/design/FeatureSwitches.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ The following switches are toggled for applications running on Mono for `TrimMod
| MauiImplicitCastOperatorsUsageViaReflectionSupport | Microsoft.Maui.RuntimeFeature.IsImplicitCastOperatorsUsageViaReflectionSupported | When disabled, MAUI won't look for implicit cast operators when converting values from one type to another. This feature is not trim-compatible. |
| _MauiBindingInterceptorsSupport | Microsoft.Maui.RuntimeFeature.AreBindingInterceptorsSupported | When disabled, MAUI won't intercept any calls to `SetBinding` methods and try to compile them. Enabled by default. |
| MauiEnableXamlCBindingWithSourceCompilation | Microsoft.Maui.RuntimeFeature.XamlCBindingWithSourceCompilationEnabled | When enabled, MAUI will compile all bindings, including those where the `Source` property is used. |
| MauiHybridWebViewSupported | Microsoft.Maui.RuntimeFeature.IsHybridWebViewSupported | Enables HybridWebView, which makes use of dynamic System.Text.Json serialization features |
| MauiNamescopesSupported | Microsoft.Maui.RuntimeFeature.AreNamescopesSupported | Enable support for Namescopes, FindByName if the application uses it, or to keep supporting runtime and XamlC XAML inflators |
| EnableDiagnostics | Microsoft.Maui.RuntimeFeature.EnableDiagnostics | Enables diagnostic for the running app |
| EnableMauiDiagnostics | Microsoft.Maui.RuntimeFeature.EnableMauiDiagnostics | Enables MAUI specific diagnostics, like VisualDiagnostics and BindingDiagnostics. Defaults to EnableDiagnostics |
Expand Down Expand Up @@ -100,9 +99,7 @@ This feature is a counterpart of [XAML Compiled bindings](https://learn.microsof

It is necessary to use this feature instead of the string-based bindings in NativeAOT apps and in apps with full trimming enabled.

## MauiHybridWebViewSupported

When this feature is disabled, `HybridWebView` will not be available. This is the default for projects using `TrimMode=full` or `PublishAot=true`.
## MauiEnableXamlCBindingWithSourceCompilation

### Example use-case

Expand All @@ -124,8 +121,6 @@ Compiled binding in XAML:
<Label Text="{Binding Customer.Name}" x:DataType="local:PageViewModel" />
```

## MauiEnableXamlCBindingWithSourceCompilation

XamlC skipped compilation of bindings with the `Source` property set to any value in previous releases. Some bindings might start producing build errors or start failing at runtime after this feature is enabled. After enabling this feature, make sure all bindings have the right `x:DataType` so they are compiled correctly. For bindings which should not be compiled, clear the data type like this:
```
{Binding MyProperty, Source={x:Reference MyTarget}, x:DataType={x:Null}}
Expand Down
1 change: 1 addition & 0 deletions eng/Microsoft.Maui.Packages-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj",
"src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\src\\HybridWebViewSourceGen\\Core.HybridWebViewSourceGen.csproj",
"src\\Core\\src\\Core.csproj",
"src\\Core\\maps\\src\\Maps.csproj",
"src\\Essentials\\src\\Essentials.csproj",
Expand Down
1 change: 1 addition & 0 deletions eng/Microsoft.Maui.Packages.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"src\\Controls\\src\\SourceGen\\Controls.SourceGen.csproj",
"src\\Controls\\src\\Xaml.Design\\Controls.Xaml.Design.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\src\\HybridWebViewSourceGen\\Core.HybridWebViewSourceGen.csproj",
"src\\Core\\src\\Core.csproj",
"src\\Core\\maps\\src\\Maps.csproj",
"src\\Graphics\\src\\Graphics\\Graphics.csproj",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public HybridWebViewPage()
{
InitializeComponent();

hwv.SetInvokeJavaScriptTarget<DotNetMethods>(new DotNetMethods(this));
hwv.SetInvokeJavaScriptTarget<DotNetMethods>(new DotNetMethods(this), SampleInvokeJsContext.Default);
}

int count;
Expand Down Expand Up @@ -128,6 +128,8 @@ public class ComputationResult

[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ComputationResult))]
[JsonSerializable(typeof(SyncReturn))]
[JsonSerializable(typeof(int))]
[JsonSerializable(typeof(double))]
[JsonSerializable(typeof(string))]
[JsonSerializable(typeof(Dictionary<string, string>))]
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<ProjectReference Include="..\Xaml\Controls.Xaml.csproj" />
<ProjectReference Include="..\SourceGen\Controls.SourceGen.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\BindingSourceGen\Controls.BindingSourceGen.csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\..\Core\src\HybridWebViewSourceGen\Core.HybridWebViewSourceGen.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,6 +55,8 @@
<None Include="$(ArtifactsBinDir)Controls.SourceGen\$(Configuration)\netstandard2.0\Microsoft.Maui.Controls.SourceGen.pdb" Visible="false" Pack="true" PackagePath="buildTransitive\netstandard2.0" />
<None Include="$(ArtifactsBinDir)Controls.BindingSourceGen\$(Configuration)\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll" Visible="false" Pack="true" PackagePath="buildTransitive\netstandard2.0" />
<None Include="$(ArtifactsBinDir)Controls.BindingSourceGen\$(Configuration)\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.pdb" Visible="false" Pack="true" PackagePath="buildTransitive\netstandard2.0" />
<None Include="$(ArtifactsBinDir)Core.HybridWebViewSourceGen\$(Configuration)\netstandard2.0\Microsoft.Maui.Core.HybridWebViewSourceGen.dll" Visible="false" Pack="true" PackagePath="buildTransitive\netstandard2.0" />
<None Include="$(ArtifactsBinDir)Core.HybridWebViewSourceGen\$(Configuration)\netstandard2.0\Microsoft.Maui.Core.HybridWebViewSourceGen.pdb" Visible="false" Pack="true" PackagePath="buildTransitive\netstandard2.0" />
<None Remove="$(OutputPath)*.xml" />
<None Include="nuget\**" PackagePath="" Pack="true" Exclude="nuget\**\*.aotprofile.txt" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@
<Analyzer Include="$(MSBuildThisFileDirectory)Microsoft.Maui.Controls.SourceGen.dll" IsImplicitlyDefined="true" />
</ItemGroup>

<!-- Enable BindingSourceGen -->
<!-- Enable interceptor source generators -->
<PropertyGroup>
<_MauiBindingInterceptorsSupport Condition=" '$(_MauiBindingInterceptorsSupport)' == '' and '$(DisableMauiAnalyzers)' != 'true' ">true</_MauiBindingInterceptorsSupport>
<InterceptorsPreviewNamespaces Condition=" '$(_MauiBindingInterceptorsSupport)' == 'true' ">$(InterceptorsPreviewNamespaces);Microsoft.Maui.Controls.Generated</InterceptorsPreviewNamespaces>
<_MauiHybridWebViewInterceptorsSupport Condition=" '$(_MauiHybridWebViewInterceptorsSupport)' == '' and '$(DisableMauiAnalyzers)' != 'true' ">true</_MauiHybridWebViewInterceptorsSupport>
<InterceptorsPreviewNamespaces Condition=" '$(_MauiBindingInterceptorsSupport)' == 'true' or '$(_MauiHybridWebViewInterceptorsSupport)' == 'true' ">$(InterceptorsPreviewNamespaces);Microsoft.Maui.Controls.Generated</InterceptorsPreviewNamespaces>
</PropertyGroup>
<ItemGroup Condition=" '$(_MauiBindingInterceptorsSupport)' == 'true' ">
<Analyzer Include="$(MSBuildThisFileDirectory)Microsoft.Maui.Controls.BindingSourceGen.dll" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition=" '$(_MauiHybridWebViewInterceptorsSupport)' == 'true' ">
<Analyzer Include="$(MSBuildThisFileDirectory)Microsoft.Maui.Core.HybridWebViewSourceGen.dll" IsImplicitlyDefined="true" />
</ItemGroup>

<ItemGroup Condition="'$(AndroidEnableProfiledAot)' == 'true' and '$(MauiUseDefaultAotProfile)' != 'false'">
<AndroidAotProfile Include="$(MSBuildThisFileDirectory)maui.aotprofile" />
Expand Down Expand Up @@ -322,7 +326,6 @@
<MauiQueryPropertyAttributeSupport Condition="'$(MauiQueryPropertyAttributeSupport)' == ''">false</MauiQueryPropertyAttributeSupport>
<MauiImplicitCastOperatorsUsageViaReflectionSupport Condition="'$(MauiImplicitCastOperatorsUsageViaReflectionSupport)' == ''">false</MauiImplicitCastOperatorsUsageViaReflectionSupport>
<MauiEnableXamlCBindingWithSourceCompilation Condition="'$(MauiEnableXamlCBindingWithSourceCompilation)' == ''">true</MauiEnableXamlCBindingWithSourceCompilation>
<MauiHybridWebViewSupported Condition="'$(MauiHybridWebViewSupported)' == ''">false</MauiHybridWebViewSupported>
<MauiCssEnabled Condition="'$(MauiCssEnabled)' == '' and '@(MauiCss->Count())' == '0'">false</MauiCssEnabled>
<!-- FIXME: https://github.com/xamarin/xamarin-macios/issues/22065 -->
<MobileAggressiveAttributeTrimming Condition="'$(PublishAot)' == 'true' and '$(MobileAggressiveAttributeTrimming)' == ''">false</MobileAggressiveAttributeTrimming>
Expand Down Expand Up @@ -356,10 +359,6 @@
Condition="'$(MauiEnableXamlCBindingWithSourceCompilation)' != ''"
Value="$(MauiEnableXamlCBindingWithSourceCompilation)"
Trim="false" />
<RuntimeHostConfigurationOption Include="Microsoft.Maui.RuntimeFeature.IsHybridWebViewSupported"
Condition="'$(MauiHybridWebViewSupported)' != ''"
Value="$(MauiHybridWebViewSupported)"
Trim="true" />
<RuntimeHostConfigurationOption Include="Microsoft.Maui.RuntimeFeature.IsCssEnabled"
Condition="'$(MauiCssEnabled)' != ''"
Value="$(MauiCssEnabled)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ Methods:
bool Microsoft.Maui.RuntimeFeature:get_EnableDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiAspire ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_IsHybridWebViewSupported ()
bool Microsoft.Maui.RuntimeFeature:InitializeIsMeterSupported ()
bool Microsoft.Maui.ViewExtensions:NeedsContainer (Microsoft.Maui.IView)
bool Microsoft.Maui.VisualDiagnostics:get_IsEnabled ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ Methods:
bool Microsoft.Maui.RuntimeFeature:get_EnableDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiAspire ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_IsHybridWebViewSupported ()
bool Microsoft.Maui.RuntimeFeature:get_IsImplicitCastOperatorsUsageViaReflectionSupported ()
bool Microsoft.Maui.RuntimeFeature:InitializeIsMeterSupported ()
bool Microsoft.Maui.Storage.PreferencesImplementation:ContainsKey (string,string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ Methods:
bool Microsoft.Maui.RuntimeFeature:get_EnableDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiAspire ()
bool Microsoft.Maui.RuntimeFeature:get_EnableMauiDiagnostics ()
bool Microsoft.Maui.RuntimeFeature:get_IsHybridWebViewSupported ()
bool Microsoft.Maui.RuntimeFeature:get_IsImplicitCastOperatorsUsageViaReflectionSupported ()
bool Microsoft.Maui.RuntimeFeature:InitializeIsMeterSupported ()
bool Microsoft.Maui.StringExtensions:ContainsChar (string,char)
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/src/Core/Controls.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
Include="..\..\..\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
<ProjectReference
Include="..\..\..\Core\src\HybridWebViewSourceGen\Core.HybridWebViewSourceGen.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 2 additions & 10 deletions src/Controls/src/Core/Hosting/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ internal static IMauiHandlersCollection AddControlsHandlers(this IMauiHandlersCo
handlersCollection.AddHandler<Stepper, StepperHandler>();
handlersCollection.AddHandler<Page, PageHandler>();
handlersCollection.AddHandler<WebView, WebViewHandler>();
if (RuntimeFeature.IsHybridWebViewSupported)
{
// NOTE: not registered under NativeAOT or TrimMode=Full scenarios
handlersCollection.AddHandler<HybridWebView, HybridWebViewHandler>();
}
handlersCollection.AddHandler<HybridWebView, HybridWebViewHandler>();

handlersCollection.AddHandler<Border, BorderHandler>();
handlersCollection.AddHandler<IContentView, ContentViewHandler>();
Expand Down Expand Up @@ -248,11 +244,7 @@ static MauiAppBuilder SetupDefaults(this MauiAppBuilder builder)
handlers.AddControlsHandlers();
});

// NOTE: not registered under NativeAOT or TrimMode=Full scenarios
if (RuntimeFeature.IsHybridWebViewSupported)
{
builder.Services.AddScoped<IHybridWebViewTaskManager>(_ => new HybridWebViewTaskManager());
}
builder.Services.AddScoped<IHybridWebViewTaskManager>(_ => new HybridWebViewTaskManager());

builder.ConfigureMauiControlsDiagnostics();

Expand Down
Loading
Loading