Skip to content

Conversation

ChrisPulman
Copy link
Member

(

What kind of change does this PR introduce?

update

What is the new behavior?

This pull request refactors platform-specific builder extension methods for Blazor and AndroidX, consolidating them under the ReactiveUI.Builder namespace and updating their APIs for consistency and improved scheduler configuration. It also updates related tests to use the new builder creation method, streamlining service registration and test setup. Minor dependency and warning suppression updates are included.

Platform Extension Refactor and Consolidation:

  • Added new extension classes BlazorReactiveUIBuilderExtensions and AndroidXReactiveUIBuilderExtensions in the ReactiveUI.Builder namespace, providing consistent APIs for configuring platform schedulers and modules. These replace the older extension files and introduce properties for main thread schedulers.
  • Removed legacy extension files ReactiveUIBuilderBlazorExtensions.cs and ReactiveUIBuilderAndroidXExtensions.cs from platform-specific namespaces, migrating their functionality to the new consolidated location.

Test Suite Modernization:

  • Updated all builder-related tests to use locator.CreateReactiveUIBuilder() instead of the previous locator.CreateBuilder() method, and replaced direct calls to AppBuilder.ResetBuilderStateForTests() with Splat.Builder.AppBuilder.ResetBuilderStateForTests(). This change ensures tests use the new builder API and maintain proper isolation.

Dependency and Warning Updates:

  • Bumped the SplatVersion property in Directory.Packages.props from 15.5.3 to 16.0.1 to use the latest version.
  • Added CA1510 to the NoWarn property in Directory.build.props to suppress a new code analysis warning.

AOT Test Initialization:

  • Ensured that RxApp.EnsureInitialized() is called in the constructor of ViewLocatorAOTMappingTests to guarantee ReactiveUI is initialized for AOT mapping tests.

What might this PR break?

N/A new unreleased feature

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

Added calls to InitializeSplat in ReactiveUIBuilder, builder extension, and RxApp static constructor to ensure Splat services are registered before core ReactiveUI services. Updated test classes to call RxApp.EnsureInitialized in constructors for consistent initialization. Also updated Splat package version in Directory.Packages.props.
Moved platform-specific ReactiveUIBuilder extension methods from platform namespaces to ReactiveUI.Builder, consolidating and standardizing their APIs. Updated tests and app code to use the new builder extension methods and removed legacy extension files. Added MultiPlatformReactiveUIBuilderExtensions for multi-platform configuration. This improves AOT compatibility and simplifies platform registration.
@ChrisPulman ChrisPulman enabled auto-merge (squash) August 26, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants