Skip to content

fix(primitives): separate R3 bridge generator package#114

Merged
ChrisPulman merged 1 commit into
mainfrom
CP_r3bridge-standalone-package
Jul 2, 2026
Merged

fix(primitives): separate R3 bridge generator package#114
ChrisPulman merged 1 commit into
mainfrom
CP_r3bridge-standalone-package

Conversation

@ChrisPulman

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

A packaging and source-generator fix for the R3/R3Async bridge generator.

What is the new behavior?

ReactiveUI.Primitives.R3Bridge.Generator is packaged as a standalone analyzer package. The runtime ReactiveUI.Primitives and ReactiveUI.Primitives.Async packages no longer embed the generator or depend on it.

The generator now stamps consuming assemblies with AssemblyMetadata("ReactiveUI.Primitives.R3Bridge.Generator", "0.1.0") instead of generating a custom internal marker attribute. This keeps the generated bridge behavior unchanged while avoiding duplicate generated marker types across project-reference and InternalsVisibleTo builds.

README and packaged Skill guidance now describe the standalone generator package and opt-in install flow.

What is the current behavior?

The R3 bridge generator was embedded into runtime packages as an analyzer, and it generated an internal marker attribute type into each consuming compilation. That shape could participate in CS0436-style duplicate type warnings when project references and internals visibility expose generated output across compilations.

Checklist

  • Tests have been added or updated (for bug fixes / features)
  • Docs have been added or updated (for bug fixes / features)
  • Changes target the main branch
  • PR title follows Conventional Commits

Additional information

Validation performed locally:

  • dotnet build "ReactiveUI.Primitives.R3Bridge.Generator\ReactiveUI.Primitives.R3Bridge.Generator.csproj" -c Release
  • dotnet pack "ReactiveUI.Primitives.R3Bridge.Generator\ReactiveUI.Primitives.R3Bridge.Generator.csproj" -c Release --no-build
  • dotnet test "tests\ReactiveUI.Primitives.Tests\ReactiveUI.Primitives.Tests.csproj" -f net8.0 -- --treenode-filter "/*/*/R3BridgeGeneratorTests/*" --output Detailed
  • dotnet test "tests\ReactiveUI.Primitives.Async.Tests\ReactiveUI.Primitives.Async.Tests.csproj" -f net8.0 -- --treenode-filter "/*/*/AsyncBridgeGeneratorContractTests/*" --output Detailed
  • MTP coverage checks for R3BridgeGenerator.cs and R3AsyncBridgeGenerator.cs reported no missed coverage.
  • dotnet build "ReactiveUI.Primitives.slnx" -c Release
  • dotnet test "ReactiveUI.Primitives.slnx" -c Release --no-build -- --output Detailed passed 10,500 tests.
  • Runtime package pack checks confirmed ReactiveUI.Primitives and ReactiveUI.Primitives.Async no longer include R3 bridge analyzer assets.
  • git diff --check is clean apart from Git line-ending warnings on Windows.

codecov.yml is intentionally unchanged. CodeQL is excluded from the requested green-build target.

Package changes:

- Package ReactiveUI.Primitives.R3Bridge.Generator as a standalone analyzer NuGet package.

- Remove the R3 bridge generator analyzer from the runtime ReactiveUI.Primitives and ReactiveUI.Primitives.Async packages.

Generator changes:

- Replace the generated internal marker attribute with an AssemblyMetadata attribute stamped by the generator.

- Keep R3 and R3Async bridge emission conditional on the consuming compilation referencing the required external symbols.

Tests and docs:

- Update generator tests to verify no CS0436 warning path through project references and InternalsVisibleTo.

- Update README and packaged Skill guidance for the standalone generator package.
@ChrisPulman ChrisPulman marked this pull request as ready for review July 2, 2026 23:30
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (14f04a5) to head (538cc7f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
- Coverage   91.35%   91.33%   -0.02%     
==========================================
  Files         658      658              
  Lines       20564    20564              
  Branches     2481     2481              
==========================================
- Hits        18787    18783       -4     
- Misses       1441     1443       +2     
- Partials      336      338       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisPulman ChrisPulman merged commit 5914884 into main Jul 2, 2026
12 of 13 checks passed
@ChrisPulman ChrisPulman deleted the CP_r3bridge-standalone-package branch July 2, 2026 23:59
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