Skip to content

0.5.1

Latest

Choose a tag to compare

@tatejennings tatejennings released this 08 Jun 19:24
· 7 commits to main since this release

A documentation, diagnostics, and CI patch release. No API or behavior changes — fully source-compatible with 0.5.0.

Documentation

  • New SwiftUI View example showing the @State-resolved ViewModel pattern (@State private var viewModel = AppContainer.shared.loginViewModel), with guidance on why @Inject belongs in classes, not Views.
  • Clarified that ViewModels are registered with concrete return types (you mock their dependencies, not the ViewModel) — so the "protocol return types" rule applies to injected services.
  • Thread-safety guidance: Forge synchronizes the cache, not your values — a shared .singleton/.cached instance must be thread-safe itself. This is deliberate, so @MainActor-isolated dependencies like cached view models remain registrable.

Diagnostics

  • Clearer wrong-type override message: it now reads "Release builds fall through to the real factory," since debug/test builds crash on the assertionFailure.

CI / Infrastructure

  • Test matrix now runs on macOS across Swift 6.0 / 6.1 / 6.2 (with 5.10 compile-verified), matching Forge's Apple-only support. The KeyPath name-extraction format the override system relies on is a Darwin behavior, so the safeguard now runs where the framework actually ships.