Skip to content

Add AOT Markup optimisations #4092

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

Merged
merged 5 commits into from
Aug 13, 2025
Merged

Add AOT Markup optimisations #4092

merged 5 commits into from
Aug 13, 2025

Conversation

ChrisPulman
Copy link
Member

What kind of change does this PR introduce?

Update

What is the current behavior?

AOT Markup is broadly applied

What is the new behavior?

A more detailed approach has been applied targeting methods and constructors primarily followed by class level attributes where required.

This pull request adds comprehensive support and validation for Native AOT (Ahead-of-Time) compilation in ReactiveUI, ensuring that the framework and its usage patterns work correctly in AOT scenarios. The changes include new AOT compatibility test suites, updates to package dependencies, build property enhancements for AOT, and detailed documentation of the current AOT implementation status and developer guidance.

Key highlights:

  • New test projects comprehensively validate both basic and advanced ReactiveUI scenarios under AOT, using proper suppression attributes in test code (not production).
  • Build system updated to ensure AOT compatibility flags are set for supported frameworks.
  • Package dependencies updated to latest versions for improved compatibility.
  • Documentation added to communicate the status, guidance, and best practices for AOT usage in ReactiveUI.

Most important changes:

AOT Test Coverage and Validation

  • Added AOTCompatibilityTests.cs and AdvancedAOTTests.cs to the ReactiveUI.AOTTests project, providing extensive test coverage for ReactiveUI features under Native AOT, including property changes, commands, property helpers, routing, validation, activation, dependency resolution, and message bus scenarios. Tests use UnconditionalSuppressMessage where required, following best practices to keep production code clean. [1] [2]

Build and Project System Enhancements

  • Updated Directory.build.props to set <IsAotCompatible>true> for all non-test projects targeting .NET 8.0 or 9.0, ensuring the build system recognizes and optimizes for AOT scenarios.

Dependency Updates for Compatibility

  • Upgraded several package versions in Directory.Packages.props for improved compatibility and stability, including Splat, System.Text.Json, and Microsoft.AspNetCore.Components. Also added Microsoft.Windows.CsWinRT as a new dependency. [1] [2] [3] [4]

These changes collectively aim to ensure that ReactiveUI is fully ready for Native AOT compilation, with clear guidance and validation for developers targeting modern .NET platforms.

What might this PR break?

AOT Trimming may be affected

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:

@ChrisPulman ChrisPulman merged commit 398bfae into main Aug 13, 2025
1 check passed
@ChrisPulman ChrisPulman deleted the CP_AOT_Optimisations branch August 13, 2025 19:25
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.

1 participant