Skip to content

Commit 2c93195

Browse files
mbrandonwJacksonUtschstephencelisJager-yoobarabashd
authored
Prerelease 1.0 (#1929)
* Converted voice memos back to identified array * update deps * update docs for DismissEffect * wip * Add Sendable conformance to PresentationState (#2086) * wip * swift-format * wip * wip * fix some warnings * docs * wip * wip * Catch some typos in Articles (#2088) * wip * wip * wip * wip * wip * wip * wip * wip * docs * wip * wip * docs * wip * wip * wip * wip * docs * docs * wip * wip * wip * wip * wip * wip * wip * Fix invalid states count for 3 optionals and typos (#2094) * wip * wip * more dismisseffect docs * fixed some references * navigation doc corrections * more nav docs * fix cancellation tests in release mode * wrap some tests in #if DEBUG since they are testing expected failures * update UUIDs in tests to use shorter initializer * fixed a todo * wip * fix merge errors * wip * fix * wip * wip * fixing a bunch of todos * get rid of rawvalue in StackElementID * more todos * NavLinkStore docs * fix swift 5.6 stuff * fix some standups tests * fix * clean up * docs fix * fixes * wip * 5.6 fix * wip * wip * dont parallelize tests * updated demo readmes * wip * Use ObservedObject instead of StateObject for alert/dialog modifiers. * integration tests for bad dismissal behavior * check for runtime warnings in every integration test * wip * wip * wip * fix * wip * wip * wip * wip * wip * wip * Drop a bunch of Hashables. * some nav bug fixes * wip * wip * wip * fix * fix * wip * wip * Simplify recording test. * add concurrent async test * fix * wip * Refact how detail dismisses itself. * fix * 5.6 fix * wip * wip * wip * wip * Add TestStore.assert. * Revert "Add TestStore.assert." This reverts commit a892ccc. * add Ukrainian Readme.md (#2121) * Add TestStore.assert. (#2123) * Add TestStore.assert. * wip * Update Sources/ComposableArchitecture/TestStore.swift Co-authored-by: Stephen Celis <[email protected]> * Update Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md Co-authored-by: Stephen Celis <[email protected]> * fix tests --------- Co-authored-by: Stephen Celis <[email protected]> * Run swift-format * push for store.finish and presentation * wip * move docs around * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Add case subscripts * wip * wip * wip * 5.7-only * wip * wip * wip * wip * fix * revert store.finish task cancellation * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * add test for presentation scope * wip * wip * wip * wip * wip * cleanup * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Rename ReducerProtocol.swift to Reducer.swift (#2206) * Hard-deprecate old SwitchStore initializers/overloads * wip * wip * Resolve CaseStudies crash (#2258) * wip * wip * wip * wip * wip * wip * wip * wip * Bump timeout for CI * wip * wip --------- Co-authored-by: Jackson Utsch <[email protected]> Co-authored-by: Stephen Celis <[email protected]> Co-authored-by: 유재호 <[email protected]> Co-authored-by: Dmytro <[email protected]> Co-authored-by: mbrandonw <[email protected]>
1 parent bad761c commit 2c93195

File tree

263 files changed

+2417
-3483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+2417
-3483
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-Core.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ComposableArchitecture
22

3-
struct Root: ReducerProtocol {
3+
struct Root: Reducer {
44
struct State: Equatable {
55
var alertAndConfirmationDialog = AlertAndConfirmationDialog.State()
66
var animation = Animations.State()
@@ -62,7 +62,7 @@ struct Root: ReducerProtocol {
6262

6363
@Dependency(\.continuousClock) var clock
6464

65-
var body: some ReducerProtocol<State, Action> {
65+
var body: some Reducer<State, Action> {
6666
Reduce { state, action in
6767
switch action {
6868
case .onAppear:

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-AlertsAndConfirmationDialogs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private let readMe = """
2121

2222
// MARK: - Feature domain
2323

24-
struct AlertAndConfirmationDialog: ReducerProtocol {
24+
struct AlertAndConfirmationDialog: Reducer {
2525
struct State: Equatable {
2626
var alert: AlertState<Action>?
2727
var confirmationDialog: ConfirmationDialogState<Action>?
@@ -37,7 +37,7 @@ struct AlertAndConfirmationDialog: ReducerProtocol {
3737
case incrementButtonTapped
3838
}
3939

40-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
40+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
4141
switch action {
4242
case .alertButtonTapped:
4343
state.alert = AlertState {

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private let readMe = """
2020

2121
// MARK: - Feature domain
2222

23-
struct Animations: ReducerProtocol {
23+
struct Animations: Reducer {
2424
struct State: Equatable {
2525
var alert: AlertState<Action>?
2626
var circleCenter: CGPoint?
@@ -40,7 +40,7 @@ struct Animations: ReducerProtocol {
4040

4141
@Dependency(\.continuousClock) var clock
4242

43-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
43+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
4444
enum CancelID { case rainbow }
4545

4646
switch action {

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Bindings-Basics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private let readMe = """
2020

2121
// MARK: - Feature domain
2222

23-
struct BindingBasics: ReducerProtocol {
23+
struct BindingBasics: Reducer {
2424
struct State: Equatable {
2525
var sliderValue = 5.0
2626
var stepCount = 10
@@ -35,7 +35,7 @@ struct BindingBasics: ReducerProtocol {
3535
case toggleChanged(isOn: Bool)
3636
}
3737

38-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
38+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
3939
switch action {
4040
case let .sliderValueChanged(value):
4141
state.sliderValue = value

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Bindings-Forms.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private let readMe = """
1515

1616
// MARK: - Feature domain
1717

18-
struct BindingForm: ReducerProtocol {
18+
struct BindingForm: Reducer {
1919
struct State: Equatable {
2020
@BindingState var sliderValue = 5.0
2121
@BindingState var stepCount = 10
@@ -28,7 +28,7 @@ struct BindingForm: ReducerProtocol {
2828
case resetButtonTapped
2929
}
3030

31-
var body: some ReducerProtocol<State, Action> {
31+
var body: some Reducer<State, Action> {
3232
BindingReducer()
3333
Reduce { state, action in
3434
switch action {

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Composition-TwoCounters.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private let readMe = """
99

1010
// MARK: - Feature domain
1111

12-
struct TwoCounters: ReducerProtocol {
12+
struct TwoCounters: Reducer {
1313
struct State: Equatable {
1414
var counter1 = Counter.State()
1515
var counter2 = Counter.State()
@@ -20,7 +20,7 @@ struct TwoCounters: ReducerProtocol {
2020
case counter2(Counter.Action)
2121
}
2222

23-
var body: some ReducerProtocol<State, Action> {
23+
var body: some Reducer<State, Action> {
2424
Scope(state: \.counter1, action: /Action.counter1) {
2525
Counter()
2626
}

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Counter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private let readMe = """
1111

1212
// MARK: - Feature domain
1313

14-
struct Counter: ReducerProtocol {
14+
struct Counter: Reducer {
1515
struct State: Equatable {
1616
var count = 0
1717
}
@@ -21,7 +21,7 @@ struct Counter: ReducerProtocol {
2121
case incrementButtonTapped
2222
}
2323

24-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
24+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
2525
switch action {
2626
case .decrementButtonTapped:
2727
state.count -= 1

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-FocusState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private let readMe = """
88

99
// MARK: - Feature domain
1010

11-
struct FocusDemo: ReducerProtocol {
11+
struct FocusDemo: Reducer {
1212
struct State: Equatable {
1313
@BindingState var focusedField: Field?
1414
@BindingState var password: String = ""
@@ -24,7 +24,7 @@ struct FocusDemo: ReducerProtocol {
2424
case signInButtonTapped
2525
}
2626

27-
var body: some ReducerProtocol<State, Action> {
27+
var body: some Reducer<State, Action> {
2828
BindingReducer()
2929
Reduce { state, action in
3030
switch action {

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-OptionalState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private let readMe = """
1414

1515
// MARK: - Feature domain
1616

17-
struct OptionalBasics: ReducerProtocol {
17+
struct OptionalBasics: Reducer {
1818
struct State: Equatable {
1919
var optionalCounter: Counter.State?
2020
}
@@ -24,7 +24,7 @@ struct OptionalBasics: ReducerProtocol {
2424
case toggleCounterButtonTapped
2525
}
2626

27-
var body: some ReducerProtocol<State, Action> {
27+
var body: some Reducer<State, Action> {
2828
Reduce { state, action in
2929
switch action {
3030
case .toggleCounterButtonTapped:

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-SharedState.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private let readMe = """
1616

1717
// MARK: - Feature domain
1818

19-
struct SharedState: ReducerProtocol {
19+
struct SharedState: Reducer {
2020
enum Tab { case counter, profile }
2121

2222
struct State: Equatable {
@@ -52,7 +52,7 @@ struct SharedState: ReducerProtocol {
5252
case selectTab(Tab)
5353
}
5454

55-
var body: some ReducerProtocol<State, Action> {
55+
var body: some Reducer<State, Action> {
5656
Scope(state: \.counter, action: /Action.counter) {
5757
Counter()
5858
}
@@ -72,7 +72,7 @@ struct SharedState: ReducerProtocol {
7272
}
7373
}
7474

75-
struct Counter: ReducerProtocol {
75+
struct Counter: Reducer {
7676
struct State: Equatable {
7777
var alert: AlertState<Action>?
7878
var count = 0
@@ -88,7 +88,7 @@ struct SharedState: ReducerProtocol {
8888
case isPrimeButtonTapped
8989
}
9090

91-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
91+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
9292
switch action {
9393
case .alertDismissed:
9494
state.alert = nil
@@ -119,7 +119,7 @@ struct SharedState: ReducerProtocol {
119119
}
120120
}
121121

122-
struct Profile: ReducerProtocol {
122+
struct Profile: Reducer {
123123
struct State: Equatable {
124124
private(set) var currentTab: Tab
125125
private(set) var count = 0
@@ -140,7 +140,7 @@ struct SharedState: ReducerProtocol {
140140
case resetCounterButtonTapped
141141
}
142142

143-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
143+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
144144
switch action {
145145
case .resetCounterButtonTapped:
146146
state.resetCount()

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Basics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private let readMe = """
2020

2121
// MARK: - Feature domain
2222

23-
struct EffectsBasics: ReducerProtocol {
23+
struct EffectsBasics: Reducer {
2424
struct State: Equatable {
2525
var count = 0
2626
var isNumberFactRequestInFlight = false
@@ -39,7 +39,7 @@ struct EffectsBasics: ReducerProtocol {
3939
@Dependency(\.factClient) var factClient
4040
private enum CancelID { case delay }
4141

42-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
42+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
4343
switch action {
4444
case .decrementButtonTapped:
4545
state.count -= 1

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Cancellation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private let readMe = """
1414

1515
// MARK: - Feature domain
1616

17-
struct EffectsCancellation: ReducerProtocol {
17+
struct EffectsCancellation: Reducer {
1818
struct State: Equatable {
1919
var count = 0
2020
var currentFact: String?
@@ -31,7 +31,7 @@ struct EffectsCancellation: ReducerProtocol {
3131
@Dependency(\.factClient) var factClient
3232
private enum CancelID { case factRequest }
3333

34-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
34+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
3535
switch action {
3636
case .cancelButtonTapped:
3737
state.isFactRequestInFlight = false

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-LongLiving.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private let readMe = """
1717

1818
// MARK: - Feature domain
1919

20-
struct LongLivingEffects: ReducerProtocol {
20+
struct LongLivingEffects: Reducer {
2121
struct State: Equatable {
2222
var screenshotCount = 0
2323
}
@@ -29,7 +29,7 @@ struct LongLivingEffects: ReducerProtocol {
2929

3030
@Dependency(\.screenshots) var screenshots
3131

32-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
32+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
3333
switch action {
3434
case .task:
3535
// When the view appears, start the effect that emits when screenshots are taken.

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Refreshable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private let readMe = """
1313

1414
// MARK: - Feature domain
1515

16-
struct Refreshable: ReducerProtocol {
16+
struct Refreshable: Reducer {
1717
struct State: Equatable {
1818
var count = 0
1919
var fact: String?
@@ -30,7 +30,7 @@ struct Refreshable: ReducerProtocol {
3030
@Dependency(\.factClient) var factClient
3131
private enum CancelID { case factRequest }
3232

33-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
33+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
3434
switch action {
3535
case .cancelButtonTapped:
3636
return .cancel(id: CancelID.factRequest)

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Timers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private let readMe = """
1111

1212
// MARK: - Feature domain
1313

14-
struct Timers: ReducerProtocol {
14+
struct Timers: Reducer {
1515
struct State: Equatable {
1616
var isTimerActive = false
1717
var secondsElapsed = 0
@@ -26,7 +26,7 @@ struct Timers: ReducerProtocol {
2626
@Dependency(\.continuousClock) var clock
2727
private enum CancelID { case timer }
2828

29-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
29+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
3030
switch action {
3131
case .onDisappear:
3232
return .cancel(id: CancelID.timer)
@@ -54,7 +54,7 @@ struct TimersView: View {
5454
let store: StoreOf<Timers>
5555

5656
var body: some View {
57-
WithViewStore(self.store) { viewStore in
57+
WithViewStore(self.store, observe: { $0 }) { viewStore in
5858
Form {
5959
AboutView(readMe: readMe)
6060

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-WebSocket.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private let readMe = """
1212

1313
// MARK: - Feature domain
1414

15-
struct WebSocket: ReducerProtocol {
15+
struct WebSocket: Reducer {
1616
struct State: Equatable {
1717
var alert: AlertState<Action>?
1818
var connectivityState = ConnectivityState.disconnected
@@ -39,7 +39,7 @@ struct WebSocket: ReducerProtocol {
3939
@Dependency(\.continuousClock) var clock
4040
@Dependency(\.webSocket) var webSocket
4141

42-
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
42+
func reduce(into state: inout State, action: Action) -> Effect<Action> {
4343
switch action {
4444
case .alertDismissed:
4545
state.alert = nil

Examples/CaseStudies/SwiftUICaseStudies/03-Navigation-Lists-NavigateAndLoad.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private let readMe = """
1010

1111
// MARK: - Feature domain
1212

13-
struct NavigateAndLoadList: ReducerProtocol {
13+
struct NavigateAndLoadList: Reducer {
1414
struct State: Equatable {
1515
var rows: IdentifiedArrayOf<Row> = [
1616
Row(count: 1, id: UUID()),
@@ -34,7 +34,7 @@ struct NavigateAndLoadList: ReducerProtocol {
3434
@Dependency(\.continuousClock) var clock
3535
private enum CancelID { case load }
3636

37-
var body: some ReducerProtocol<State, Action> {
37+
var body: some Reducer<State, Action> {
3838
Reduce { state, action in
3939
switch action {
4040
case .counter:

Examples/CaseStudies/SwiftUICaseStudies/03-Navigation-Multiple-Destinations.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ private let readMe = """
66
piece of enum state.
77
"""
88

9-
struct MultipleDestinations: ReducerProtocol {
10-
public struct Destination: ReducerProtocol {
9+
struct MultipleDestinations: Reducer {
10+
public struct Destination: Reducer {
1111
public enum State: Equatable {
1212
case drillDown(Counter.State)
1313
case popover(Counter.State)
@@ -20,7 +20,7 @@ struct MultipleDestinations: ReducerProtocol {
2020
case sheet(Counter.Action)
2121
}
2222

23-
public var body: some ReducerProtocol<State, Action> {
23+
public var body: some Reducer<State, Action> {
2424
Scope(state: /State.drillDown, action: /Action.drillDown) {
2525
Counter()
2626
}
@@ -44,7 +44,7 @@ struct MultipleDestinations: ReducerProtocol {
4444
case showSheet
4545
}
4646

47-
var body: some ReducerProtocol<State, Action> {
47+
var body: some Reducer<State, Action> {
4848
Reduce { state, action in
4949
switch action {
5050
case .showDrillDown:

Examples/CaseStudies/SwiftUICaseStudies/03-Navigation-NavigateAndLoad.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private let readMe = """
1010

1111
// MARK: - Feature domain
1212

13-
struct NavigateAndLoad: ReducerProtocol {
13+
struct NavigateAndLoad: Reducer {
1414
struct State: Equatable {
1515
var isNavigationActive = false
1616
var optionalCounter: Counter.State?
@@ -25,7 +25,7 @@ struct NavigateAndLoad: ReducerProtocol {
2525
@Dependency(\.continuousClock) var clock
2626
private enum CancelID { case load }
2727

28-
var body: some ReducerProtocol<State, Action> {
28+
var body: some Reducer<State, Action> {
2929
Reduce { state, action in
3030
switch action {
3131
case .setNavigation(isActive: true):

0 commit comments

Comments
 (0)