Skip to content

Update dependency Pure.DI to 2.5.2#33

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/pure.di-2.x
Open

Update dependency Pure.DI to 2.5.2#33
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/pure.di-2.x

Conversation

@renovate

@renovate renovate Bot commented Jul 24, 2026

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
Pure.DI 2.5.02.5.2 age adoption passing confidence

Release Notes

DevTeam/Pure.DI (Pure.DI)

v2.5.2

Compare Source

🚀 New Features

  • Owned and Own Infrastructure Enhancements

    • Improved built-in ownership infrastructure for Owned<T> graphs.
    • Added Own.Empty shared no-op owner for graphs that are known to contain no disposable resources.
    • Added preallocated ownership storage paths to reduce overhead when the generator knows the expected number of tracked resources.
    • Added synchronization-aware Own construction to coordinate resource registration with disposal when thread safety is enabled.
    • Added rejection checks for disposed owners: resources added after disposal are immediately disposed and rejected instead of leaking.
  • Disposal Exception Tracing

🛠 Improvements

  • Owned Disposal Semantics

    • Improved nested ownership boundary isolation.
    • Refined rollback logic when graph construction fails after disposable resources have already been created.
    • Suppressed disposal exceptions so one failing dependency does not prevent cleanup of the rest of the graph.
    • Avoided generating empty root try/catch blocks for Owned<T> factory scenarios when no cleanup work is required.
  • Autofac-Parity Coverage

    • Added a comparison test suite for Owned<T> disposal behavior using Autofac scenarios as a reference.
    • Expanded integration tests for nested ownership, failed construction rollback, disposal ordering, disposal exceptions, and built-in ownership behavior.
  • Documentation

    • Expanded XML documentation for abstractions, attributes, templates, ownership infrastructure, and generated API components.
    • Refined README structure and disposal/ownership examples.

What's Changed

New Contributors

Full Changelog: DevTeam/Pure.DI@2.5.1...2.5.2

v2.5.1

Compare Source

🚀 New Features

  • Union Type Contracts — Pure.DI now supports preview C# union types as DI contracts.

    • Case implementations can be bound to a union contract through implicit case-to-union conversion.
    • Union contracts are resolved from a single applicable case binding using generated compile-time conversion code.
    • Nested union cases and standard conversion rules are supported.
    • Ambiguous case bindings now report DIE050 with candidate details and related binding locations.
    • Union types are not auto-bound, preventing empty union instances from being created accidentally.
    • See readme/union-types.md.
  • Non-Boxing Union Results

    • Added support for allocation-friendly custom union results with direct value-type case storage.
    • Pure.DI can bind value-type cases to a union contract without adding reflection, lookup, or wrapper allocation.
    • See readme/non-boxing-union-result.md.
  • Ref-Like and Stack-Only Type Support

    • Extended fluent API support for ref-like type arguments, including Span<T>, ReadOnlySpan<T>, custom ref struct types, and where T : allows ref struct.
    • Added support for generic lightweight roots and root arguments with allows ref struct.
    • Added support for factory delegates that accept stack-only values.
    • Added safe default Func<ReadOnlySpan<char>, T> roots.
    • Added array-to-Span<T> / ReadOnlySpan<T> root argument conversion.
    • See readme/span-and-readonlyspan.md, readme/default-func-with-readonlyspan.md, and readme/allows-ref-struct-factory.md.
  • C# 14 Constructor and Overload Features

  • Method and Member Injection Ordering

    • OrdinalAttribute now applies consistently to fields, properties, methods, and method parameters.
    • Method-level ordinal takes precedence; otherwise, the lowest parameter ordinal determines method execution order.
    • Required fields and selected init properties are initialized before regular member injection.
    • Custom and inherited member ordinal scenarios are now covered by tests and documentation.

🛡 Diagnostics and Validation

  • Stack-Only Safety Diagnostics

    • DIE046: stack-only dependency cannot be used with stored lifetimes.
    • DIE047: stack-only dependency cannot be injected into fields or properties.
    • DIE048: stack-only implementation cannot be injected through an interface conversion.
    • DIE049: stack-only dependency cannot be captured in generated delegates or factories.
    • DIW012: warns when stack-only dependencies are injected into heap-type constructors.
    • DIW013: warns when stack-only factory overrides are not synchronized.
  • Union and Overload Diagnostics

    • DIE050: reports ambiguous union case bindings.
    • DIW014: warns when an injection method may resolve to another overload because of OverloadResolutionPriority.

⚡ High-Performance Scenarios

  • Added new examples for:
    • ArrayPool-backed buffers.
    • Zero-copy network packet parsing.
    • Method injection for hot paths.
    • Factory delegates without closure capture.
    • Object pooling.
    • Struct dependencies.
    • ThreadSafe = Off for single-threaded compositions.
    • ValueTask<T> roots.
    • Non-boxing union results.

🧰 Maintenance

  • Updated Roslyn analyzer baseline from 4.8 to 5.6.
  • Enabled preview language support for union type scenarios.

Uno Platform Sample Application

  • Added a new cross-platform Uno Platform sample application powered by Pure.DI.
  • The sample uses the single-project Uno SDK with Skia Desktop and targets net10.0-desktop.
  • Demonstrates XAML-friendly virtual composition roots, DesignTimeComposition overrides for tooling, and a shared Composition resource without adding a runtime DI container.
  • Includes dispatcher integration, application/window lifetime disposal, and documentation in readme/UnoApp.md.

Full Changelog: DevTeam/Pure.DI@2.5.0...2.5.1


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

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.

0 participants