Commit Graph
11 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
Gil 847d72759d Fix formatting that was somehow ignored (#4002)
* Fix formatting that somehow was ignored.

* Minor tweaks to style.sh

... reflecting updated source layout.
2019-10-07 09:10:47 -07:00
Gil 228537cb66 Provide better error messages when encoding is not available (#3953)
* Rewrite FirestoreEncoderTests using assertThat

* Throw invalidValue for use of invalid top-level values

* Provide an message for not supported errors
2019-10-01 10:04:52 -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
Morgan Chen 390966620a Fix token fetch not invoking callback for unchanged token (#3251) 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
Gil 2bf7542573 Pristine copy of JSONEncoder.swift (#3794)
From
https://github.com/apple/swift/commit/3391b746d9fb36d7bbf428bdc3f5f69e2bb9ac6f
pulled with the tag swift-DEVELOPMENT-SNAPSHOT-2019-09-04-a.
2019-09-26 11:03:05 -07:00