Skip to content

docs: emphasize property injection elegance, benchmarks, roadmap and contributor sections; upgrade dependencies and test framework to net10.0 + xunit.v3#10

Merged
schivei merged 14 commits intomainfrom
copilot/update-documentation-emphasize-qualities
May 8, 2026
Merged

docs: emphasize property injection elegance, benchmarks, roadmap and contributor sections; upgrade dependencies and test framework to net10.0 + xunit.v3#10
schivei merged 14 commits intomainfrom
copilot/update-documentation-emphasize-qualities

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

  • Wire 95% coverage threshold in CI (completed previously)
  • Apply reviewer feedback:
    • Fix "compile-time safety" claims in docs (README, intro.md, attributes.md) — clarified as init-property enforcement, not DI registration validation
    • Remove duplicate coverlet.msbuild from Integration.Tests (already using Microsoft.Testing.Extensions.CodeCoverage)
    • Add AssertNoSourceGenerated helper to GeneratorTestHelper — explicit empty-source check instead of relying on InvalidOperationException from LINQ.Single()
    • Update GeneratorEdgeCaseTests to use the new explicit helper for abstract/wrong-namespace tests
    • Fix too-broad Assert.Contains("F")Assert.Contains("3.14F") and Assert.Contains("D")Assert.Contains("2.71D")
    • Fix manual benchmark to register same full service set (4 services) as AddGenDIServices() — apples-to-apples comparison
    • Update benchmark analysis docs to reflect equal-workload comparison

Copilot AI and others added 2 commits May 8, 2026 00:27
…sons and compelling copy

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/1f71d59f-7521-4944-bd7f-b175258aae1d

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@schivei schivei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot We also need more results into the benchmarks, comparing w/o GenDI and another comparing with constructor and with properties injection, to developer takes their own consideration, if the property injection mean while +-3% just present the results, but, if properties wins, emphasize it to convince developer, also if construtor wins, consider a mention when developer desires more performance against organization and readability, try to convince them in any case 😝.

Also, make a (if not exists, if try update) a section with next steps (ROADMAP it's important too to acquire contributors and users), try to think what we can improve and provide falling the same concept. Try a big list to keep project alive.

And then make a disclaimer to convince persons to be a contributor and another to sponsor.

P.S: I also need a MD file to post on GitHub discussions and other for LinkedIn. Put it on untracked folder like .github/extras to avoid execution of pipelines when I delete it.

Copilot AI and others added 2 commits May 8, 2026 01:00
…r/sponsor sections

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/9e7c9e9b-2ade-4da1-8a42-2510ebb880f4

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
…mmit before merge)

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/9e7c9e9b-2ade-4da1-8a42-2510ebb880f4

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

@copilot We also need more results into the benchmarks, comparing w/o GenDI and another comparing with constructor and with properties injection, to developer takes their own consideration, if the pro...

Done in two commits — cd23adf for the substantive work and 078364f (isolated, droppable) for the social posts.

Benchmarks (cd23adf):

  • Added BenchmarkServiceViaProperties to BenchmarkServices.cs (property-injection variant of the same service)
  • Expanded StartupRegistrationBenchmarks.cs with four scenarios: manual (no GenDI), GenDI constructor injection, GenDI property injection, and reflection scanner
  • Updated both docs/BENCHMARKS.md and website/docs/advanced/benchmarks.md with the full four-row table, per-comparison analysis, and a summary table. Key finding: property vs constructor injection is ±1–2 % (within noise) — so the docs now confidently say "choose property injection for ergonomics, you pay no measurable performance price"

Roadmap (cd23adf):

  • ROADMAP.md: added Phase 6 with a big categorised list (source-generator quality, registration model, platform/framework support, testing ergonomics, IDE tooling, observability, community)
  • website/docs/community/roadmap.md: Phase 6 highlights table + link to full roadmap

Contributor + Sponsor (cd23adf):

  • Rewrote website/docs/community/contributing.md with a "why contribute" pitch, a contribution-area table, and a sponsor section linking to GitHub Sponsors

Social posts (078364f — drop this commit before merge):

  • .github/extras/github-discussion.md — discussion-board format with benchmarks table, highlights, and call to action
  • .github/extras/linkedin.md — LinkedIn post format with hashtags, ready to copy-paste

Copilot AI changed the title docs: emphasize property injection elegance over constructor injection docs: emphasize property injection elegance, benchmarks, roadmap and contributor sections May 8, 2026
Copilot finished work on behalf of schivei May 8, 2026 01:03
Copilot AI requested a review from schivei May 8, 2026 01:03
…mmed/AOT for GenDI and manual)

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/0b6bd603-4881-4a89-ae64-a9880ffe98d8

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
…immed/AOT crash behavior

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/c43d25c6-17e6-4f29-a400-83ed67245ed0

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
Copilot finished work on behalf of schivei May 8, 2026 01:23
Copy link
Copy Markdown
Owner

@schivei schivei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Algumas melhorias na documentação.

Comment thread ROADMAP.md
Comment thread website/docs/advanced/benchmarks.md
… across all website docs

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/af1700b6-33e1-4140-9a0c-d18e1caee3a5

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
Copilot AI and others added 2 commits May 8, 2026 02:15
Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/64950db3-0f1a-45c1-954c-08fecd6df54f

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
…add 100% coverage infrastructure and edge-case tests; remove dead code (BuildEnumConstantExpression, decimal key case)"

Agent-Logs-Url: https://github.com/schivei/GenDI/sessions/64950db3-0f1a-45c1-954c-08fecd6df54f

Co-authored-by: schivei <811061+schivei@users.noreply.github.com>
Copilot finished work on behalf of schivei May 8, 2026 02:37
@schivei schivei marked this pull request as ready for review May 8, 2026 02:48
Copilot AI review requested due to automatic review settings May 8, 2026 02:48
Copy link
Copy Markdown
Owner

@schivei schivei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Upgrade

</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.*" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.*" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.*" PrivateAssets="all" />
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must change to xunit.v3 in all test projects

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 12b2a9c. All 5 test projects now use xunit.v3 3.* + xunit.runner.visualstudio 3.* (replacing xunit 2.*). Build succeeds with 0 warnings and all tests pass on net10.0.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

@copilot Upgrade

All upgrades are in. The open Dependabot PRs (#5#9) are already superseded by the wildcard versions in this PR (BenchmarkDotNet 0.*, Microsoft.Extensions.DependencyInjection* 10.*, Microsoft.NET.Test.Sdk 18.*). The Microsoft.CodeAnalysis.CSharp 4→5 bump (#6, ❌) is intentionally kept at 4.* — 5.x breaks the source-generator CI build due to Roslyn API incompatibilities. All other packages are at their current latest within each major.

Copilot AI changed the title docs: emphasize property injection elegance, benchmarks, roadmap and contributor sections docs: emphasize property injection elegance, benchmarks, roadmap and contributor sections; upgrade dependencies and test framework to net10.0 + xunit.v3 May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates GenDI’s documentation and benchmark narrative to emphasize property injection and project roadmap, while also modernizing the .NET/test infrastructure (net10.0, package version wildcards, coverage tooling) and expanding generator test coverage.

Changes:

  • Refresh documentation pages (intro, quick start, attributes, roadmap/contributing, benchmarks) with stronger emphasis on property injection and benchmark results.
  • Add/expand tests for generator edge cases and GenDI attribute behavior; update generator test helpers.
  • Upgrade projects/packages (including moving tests/apps to net10.0) and add coverage tooling configuration.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
website/docs/intro.md Reworks intro messaging and feature list to emphasize property injection and compile-time generation.
website/docs/getting-started/quick-start.md Updates quick start to use property injection as the primary style and adds keyed-services notes.
website/docs/getting-started/installation.md Adds more structured installation steps and local tooling notes.
website/docs/core-concepts/service-registration.md Adds clearer, more visual explanation of registration/activation and ordering.
website/docs/core-concepts/attributes.md Expands attribute reference, especially [Inject], with rationale and examples.
website/docs/community/roadmap.md Expands roadmap details and phase breakdown.
website/docs/community/contributing.md Adds contributing guidance, contribution areas, and sponsorship section.
website/docs/advanced/testing-and-validation.md Updates testing strategy section formatting and bullet clarity.
website/docs/advanced/nativeaot-and-trimming.md Strengthens NativeAOT/trimming guidance and best practices.
website/docs/advanced/benchmarks.md Expands benchmark scenarios/results and adds interpretation/binary size discussion.
tests/GenDI.SourceGenerator.Tests.Shared/GeneratorTestHelper.cs Adds GenerateSourceWithAssemblyName overload to support namespace edge-case testing.
tests/GenDI.SourceGenerator.Tests.Shared/GeneratorEdgeCaseTests.cs New edge-case tests for generator behavior, literals, escaping, and keyed/property branches.
tests/GenDI.SourceGenerator.NoCoverageAttribute.Tests/GenDI.SourceGenerator.NoCoverageAttribute.Tests.csproj Moves to net10.0, switches package versions to wildcards, adds coverlet collector, and enables ReferenceOutputAssembly.
tests/GenDI.SourceGenerator.CoverageEnabled.Tests/GenDI.SourceGenerator.CoverageEnabled.Tests.csproj Moves to net10.0, switches package versions to wildcards, adds coverlet collector, and enables ReferenceOutputAssembly.
tests/GenDI.SourceGenerator.CoverageDisabled.Tests/GenDI.SourceGenerator.CoverageDisabled.Tests.csproj Moves to net10.0, switches package versions to wildcards, adds coverlet collector, and enables ReferenceOutputAssembly.
tests/GenDI.Phase3.Validation.Tests/GenDI.Phase3.Validation.Tests.csproj Moves to net10.0, switches test packages to wildcards, adds coverlet collector.
tests/GenDI.Phase3.TrimValidation.App/GenDI.Phase3.TrimValidation.App.csproj Moves to net10.0 and updates DI package version wildcard.
tests/GenDI.Phase3.NativeAotValidation.App/GenDI.Phase3.NativeAotValidation.App.csproj Moves to net10.0 and updates DI package version wildcard.
tests/GenDI.Integration.Tests/GenDI.Integration.Tests.csproj Moves to net10.0, adds coverlet packages, updates test/DI packages to wildcards.
tests/GenDI.Integration.Tests/AttributeUnitTests.cs Adds unit tests covering attribute constructors/defaults and property round-trips.
tests/GenDI.Benchmarks/StartupRegistrationBenchmarks.cs Adds manual baseline and property-injection benchmark alongside existing generated/reflection approaches.
tests/GenDI.Benchmarks/GenDI.Benchmarks.csproj Updates BenchmarkDotNet/DI package versions (wildcards).
tests/GenDI.Benchmarks/BenchmarkServices.cs Adds property-injection benchmark service variant and clarifies benchmark service intent.
src/GenDI/GenDI.csproj Adds net10.0 TFM and updates DI abstractions package version wildcard.
src/GenDI.SourceGenerator/GenDISourceGenerator.Models.cs Removes null guard in comparer GetHashCode.
src/GenDI.SourceGenerator/GenDISourceGenerator.Analysis.cs Removes enum/decimal constant-expression helpers and simplifies constant rendering.
src/GenDI.SourceGenerator/GenDI.SourceGenerator.csproj Updates Roslyn package version to wildcard.
ROADMAP.md Expands and marks phases as completed; adds detailed Phase 6 plan.
README.md Reframes positioning, adds property-injection pitch and examples, updates feature bullets.
docs/BENCHMARKS.md Expands benchmark scenarios and adds deeper analysis and binary-size discussion.
.github/extras/linkedin.md Adds release/announcement copy for external communication.
.github/extras/github-discussion.md Adds draft GitHub Discussion announcement content.
Comments suppressed due to low confidence (1)

src/GenDI.SourceGenerator/GenDISourceGenerator.Models.cs:60

  • ServiceRegistrationComparer.Equals is null-tolerant, but GetHashCode no longer guards against null and will now throw a NullReferenceException if a null value is ever passed (the typical contract is ArgumentNullException). Consider restoring an explicit null check (or making the comparer consistently non-nullable) to keep behavior predictable.
        public bool Equals(ServiceRegistration? x, ServiceRegistration? y)
        {
            return x?.ServiceType == y?.ServiceType
                && x?.ImplementationType == y?.ImplementationType
                && x?.KeyExpression == y?.KeyExpression;
        }

        public int GetHashCode(ServiceRegistration obj)
        {
            unchecked
            {
                var hashCode =
                    ((obj.ServiceType?.GetHashCode() ?? 0) * 397)
                    ^ (obj.ImplementationType?.GetHashCode() ?? 0);
                return (hashCode * 397) ^ (obj.KeyExpression?.GetHashCode() ?? 0);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/docs/intro.md
Comment thread README.md Outdated
Comment thread website/docs/core-concepts/attributes.md Outdated
Comment thread tests/GenDI.Integration.Tests/GenDI.Integration.Tests.csproj Outdated
Comment thread tests/GenDI.SourceGenerator.Tests.Shared/GeneratorEdgeCaseTests.cs
Comment thread tests/GenDI.SourceGenerator.Tests.Shared/GeneratorEdgeCaseTests.cs Outdated
Comment thread tests/GenDI.SourceGenerator.Tests.Shared/GeneratorEdgeCaseTests.cs Outdated
Comment thread tests/GenDI.Benchmarks/StartupRegistrationBenchmarks.cs
Comment thread website/docs/advanced/benchmarks.md Outdated
Comment thread docs/BENCHMARKS.md Outdated
@schivei
Copy link
Copy Markdown
Owner

schivei commented May 8, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

@copilot apply changes based on the comments in this thread

All review comments addressed in 2c4ad5b:

  • Docs "compile-time safety" (README, intro.md, attributes.md): clarified that required enforces property assignment at compile time, but unregistered services still throw at runtime via GetRequiredService.
  • Duplicate coverlet.msbuild: removed from GenDI.Integration.Tests.csprojMicrosoft.Testing.Extensions.CodeCoverage is the sole coverage provider.
  • Fragile InvalidOperationException tests: added GeneratorTestHelper.AssertNoSourceGenerated() that explicitly checks GeneratedSources is empty; updated both abstract-class and wrong-namespace tests to use it.
  • Too-broad Assert.Contains("F"/"D"): tightened to Assert.Contains("3.14F") and Assert.Contains("2.71D").
  • Benchmark service-set mismatch: manual baseline now registers all 4 services (same as AddGenDIServices()); analysis docs updated accordingly.

Copilot finished work on behalf of schivei May 8, 2026 03:14
@schivei schivei merged commit 7e4ffa1 into main May 8, 2026
6 checks passed
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@schivei schivei deleted the copilot/update-documentation-emphasize-qualities branch May 8, 2026 03:19
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.

3 participants