SkipFirebaseCore.swift - Timestamp now conforms to Codable using internal sentinel keys (__fts__/__ftn__) for JSON round-tripping SkipFirebaseFirestore.swift - GeoPoint class — Hashable, KotlinConverting (so it survives .kotlin() dict conversion), Codable - firestoreDeepSwift — replaces deepSwift calls throughout to also handle com.google.firebase.firestore.GeoPoint → GeoPoint - FirestoreCacheSizeUnlimited, FirestoreCacheSettings, MemoryGarbageCollectionSettings, MemoryLRUGCSettings, MemoryEagerGCSettings, MemoryCacheSettings, PersistentCacheSettings - FirestoreSettings class with host, isSSLEnabled, cacheSettings and toAndroid() builder - Firestore.settings get/set property — applies to the Android store on set - SnapshotMetadata.isFromCache - DocumentSnapshot.metadata, .reference, .get(_ fieldPath: FieldPath), .data<T>() throws -> T - DocumentReference.getDocument(source:) async, setData(_:mergeFields:) async, setData<T: Encodable>(from:merge:) async, setData<T: Encodable>(from:mergeFields:) async - CollectionReference.addDocument(data:completion:) - FirestoreEncoder and FirestoreDecoder classes One API note: Skip can't bridge T.Type parameters, so on Android the Codable decode is let m: MyModel = try snapshot.data() (return-type inference). On iOS you use FirebaseFirestoreSwift's snapshot.data(as: MyModel.self) as normal. The encode direction (setData(from:)) works identically on both platforms.
SkipFirebaseCore.swift
- Timestamp.init(from:) now handles a plain Double (seconds since epoch) in addition to the existing {"__fts__"/"__ftn__"} sentinel dict — enables Timestamp fields in Codable
models to decode from the timeInterval doubles emitted by the new decoder path
SkipFirebaseFirestore.swift
Property wrappers (new):
- @documentid<Value: Codable> — no-op on encode; on decode reads from decoder.userInfo[.firestoreDocumentID] (set by the decoder when a documentID is provided), with a
keyed-container fallback for Skip runtimes where userInfo may not propagate
- @ServerTimestamp — on encode: nil → {"__fts_server__": true} sentinel (restored to FieldValue.serverTimestamp() by the encoder pass); non-nil → actual Timestamp. On decode: reads
Timestamp back normally
- CodingUserInfoKey.firestoreDocumentID extension
- _DocumentIDCodingKey and _FirestoreDateSentinelKeys private enum helpers
FirestoreEncoder improvements:
- Date → {"__firestore_date__": timeInterval} sentinel via custom dateEncodingStrategy, restored to Timestamp in restoreFirestoreTypes
- {"__fts_server__": true} → FieldValue.serverTimestamp() in restoreFirestoreTypes
- NSNumber Bool coercion in restoreFirestoreTypes (Android JSONSerialization returns 0/1 instead of native Bool)
FirestoreDecoder improvements:
- New decode(from:documentID:) overload — injects document ID into userInfo, sets dateDecodingStrategy = .secondsSince1970
- prepareForJSON now converts Timestamp → Double (timeInterval) instead of sentinel dict, enabling both Date and Timestamp model fields to decode correctly
- NSNumber Bool coercion in prepareForJSON
- DocumentSnapshot.decoded() now passes documentID to the decoder
New Codable overloads:
- CollectionReference.addDocument(from: T) async throws
- WriteBatch.setData(from: T, forDocument:) throws → WriteBatch (chainable)
- WriteBatch.setData(from: T, forDocument:mergeFields:) throws → WriteBatch
IT-Guy007 marked this pull request as ready for review
May 15, 2026 21:05Closed
Remove Codable from the main class declarations for Timestamp and GeoPoint and add separate extension-based Codable conformance. This prevents the Skip bridge generator from including Codable in the generated bridge class (which has a JObject peer that cannot auto-synthesize Codable); the existing encode/decode implementations already satisfy the conformance. Changes made in SkipFirebaseCore.swift and SkipFirebaseFirestore.swift.
The Skip bridge generator includes ALL protocol conformances (both class declarations and extensions) when generating bridge classes. Moving Codable to an extension was insufficient. SwiftCustomBridged is the correct signal — used by skip-foundation's Date, Data, UUID, and URL for the same reason — to tell the bridge generator that these types handle their own bridging rather than auto-generating a standard bridge class that would fail to synthesize Codable with a JObject peer.
SwiftCustomBridged is defined in SkipLib, but the generated bridge file only imports SkipBridge and Foundation, so the protocol is not in scope during the SKIP_BRIDGE compilation and causes a build error.
IT-Guy007 marked this pull request as ready for review
May 16, 2026 21:00IT-Guy007 deleted the firebase-firestore-improvements branch
May 24, 2026 16:17This was referenced
May 28, 2026Closed
Merged