Skip to content

Commit bf06c12

Browse files
authored
refactor: remove deprecations (#23)
* refactor: remove deprecations * add changeling
1 parent 29f8ecb commit bf06c12

33 files changed

+58
-1691
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/4.16.2...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift)
55
* _Contributing to this repo? Add info about your change here to be included in the next release_
66

7+
### 5.0.0
8+
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/4.16.2...5.0.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.0.0/documentation/parseswift)
9+
10+
__Fixes__
11+
- (Breaking Change) Remove deprecated code ([#23](https://github.com/netreconlab/Parse-Swift/pull/23)), thanks to [Corey Baker](https://github.com/cbaker6).
12+
713
### 4.16.2
814
[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/4.16.1...4.16.2), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/4.16.2/documentation/parseswift)
915

Sources/ParseSwift/API/API.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ public struct API {
137137

138138
/// Use the primaryKey/masterKey if it was provided during initial configuraration.
139139
case usePrimaryKey
140-
/// Use the masterKey if it was provided during initial configuraration.
141-
@available(*, deprecated, renamed: "usePrimaryKey")
142-
case useMasterKey // swiftlint:disable:this inclusive_language
143140
/// Use a specific session token.
144141
/// - note: The session token of the current user is provided by default.
145142
case sessionToken(String)
@@ -170,7 +167,7 @@ public struct API {
170167

171168
public func hash(into hasher: inout Hasher) {
172169
switch self {
173-
case .usePrimaryKey, .useMasterKey:
170+
case .usePrimaryKey:
174171
hasher.combine(1)
175172
case .sessionToken:
176173
hasher.combine(2)
@@ -219,7 +216,7 @@ public struct API {
219216

220217
options.forEach { (option) in
221218
switch option {
222-
case .usePrimaryKey, .useMasterKey:
219+
case .usePrimaryKey:
223220
headers["X-Parse-Master-Key"] = Parse.configuration.primaryKey
224221
case .sessionToken(let sessionToken):
225222
headers["X-Parse-Session-Token"] = sessionToken

Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,6 @@ extension ParseLiveQuery {
277277
}
278278
}
279279

280-
/// Set a specific ParseLiveQuery client to be the default for all `ParseLiveQuery` connections.
281-
/// - parameter client: The client to set as the default.
282-
/// - warning: This will be removed in ParseSwift 5.0.0 in favor of `defaultClient`.
283-
@available(*, deprecated, renamed: "defaultClient")
284-
class public func setDefault(_ client: ParseLiveQuery) {
285-
Self.defaultClient = client
286-
}
287-
288-
/// Get the default `ParseLiveQuery` client for all LiveQuery connections.
289-
/// - returns: The default `ParseLiveQuery` client.
290-
/// - warning: This will be removed in ParseSwift 5.0.0 in favor of `defaultClient`.
291-
@available(*, deprecated, renamed: "defaultClient")
292-
class public func getDefault() -> ParseLiveQuery? {
293-
Self.defaultClient
294-
}
295-
296280
/// Check if a query has an active subscription on this `ParseLiveQuery` client.
297281
/// - parameter query: Query to verify.
298282
/// - returns: **true** if subscribed. **false** otherwise.

Sources/ParseSwift/Objects/ParseInstallation+async.swift

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -444,34 +444,6 @@ internal extension Sequence where Element: ParseInstallation {
444444
#if !os(Linux) && !os(Android) && !os(Windows)
445445
// MARK: Migrate from Objective-C SDK
446446
public extension ParseInstallation {
447-
/**
448-
Migrates the `ParseInstallation` *asynchronously* from the Objective-C SDK Keychain.
449-
450-
- parameter copyEntireInstallation: When **true**, copies the
451-
entire `ParseInstallation` from the Objective-C SDK Keychain to the Swift SDK. When
452-
**false**, only the `channels` and `deviceToken` are copied from the Objective-C
453-
SDK Keychain; resulting in a new `ParseInstallation` for original `sessionToken`.
454-
Defaults to **true**.
455-
- parameter options: A set of header options sent to the server. Defaults to an empty set.
456-
- returns: Returns saved `ParseInstallation`.
457-
- throws: An error of type `ParseError`.
458-
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
459-
desires a different policy, it should be inserted in `options`.
460-
- warning: When initializing the Swift SDK, `migratingFromObjcSDK` should be set to **false**
461-
when calling this method.
462-
- warning: The latest **PFInstallation** from the Objective-C SDK should be saved to your
463-
Parse Server before calling this method.
464-
*/
465-
@available(*, deprecated, message: "This does not work, use become() instead")
466-
@discardableResult static func migrateFromObjCKeychain(copyEntireInstallation: Bool = true,
467-
options: API.Options = []) async throws -> Self {
468-
try await withCheckedThrowingContinuation { continuation in
469-
Self.migrateFromObjCKeychain(copyEntireInstallation: copyEntireInstallation,
470-
options: options,
471-
completion: continuation.resume)
472-
}
473-
}
474-
475447
/**
476448
Deletes the Objective-C Keychain along with the Objective-C `ParseInstallation`
477449
from the Parse Server *asynchronously*.

Sources/ParseSwift/Objects/ParseInstallation+combine.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -324,36 +324,6 @@ public extension Sequence where Element: ParseInstallation {
324324
#if !os(Linux) && !os(Android) && !os(Windows)
325325
// MARK: Migrate from Objective-C SDK
326326
public extension ParseInstallation {
327-
328-
/**
329-
Migrates the `ParseInstallation` *asynchronously* from the Objective-C SDK Keychain
330-
and publishes when complete.
331-
332-
- parameter copyEntireInstallation: When **true**, copies the
333-
entire `ParseInstallation` from the Objective-C SDK Keychain to the Swift SDK. When
334-
**false**, only the `channels` and `deviceToken` are copied from the Objective-C
335-
SDK Keychain; resulting in a new `ParseInstallation` for original `sessionToken`.
336-
Defaults to **true**.
337-
- parameter options: A set of header options sent to the server. Defaults to an empty set.
338-
- returns: A publisher that eventually produces a single value and then finishes or fails.
339-
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
340-
desires a different policy, it should be inserted in `options`.
341-
- warning: When initializing the Swift SDK, `migratingFromObjcSDK` should be set to **false**
342-
when calling this method.
343-
- warning: The latest **PFInstallation** from the Objective-C SDK should be saved to your
344-
Parse Server before calling this method. This method assumes **PFInstallation.installationId** is saved
345-
to the Keychain. If the **installationId** is not saved to the Keychain, this method will not work.
346-
*/
347-
@available(*, deprecated, message: "This does not work, use become() instead")
348-
static func migrateFromObjCKeychainPublisher(copyEntireInstallation: Bool = true,
349-
options: API.Options = []) -> Future<Self, ParseError> {
350-
Future { promise in
351-
Self.migrateFromObjCKeychain(copyEntireInstallation: copyEntireInstallation,
352-
options: options,
353-
completion: promise)
354-
}
355-
}
356-
357327
/**
358328
Deletes the Objective-C Keychain along with the Objective-C `ParseInstallation`
359329
from the Parse Server *asynchronously* and publishes when complete.

Sources/ParseSwift/Objects/ParseInstallation.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,46 +1760,6 @@ public extension Sequence where Element: ParseInstallation {
17601760
// MARK: Migrate from Objective-C SDK
17611761
public extension ParseInstallation {
17621762

1763-
/**
1764-
Migrates the `ParseInstallation` *asynchronously* from the Objective-C SDK Keychain.
1765-
1766-
- parameter copyEntireInstallation: When **true**, copies the
1767-
entire `ParseInstallation` from the Objective-C SDK Keychain to the Swift SDK. When
1768-
**false**, only the `channels` and `deviceToken` are copied from the Objective-C
1769-
SDK Keychain; resulting in a new `ParseInstallation` for original `sessionToken`.
1770-
Defaults to **true**.
1771-
- parameter options: A set of header options sent to the server. Defaults to an empty set.
1772-
- parameter callbackQueue: The queue to return to after completion. Default value of .main.
1773-
- parameter completion: The block to execute.
1774-
It should have the following argument signature: `(Result<Self, ParseError>)`.
1775-
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
1776-
desires a different policy, it should be inserted in `options`.
1777-
- warning: When initializing the Swift SDK, `migratingFromObjcSDK` should be set to **false**
1778-
when calling this method.
1779-
- warning: The latest **PFInstallation** from the Objective-C SDK should be saved to your
1780-
Parse Server before calling this method. This method assumes **PFInstallation.installationId**
1781-
is saved to the Keychain. If the **installationId** is not saved to the Keychain, this method will
1782-
not work.
1783-
*/
1784-
@available(*, deprecated, message: "This does not work, use become() instead")
1785-
static func migrateFromObjCKeychain(copyEntireInstallation: Bool = true,
1786-
options: API.Options = [],
1787-
callbackQueue: DispatchQueue = .main,
1788-
completion: @escaping (Result<Self, ParseError>) -> Void) {
1789-
guard let objcParseKeychain = KeychainStore.objectiveC,
1790-
let oldInstallationId: String = objcParseKeychain.objectObjectiveC(forKey: "installationId") else {
1791-
let error = ParseError(code: .unknownError,
1792-
message: "Could not find Installation in the Objective-C SDK Keychain")
1793-
callbackQueue.async {
1794-
completion(.failure(error))
1795-
}
1796-
return
1797-
}
1798-
become(oldInstallationId,
1799-
copyEntireInstallation: copyEntireInstallation,
1800-
completion: completion)
1801-
}
1802-
18031763
/**
18041764
Deletes the Objective-C Keychain along with the Objective-C `ParseInstallation`
18051765
from the Parse Server *asynchronously* and executes the given callback block.

Sources/ParseSwift/Objects/ParseObject.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -241,29 +241,6 @@ extension ParseObject {
241241

242242
// MARK: Helper Methods
243243
public extension ParseObject {
244-
/**
245-
Reverts the `KeyPath` of the `ParseObject` back to the original `KeyPath`
246-
before mutations began.
247-
- throws: An error of type `ParseError`.
248-
- important: This reverts to the contents in `originalData`. This means `originalData` should have
249-
been populated by calling `.mergeable` or the `.set` method.
250-
*/
251-
@available(*, deprecated, renamed: "revert")
252-
func revertKeyPath<W>(_ keyPath: WritableKeyPath<Self, W?>) throws -> Self where W: Equatable {
253-
try revert(keyPath)
254-
}
255-
256-
/**
257-
Reverts the `ParseObject` back to the original object before mutations began.
258-
- throws: An error of type `ParseError`.
259-
- important: This reverts to the contents in `originalData`. This means `originalData` should have
260-
been populated by calling `.mergeable` or the `.set()` method.
261-
*/
262-
@available(*, deprecated, renamed: "revert")
263-
func revertObject() throws -> Self {
264-
try revert()
265-
}
266-
267244
/**
268245
Reverts the `KeyPath` of the `ParseObject` back to the original `KeyPath`
269246
before mutations began.

0 commit comments

Comments
 (0)