Skip to content

Conversation

@couchdeveloper
Copy link
Owner

Changes:

  • Modified __Settings_Container protocol to use 'any UserDefaultsStore' instead of associated type
  • Changed observer return type from associated type to 'any Cancellable'
  • Updated AppSettingValues to use OSAllocatedUnfairLock for thread-safe store access
  • Added support for mock stores in SwiftUI previews via environment injection
  • Updated all test containers to match new protocol requirements

BREAKING CHANGE: Custom __Settings_Container implementations must now declare:
static var store: any UserDefaultsStore { get }
instead of using an associated type.

This enables dynamic store switching for testing and previews without requiring actor isolation, maintaining flexibility while ensuring thread-safety.

Changes:
- Modified __Settings_Container protocol to use 'any UserDefaultsStore' instead of associated type
- Changed observer return type from associated type to 'any Cancellable'
- Updated AppSettingValues to use OSAllocatedUnfairLock for thread-safe store access
- Added support for mock stores in SwiftUI previews via environment injection
- Updated all test containers to match new protocol requirements

BREAKING CHANGE: Custom __Settings_Container implementations must now declare:
  static var store: any UserDefaultsStore { get }
instead of using an associated type.

This enables dynamic store switching for testing and previews without requiring
actor isolation, maintaining flexibility while ensuring thread-safety.
@couchdeveloper couchdeveloper added enhancement New feature or request breaking A change which result in breaking the API. This will increase the major version number by one. labels Dec 8, 2025
@couchdeveloper couchdeveloper merged commit 7bd6e81 into main Dec 8, 2025
0 of 3 checks passed
@couchdeveloper couchdeveloper deleted the fixSwiftUIAppSettings branch December 8, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A change which result in breaking the API. This will increase the major version number by one. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants