Skip to content

Commit 24d07bc

Browse files
authored
Refactor builder extension APIs and update dependencies (#4113)
<!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Update **What is the new behavior?** <!-- If this is a feature change --> Changed builder extension methods to use IReactiveUIBuilder interface for improved flexibility and consistency across platforms. Added System.Reactive package references to multiple projects. Updated Splat and Microsoft.Reactive.Testing package versions. Improved code analysis attributes and suppressions for better trimming and AOT compatibility. Updated API approval files to reflect public API changes. **What might this PR break?** Un-released version **Please check if the PR fulfills these requirements** - [x] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**:
1 parent 97361d2 commit 24d07bc

File tree

69 files changed

+1069
-883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1069
-883
lines changed

src/Directory.Packages.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
66
<PropertyGroup>
7-
<SplatVersion>16.0.1</SplatVersion>
7+
<SplatVersion>16.1.1</SplatVersion>
88
<XamarinAndroidXCoreVersion>1.13.1.4</XamarinAndroidXCoreVersion>
99
<XamarinAndroidXLifecycleLiveDataVersion>2.8.4.1</XamarinAndroidXLifecycleLiveDataVersion>
1010
</PropertyGroup>
@@ -16,7 +16,8 @@
1616
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
1717
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
1818
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
19-
<PackageVersion Include="Microsoft.Reactive.Testing" Version="6.0.1" />
19+
<PackageVersion Include="Microsoft.Reactive.Testing" Version="6.0.2" />
20+
<PackageVersion Include="System.Reactive" Version="6.0.2" />
2021
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
2122
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4948" />
2223
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />

src/ReactiveUI.AndroidX/Builder/AndroidXReactiveUIBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class AndroidXReactiveUIBuilderExtensions
2525
/// </summary>
2626
/// <param name="builder">The builder instance.</param>
2727
/// <returns>The builder instance for chaining.</returns>
28-
public static ReactiveUIBuilder WithAndroidX(this ReactiveUIBuilder builder)
28+
public static IReactiveUIBuilder WithAndroidX(this IReactiveUIBuilder builder)
2929
{
3030
if (builder is null)
3131
{
@@ -42,7 +42,7 @@ public static ReactiveUIBuilder WithAndroidX(this ReactiveUIBuilder builder)
4242
/// </summary>
4343
/// <param name="builder">The builder.</param>
4444
/// <returns>The builder instance for chaining.</returns>
45-
public static ReactiveUIBuilder WithAndroidXScheduler(this ReactiveUIBuilder builder)
45+
public static IReactiveUIBuilder WithAndroidXScheduler(this IReactiveUIBuilder builder)
4646
{
4747
if (builder is null)
4848
{

src/ReactiveUI.AndroidX/ReactiveUI.AndroidX.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI" />
1313
<PackageReference Include="Xamarin.Google.Android.Material" />
1414
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" />
15+
<PackageReference Include="System.Reactive" />
1516
</ItemGroup>
1617
<ItemGroup>
1718
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />

src/ReactiveUI.AndroidX/Registrations.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ namespace ReactiveUI.AndroidX;
1414
public class Registrations : IWantsToRegisterStuff
1515
{
1616
/// <inheritdoc/>
17-
#if NET6_0_OR_GREATER
18-
[RequiresDynamicCode("Register uses methods that require dynamic code generation")]
19-
[RequiresUnreferencedCode("Register uses methods that may require unreferenced code")]
20-
[SuppressMessage("Trimming", "IL2046:'RequiresUnreferencedCodeAttribute' annotations must match across all interface implementations or overrides.", Justification = "Not all paths use reflection")]
21-
[SuppressMessage("AOT", "IL3051:'RequiresDynamicCodeAttribute' annotations must match across all interface implementations or overrides.", Justification = "Not all paths use reflection")]
22-
#endif
2317
public void Register(Action<Func<object>, Type> registerFunction)
2418
{
2519
#if NET6_0_OR_GREATER

src/ReactiveUI.Blazor/Builder/BlazorReactiveUIBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static class BlazorReactiveUIBuilderExtensions
2323
/// </summary>
2424
/// <param name="builder">The builder instance.</param>
2525
/// <returns>The builder instance for chaining.</returns>
26-
public static ReactiveUIBuilder WithBlazor(this ReactiveUIBuilder builder)
26+
public static IReactiveUIBuilder WithBlazor(this IReactiveUIBuilder builder)
2727
{
2828
if (builder is null)
2929
{
@@ -40,7 +40,7 @@ public static ReactiveUIBuilder WithBlazor(this ReactiveUIBuilder builder)
4040
/// </summary>
4141
/// <param name="builder">The builder.</param>
4242
/// <returns>The builder instance for chaining.</returns>
43-
public static ReactiveUIBuilder WithBlazorScheduler(this ReactiveUIBuilder builder)
43+
public static IReactiveUIBuilder WithBlazorScheduler(this IReactiveUIBuilder builder)
4444
{
4545
if (builder is null)
4646
{

src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup>
99
<PackageReference Include="Reactive.Wasm" />
1010
<PackageReference Include="Microsoft.AspNetCore.Components" />
11+
<PackageReference Include="System.Reactive" />
1112
</ItemGroup>
1213
<ItemGroup>
1314
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />

src/ReactiveUI.Blend/ReactiveUI.Blend.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ItemGroup>
1919
<Compile Include="Platforms\net4\**\*.cs" />
2020
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" />
21+
<PackageReference Include="System.Reactive" />
2122
</ItemGroup>
2223
<ItemGroup>
2324
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />

src/ReactiveUI.Drawing/Builder/ReactiveUIBuilderDrawingExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class ReactiveUIBuilderDrawingExtensions
1515
/// </summary>
1616
/// <param name="builder">The builder instance.</param>
1717
/// <returns>The builder instance for method chaining.</returns>
18-
public static ReactiveUIBuilder WithDrawing(this ReactiveUIBuilder builder)
18+
public static IReactiveUIBuilder WithDrawing(this IReactiveUIBuilder builder)
1919
{
2020
if (builder is null)
2121
{

src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
</ItemGroup>
2525
<ItemGroup>
2626
<PackageReference Include="Splat.Drawing" />
27+
<PackageReference Include="System.Reactive" />
2728
</ItemGroup>
2829
</Project>

src/ReactiveUI.Maui/Builder/MauiReactiveUIBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static class MauiReactiveUIBuilderExtensions
2626
/// <param name="builder">The builder instance.</param>
2727
/// <param name="dispatcher">The MAUI dispatcher to use for the main thread scheduler.</param>
2828
/// <returns>The builder instance for chaining.</returns>
29-
public static ReactiveUIBuilder WithMaui(this ReactiveUIBuilder builder, IDispatcher? dispatcher = null)
29+
public static IReactiveUIBuilder WithMaui(this IReactiveUIBuilder builder, IDispatcher? dispatcher = null)
3030
{
3131
if (builder is null)
3232
{
@@ -43,7 +43,7 @@ public static ReactiveUIBuilder WithMaui(this ReactiveUIBuilder builder, IDispat
4343
/// </summary>
4444
/// <param name="builder">The builder.</param>
4545
/// <returns>The builder instance for chaining.</returns>
46-
public static ReactiveUIBuilder WithMauiScheduler(this ReactiveUIBuilder builder)
46+
public static IReactiveUIBuilder WithMauiScheduler(this IReactiveUIBuilder builder)
4747
{
4848
if (builder is null)
4949
{

0 commit comments

Comments
 (0)