-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address @Shared sendability. #3329
Changes from all commits
70cf0bd
68023fa
17eed0c
4b38430
2dac7a3
d277743
53d5389
414e4fa
0020365
36d2323
2faa246
85354f4
e77c431
93e858d
833be15
d185c0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// swift-tools-version:6.0 | ||
|
||
import CompilerPluginSupport | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "swift-composable-architecture", | ||
platforms: [ | ||
.iOS(.v13), | ||
.macOS(.v10_15), | ||
.tvOS(.v13), | ||
.watchOS(.v6), | ||
], | ||
products: [ | ||
.library( | ||
name: "ComposableArchitecture", | ||
targets: ["ComposableArchitecture"] | ||
) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-collections", from: "1.1.0"), | ||
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"), | ||
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.2"), | ||
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"), | ||
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.1.0"), | ||
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"), | ||
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.5"), | ||
.package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.1.0"), | ||
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"), | ||
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.1.0"), | ||
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"), | ||
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"), | ||
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"), | ||
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0-prerelease"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "ComposableArchitecture", | ||
dependencies: [ | ||
"ComposableArchitectureMacros", | ||
.product(name: "CasePaths", package: "swift-case-paths"), | ||
.product(name: "CombineSchedulers", package: "combine-schedulers"), | ||
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"), | ||
.product(name: "CustomDump", package: "swift-custom-dump"), | ||
.product(name: "Dependencies", package: "swift-dependencies"), | ||
.product(name: "DependenciesMacros", package: "swift-dependencies"), | ||
.product(name: "IdentifiedCollections", package: "swift-identified-collections"), | ||
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"), | ||
.product(name: "OrderedCollections", package: "swift-collections"), | ||
.product(name: "Perception", package: "swift-perception"), | ||
.product(name: "SwiftUINavigation", package: "swift-navigation"), | ||
.product(name: "UIKitNavigation", package: "swift-navigation"), | ||
], | ||
resources: [ | ||
.process("Resources/PrivacyInfo.xcprivacy") | ||
] | ||
), | ||
.testTarget( | ||
name: "ComposableArchitectureTests", | ||
dependencies: [ | ||
"ComposableArchitecture", | ||
.product(name: "IssueReportingTestSupport", package: "xctest-dynamic-overlay"), | ||
] | ||
), | ||
.macro( | ||
name: "ComposableArchitectureMacros", | ||
dependencies: [ | ||
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"), | ||
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"), | ||
] | ||
), | ||
.testTarget( | ||
name: "ComposableArchitectureMacrosTests", | ||
dependencies: [ | ||
"ComposableArchitectureMacros", | ||
.product(name: "MacroTesting", package: "swift-macro-testing"), | ||
] | ||
), | ||
.executableTarget( | ||
name: "swift-composable-architecture-benchmark", | ||
dependencies: [ | ||
"ComposableArchitecture", | ||
.product(name: "Benchmark", package: "swift-benchmark"), | ||
] | ||
), | ||
], | ||
swiftLanguageModes: [.v6] | ||
) | ||
|
||
for target in package.targets where target.type == .system || target.type == .test { | ||
target.swiftSettings = target.swiftSettings ?? [] | ||
target.swiftSettings?.append(contentsOf: [ | ||
.swiftLanguageMode(.v5), | ||
.enableExperimentalFeature("StrictConcurrency"), | ||
.enableUpcomingFeature("InferSendableFromCaptures") | ||
]) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ | |
/// | ||
/// See the article <doc:SharingState> for more information, in particular the | ||
/// <doc:SharingState#Custom-persistence> section. | ||
public protocol PersistenceReaderKey<Value> { | ||
public protocol PersistenceReaderKey<Value>: Sendable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Persistence keys need to be sendable because they are captured in some |
||
/// A type that can be loaded or subscribed to in an external system. | ||
associatedtype Value | ||
associatedtype Value: Sendable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
/// A type representing the hashable identity of a persistence key. | ||
associatedtype ID: Hashable = Self | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this temporarily so that we don't get flooded with warnings in test targets, but maybe we should keep this around until we've addressed all/most warnings in TCA proper, and then we can later concentrate on tests?