Skip to content

Commit 51dfbe1

Browse files
authored
feat: Removes emptyObject requirement (#249)
* feat: Removes emptyObject requirement * update jazzy
1 parent f085dcf commit 51dfbe1

File tree

11 files changed

+118
-53
lines changed

11 files changed

+118
-53
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Parse-Swift Changelog
22

33
### main
4-
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.0...main)
4+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.1...main)
55
* _Contributing to this repo? Add info about your change here to be included in the next release_
66

7+
### 1.10.1
8+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.10.0...1.10.1)
9+
10+
__Improvements__
11+
- Removes emptyObject requirement that was added in #243. Instead, has a recommendation in playgrounds on how to use emptyObject to only send select modified keys to the server ([#249](https://github.com/parse-community/Parse-Swift/pull/249)), thanks to [Corey Baker](https://github.com/cbaker6).
12+
713
### 1.10.0
814
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.9.10...1.10.0)
915

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source 'https://rubygems.org'
22

3-
gem 'jazzy', '~> 0.13.7'
3+
gem 'jazzy', '~> 0.14.0'

Gemfile.lock

+38-32
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.3)
5-
activesupport (5.2.6)
4+
CFPropertyList (3.0.4)
5+
rexml
6+
activesupport (6.1.4.1)
67
concurrent-ruby (~> 1.0, >= 1.0.2)
7-
i18n (>= 0.7, < 2)
8-
minitest (~> 5.1)
9-
tzinfo (~> 1.1)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
zeitwerk (~> 2.3)
1012
addressable (2.8.0)
1113
public_suffix (>= 2.0.2, < 5.0)
1214
algoliasearch (1.27.5)
1315
httpclient (~> 2.8, >= 2.8.3)
1416
json (>= 1.5.1)
1517
atomos (0.1.3)
1618
claide (1.0.3)
17-
cocoapods (1.10.1)
18-
addressable (~> 2.6)
19+
cocoapods (1.11.2)
20+
addressable (~> 2.8)
1921
claide (>= 1.0.2, < 2.0)
20-
cocoapods-core (= 1.10.1)
22+
cocoapods-core (= 1.11.2)
2123
cocoapods-deintegrate (>= 1.0.3, < 2.0)
2224
cocoapods-downloader (>= 1.4.0, < 2.0)
2325
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -28,85 +30,89 @@ GEM
2830
escape (~> 0.0.4)
2931
fourflusher (>= 2.3.0, < 3.0)
3032
gh_inspector (~> 1.0)
31-
molinillo (~> 0.6.6)
33+
molinillo (~> 0.8.0)
3234
nap (~> 1.0)
33-
ruby-macho (~> 1.4)
34-
xcodeproj (>= 1.19.0, < 2.0)
35-
cocoapods-core (1.10.1)
36-
activesupport (> 5.0, < 6)
37-
addressable (~> 2.6)
35+
ruby-macho (>= 1.0, < 3.0)
36+
xcodeproj (>= 1.21.0, < 2.0)
37+
cocoapods-core (1.11.2)
38+
activesupport (>= 5.0, < 7)
39+
addressable (~> 2.8)
3840
algoliasearch (~> 1.0)
3941
concurrent-ruby (~> 1.1)
4042
fuzzy_match (~> 2.0.4)
4143
nap (~> 1.0)
4244
netrc (~> 0.11)
43-
public_suffix
45+
public_suffix (~> 4.0)
4446
typhoeus (~> 1.0)
45-
cocoapods-deintegrate (1.0.4)
46-
cocoapods-downloader (1.4.0)
47+
cocoapods-deintegrate (1.0.5)
48+
cocoapods-downloader (1.5.1)
4749
cocoapods-plugins (1.0.0)
4850
nap
49-
cocoapods-search (1.0.0)
50-
cocoapods-trunk (1.5.0)
51+
cocoapods-search (1.0.1)
52+
cocoapods-trunk (1.6.0)
5153
nap (>= 0.8, < 2.0)
5254
netrc (~> 0.11)
5355
cocoapods-try (1.2.0)
5456
colored2 (3.1.2)
55-
concurrent-ruby (1.1.8)
57+
concurrent-ruby (1.1.9)
5658
escape (0.0.4)
5759
ethon (0.14.0)
5860
ffi (>= 1.15.0)
59-
ffi (1.15.0)
61+
ffi (1.15.4)
6062
fourflusher (2.3.1)
6163
fuzzy_match (2.0.4)
6264
gh_inspector (1.1.3)
6365
httpclient (2.8.3)
6466
i18n (1.8.10)
6567
concurrent-ruby (~> 1.0)
66-
jazzy (0.13.7)
68+
jazzy (0.14.0)
6769
cocoapods (~> 1.5)
6870
mustache (~> 1.1)
69-
open4
71+
open4 (~> 1.3)
7072
redcarpet (~> 3.4)
73+
rexml (~> 3.2)
7174
rouge (>= 2.0.6, < 4.0)
7275
sassc (~> 2.1)
7376
sqlite3 (~> 1.3)
7477
xcinvoke (~> 0.3.0)
7578
json (2.5.1)
7679
liferaft (0.0.6)
7780
minitest (5.14.4)
78-
molinillo (0.6.6)
81+
molinillo (0.8.0)
7982
mustache (1.1.1)
8083
nanaimo (0.3.0)
8184
nap (1.1.0)
8285
netrc (0.11.0)
8386
open4 (1.3.4)
8487
public_suffix (4.0.6)
8588
redcarpet (3.5.1)
86-
rouge (3.26.0)
87-
ruby-macho (1.4.0)
89+
rexml (3.2.5)
90+
rouge (3.26.1)
91+
ruby-macho (2.5.1)
8892
sassc (2.4.0)
8993
ffi (~> 1.9)
9094
sqlite3 (1.4.2)
91-
thread_safe (0.3.6)
9295
typhoeus (1.4.0)
9396
ethon (>= 0.9.0)
94-
tzinfo (1.2.9)
95-
thread_safe (~> 0.1)
97+
tzinfo (2.0.4)
98+
concurrent-ruby (~> 1.0)
9699
xcinvoke (0.3.0)
97100
liferaft (~> 0.0.6)
98-
xcodeproj (1.19.0)
101+
xcodeproj (1.21.0)
99102
CFPropertyList (>= 2.3.3, < 4.0)
100103
atomos (~> 0.1.3)
101104
claide (>= 1.0.2, < 2.0)
102105
colored2 (~> 3.1)
103106
nanaimo (~> 0.3.0)
107+
rexml (~> 3.2.4)
108+
zeitwerk (2.4.2)
104109

105110
PLATFORMS
106111
ruby
112+
universal-darwin-20
107113

108114
DEPENDENCIES
109-
jazzy (~> 0.13.7)
115+
jazzy (~> 0.14.0)
110116

111117
BUNDLED WITH
112-
2.1.4
118+
2.2.2

ParseSwift.playground/Pages/1 - Your first Object.xcplaygroundpage/Contents.swift

+15
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ struct GameScore: ParseObject {
3939

4040
//: Your own properties.
4141
var score: Int = 0
42+
43+
/*:
44+
It's recommended the developer adds the emptyObject computed property or similar.
45+
Gets an empty version of the respective object. This can be used when you only need to update a
46+
a subset of the fields of an object as oppose to updating every field of an object.
47+
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
48+
client and server when using `save` and `saveAll` to update objects.
49+
*/
50+
var emptyObject: Self {
51+
var object = Self()
52+
object.objectId = objectId
53+
object.createdAt = createdAt
54+
return object
55+
}
4256
}
4357

4458
//: It's recommended to place custom initializers in an extension
@@ -348,6 +362,7 @@ let points = [
348362
try ParseGeoPoint(latitude: 1, longitude: 0),
349363
try ParseGeoPoint(latitude: 0, longitude: 0)
350364
]
365+
351366
do {
352367
let polygon = try ParsePolygon(points)
353368
let bytes = ParseBytes(data: "hello world".data(using: .utf8)!)

ParseSwift.playground/Pages/15 - Custom ObjectId.xcplaygroundpage/Contents.swift

+14
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ struct GameScore: ParseObject {
3030

3131
//: Your own properties.
3232
var score: Int = 0
33+
34+
/*:
35+
It's recommended the developer adds the emptyObject computed property or similar.
36+
Gets an empty version of the respective object. This can be used when you only need to update a
37+
a subset of the fields of an object as oppose to updating every field of an object.
38+
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
39+
client and server when using `save` and `saveAll` to update objects.
40+
*/
41+
var emptyObject: Self {
42+
var object = Self()
43+
object.objectId = objectId
44+
object.createdAt = createdAt
45+
return object
46+
}
3347
}
3448

3549
//: It's recommended to place custom initializers in an extension

ParseSwift.playground/Pages/4 - User - Continued.xcplaygroundpage/Contents.swift

+14
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ struct User: ParseUser {
3232
var score: GameScore?
3333
var targetScore: GameScore?
3434
var allScores: [GameScore]?
35+
36+
/*:
37+
It's recommended the developer adds the emptyObject computed property or similar.
38+
Gets an empty version of the respective object. This can be used when you only need to update a
39+
a subset of the fields of an object as oppose to updating every field of an object.
40+
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
41+
client and server when using `save` and `saveAll` to update objects.
42+
*/
43+
var emptyObject: Self {
44+
var object = Self()
45+
object.objectId = objectId
46+
object.createdAt = createdAt
47+
return object
48+
}
3549
}
3650

3751
//: It's recommended to place custom initializers in an extension

ParseSwift.playground/Pages/6 - Installation.xcplaygroundpage/Contents.swift

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ struct Installation: ParseInstallation {
3535

3636
//: Your custom keys
3737
var customKey: String?
38+
39+
/*:
40+
It's recommended the developer adds the emptyObject computed property or similar.
41+
Gets an empty version of the respective object. This can be used when you only need to update a
42+
a subset of the fields of an object as oppose to updating every field of an object.
43+
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
44+
client and server when using `save` and `saveAll` to update objects.
45+
*/
46+
var emptyObject: Self {
47+
var object = Self()
48+
object.objectId = objectId
49+
object.createdAt = createdAt
50+
return object
51+
}
3852
}
3953

4054
/*: Save your first `customKey` value to your `ParseInstallation`.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import PackageDescription
4545
let package = Package(
4646
name: "YOUR_PROJECT_NAME",
4747
dependencies: [
48-
.package(url: "https://github.com/parse-community/Parse-Swift", from: "1.9.10"),
48+
.package(url: "https://github.com/parse-community/Parse-Swift", from: "1.10.1"),
4949
]
5050
)
5151
```

Sources/ParseSwift/Objects/ParseObject.swift

-17
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,11 @@ public protocol ParseObject: Objectable,
3333
Hashable,
3434
CustomDebugStringConvertible,
3535
CustomStringConvertible {
36-
/**
37-
Default initializer of this object.
38-
*/
39-
init()
4036
}
4137

4238
// MARK: Default Implementations
4339
public extension ParseObject {
4440

45-
/**
46-
Gets an empty version of the respective object. This can be used when you only need to update a
47-
a subset of the fields of an object as oppose to updating every field of an object.
48-
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
49-
client and server when using `save` and `saveAll` to update objects.
50-
*/
51-
var emptyObject: Self {
52-
var object = Self()
53-
object.objectId = objectId
54-
object.createdAt = createdAt
55-
return object
56-
}
57-
5841
/**
5942
Determines if two objects have the same objectId.
6043
- parameter as: Object to compare.

Sources/ParseSwift/ParseConstants.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
enum ParseConstants {
1212
static let sdk = "swift"
13-
static let version = "1.10.0"
13+
static let version = "1.10.1"
1414
static let fileManagementDirectory = "parse/"
1515
static let fileManagementPrivateDocumentsDirectory = "Private Documents/"
1616
static let fileManagementLibraryDirectory = "Library/"

Tests/ParseSwiftTests/ParseObjectTests.swift

+13
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length
5555
self.score = score
5656
self.player = name
5757
}
58+
59+
/**
60+
Gets an empty version of the respective object. This can be used when you only need to update a
61+
a subset of the fields of an object as oppose to updating every field of an object.
62+
- note: Using an empty object and updating a subset of the fields reduces the amount of data sent between
63+
client and server when using `save` and `saveAll` to update objects.
64+
*/
65+
var emptyObject: Self {
66+
var object = Self()
67+
object.objectId = objectId
68+
object.createdAt = createdAt
69+
return object
70+
}
5871
}
5972

6073
struct Game: ParseObject {

0 commit comments

Comments
 (0)