Releases: pointfreeco/swift-composable-architecture
0.38.2
- Changed: Bumped dependencies to include Combine Schedulers 0.6.0 and XCTest Dynamic Overlay 0.3.0, which includes the renamed
UnimplementedScheduler, andXCTUnimplemented, respectively. - Infrastructure: Cleaned up and simplified some demo apps and case studies.
0.38.1
- Fixed: 0.38.0 introduced a regression that could cause test stores that receive
BindingActions from effects to cause test failures. This has been fixed.
0.38.0
- Added: A new runtime warning for when a
BindingActionis sent to the store butReducer.binding()wasn't applied to the reducer. This should help diagnose missing integrations faster. - Fixed: A regression for
TestStore.sendandreceivewas introduced in 0.37.0 that failed to perform assertions against state when the trailing closure was omitted. This has been fixed (thanks @umbertovolta).
0.37.0
- Added:
Effect.animation(), which adds animation to an effect without the need of a scheduler. - Changed:
TestStorestate modification failures are less noisy. - Renamed:
ViewStore.suspend(while:)has been renamed toViewStore.yield(while:). - Bug fixed: A bug was introduced to the deprecated
TestStore.assertAPIs in 0.36.0, which caused test failures when a sent/received test action left state unchanged. This has been fixed. - Infrastructure: Worked around a SwiftUI bug/warning in the Case Studies demo; cleaned up some of the library's generic signatures.
0.36.0
- Added:
Effect.throttleoverloads that takeAny.Type(thanks @elkraneo). - Added:
TestStore.state, which reflects the state of the store between assertions. This property can be used to further probe test store state over time and make additional assertions. - Updated:
WithViewStorecan be in more places, like@CommandsBuilder(thanks @tgrapperon). - Fixed:
Effect.taskmodifiers now deliver output and completion on the main actor, avoiding potential data races. - Documentation: Added support for SPI documentation (thanks @finestructure).
- Infrastructure: typo fixes (thanks @konomae) and demo app cleanup.
0.35.0
-
Breaking change: test stores will now catch assertions that do not change state (thanks @rcarver).
// Before: store.send(.actionThatDoesntChangeState) { $0.state = .sameStateAsBefore } // ✅ // After: store.send(.actionThatDoesntChangeState) { $0.state = .sameStateAsBefore } // ❌ Expected to modify the expected state, but no change occurred.
To fix, remove the trailing closure assertion to let the test store know you don't expect its state to change:
store.send(.actionThatDoesntChangeState) // ✅
-
Added: Effect cancellation endpoints can now take types as identifiers, a slightly simpler alternative to safely defining and instantiating a hashable type:
// Before: struct CancelId: Hashable {} return .cancel(id: CancelId()) // After: enum CancelId {} return .cancel(id: CancelId.self)
-
Added: A new overload of
eraseToEffectthat takes a transform function. This provides symmetry tocatchToEffectand can help streamline effect work in the reducer (thanks @klundberg).// Before: return environment.doSomething() .map(Action.case) .eraseToEffect() // After: return environment.doSomething() .eraseToEffect(Action.case)
-
Added: A new overload of
Effect.fireAndForgetthat takes an async, throwing function.return .fireAndForget { try await environment.analytics(event: .tappedProfile) }
-
Changed: The synchronous version of
Effect.fireAndForgetcan nowthrow, which will simply terminate the effect's execution early if an error is thrown. -
Changed: Runtime warnings should now show up closer to the source of the warning (thanks @iampatbrown).
-
Changed: When multiple
TestStorefailure messages stack, they should print in a better, more readable order. -
Changed: Case Paths has been pinned to a newer version (thanks @nsillik).
-
Fixed: A bug in which the array-based overload of
Effect.cancel(ids:)was not being favored over the variadic overload would treat the entire array as the cancel token and not each individual item has been fixed (thanks @iampatbrown). -
Fixed: A few small warnings that show up in Swift 5.7 have been fixed.
-
Performance: Effect cancellation lookup has been improved for type-safe identifiers.
-
Infrastructure: Fixed SPI's config file (thanks @finestructure).
-
Infrastructure: The long-living effect SwiftUI case study has been modernized and simplified.
0.34.0
- Changed: An effect is now not considered "in-flight" till it is kicked off. This fixes a potential behavior where marking a timer effect cancellable (which is already cancellable by default) could prevent the effect from running.
- Changed: Runtime warnings now emit XCTest failures, as well, making it easier to catch common issues in your tests.
- Optimized: In-flight effects are now cancelled inline (thanks @iampatbrown).
- Fixed:
Effect.cancel(ids:)now properly routes to the sequence overload (thanks @iampatbrown). - Fixed:
WithViewStoreno longer breaks in certain contexts, e.g. when placed inside aGeometryReader(thanks @tgrapperon). - Infrastructure: Added Arabic translation to README (thanks @NorhanBoghdadi).
- Infrastructure: Added Simplified Chinese translation to README (thanks @sh3l6orrr).
- Infrastructure: Cleaned up case studies (thanks @rono23).
- Infrastructure: Fixed and added unit tests to UIKit list case study (thanks @bjford).
- Infrastructure: Fixed a few missing asset warnings in demo applications (thanks @tgrapperon).
0.33.1
0.33.0
-
Bug fixed: nested calls to
Effect.cancellableno longer prevent certain outputs from being emitted (thanks @iampatbrown).Breaking change: a consequence of this fix is that
Effect.timers running on an immediate scheduler will now immediately emit its first output in tests. If a test fails after upgrading to this version, you may need to assert against the output of such an effect.
0.32.0
- Changed: operators like
Reducer.optional()andReducer.forEach()no longer halt with a breakpoint. Instead, issues are logged via Xcode's runtime warning system.