Commit Graph
7 Commits
Author SHA1 Message Date
Gil 539ff07fd1 Avoid references to DocumentIDProtocol in Swift < 5.1 (#4092) 2019-10-16 11:41:50 -07:00
Gil 53e91860e0 Rewrite SelfDocumentID as a property wrapper (#4031)
* Rewrite SelfDocumentID as a property wrapper

Make wrapped types conform to DocumentReferenceConvertible and use that
protocol to implement the conversion.

* Change DocumentReferenceConvertible to DocumentIDWrappable

* Make ServerTimestampWrappable use static functions

Use the same form as DocumentIDWrappable.

* Update extension String: ServerTimestampWrappable

* Use #if compiler, not #if swift

The FirebaseFirestoreSwift module is declared as conforming to Swift
4.0 so #if swift is still false, even when compiling with Swift 5.1.
Using #if compiler will see the actual compiler version. Property
wrappers don't depend on runtime features, so this works.

Also, allow Wrappable protocols to throw during conversions.
2019-10-15 12:59:36 -07:00
wu-hui b45bd79ec3 Add @DocumentId equivalent to Swift Codable (#3762)
* Commit with failed optional test case.

* Integration Test and cleanup

* swiftformat

* better doc formatting

* addressing comments

* rename to SelfDocumentID

* Addressing Comments

* fix comment
2019-09-26 12:02:04 -07:00
Hui-Wu d709b9f2b5 Allow firestore api to work with Codable objects + ExplicitNull + Integration tests (#3261)
* Convinience api for codables

* Integration Tests

* ExplicitNull implementation
2019-09-26 12:02:04 -07:00
Hui-Wu 34023c30ea FieldValue and DocumentReference codable support. (#3231)
* working serverTimestamp

* working FieldValue. Still need: document ref and ability to Eq of FieldValue

* DocumentReference implemented and testing works

* clean up header search path

* improving FieldValue enum comments

* run through formatting

* addressing comments

* formatted with swiftformat 0.35.7

* add missing bool->BOOL change

* undo unintended swift version change

* remove unwanted proj file change
2019-09-26 12:02:03 -07:00
Hui-Wu 5fdfc9d413 Firestore swift Codable support (#3198)
FirestoreEncoder/Decoder and Timestamp/GeoPoint codable support.
2019-09-26 12:02:03 -07:00
Marek Gilbert f7d26168ca Rename JSONEncoder; prep for split 2019-09-26 12:02:03 -07:00