Skip to content

Commit c9e3574

Browse files
authored
chore: Update to ReactiveUI 23.1.0-beta, migrate tests to TUnit and MTP (#308)
* Remove SQLiteStudio sample and update configs Deleted the ReactiveUI.Uno.SQLiteStudio sample project and related files, including test projects and configuration files. Updated .editorconfig to improve organization, add comments, and clarify analyzer rules. Added new documentation and configuration files (CLAUDE.md, agent.md, codecov.yml, etc.), and updated solution and project references accordingly. * Add .slnx solution, update WinRTAppDataDriver, and add tests Replaces the .sln solution file with a new .slnx format and updates references accordingly. Enhances WinRTAppDataDriver to implement JSON-based state load/save/invalidate methods and improves error handling. Updates Directory.Build.props to include net9.0 in cross-platform targets and suppresses additional warnings. Adds comprehensive unit tests for activation, bootstrapping, builder extensions, controls, converters, helpers, hooks, observables, platform operations, registrations, resources, schedulers, and storage. Updates example project to suppress more warnings and disables TreatWarningsAsErrors. Simplifies and redirects Copilot instructions to agent.md. * Add ReactiveUI.Uno.SQLiteStudio example and update Uno builder Introduces a new example project, ReactiveUI.Uno.SQLiteStudio, demonstrating usage of ReactiveUI with Uno Platform and SQLite. Refactors UnoReactiveUIBuilderExtensions to require the startup window for WithUno, updates scheduler registration, and improves Uno dictionary resource injection. Updates codecov config to ignore examples, adjusts target framework order for Uno cross-platform builds, and includes the new example in the solution. * Update solution and workflows to use .slnx format Changed CI and release workflows to reference the .slnx solution file instead of .sln. Updated ReactiveUI.Uno.slnx to include workflow files and set deploy configuration for the SQLiteStudio example project. Fixed test to pass required parameters to WithUno. * Improve XML docs and remove unused attributes Enhanced XML documentation for several classes and dependency properties to provide clearer descriptions and usage context. Removed unused or unnecessary RequiresUnreferencedCode attributes and redundant using directives to clean up the codebase. * Update Android build settings and add PublishTrimmed property Refines the condition for Android-specific settings to use TargetFramework.EndsWith('0-android'), adds PublishTrimmed property for Android builds, and sets PublishTrimmed to false for non-Android targets. This improves build configuration and output trimming behavior. * Comment out Android targets in Uno example build Android target frameworks are now commented out in Directory.Build.props, likely to avoid building Android targets by default. Also, a commented RuntimeIdentifierGraphPath line was removed from the SQLiteStudio example project for cleanup. * Update ReactiveUI.Uno.SQLiteStudio.csproj * Update target frameworks and remove obsolete test Removed 'net9.0-browserwasm' from UnoExampleCrossPlatformNet9 in Directory.Build.props to update supported target frameworks. Also removed the WithDefaultIScreen_HasRequiresUnreferencedCodeAttribute test from UnoReactiveUIBuilderExtensionsTests.cs, likely due to changes in method attributes or relevance. * Update PublishTrimmed property for iOS and other targets Added a separate PropertyGroup to enable PublishTrimmed for iOS targets and updated the condition for disabling PublishTrimmed to exclude both Android and iOS. This ensures correct trimming behavior for different platforms. * Update workflow configs for ReactiveUI.Uno Removed the solutionFile parameter from ci-build.yml and updated productNamespacePrefix in release.yml to 'ReactiveUI.Uno'. This aligns workflow configuration with the current project structure. * Add XML documentation to ScheduleSlow method Added detailed XML comments to the ScheduleSlow<TState> method in UnoDispatcherScheduler.cs to improve code clarity and provide usage information for developers. * Comment out Apple Mobile TFMs addition in build props The line adding Apple Mobile Target Frameworks for macOS and Windows builds has been commented out in Directory.Build.props. This may be to temporarily disable building for Apple mobile platforms during certain builds.
1 parent e47501b commit c9e3574

149 files changed

Lines changed: 4293 additions & 4063 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 701 additions & 372 deletions
Large diffs are not rendered by default.

.github/copilot-instructions.md

Lines changed: 4 additions & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -1,196 +1,7 @@
1-
# GitHub Copilot Instructions for ReactiveUI.Uno
1+
This repository’s canonical agent guidance has been consolidated into:
22

3-
## 🚨 VITAL PREREQUISITES - READ FIRST 🚨
3+
- `agent.md` in the root folder or relative path is `../agent.md` to this file.
44

5-
**BEFORE MAKING ANY CODE CHANGES OR BUILD ATTEMPTS**, you MUST ensure these requirements are met. Failure to do so will result in redundant actions and wasted time.
5+
GitHub Copilot (and other coding agents) should read and follow `agent.md` for build/test commands, repository architecture context, coding standards, and AOT requirements.
66

7-
### 1. .NET 9 SDK Requirement - MANDATORY
8-
9-
This project **REQUIRES** .NET 9 SDK (specifically version 9.0.304 or later). The project will NOT build with .NET 8 or earlier versions.
10-
11-
**Before any build or development work:**
12-
13-
```bash
14-
# Check current .NET version
15-
dotnet --version
16-
17-
# If not 9.0.304 or later, install .NET 9 SDK:
18-
# Download from: https://dotnet.microsoft.com/download/dotnet/9.0
19-
```
20-
21-
**Why this is VITAL:**
22-
- The `global.json` file pins the SDK to version 9.0.304
23-
- Cross-platform build targets require .NET 9 features
24-
- Build will fail immediately without proper SDK version
25-
- All subsequent development attempts will be futile without this
26-
27-
### 2. Non-Shallow Clone Requirement - MANDATORY
28-
29-
You MUST work with a full repository clone, not a shallow one. This is essential for the build system to function properly.
30-
31-
**If working with a shallow clone, fix it immediately:**
32-
33-
```bash
34-
# Convert shallow clone to full clone
35-
git fetch --unshallow
36-
37-
# Verify you have full history
38-
git log --oneline | wc -l # Should show more than just recent commits
39-
```
40-
41-
**Why this is VITAL:**
42-
- Cross-platform build compatibility depends on full git history
43-
- Version generation and build scripts rely on commit history
44-
- Shallow clones cause build failures and inconsistent behavior
45-
- The build system has been significantly improved for cross-platform compatibility
46-
47-
## Development Workflow
48-
49-
### Initial Setup (MANDATORY FIRST STEPS)
50-
51-
1. **Verify .NET 9 SDK installation**
52-
2. **Ensure non-shallow repository clone**
53-
3. **Only then proceed with development tasks**
54-
55-
### Build and Test
56-
57-
```bash
58-
# Build the main solution (from repository root)
59-
dotnet restore src/ReactiveUI.Uno.sln
60-
dotnet build src/ReactiveUI.Uno.sln
61-
62-
# Run tests
63-
dotnet test src/ReactiveUI.Uno.sln
64-
```
65-
66-
### Platform-Specific Notes
67-
68-
The project supports multiple target frameworks:
69-
- `net9.0` (cross-platform)
70-
- `net9.0-desktop` (desktop targets)
71-
- `net9.0-browserwasm` (WebAssembly)
72-
- `net9.0-windows10.0.19041.0` (Windows desktop - Windows hosts only)
73-
- `net9.0-android` (Android - all platforms)
74-
- `net9.0-ios` (iOS - macOS and Windows hosts only)
75-
76-
Target frameworks are automatically selected based on the host platform for optimal build performance.
77-
78-
## Validation and Quality Assurance
79-
80-
### Code Style and Analysis Enforcement
81-
- **EditorConfig Compliance**: Repository uses a comprehensive `.editorconfig` with detailed rules for C# formatting, naming conventions, and code analysis.
82-
- **StyleCop Analyzers**: Enforces consistent C# code style with `stylecop.analyzers`.
83-
- **Roslynator Analyzers**: Additional code quality rules with `Roslynator.Analyzers`.
84-
- **Analysis Level**: Set to `latest` with enhanced .NET analyzers enabled.
85-
- **CRITICAL**: All code must comply with ReactiveUI contribution guidelines: [https://www.reactiveui.net/contribute/index.html](https://www.reactiveui.net/contribute/index.html).
86-
87-
## C# Style Guide
88-
**General Rule**: Follow "Visual Studio defaults" with the following specific requirements:
89-
90-
### Brace Style
91-
- **Allman style braces**: Each brace begins on a new line.
92-
- **Single line statement blocks**: Can go without braces but must be properly indented on its own line and not nested in other statement blocks that use braces.
93-
- **Exception**: A `using` statement is permitted to be nested within another `using` statement by starting on the following line at the same indentation level, even if the nested `using` contains a controlled block.
94-
95-
### Indentation and Spacing
96-
- **Indentation**: Four spaces (no tabs).
97-
- **Spurious free spaces**: Avoid, e.g., `if (someVar == 0)...` where dots mark spurious spaces.
98-
- **Empty lines**: Avoid more than one empty line at any time between members of a type.
99-
- **Labels**: Indent one less than the current indentation (for `goto` statements).
100-
101-
### Field and Property Naming
102-
- **Internal and private fields**: Use `_camelCase` prefix with `readonly` where possible.
103-
- **Static fields**: `readonly` should come after `static` (e.g., `static readonly` not `readonly static`).
104-
- **Public fields**: Use PascalCasing with no prefix (use sparingly).
105-
- **Constants**: Use PascalCasing for all constant local variables and fields (except interop code, where names and values must match the interop code exactly).
106-
- **Fields placement**: Specify fields at the top within type declarations.
107-
108-
### Visibility and Modifiers
109-
- **Always specify visibility**: Even if it's the default (e.g., `private string _foo` not `string _foo`).
110-
- **Visibility first**: Should be the first modifier (e.g., `public abstract` not `abstract public`).
111-
- **Modifier order**: `public`, `private`, `protected`, `internal`, `static`, `extern`, `new`, `virtual`, `abstract`, `sealed`, `override`, `readonly`, `unsafe`, `volatile`, `async`.
112-
113-
### Namespace and Using Statements
114-
- **Namespace imports**: At the top of the file, outside of `namespace` declarations.
115-
- **Sorting**: System namespaces alphabetically first, then third-party namespaces alphabetically.
116-
- **Global using directives**: Use where appropriate to reduce repetition across files.
117-
- **Placement**: Use `using` directives outside `namespace` declarations.
118-
119-
### Type Usage and Variables
120-
- **Language keywords**: Use instead of BCL types (e.g., `int`, `string`, `float` instead of `Int32`, `String`, `Single`) for type references and method calls (e.g., `int.Parse` instead of `Int32.Parse`).
121-
- **var usage**: Encouraged for large return types or refactoring scenarios; use full type names for clarity when needed.
122-
- **this. avoidance**: Avoid `this.` unless absolutely necessary.
123-
- **nameof(...)**: Use instead of string literals whenever possible and relevant.
124-
125-
### Code Patterns and Features
126-
- **Method groups**: Use where appropriate.
127-
- **Pattern matching**: Use C# 7+ pattern matching, including recursive, tuple, positional, type, relational, and list patterns for expressive conditional logic.
128-
- **Inline out variables**: Use C# 7 inline variable feature with `out` parameters.
129-
- **Non-ASCII characters**: Use Unicode escape sequences (`\uXXXX`) instead of literal characters to avoid garbling by tools or editors.
130-
- **Modern C# features (C# 8–12)**:
131-
- Enable nullable reference types to reduce null-related errors.
132-
- Use ranges (`..`) and indices (`^`) for concise collection slicing.
133-
- Employ `using` declarations for automatic resource disposal.
134-
- Declare static local functions to avoid state capture.
135-
- Prefer switch expressions over statements for concise control flow.
136-
- Use records and record structs for data-centric types with value semantics.
137-
- Apply init-only setters for immutable properties.
138-
- Utilize target-typed `new` expressions to reduce verbosity.
139-
- Declare static anonymous functions or lambdas to prevent state capture.
140-
- Use file-scoped namespace declarations for concise syntax.
141-
- Apply `with` expressions for nondestructive mutation.
142-
- Use raw string literals (`"""`) for multi-line or complex strings.
143-
- Mark required members with the `required` modifier.
144-
- Use primary constructors to centralize initialization logic.
145-
- Employ collection expressions (`[...]`) for concise array/list/span initialization.
146-
- Add default parameters to lambda expressions to reduce overloads.
147-
148-
### Documentation Requirements
149-
- **XML comments**: All publicly exposed methods and properties must have .NET XML comments, including protected methods of public classes.
150-
- **Documentation culture**: Use `en-US` as specified in `src/stylecop.json`.
151-
152-
### File Style Precedence
153-
- **Existing style**: If a file differs from these guidelines (e.g., private members named `m_member` instead of `_member`), the existing style in that file takes precedence.
154-
- **Consistency**: Maintain consistency within individual files.
155-
156-
### Notes
157-
- **EditorConfig**: The `.editorconfig` at the root of the ReactiveUI repository enforces formatting and analysis rules, replacing the previous `analyzers.ruleset`. Update `.editorconfig` as needed to support modern C# features, such as nullable reference types.
158-
- **Example Updates**: The example incorporates modern C# practices like file-scoped namespaces and nullable reference types. Refer to Microsoft documentation for further integration of C# 8–12 features.
159-
160-
### Code Formatting (Fast - Always Run)
161-
- **ALWAYS** run formatting before committing:
162-
```bash
163-
cd src
164-
dotnet format whitespace --verify-no-changes
165-
dotnet format style --verify-no-changes
166-
```
167-
Time: **2-5 seconds per command**.
168-
169-
### Code Analysis Validation
170-
- **Run analyzers** to check StyleCop and code quality compliance:
171-
```bash
172-
cd src
173-
dotnet build --configuration Release --verbosity normal
174-
```
175-
This runs all analyzers (StyleCop SA*, Roslynator RCS*, .NET CA*) and treats warnings as errors.
176-
- **Analyzer Configuration**:
177-
- StyleCop settings in `src/stylecop.json`
178-
- EditorConfig rules in `.editorconfig` (root level)
179-
- Analyzer packages in `src/Directory.Build.props`
180-
- All code must follow the **ReactiveUI C# Style Guide** detailed above
181-
182-
## Common Issues and Solutions
183-
184-
### "A compatible .NET SDK was not found"
185-
- **Solution**: Install .NET 9 SDK (version 9.0.304 or later)
186-
- **Do NOT**: Modify global.json to use an older SDK version
187-
188-
### Build failures with version/history errors
189-
- **Solution**: Ensure you have a full clone (`git fetch --unshallow`)
190-
- **Do NOT**: Attempt workarounds with shallow clones
191-
192-
### Cross-platform build issues
193-
- **Solution**: Verify both .NET 9 SDK and full clone requirements are met
194-
- **Note**: Recent improvements require these prerequisites for proper functionality
195-
196-
Remember: These requirements exist because significant work has been done to improve cross-platform build compatibility. Respecting these prerequisites ensures you benefit from these improvements rather than fighting against them.
7+
If there is any conflict between this file and `agent.md`, follow **agent.md**.

.github/workflows/ci-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
with:
1818
useUNO: true
1919
productNamespacePrefix: "ReactiveUI.Uno"
20-
solutionFile: "ReactiveUI.Uno.sln"
2120
installWorkloads: true
2221
secrets:
2322
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main
1515
with:
1616
configuration: Release
17-
productNamespacePrefix: "ReactiveUI"
18-
solutionFile: "reactiveui.uno.sln"
17+
productNamespacePrefix: "ReactiveUI.Uno"
1918
secrets:
2019
SIGN_CLIENT_USER_ID: ${{ secrets.SIGN_CLIENT_USER_ID }}
2120
SIGN_CLIENT_SECRET: ${{ secrets.SIGN_CLIENT_SECRET }}

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CLAUDE.md
2+
3+
Follow the canonical repository agent guidance in @agent.md.
4+
5+
If anything in this file conflicts with @agent.md, follow @agent.md.

Directory.Build.props

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)