You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ If you're stuck, find more information at [developer.apple.com](https://develope
45
45
Add the following to your `Cartfile`:
46
46
47
47
```
48
-
github "readium/swift-toolkit" ~> 3.0.0-beta.2
48
+
github "readium/swift-toolkit" ~> 3.0.0
49
49
```
50
50
51
51
Then, [follow the usual Carthage steps](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add the Readium libraries to your project.
@@ -74,11 +74,11 @@ Add the following `pod` statements to your `Podfile` for the Readium libraries y
74
74
source 'https://github.com/readium/podspecs'
75
75
source 'https://cdn.cocoapods.org/'
76
76
77
-
pod 'ReadiumShared', '~> 3.0.0-beta.2'
78
-
pod 'ReadiumStreamer', '~> 3.0.0-beta.2'
79
-
pod 'ReadiumNavigator', '~> 3.0.0-beta.2'
80
-
pod 'ReadiumOPDS', '~> 3.0.0-beta.2'
81
-
pod 'ReadiumLCP', '~> 3.0.0-beta.2'
77
+
pod 'ReadiumShared', '~> 3.0.0'
78
+
pod 'ReadiumStreamer', '~> 3.0.0'
79
+
pod 'ReadiumNavigator', '~> 3.0.0'
80
+
pod 'ReadiumOPDS', '~> 3.0.0'
81
+
pod 'ReadiumLCP', '~> 3.0.0'
82
82
```
83
83
84
84
Take a look at [CocoaPods's documentation](https://guides.cocoapods.org/using/using-cocoapods.html) for more information.
Copy file name to clipboardexpand all lines: docs/Migration Guide.md
+65-72
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,26 @@ All migration steps necessary in reading apps to upgrade to major versions of th
4
4
5
5
<!-- ## Unreleased -->
6
6
7
-
## 3.0.0-beta.2
7
+
## 3.0.0
8
8
9
-
### CocoaPods Specs repository
9
+
:warning: If you upgrade from an `alpha` or `beta` version of 3.0.0, please refer to the [3.0.0-beta.2 migration guide](https://github.com/readium/swift-toolkit/blob/3.0.0-beta.2/docs/Migration%20Guide.md) instead.
10
+
11
+
### R2 prefix dropped
12
+
13
+
The `R2` prefix is now deprecated. The `R2Shared`, `R2Streamer` and `R2Navigator` packages were renamed as `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
14
+
15
+
You will need to update your imports, as well as the dependencies you include in your project:
16
+
17
+
* Swift Package Manager: There's nothing to do.
18
+
* Carthage:
19
+
* Update the Carthage dependencies and make sure the new `ReadiumShared.xcframework`, `ReadiumStreamer.xcframework` and `ReadiumNavigator.xcframework` were built.
20
+
* Replace the old frameworks with the new ones in your project.
21
+
* CocoaPods:
22
+
* Update the `pod` statements to reflect the new names of `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
23
+
24
+
### Dependency managers
25
+
26
+
#### CocoaPods Specs repository
10
27
11
28
All the libraries are now available on a dedicated [Readium CocoaPods Specs repository](https://github.com/readium/podspecs). To use it, add the following statements at the top of your `Podfile`:
12
29
@@ -35,14 +52,57 @@ Don't forget to remove the statements for some internal dependencies that are no
35
52
36
53
Finally, run `pod install --repo-update`.
37
54
38
-
### ZIPFoundation replaces Minizip
55
+
####ZIPFoundation replaces Minizip
39
56
40
57
The default `ZIPArchiveOpener` is now using ZIPFoundation instead of Minizip, with improved performances when reading ranges of `stored` ZIP entries.
41
58
42
59
If you use Carthage, remove `Minizip.xcframework` from your dependencies and add `ReadiumZIPFoundation.xcframework` instead. No changes are needed when using Swift Package Manager or CocoaPods.
43
60
61
+
### Migration of HREFs and Locators (bookmarks, annotations, etc.)
44
62
45
-
## 3.0.0-alpha.2
63
+
:warning: This requires a database migration in your application, if you were persisting `Locator` objects.
64
+
65
+
In Readium v2.x, a `Link` or `Locator`'s `href` could be either:
66
+
67
+
* a valid absolute URL for a streamed publication, e.g. `https://domain.com/isbn/dir/my%20chapter.html`,
68
+
* a percent-decoded path for a local archive such as an EPUB, e.g. `/dir/my chapter.html`.
69
+
* Note that it was relative to the root of the archive (`/`).
70
+
71
+
To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) **Readium v3 now generates and expects valid URLs** for `Locator` and `Link`'s `href`.
72
+
73
+
*`https://domain.com/isbn/dir/my%20chapter.html` is left unchanged, as it was already a valid URL.
74
+
*`/dir/my chapter.html` becomes the relative URL path `dir/my%20chapter.html`
75
+
* We dropped the `/` prefix to avoid issues when resolving to a base URL.
76
+
* Special characters are percent-encoded.
77
+
78
+
**You must migrate the HREFs or Locators stored in your database** when upgrading to Readium 3. To assist you, two helpers are provided: `AnyURL(legacyHREF:)` and `Locator(legacyJSONString:)`.
79
+
80
+
Here's an example of a [GRDB migration](https://swiftpackageindex.com/groue/grdb.swift/master/documentation/grdb/migrations) that can serve as inspiration:
81
+
82
+
```swift
83
+
migrator.registerMigration("normalizeHREFs") { db in
84
+
let normalizedRows: [(id: Int, href: String, locator: String)] =
85
+
try Row.fetchAll(db, sql: "SELECT id, href, locator FROM bookmarks")
86
+
.compactMap { row in
87
+
guard
88
+
let normalizedHREF =AnyURL(legacyHREF: row["href"])?.string,
89
+
let normalizedLocator =tryLocator(legacyJSONString: row["locator"])?.jsonString
let updateStmt =try db.makeStatement(sql: "UPDATE bookmarks SET href = :href, locator = :locator WHERE id = :id")
97
+
for (id, href, locator) in normalizedRows {
98
+
try updateStmt.execute(arguments: [
99
+
"id": id,
100
+
"href": href
101
+
"locator": locator
102
+
])
103
+
}
104
+
}
105
+
```
46
106
47
107
### Error management
48
108
@@ -119,7 +179,7 @@ To use `ReadiumAdapterLCPSQLite`, you must update your imports and the dependenc
119
179
* CocoaPods:
120
180
* Update the `pod` statements in your `Podfile` with the following, before running `pod install`:
121
181
```
122
-
pod 'ReadiumAdapterLCPSQLite', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumAdapterLCPSQLite.podspec'
182
+
pod 'ReadiumAdapterLCPSQLite', '~> 3.0.0'
123
183
```
124
184
Then, provide the adapters when initializing the `LCPService`.
125
185
@@ -145,73 +205,6 @@ The LCP APIs now accept a `LicenseDocumentSource` enum instead of a URL to an LC
145
205
```
146
206
147
207
148
-
## 3.0.0-alpha.1
149
-
150
-
### R2 prefix dropped
151
-
152
-
The `R2` prefix is now deprecated. The `R2Shared`, `R2Streamer` and `R2Navigator` packages were renamed as `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
153
-
154
-
You will need to update your imports, as well as the dependencies you include in your project:
155
-
156
-
* Swift Package Manager: There's nothing to do.
157
-
* Carthage:
158
-
* Update the Carthage dependencies and make sure the new `ReadiumShared.xcframework`, `ReadiumStreamer.xcframework` and `ReadiumNavigator.xcframework` were built.
159
-
* Replace the old frameworks with the new ones in your project.
160
-
* CocoaPods:
161
-
* Update the `pod` statements in your `Podfile` with the following, before running `pod install`:
162
-
```
163
-
pod 'ReadiumShared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumShared.podspec'
164
-
pod 'ReadiumStreamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumStreamer.podspec'
165
-
pod 'ReadiumNavigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumNavigator.podspec'
166
-
```
167
-
168
-
### Migration of HREFs and Locators (bookmarks, annotations, etc.)
169
-
170
-
:warning: This requires a database migration in your application, if you were persisting `Locator` objects.
171
-
172
-
In Readium v2.x, a `Link` or `Locator`'s `href` could be either:
173
-
174
-
* a valid absolute URL for a streamed publication, e.g. `https://domain.com/isbn/dir/my%20chapter.html`,
175
-
* a percent-decoded path for a local archive such as an EPUB, e.g. `/dir/my chapter.html`.
176
-
* Note that it was relative to the root of the archive (`/`).
177
-
178
-
To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) **Readium v3 now generates and expects valid URLs** for `Locator` and `Link`'s `href`.
179
-
180
-
*`https://domain.com/isbn/dir/my%20chapter.html` is left unchanged, as it was already a valid URL.
181
-
*`/dir/my chapter.html` becomes the relative URL path `dir/my%20chapter.html`
182
-
* We dropped the `/` prefix to avoid issues when resolving to a base URL.
183
-
* Special characters are percent-encoded.
184
-
185
-
**You must migrate the HREFs or Locators stored in your database** when upgrading to Readium 3. To assist you, two helpers are provided: `AnyURL(legacyHREF:)` and `Locator(legacyJSONString:)`.
186
-
187
-
Here's an example of a [GRDB migration](https://swiftpackageindex.com/groue/grdb.swift/master/documentation/grdb/migrations) that can serve as inspiration:
188
-
189
-
```swift
190
-
migrator.registerMigration("normalizeHREFs") { db in
191
-
let normalizedRows: [(id: Int, href: String, locator: String)] =
192
-
try Row.fetchAll(db, sql: "SELECT id, href, locator FROM bookmarks")
193
-
.compactMap { row in
194
-
guard
195
-
let normalizedHREF =AnyURL(legacyHREF: row["href"])?.string,
196
-
let normalizedLocator =tryLocator(legacyJSONString: row["locator"])?.jsonString
0 commit comments