-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR]: Support for CodableWithConfiguration #13552
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
@Supereg, thank you for the feature request. I'll review this with the team. |
Can you tell us more about your use case(s)? Thanks! |
Sounds great, thank you 🚀
I might just point you to our real-world example. We have a framework that provides typed-storage This is a small overview of our specific use case. Feel free to reach out, if you want me to go into more detail or need a broader description of potential use cases. |
Description
Codable
(Encodable
orDecodable
respectively) types when retrieving or setting the data of a document. iOS 17 introduced a new set of protocols:CodableWithConfiguration
(a type alias forEncodableWithConfiguration
&DecodableWithConfiguration
) that allow passing an additional, fully typedConfiguration
type alongside the encode and decode methods. Newencode(_:configuration:)
anddecode(_:configuration:)
methods on e.g. the JSON coders allow to pass a configuration alongside the type/value.CodableWithConfiguration
-conforming types when using Firestore without the need to create additional wrapper types.Codable
types, Firestore should acceptCodableWithConfiguration
types by allowing to pass an additionalconfiguration
argument.API Proposal
The following additive API changes are proposed. They are expressed as Swift Extensions with the implementation body missing.
Additionally, one would need to add additional overloads for the factious
setData
,data
,getDocument
,setDocument
methods in types likeDocumentReference
,DocumentSnapshot
,CollectionReference
,Transaction
andWriteBatch
(might be missing some). Each of them would ned similar adjustments of using the new protocols and accepting an additionalconfiguration
parameter that is forwarded to the Encoder/Decoder.Firebase Product(s)
Firestore
The text was updated successfully, but these errors were encountered: