Skip to content

Commit 83089b7

Browse files
committed
Remove macros
ATM, they're basically not needed and add an extra layer of unneeded burden to anyone wanting to use CAP.
1 parent ff768b2 commit 83089b7

File tree

6 files changed

+22
-141
lines changed

6 files changed

+22
-141
lines changed

Package.resolved

Lines changed: 0 additions & 15 deletions
This file was deleted.

Package.swift

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,18 @@ let package = Package(
1717
.library(
1818
name: "ComposableArchitecturePattern",
1919
targets: ["ComposableArchitecturePattern"]),
20-
.library(
21-
name: "Composable",
22-
targets: ["Composable"]
23-
),
24-
.executable(
25-
name: "ComposableClient",
26-
targets: ["ComposableClient"]
27-
),
2820
],
2921
dependencies: [
30-
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.2"),
3122
],
3223
targets: [
33-
.macro(
34-
name: "ComposableMacros",
35-
dependencies: [
36-
.product(
37-
name: "SwiftSyntaxMacros",
38-
package: "swift-syntax"
39-
),
40-
.product(
41-
name: "SwiftCompilerPlugin",
42-
package: "swift-syntax"
43-
)
44-
]
45-
),
46-
47-
.target(
48-
name: "Composable",
49-
dependencies: ["ComposableMacros"]
50-
),
51-
52-
.executableTarget(
53-
name: "ComposableClient",
54-
dependencies: ["Composable"]
55-
),
56-
5724
.target(
5825
name: "ComposableArchitecturePattern",
59-
dependencies: ["Composable"]
26+
dependencies: []
6027
),
6128

6229
.testTarget(
6330
name: "ComposableArchitecturePatternTests",
6431
dependencies: [
65-
"ComposableMacros",
66-
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
6732
]
6833
),
6934
]

Sources/Composable/Composable.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1+
import SwiftUI
12

3+
/// A closure called asynchronously with the given output and throw any error.
4+
public typealias OutputHandler<Output> = (Output) async throws -> Void
5+
6+
public protocol Composable {
7+
/// The supported actions of a view.
8+
associatedtype Actions
9+
}
10+
11+
/// A protocol to provide a basis for making the implementation composable.
12+
public protocol ComposableView: View, Composable {
13+
/// A closure called to handle actions performed in the view.
14+
var perform: OutputHandler<Actions> { get }
15+
16+
/// Any layout designs to support a view.
17+
associatedtype Design
18+
}
19+
20+
public protocol ComposableObject: Composable {
21+
func handle(action: Actions) async throws
22+
}

Sources/ComposableClient/main.swift

Lines changed: 0 additions & 1 deletion
This file was deleted.

Sources/ComposableMacros/ComposableMacro.swift

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)