The swift-dependencies library now ships a new `@DependencyEntry` macro that dramatically reduces boilerplate when registering dependencies. Inspired by SwiftUI's `@Entry` macro, it handles the library's three-environment model (live, preview, test) through a concise API: the property initializer becomes the `testValue`, while `liveValue:` and `previewValue:` can be passed as macro arguments. Omitting `liveValue` keeps the dependency conforming only to `TestDependencyKey`, preserving the ability to separate interface from live implementation for modular codebases. Available in Dependencies version 1.13 via the `DependenciesMacros` module.
13.8K Impressions