Skip to content

Releases: pointfreeco/swift-composable-architecture

0.39.0

08 Aug 05:04
108e3a5
Compare
Choose a tag to compare

0.38.3

15 Jul 16:24
Compare
Choose a tag to compare
  • Deprecated: Store.unchecked has been deprecated. As the Composable Architecture migrates to modern Swift concurrency tools, its async endpoints must run on a consistent actor to ensure safety from data races. Because the primary use case of the Composable Architecture is driving UIs, we have chosen the @MainActor for these endpoints, which makes them unsafe to call from unchecked stores. We believe the number of unchecked stores out in the wild is small, but in the meantime are soliciting feedback from the community with this deprecation warning.

    See #1206 for more information and migration paths.

0.38.2

30 Jun 14:05
d0ba4b8
Compare
Choose a tag to compare
  • Changed: Bumped dependencies to include Combine Schedulers 0.6.0 and XCTest Dynamic Overlay 0.3.0, which includes the renamed UnimplementedScheduler, and XCTUnimplemented, respectively.
  • Infrastructure: Cleaned up and simplified some demo apps and case studies.

0.38.1

24 Jun 21:46
b559778
Compare
Choose a tag to compare
  • 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

24 Jun 14:12
809c3bb
Compare
Choose a tag to compare
  • Added: A new runtime warning for when a BindingAction is sent to the store but Reducer.binding() wasn't applied to the reducer. This should help diagnose missing integrations faster.
  • Fixed: A regression for TestStore.send and receive was 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

20 Jun 17:56
cfcf8b4
Compare
Choose a tag to compare
  • Added: Effect.animation(), which adds animation to an effect without the need of a scheduler.
  • Changed: TestStore state modification failures are less noisy.
  • Renamed: ViewStore.suspend(while:) has been renamed to ViewStore.yield(while:).
  • Bug fixed: A bug was introduced to the deprecated TestStore.assert APIs 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

04 Jun 01:49
db89099
Compare
Choose a tag to compare
  • Added: Effect.throttle overloads that take Any.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: WithViewStore can be in more places, like @CommandsBuilder (thanks @tgrapperon).
  • Fixed: Effect.task modifiers 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

16 May 16:41
c307541
Compare
Choose a tag to compare
  • 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 eraseToEffect that takes a transform function. This provides symmetry to catchToEffect and 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.fireAndForget that takes an async, throwing function.

    return .fireAndForget {
      try await environment.analytics(event: .tappedProfile)
    }
  • Changed: The synchronous version of Effect.fireAndForget can now throw, 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 TestStore failure 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

15 Mar 20:32
2828dc4
Compare
Choose a tag to compare
  • 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: WithViewStore no longer breaks in certain contexts, e.g. when placed inside a GeometryReader (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

11 Jan 15:35
ba9c626
Compare
Choose a tag to compare
  • Bug fixed: the new runtime warning system no longer crash iOS 13 debug builds (thanks @mcfans).
  • Infrastructure: modernized demo apps by removing scene delegates and unneeded Info.plists.