| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This pull request introduces a major architectural change to Splat's dependency injection system by implementing a new AOT-compatible dependency resolver (InstanceGenericFirstDependencyResolver) to replace ModernDependencyResolver as the default. The PR significantly reduces the need for trimming attributes and improves AOT compatibility.
Key changes:
Copilot reviewed 168 out of 176 changed files in this pull request and generated 50 comments.
Show a summary per file| File | Description |
|---|---|
| src/tests/Splat.Tests/Splat.Tests.csproj | Simplified project references, enabled implicit usings, removed logging framework dependencies from core tests |
| src/tests/Splat.Tests/ServiceLocation/*.cs | Added comprehensive test coverage for new resolver implementations including ResolverMixins, NullServiceType, InternalLocator, and base resolver tests |
| src/tests/Splat.Tests/ServiceLocation/InstanceGenericFirst/*.cs | New tests for instance-scoped generic-first resolver components (ContainerCache, ResolverState) |
| src/tests/Splat.Tests/ServiceLocation/GlobalGenericFirst/*.cs | New tests for global generic-first resolver components (ServiceTypeRegistry, Container, ContractContainer, ArrayHelpers, Registration) |
| src/tests/Splat.Tests/ServiceLocation/ModernDependencyResolverTests.cs | Extended tests with disposal, duplication, and edge case coverage |
| src/tests/Splat.Tests/ServiceLocation/BaseDependencyResolverTests.cs | Enhanced base test class with comprehensive generic method coverage and disposal tests |
| src/tests/Splat.Common.Test/*.cs | New test infrastructure including InternalLocatorScope, IMockLogTarget, TextLogger, and improved scope helpers |
| src/tests/Splat..Tests/.cs | Updated integration tests across all framework-specific test projects to use new resolver and generic methods |
| src/Splat/ServiceLocation/ServiceLocationInitialization.cs | Updated to use generic HasRegistration<T>() methods |
| src/tests/Splat.Tests/API/*.verified.txt | Updated API approval snapshots showing new generic overloads in FuncDependencyResolver |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
…d bodies - Updated various test classes to utilize target-typed `new` expressions for cleaner instantiation. - Simplified method bodies by removing unnecessary braces and return statements in async methods. - Adjusted assertions to directly use the result of method calls where applicable. - Ensured consistency across tests in handling null checks and service registrations.
Sorry, something went wrong.
…ogging features - Introduced new tests in `FullLoggerExtensionsTests` to validate behavior across all log levels (Debug, Info, Warn, Error, Fatal) for standard loggers, generic loggers, and exception-based loggers. - Added coverage for `StaticLoggerTests` to verify constructor exception handling. - Expanded `CoverageColorTests` to include validation tests for known color properties.
- Replaced inline `null!` usage with `Func<string> nullFunc = null!` across all test cases. - Ensured consistency when testing null argument exceptions for loggers at all levels (Debug, Info, Warn, Error, Fatal).
…DependencyResolver` - Added null-check handling for contracts in registration methods to enhance robustness. - Simplified and centralized logic for marking registrations and managing disposables. - Updated comments and docstrings for clearer documentation and understanding. - Refactored `GenericFirstDependencyResolver` based classes with improved thread-safety, state handling, and null/unwrapped results processing.
- Updated `HasRegistration` to handle null contracts correctly and align with Splat's expected behavior. - Enhanced documentation in the README to clarify performance and isolation differences between resolvers. - Added recommendations for resolver usage and detailed performance characteristics for better user guidance.
…nit tests. Fixed other unit tests.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This release introduces a new, high-performance dependency resolver designed for AOT (Ahead-of-Time) compilation compatibility, while significantly reducing the trimming attribute burden on your applications.
What Changed
1. New Dependency Resolver Implementation
We've replaced the previous dependency resolver with a new AOT-compatible, generic-first implementation that provides:
2. Simplified Trimming Attributes (Major Developer Experience Improvement)
This is a big win for you as an end user!
Previously, using Splat's dependency injection features required you to annotate your code with various DynamicallyAccessedMembers attributes to satisfy the trimmer. This was burdensome and easy to get wrong.
Now: We've removed the need for almost all trimming attributes!
Before (you had to do this):
Now (clean and simple):
3. Improved Test Isolation
We've enhanced our test infrastructure with proper scope isolation to prevent state leakage between tests, particularly for:
This doesn't affect you directly, but ensures higher quality and more reliable releases.
Breaking Changes
Container Swap
The internal dependency resolver implementation has changed. If you're using the public AppLocator API as documented, you should see no breaking changes.
Potential issues only if you:
Migration Guide
For most users: No changes needed - the public API remains the same.
If you were using internal APIs:
Benefits
Benchmark Results
See the updated README for detailed benchmark comparisons showing performance improvements in: