From 232422a4c7ab100a010159f7cf928f67cb769b32 Mon Sep 17 00:00:00 2001 From: Malte Schonvogel Date: Mon, 27 Nov 2023 13:16:34 +0000 Subject: [PATCH 1/2] Update TCA to 1.5.0 --- Package.swift | 4 +-- .../IdentifiedArray+RoutableCollection.swift | 4 +-- .../Reducers/CancelEffectsOnDismiss.swift | 4 +-- .../Reducers/ForEachIdentifiedRoute.swift | 8 ++--- .../Reducers/ForEachIndexedRoute.swift | 8 ++--- .../Reducers/ForEachReducer.swift | 6 ++-- .../Reducers/UpdateRoutesOnInteraction.swift | 4 +-- .../xcshareddata/swiftpm/Package.resolved | 29 ++++++++++++------- 8 files changed, 38 insertions(+), 29 deletions(-) diff --git a/Package.swift b/Package.swift index f3767d9..d764f11 100644 --- a/Package.swift +++ b/Package.swift @@ -14,8 +14,8 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/johnpatrickmorgan/FlowStacks", from: "0.3.0"), - .package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.0.0"), + .package(url: "https://github.com/johnpatrickmorgan/FlowStacks", from: "0.3.2"), + .package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.5.0"), ], targets: [ .target( diff --git a/Sources/TCACoordinators/IdentifiedArray+RoutableCollection.swift b/Sources/TCACoordinators/IdentifiedArray+RoutableCollection.swift index 3e0940d..3509e89 100644 --- a/Sources/TCACoordinators/IdentifiedArray+RoutableCollection.swift +++ b/Sources/TCACoordinators/IdentifiedArray+RoutableCollection.swift @@ -15,7 +15,7 @@ public extension RoutableCollection where Element: RouteProtocol { /// - Parameter condition: The predicate indicating which screen to pop to. /// - Returns: A `Bool` indicating whether a screen was found. @discardableResult - mutating func goBackTo(_ screenCasePath: CasePath) -> Bool { + mutating func goBackTo(_ screenCasePath: AnyCasePath) -> Bool { goBackTo(where: { screenCasePath.extract(from: $0.screen) != nil }) } @@ -26,7 +26,7 @@ public extension RoutableCollection where Element: RouteProtocol { /// - Parameter condition: The predicate indicating which screen to pop to. /// - Returns: A `Bool` indicating whether a screen was found. @discardableResult - mutating func popTo(_ screenCasePath: CasePath) -> Bool { + mutating func popTo(_ screenCasePath: AnyCasePath) -> Bool { popTo(where: { screenCasePath.extract(from: $0.screen) != nil }) } } diff --git a/Sources/TCACoordinators/Reducers/CancelEffectsOnDismiss.swift b/Sources/TCACoordinators/Reducers/CancelEffectsOnDismiss.swift index 1c90d31..1ba60f3 100644 --- a/Sources/TCACoordinators/Reducers/CancelEffectsOnDismiss.swift +++ b/Sources/TCACoordinators/Reducers/CancelEffectsOnDismiss.swift @@ -10,7 +10,7 @@ public struct CancellationIdentity: struct CancelEffectsOnDismiss: Reducer where CoordinatorScreensReducer.State == CoordinatorReducer.State, CoordinatorScreensReducer.Action == CoordinatorReducer.Action { let coordinatedScreensReducer: CoordinatorScreensReducer let routes: (CoordinatorReducer.State) -> C - let routeAction: CasePath + let routeAction: AnyCasePath let cancellationId: CoordinatorID? let getIdentifier: (C.Element, C.Index) -> RouteID let coordinatorReducer: CoordinatorReducer @@ -42,7 +42,7 @@ struct CancelEffectsOnDismiss: Reducer { let screenReducer: ScreenReducer let coordinatorId: CoordinatorID - let routeAction: CasePath + let routeAction: AnyCasePath var body: some ReducerOf { Reduce { state, action in diff --git a/Sources/TCACoordinators/Reducers/ForEachIdentifiedRoute.swift b/Sources/TCACoordinators/Reducers/ForEachIdentifiedRoute.swift index ee1d622..ba05f6a 100644 --- a/Sources/TCACoordinators/Reducers/ForEachIdentifiedRoute.swift +++ b/Sources/TCACoordinators/Reducers/ForEachIdentifiedRoute.swift @@ -6,8 +6,8 @@ struct ForEachIdentifiedRoute>> - let toLocalAction: CasePath - let updateRoutes: CasePath>> + let toLocalAction: AnyCasePath + let updateRoutes: AnyCasePath>> var body: some ReducerOf { CancelEffectsOnDismiss( @@ -32,8 +32,8 @@ public extension Reducer { func forEachRoute( cancellationId: CoordinatorID?, toLocalState: WritableKeyPath>>, - toLocalAction: CasePath, - updateRoutes: CasePath>>, + toLocalAction: AnyCasePath, + updateRoutes: AnyCasePath>>, @ReducerBuilder screenReducer: () -> ScreenReducer ) -> some ReducerOf where ScreenReducer.State: Identifiable, diff --git a/Sources/TCACoordinators/Reducers/ForEachIndexedRoute.swift b/Sources/TCACoordinators/Reducers/ForEachIndexedRoute.swift index b1dab23..51af98a 100644 --- a/Sources/TCACoordinators/Reducers/ForEachIndexedRoute.swift +++ b/Sources/TCACoordinators/Reducers/ForEachIndexedRoute.swift @@ -6,8 +6,8 @@ struct ForEachIndexedRoute]> - let toLocalAction: CasePath - let updateRoutes: CasePath]> + let toLocalAction: AnyCasePath + let updateRoutes: AnyCasePath]> var body: some ReducerOf { CancelEffectsOnDismiss( @@ -32,8 +32,8 @@ public extension Reducer { func forEachRoute( coordinatorIdForCancellation: CoordinatorID?, toLocalState: WritableKeyPath]>, - toLocalAction: CasePath, - updateRoutes: CasePath]>, + toLocalAction: AnyCasePath, + updateRoutes: AnyCasePath]>, @ReducerBuilder screenReducer: () -> ScreenReducer ) -> some ReducerOf where ScreenState == ScreenReducer.State, diff --git a/Sources/TCACoordinators/Reducers/ForEachReducer.swift b/Sources/TCACoordinators/Reducers/ForEachReducer.swift index 8d3294d..bfde988 100644 --- a/Sources/TCACoordinators/Reducers/ForEachReducer.swift +++ b/Sources/TCACoordinators/Reducers/ForEachReducer.swift @@ -9,7 +9,7 @@ import ComposableArchitecture extension Reducer { func forEachIndex( _ toElementsState: WritableKeyPath, - action toElementAction: CasePath, + action toElementAction: AnyCasePath, @ReducerBuilder element: () -> Element, file: StaticString = #file, fileID: StaticString = #fileID, @@ -33,7 +33,7 @@ struct _ForEachIndexReducer< >: Reducer { let parent: Parent let toElementsState: WritableKeyPath - let toElementAction: CasePath + let toElementAction: AnyCasePath let element: Element let file: StaticString let fileID: StaticString @@ -42,7 +42,7 @@ struct _ForEachIndexReducer< init( parent: Parent, toElementsState: WritableKeyPath, - toElementAction: CasePath, + toElementAction: AnyCasePath, element: Element, file: StaticString, fileID: StaticString, diff --git a/Sources/TCACoordinators/Reducers/UpdateRoutesOnInteraction.swift b/Sources/TCACoordinators/Reducers/UpdateRoutesOnInteraction.swift index 4b1c6b8..b4a6d4b 100644 --- a/Sources/TCACoordinators/Reducers/UpdateRoutesOnInteraction.swift +++ b/Sources/TCACoordinators/Reducers/UpdateRoutesOnInteraction.swift @@ -3,7 +3,7 @@ import Foundation extension Reducer { @ReducerBuilder - func updatingRoutesOnInteraction(updateRoutes: CasePath, toLocalState: WritableKeyPath) -> some ReducerOf { + func updatingRoutesOnInteraction(updateRoutes: AnyCasePath, toLocalState: WritableKeyPath) -> some ReducerOf { self UpdateRoutesOnInteraction( wrapped: self, @@ -15,7 +15,7 @@ extension Reducer { struct UpdateRoutesOnInteraction: Reducer { let wrapped: WrappedReducer - let updateRoutes: CasePath + let updateRoutes: AnyCasePath let toLocalState: WritableKeyPath var body: some ReducerOf { diff --git a/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6af7ec6..145b961 100644 --- a/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/pointfreeco/swift-case-paths", "state": { "branch": null, - "revision": "5da6989aae464f324eef5c5b52bdb7974725ab81", - "version": "1.0.0" + "revision": "ed7facdd4a361514b46e3bbc6238cd41c84be4ec", + "version": "1.1.1" } }, { @@ -51,8 +51,8 @@ "repositoryURL": "https://github.com/pointfreeco/swift-composable-architecture", "state": { "branch": null, - "revision": "195284b94b799b326729640453f547f08892293a", - "version": "1.0.0" + "revision": "3f80eb9ed07c16a9f42ac4f23d4dafaa0494568c", + "version": "1.5.0" } }, { @@ -60,8 +60,8 @@ "repositoryURL": "https://github.com/pointfreeco/swift-concurrency-extras", "state": { "branch": null, - "revision": "ea631ce892687f5432a833312292b80db238186a", - "version": "1.0.0" + "revision": "bb5059bde9022d69ac516803f4f227d8ac967f71", + "version": "1.1.0" } }, { @@ -78,8 +78,8 @@ "repositoryURL": "https://github.com/pointfreeco/swift-dependencies", "state": { "branch": null, - "revision": "4e1eb6e28afe723286d8cc60611237ffbddba7c5", - "version": "1.0.0" + "revision": "63301f4a181ed9aefb46dccef2dfb66466798341", + "version": "1.1.1" } }, { @@ -91,13 +91,22 @@ "version": "1.0.0" } }, + { + "package": "swift-syntax", + "repositoryURL": "https://github.com/apple/swift-syntax", + "state": { + "branch": null, + "revision": "6ad4ea24b01559dde0773e3d091f1b9e36175036", + "version": "509.0.2" + } + }, { "package": "swiftui-navigation", "repositoryURL": "https://github.com/pointfreeco/swiftui-navigation", "state": { "branch": null, - "revision": "f5bcdac5b6bb3f826916b14705f37a3937c2fd34", - "version": "1.0.0" + "revision": "78f9d72cf667adb47e2040aa373185c88c63f0dc", + "version": "1.2.0" } }, { From 89494fe0f14afd47607661752f434735860fe1eb Mon Sep 17 00:00:00 2001 From: johnpatrickmorgan Date: Tue, 28 Nov 2023 22:05:02 +0000 Subject: [PATCH 2/2] Updates FlowStacks --- Package.resolved | 115 ------------------ Package.swift | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- 3 files changed, 3 insertions(+), 118 deletions(-) delete mode 100644 Package.resolved diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index 221a828..0000000 --- a/Package.resolved +++ /dev/null @@ -1,115 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "combine-schedulers", - "repositoryURL": "https://github.com/pointfreeco/combine-schedulers", - "state": { - "branch": null, - "revision": "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb", - "version": "1.0.0" - } - }, - { - "package": "FlowStacks", - "repositoryURL": "https://github.com/johnpatrickmorgan/FlowStacks", - "state": { - "branch": null, - "revision": "8d1bc577fcab0c09d599f1f2f6747db2d15f84f4", - "version": "0.3.0" - } - }, - { - "package": "swift-case-paths", - "repositoryURL": "https://github.com/pointfreeco/swift-case-paths", - "state": { - "branch": null, - "revision": "5da6989aae464f324eef5c5b52bdb7974725ab81", - "version": "1.0.0" - } - }, - { - "package": "swift-clocks", - "repositoryURL": "https://github.com/pointfreeco/swift-clocks", - "state": { - "branch": null, - "revision": "d1fd837326aa719bee979bdde1f53cd5797443eb", - "version": "1.0.0" - } - }, - { - "package": "swift-collections", - "repositoryURL": "https://github.com/apple/swift-collections", - "state": { - "branch": null, - "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version": "1.0.4" - } - }, - { - "package": "swift-composable-architecture", - "repositoryURL": "https://github.com/pointfreeco/swift-composable-architecture", - "state": { - "branch": null, - "revision": "195284b94b799b326729640453f547f08892293a", - "version": "1.0.0" - } - }, - { - "package": "swift-concurrency-extras", - "repositoryURL": "https://github.com/pointfreeco/swift-concurrency-extras", - "state": { - "branch": null, - "revision": "ea631ce892687f5432a833312292b80db238186a", - "version": "1.0.0" - } - }, - { - "package": "swift-custom-dump", - "repositoryURL": "https://github.com/pointfreeco/swift-custom-dump", - "state": { - "branch": null, - "revision": "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01", - "version": "1.0.0" - } - }, - { - "package": "swift-dependencies", - "repositoryURL": "https://github.com/pointfreeco/swift-dependencies", - "state": { - "branch": null, - "revision": "4e1eb6e28afe723286d8cc60611237ffbddba7c5", - "version": "1.0.0" - } - }, - { - "package": "swift-identified-collections", - "repositoryURL": "https://github.com/pointfreeco/swift-identified-collections", - "state": { - "branch": null, - "revision": "d1e45f3e1eee2c9193f5369fa9d70a6ddad635e8", - "version": "1.0.0" - } - }, - { - "package": "swiftui-navigation", - "repositoryURL": "https://github.com/pointfreeco/swiftui-navigation", - "state": { - "branch": null, - "revision": "f5bcdac5b6bb3f826916b14705f37a3937c2fd34", - "version": "1.0.0" - } - }, - { - "package": "xctest-dynamic-overlay", - "repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state": { - "branch": null, - "revision": "302891700c7fa3b92ebde9fe7b42933f8349f3c7", - "version": "1.0.0" - } - } - ] - }, - "version": 1 -} diff --git a/Package.swift b/Package.swift index d764f11..fcbc840 100644 --- a/Package.swift +++ b/Package.swift @@ -14,7 +14,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/johnpatrickmorgan/FlowStacks", from: "0.3.2"), + .package(url: "https://github.com/johnpatrickmorgan/FlowStacks", from: "0.3.6"), .package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.5.0"), ], targets: [ diff --git a/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 145b961..40d75c8 100644 --- a/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/TCACoordinatorsExample/TCACoordinatorsExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/johnpatrickmorgan/FlowStacks", "state": { "branch": null, - "revision": "0c5414b018fac906ffce9c4aee7da2a599615c95", - "version": "0.3.4" + "revision": "14a726e093568c3088ecbd4cd5b578059b029c28", + "version": "0.3.6" } }, {