Skip to content

Commit 6bda67a

Browse files
authored
FirestoreSwift: Reword DocumentID breaking change in changelog (#10305)
Updated the FirestoreSwift CHANGELOG to match the current state of the repo. Most users will be unaffected since the `@DocumentID` property wrapper constructors remain public but the changelog now warns that the `init(from documentReference: DocumentReference?)` constructor for `DocumentID` is internal. In greater detail, the following is no longer possible: ``` let userDoc: DocumentReference = Firestore.firestore().document("users/foo") do { let docID = try DocumentID<DocumentReference>(from: userDoc) if let docRef = docID.wrappedValue { print("Document ID: \(docRef.documentID)") } } catch { print("DocumentID Error: \(error)") } ``` The visibility change doesn't affect usage of `@DocumentID` though. The following is still possible (though it will trigger our warnings at runtime): ``` struct User: Codable { @documentid var docRef: DocumentReference? = Firestore.firestore().document("users/foo") } ```
1 parent 952df9b commit 6bda67a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Firestore/Swift/CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# 10.0.0
2-
- [changed] **Breaking Change:** Made the `@DocumentID` property wrapper value
3-
setter internal to clarify that the value is ignored during writes. (#9368)
4-
- [changed] Initializing a `@DocumentID` property wrapper with a non-nil value
5-
or using the `@DocumentID` property wrapper value setter will log a warning.
6-
This is because the set value will be ignored. (#9368)
2+
- [changed] **Breaking Change:** The `DocumentID` constructor from a
3+
`DocumentReference` is now internal; this does not affect instantiating a
4+
`@DocumentID` property wrapper for a `DocumentReference`. (#9368)
5+
- [changed] Passing a non-nil value to the `@DocumentID` property wrapper's
6+
constructor or setter will log a warning and the set value will be ignored.
7+
(#9368)
78
- [changed] `Firestore.Encoder` and `Firestore.Decoder` now wraps the shared
89
`FirebaseDataEncoder` and `FirebaseDataDecoder` types, which provides new
910
customization options for encoding and decoding data to and from Firestore

0 commit comments

Comments
 (0)