Skip to content

Commit ff1a875

Browse files
authored
Bump Sharing requirement to include 2.0.0 (#3546)
* Bump Sharing requirement to include 2.0.0 * Add migration guide * wip * wip * wip * wip * wip * wip * wip * wip
1 parent 42192d4 commit ff1a875

File tree

11 files changed

+110
-54
lines changed

11 files changed

+110
-54
lines changed

.github/package.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ComposableArchitecture.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/CaseStudies/SwiftUICaseStudiesTests/01-GettingStarted-AnimationsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct AnimationTests {
5656
$0.circleColor = .black
5757
}
5858

59-
await clock.run()
59+
await clock.run(timeout: .seconds(7))
6060
}
6161

6262
@Test

Examples/SyncUps/SyncUps/AppFeature.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ struct AppView: View {
5454

5555
var body: some View {
5656
NavigationStack(path: $store.scope(state: \.path, action: \.path)) {
57-
SyncUpsListView(
58-
store: store.scope(state: \.syncUpsList, action: \.syncUpsList)
59-
)
57+
SyncUpsListView(store: store.scope(state: \.syncUpsList, action: \.syncUpsList))
6058
} destination: { store in
6159
switch store.case {
6260
case let .detail(store):

Examples/SyncUps/SyncUps/RecordMeeting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct RecordMeeting {
7272
? speechClient.requestAuthorization()
7373
: speechClient.authorizationStatus()
7474

75-
await withTaskGroup(of: Void.self) { group in
75+
await withDiscardingTaskGroup { group in
7676
if authorization == .authorized {
7777
group.addTask {
7878
await startSpeechRecognition(send: send)

Package.resolved

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let package = Package(
2828
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
2929
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.2"),
3030
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
31-
.package(url: "https://github.com/pointfreeco/swift-sharing", "0.1.2"..<"2.0.0"),
31+
.package(url: "https://github.com/pointfreeco/swift-sharing", "0.1.2"..<"3.0.0"),
3232
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.3.0"),
3333
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
3434
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0"),

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let package = Package(
2828
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
2929
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.2.2"),
3030
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
31-
.package(url: "https://github.com/pointfreeco/swift-sharing", "0.1.2"..<"2.0.0"),
31+
.package(url: "https://github.com/pointfreeco/swift-sharing", "0.1.2"..<"3.0.0"),
3232
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.3.0"),
3333
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
3434
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0"),

Sources/ComposableArchitecture/Documentation.docc/Articles/MigrationGuides.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ APIs, and these guides contain tips to do so.
1414
1515
## Topics
1616

17+
- <doc:MigratingTo1.17.1>
1718
- <doc:MigratingTo1.17>
1819
- <doc:MigratingTo1.16>
1920
- <doc:MigratingTo1.15>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Migrating to 1.17.1
2+
3+
The Sharing library has graduated, with backwards-incompatible changes, to 2.0, and the Composable
4+
Architecture has been updated to extend support to this new version.
5+
6+
## Overview
7+
8+
The [Sharing][sharing-gh] package is a general purpose, state-sharing and persistence toolkit that
9+
works on all platforms supported by Swift, including iOS/macOS, Linux, Windows, Wasm, and more.
10+
11+
A [2.0][2.0-release] has introduced new features and functionality, and the Composable Architecture
12+
1.17.1 includes support for this release.
13+
14+
While many of Sharing 2.0's APIs are backwards-compatible with 1.0, if you have defined any of your
15+
own custom persistence strategies via the `SharedKey` or `SharedReaderKey` protocols, you will need
16+
to migrate them in order to support the brand new error handling and async functionality.
17+
18+
If you are not ready to migrate, then you can add an explicit dependency on the library to pin to
19+
any version less than 2.0:
20+
21+
```swift
22+
.package(url: "https://github.com/pointfreeco/swift-sharing", from: "0.1.0"),
23+
```
24+
25+
If you are ready to upgrade to 2.0, then you can follow the [2.0 migration guide][2.0-migration]
26+
from that package.
27+
28+
[sharing-gh]: https://github.com/pointfreeco/swift-sharing
29+
[1.0-migration]: https://swiftpackageindex.com/pointfreeco/swift-sharing/main/documentation/sharing/migratingto2.0
30+
[2.0-release]: https://github.com/pointfreeco/swift-sharing/releases/2.0.0

0 commit comments

Comments
 (0)