Releases: pointfreeco/swift-composable-architecture
0.54.0
What's Changed
-
Added: All-new navigation tools for presenting child features (#1945, #1944, #2048).
See the associated documentation and tutorial for how to incorporate these tools into your applications today!
-
Added:
TestStore.assert
, for asserting state changes on non-exhaustive stores at any time (#2123). -
Fixed: Ensure that a test store helper runs on the main actor (#2117).
-
Added: Ukrainian translation of TCA's README (thanks @barabashd, #2121).
-
Infrastructure: DocC organization (#2118).
-
Infrastructure: Ensure CI runs library tests in release (#2120).
-
Fix assertion values by @tomassliz in #2128
-
Infrastructure: Documentation fixes (thanks @tomassliz, #2124, #2128; @jaesung-0o0, #2144).
New Contributors
- @tomassliz made their first contribution in #2124
- @jaesung-0o0 made their first contribution in #2144
Full Changelog: 0.53.2...0.54.0
0.53.2
What's Changed
- Make
Send
sendable (#2112) - When test exhaustivity is off,
receive
now waits for the expected action rather than taking the first action (thanks @alex-reilly-pronto, #2100) - Fix typo in the "Meet the Composable Architecture" (thanks @redryerye, #2114)
- Fix compile error in Xcode <14.3 (thanks @hj56775, #2115)
New Contributors
- @alex-reilly-pronto made their first contribution in #2100
- @redryerye made their first contribution in #2114
- @hj56775 made their first contribution in #2115
Full Changelog: 0.53.1...0.53.2
0.53.1
What's Changed
- Fixed: A regression was introduced in 0.53.0 where
TestStore.init
'sprepareDependencies
was called twice. It will not be called just a single time again (#2111). - Infrastructure: Added a "Meet the Composable Architecture" tutorial (#2107, #2109).
- Infrastructure: Docs fixes (thanks @Ryu0118, #2110)
Full Changelog: 0.53.0...0.53.1
0.53.0
What's Changed
-
Added:
Store.init
andTestStore.init
now take reducer builders (#2087).// Before: Store( initialState: Feature.State(), reducer: Feature() ) // After: Store(initialState: Feature.State()) { Feature() }
-
Changed:
SwitchStore
has gotten some quality-of-life improvements (#2029).-
SwitchStore.init
can now take the initial enum state so that it can be switched over exhaustively. This initializer also relaxes certain compile-time constraints previously requiring onlyCaseLet
views and an optional, trailingDefault
view. -
CaseLet
can now omit thestate
parameter label, making it more consistent with other APIs, likeReducer.ifCaseLet
. -
The older
SwitchStore
andCaseLet
initializers have been soft-deprecated along with theDefault
view.// Before: SwitchStore(self.store) { CaseLet(state: /App.State.loggedIn, action: App.Action.loggedIn) { loggedInStore in LoggedInView(store: loggedInStore) } CaseLet(state: /App.State.loggedOut, action: App.Action.loggedOut) { loggedOutStore in LoggedOutView(store: loggedOutStore) } } // After: SwitchStore(self.store) { switch $0 { // Can now switch over initial state for exhaustivity at compile time case .loggedIn: CaseLet(/App.State.loggedIn, action: App.Action.loggedIn) { loggedInStore in LoggedInView(store: loggedInStore) } .buttonStyle(.plain) // Can now render arbitrary views/modifiers in the view builder case .loggedOut: CaseLet(/App.State.loggedOut, action: App.Action.loggedOut) { loggedOutStore in LoggedOutView(store: loggedOutStore) } } }
-
-
Changed:
WithViewStore.debug
has been renamed toWithViewStore._printChanges
for consistency withReducer._printChanges
(#2101). -
Fixed:
EffectTask.publisher
now properly escapes dependencies accessed within it (#1988). -
Fixed:
Reducer._printChanges()
is no longer disabled in tests (#1995). This allows it to be used for debugging purposes during test runs. -
Changed: The internal
Task.megaYield
tool, for more predictably testing concurrent code, is now configurable via theTASK_MEGA_YIELD_COUNT
environment variable (#2064). -
Improved: The output format of
WithViewStore._printChanges()
has been improved (#1973). -
Improved: Runtime warnings will now emit XCTest failures in test code rather than in app code (#2059).
-
Deprecated: Type-based cancel IDs have been deprecated (#2091). Use hashable values, instead.
-
Deprecated: The actionless overload of
Store.scope(state:)
has been deprecated in favor of theobserve
parameter on view stores (#2097). -
Deprecated:
Effect.task
andEffect.fireAndForget
have been soft-deprecated in favor ofEffect.run
(#2099). -
Infrastructure: Added test coverage for child/parent effect cancellation behavior (#1970).
-
Infrastructure: Clean up effect cancellation logic (#1977).
-
Infrastructure: Miscellaneous documentation/formatting fixes:
Fixed missing
action
parameter inForEachStore
documentation (thanks @m-housh, #1998).Number fact tutorial fix (thanks @siliconsorcery, #1962).
BindingAction
fix (thanks @Ryu0118, #2019).withTaskCancellation(id:)
fix (thanks @bjford, #2049).Formatting fix (thanks @mooyoung2309, #2056).
Update 'bindable state' to 'binding state' (thanks @Jager-yoo, #2054).
-
Infrastructure: Added Russian README translation (thanks @artyom-ivanov, #2014).
-
Infrastructure: Added Polish README translation (thanks @MarcelStarczyk, #2040).
-
Infrastructure: Bump dependencies.
-
Infrastructure: Bump Xcode demo project settings (#2042).
-
Infrastructure: Clean up and test
TestStore.skipInFlightEffects
(#2057). -
Infrastructure: CI updates (#2060).
-
Infrastructure: Document how exhaustive vs. non-exhaustive test stores work (#2096).
New Contributors
- @m-housh made their first contribution in #1998
- @siliconsorcery made their first contribution in #1962
- @artyom-ivanov made their first contribution in #2014
- @Ryu0118 made their first contribution in #2019
- @MarcelStarczyk made their first contribution in #2040
- @mooyoung2309 made their first contribution in #2056
Full Changelog: 0.52.0...0.53.0
0.52.0
What's Changed
- Added: Support for
XCTModify
and non-exhaustive testing (#1939). - Added: Library reducer operators are now annotated with
@warn_unqualified_access
to prevent accidental bugs (#1950). - Added:
Effect.publisher
for bridging effects from Combine (#1958). - Changed:
Effect<Action>.Send
has been renamed toSend<Action>
(thanks @tgrapperon, #1930). - Changed: Dependencies have been bumped to their latest versions to encourage adoption of bug fixes (#1964).
- Fixed: Dependencies are no longer recursively propagated over effects (#1954).
- Fixed:
TestStore.init
now callsprepareDependencies
in awithDependencies
block (#1955). - Infrastructure: Fix UI test for
ForEach
bindings (#1933). - Infrastructure: Add missing documentation to
Store.init
(thanks @kristofferjohansson, #1940). - Infrastructure: DocC fixes (#1942, #1956).
- Infrastructure: Update latest version documentation link in README (thanks @yimajo, #1943)
- Infrastructure: Fix
.forEach()
documentation (thanks @finestructure, #1957). - Infrastructure: Documentation grammar fixes (thanks @bjford, #1963)
New Contributors
- @kristofferjohansson made their first contribution in #1940
Full Changelog: 0.51.0...0.52.0
0.51.0
What's Changed
- Added: Escaping
send
fromEffect.run
and sending actions to it after the effect has completed now produces runtime warnings (thanks @kabiroberai, #1900). - Changed:
ReducerProtocol._printChanges()
now logs to console for Xcode 14.3 previews (thanks @tgrapperon, #1917). - Changed: The
Send
type has been moved to be nested in theEffect
type and should no longer take precedence over theSendable
protocol in autocomplete (thanks @tgrapperon, #1911). - Changed:
WithViewStore
now conforms toView
(#1910). - Fixed: Fix some Xcode 14.3 / sendability checking warnings (#1920).
New Contributors
- @kabiroberai made their first contribution in #1900
Full Changelog: 0.50.3...0.51.0
0.50.3
What's Changed
- Changed: The
Identified
type has been extracted from the Composable Architecture and now comes from Identified Collections (#1907).
Full Changelog: 0.50.2...0.50.3
0.50.2
What's Changed
- Changed: Improved formatting of test store failures when expected action isn't received (#1883).
- Changed: Added unavailable overloads to
TestStore.send
andreceive
when state/action is notEquatable
(#1890). This should improve compiler error messaging when attempting to write tests against non-equatable state. - Changed:
Scope
's trailing builder parameter now has an explicit name,child
, andReducerProtocol.forEach
has an explicitelement
(#1897). - Infrastructure: Documentation and deprecation fixes (thanks @bjford, #1893; @eimantas, #1896).
- Infrastructure: Added a workflow for Slack release announcements (#1899).
Full Changelog: 0.50.1...0.50.2
0.50.1
What's Changed
- Fixed: SwiftUI can write to bindings at inopportune times, like if a text field in a sheet is focussed, it will write to the binding after the sheet has been dismissed. When using
IfLetStore
, this can lead to noisy runtime warnings emitted by TCA, where optional state driving the sheet is nownil
, and thus the binding cannot write to state at this time. As a workaround,IfLetStore
will now ignore actions sent through bindings when state isnil
(#1879). - Fixed: A bug in Swift 5.7 and earlier can cause the runtime metadata mechanism used by swift-case-paths to crash in release mode when an
Any
existential exists in the type data. BecauseBindingAction
holds onto anAny
under the hood, it could be responsible for the occasional crash in release mode when present in certain type layouts. We've worked around this bug to prevent crashes in release mode (#1881). - Infrastructure: Fix docs link (thanks @Jager-yoo, #1874); add note to reducer protocol dependency docs (#1873); updated CoC to the latest Contributor Covenant.
Full Changelog: 0.50.0...0.50.1
0.50.0
What's Changed
-
Added:
@BindingState
(renamed from@BindableState
in this release) now conditionally conforms toSendable
(thanks @jshier, #1834). -
Added: SwiftUI Transaction helper APIs, including
Effect.transaction
,ViewStore.send(_:transaction:)
, andEffect.run { send in send(_:transaction:) }
(thanks @drucelweisse, #1824). -
Added:
Store.init
now takes aprepareDependencies
block, for preparing the initial dependencies of a store (TestStore
introduced a similar API earlier) (#1844). -
Added:
Effect.send
has been introduced as a new version ofEffect.init(value:)
(#1859).Effect.init(value:)
has been soft-deprecated and will be hard-deprecated soon, so prefer usingEffect.send
to synchronously feed actions back into the system. -
Changed: The
@BindableState
property wrapper has been renamed to@BindingState
(#1855). -
Changed:
TestStore
ergonomics have been improved to better surface when APIs are unavailable due to lack of anEquatable
conformance (#1857). -
Changed: Alert modifiers now use
@StateObject
instead of@ObservedObject
in iOS 15 and higher (#1860). -
Changed: Reducer builders have been rewritten to be more performant and to prepare for forthcoming Swift 5.8 changes (#1863). If you notice any regressions in your app's reducer builders, please let us know.
-
Changed: The Composable Architecture has been updated to depend on SwiftUI Navigation 0.6.0 (#1865).
Warning: This upgrade contains breaking changes that mostly do not affect the Composable Architecture, with the exception of its UIKit alert helper tools, which will now require you to handle a
nil
alert action for dismissal/cancel buttons with no action attached. -
Fixed: #1802 introduced a slight regression in view store binding animation behavior, so it was reverted back to the original behavior (#1845).
-
Fixed:
Effect
is now hard deprecated as planned (thanks @kalupas226, #1822). -
Fixed: The Composable Architecture now explicitly depends on Ordered Collections, rather than implicitly via its transitive dependency on Identified Collections (thanks @kalupas226, #1828).
-
Fixed:
TestStore.receive
methods that take predicates and case paths no longer requireAction
equatability (#1856). -
Infrastructure: Removed and updated a few deprecated, flakey tests (#1816).
-
Infrastructure: Added UI test to catch SwiftUI regressions (#1815; thanks @tgrapperon in #1819).
-
Infrastructure: Doc fixes (thanks @brennobemoura, #1843).
-
Infrastructure: Document testing gotchas (#1854).
New Contributors
- @jshier made their first contribution in #1834
- @brennobemoura made their first contribution in #1843
- @drucelweisse made their first contribution in #1824
Full Changelog: 0.49.2...0.50.0