From 90e9e4bae0c05d947fee506a88e6388bd66b20fe Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Thu, 11 Jul 2024 22:26:10 -0700 Subject: [PATCH 1/3] fix: Make PaseEncoder Sendable --- CHANGELOG.md | 7 ++++++- Sources/ParseSwift/Coding/ParseCoding.swift | 4 ++-- Sources/ParseSwift/Coding/ParseEncoder.swift | 2 +- Sources/ParseSwift/ParseConstants.swift | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52d7c673..6592da142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,14 @@ # Parse-Swift Changelog ### main -[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.10.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.11.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) * _Contributing to this repo? Add info about your change here to be included in the next release_ +### 5.11.0 +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.10.0...5.10.1), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.10.0/documentation/parseswift) + +__Fixes__ +* Make ParseEncoder sendable ([#175](https://github.com/netreconlab/Parse-Swift/pull/175)), thanks to [Corey Baker](https://github.com/cbaker6). ### 5.10.0 [Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.9.3...5.10.0), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/5.10.0/documentation/parseswift) diff --git a/Sources/ParseSwift/Coding/ParseCoding.swift b/Sources/ParseSwift/Coding/ParseCoding.swift index 0c08a4cdc..23d96db4e 100644 --- a/Sources/ParseSwift/Coding/ParseCoding.swift +++ b/Sources/ParseSwift/Coding/ParseCoding.swift @@ -10,7 +10,7 @@ import Foundation // MARK: ParseCoding /// Custom coding for Parse objects. -enum ParseCoding {} +public enum ParseCoding {} // MARK: Coders extension ParseCoding { @@ -100,7 +100,7 @@ extension ParseCoding { return dateFormatter }() - static let parseDateEncodingStrategy: JSONEncoder.DateEncodingStrategy = .custom { (date, encoder) in + public static let parseDateEncodingStrategy: JSONEncoder.DateEncodingStrategy = .custom { (date, encoder) in var container = encoder.container(keyedBy: DateEncodingKeys.self) try container.encode("Date", forKey: .type) let dateString = dateFormatter.string(from: date) diff --git a/Sources/ParseSwift/Coding/ParseEncoder.swift b/Sources/ParseSwift/Coding/ParseEncoder.swift index 38cb94b46..ed1d0b69c 100644 --- a/Sources/ParseSwift/Coding/ParseEncoder.swift +++ b/Sources/ParseSwift/Coding/ParseEncoder.swift @@ -54,7 +54,7 @@ extension Dictionary: _JSONStringDictionaryEncodableMarker where Key == String, ParseEncoder matches the features of the [Swift 5.4 JSONEncoder ](https://github.com/apple/swift/blob/main/stdlib/public/Darwin/Foundation/JSONEncoder.swift). Update commits as needed for improvement. */ -public struct ParseEncoder { +public struct ParseEncoder: Sendable { let dateEncodingStrategy: JSONEncoder.DateEncodingStrategy? let outputFormatting: JSONEncoder.OutputFormatting? diff --git a/Sources/ParseSwift/ParseConstants.swift b/Sources/ParseSwift/ParseConstants.swift index 2742007c6..3c4398f19 100644 --- a/Sources/ParseSwift/ParseConstants.swift +++ b/Sources/ParseSwift/ParseConstants.swift @@ -10,7 +10,7 @@ import Foundation enum ParseConstants { static let sdk = "swift" - static let version = "5.10.0" + static let version = "5.10.1" static let fileManagementDirectory = "parse/" static let fileManagementPrivateDocumentsDirectory = "Private Documents/" static let fileManagementLibraryDirectory = "Library/" From 2777299952e638944f54366ce568d85261460cb3 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Fri, 12 Jul 2024 05:44:01 -0700 Subject: [PATCH 2/3] revert back to internal --- Sources/ParseSwift/Coding/ParseCoding.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ParseSwift/Coding/ParseCoding.swift b/Sources/ParseSwift/Coding/ParseCoding.swift index 23d96db4e..0c08a4cdc 100644 --- a/Sources/ParseSwift/Coding/ParseCoding.swift +++ b/Sources/ParseSwift/Coding/ParseCoding.swift @@ -10,7 +10,7 @@ import Foundation // MARK: ParseCoding /// Custom coding for Parse objects. -public enum ParseCoding {} +enum ParseCoding {} // MARK: Coders extension ParseCoding { @@ -100,7 +100,7 @@ extension ParseCoding { return dateFormatter }() - public static let parseDateEncodingStrategy: JSONEncoder.DateEncodingStrategy = .custom { (date, encoder) in + static let parseDateEncodingStrategy: JSONEncoder.DateEncodingStrategy = .custom { (date, encoder) in var container = encoder.container(keyedBy: DateEncodingKeys.self) try container.encode("Date", forKey: .type) let dateString = dateFormatter.string(from: date) From b255210c3fe32d84a77336f39f716abe455fdd97 Mon Sep 17 00:00:00 2001 From: Corey Date: Fri, 12 Jul 2024 06:03:06 -0700 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6592da142..e665e9e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # Parse-Swift Changelog ### main -[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.11.0...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) +[Full Changelog](https://github.com/netreconlab/Parse-Swift/compare/5.10.1...main), [Documentation](https://swiftpackageindex.com/netreconlab/Parse-Swift/main/documentation/parseswift) * _Contributing to this repo? Add info about your change here to be included in the next release_ ### 5.11.0