Factory

A new approach to Container-Based Dependency Injection for Swift and SwiftUI.

MIT License

Stars
1.6K
Committers
13

Bot releases are hidden (Show)

Factory - Release 2.3.2 Latest Release

Published by hmlongco 7 months ago

  • Project updated CocoaPods to 1.15.2
  • Public aliases for masked Factory objects - Issue #154
  • Fix key issue when building xcframeworks - Issue #173
  • Add VisionOS target to package.swift - PR #186
  • Add Privacy Manifest file - PR #180
  • Update README to include example for use with Swift's new Observable macro - PR #172
Factory - Release 2.3.1

Published by hmlongco about 1 year ago

  • Fix for SpinLock on Linux
  • Add action to test linux - Issue #113
  • Add various aliases to avoid external naming conflicts - Issue #154
Factory - Release 2.3.0

Published by hmlongco about 1 year ago

  • Dramatic performance enhancements:
    Up to 200% faster in debug builds!
    Up to 400% faster in production builds!
  • Fixed bug where registering a context in the Factory definition cleared the scope cache. - Issue #146
    Note that issue #146 could be a breaking change if your code attempts to replace a scoped context registration.
    Add a manual reset.
    Container.shared.myService.reset(.scope).onTest { MockService() }
    See The Factory Wins section in the Modifiers documentation for more on this.
  • Update trace output to also show actual instance type
Factory - Release 2.2.0

Published by hmlongco over 1 year ago

2.2.0

  • Converts "shared" container variables from var to let. - Issue #111
  • Add convenience reset() function to container. - Issue #111
    Note that issue #111 could be a breaking change if your code attempts to "replace" a shared container. Do reset instead.
    Container.shared.reset() // Do this...
    Container.shared = Container() // Not this...
  • Removes @MainActor from @InjectedObject property wrapper variables. - Issue #107
  • Fix registering a new context doesn't clear existing cache as did register. - Issue #114
  • Fix FactoryContext not public. - Issue #116
  • Update Modular Application documentation. - Issue #121
  • Adds $service.resolvedOrNil() function to LazyInjected and WeakLazyInjected. - Issue #122
  • Adds keypath-based global resolutions functions for shared containers.
  • Removes func register(scope🏭) function deprecated in 2.1
    Use container.service.scope(.cached).register { Service() } instead.
Factory - Release 2.1.5

Published by hmlongco over 1 year ago

  • Adds TimeToLive to scoped instances.
Factory - Release 2.1.4

Published by hmlongco over 1 year ago

  • Fix singletons in multiple modules keyed with same type and name. Issue - #99
  • Fix building on Linux. Issue - #100
Factory - Release 2.1.3

Published by hmlongco over 1 year ago

  • Fix singleton scope issue with SharedContainer across multiple container types. Issue - #92
  • Fix unit test context to detect when run from command line. Issue - #94
  • Fix where new registration on Factory also clears singleton cache. Issue - #96
  • Minor update to trace logging for better presentation of nil optionals
Factory - Release 2.1.2

Published by hmlongco over 1 year ago

  • Fixing POD issue
Factory - Release 2.1.1

Published by hmlongco over 1 year ago

  • Fix SPM/POD build issue
Factory - Release 2.1.0

Published by hmlongco over 1 year ago

  • Contexts allow quick and easy Factory customization when doing previews, debugging and testing.
  • Provides once modifier which allows one-time initialization on a per-Factory basis.
  • Let's you define the default scope used for a given container.
  • Allows you to specify promised optionals that warn when registrations are not provided.
  • Singletons now span containers and are cached separately.
  • Factory library now implemented across multiple files.
Factory - Release 2.0.3

Published by hmlongco over 1 year ago

  • AutoRegister should be retriggered after resetting registrations.
Factory - Release 2.0.2

Published by hmlongco over 1 year ago

  • Registration on a new container could be overriden by auto registration on same Factory
  • Some internal code reorginization for performance
Factory - Release 2.0.1

Published by hmlongco over 1 year ago

  • Minor issue in that new scope registration function doesn't allow scope to be reset to unique
  • Add watchos.deployment_target = "8.2" - Issue #54
Factory - Release 2.0

Published by hmlongco over 1 year ago

Factory 2.0 Release

  • Adds true Factory containers for container-based dependency resolution
  • Adds container-based scopes
  • Adds decorators to containers and factories
  • Adds debug trace support
  • Adds ability to specify scope during dependency assembly and registration
  • Adds keyPath-based property wrappers
  • Adds a new InjectedObject property wrapper for SwiftUI Views
  • Fixes circular dependency check when same class name used in separate modules.

Note that version 2.0 is a breaking change over 1.0. See the Migration documentation for more details.

Factory - Release 1.3.7

Published by hmlongco over 1 year ago

1.3.7

  • Circular dependency check bugfix for passthrough types
Factory - Version 1.3.6

Published by hmlongco over 1 year ago

  • Circular dependency check bugfix for duplicate class names in multiple modules
Factory - Release 1.3.5

Published by hmlongco almost 2 years ago

  • Adds specific reset options to factories and property wrappers
Factory - Release 1.3.4

Published by hmlongco almost 2 years ago

  • Add resolve() function to property wrappers to trigger immediate resolution.
Factory - Release 1.3.3

Published by hmlongco almost 2 years ago

  • Minor bugfix in circular dependency check to reset chain on error
Factory - Release 1.3.1

Published by hmlongco almost 2 years ago

  • Increase unit test code coverage to 98.8%