-
Notifications
You must be signed in to change notification settings - Fork 142
Swift 4 - Decodable/Encodable protocols #296
Comments
yeah - i saw that and was thinking similarly 😑 perhaps i'll create a |
Since Swift has module namespacing, for now Gloss is usable in XCode 9 by simply prepending "Gloss." to all use of Decodable and Encodable. Probably not an ideal solution long term though! |
Have you considered making a Gloss 2.0 which builds on top of the Swift 4 primitives? I haven't dug in deeply, but I feel like these spots can be much more ergonomically handled by a 3rd party library like Gloss than what's in Swift 4:
I feel like there's room for a "DSL" over Codable that combines the CodingKey concept (which is great!) with Gloss' ergonomics (which is even greater!). Even a Gloss 1.x that adds support for |
Neat ideas! Though I had not considered a re-write on top of Swift JSON parsing. I was simply going to update for compatibility. I was more viewing this an opportunity to eventually halt feature development as native JSON parsing gains popularity. I don't have the bandwidth to personally support Gloss indefinitely. I agree there's room for a DSL on top of Swift's and others are free to take that notion and other ones present in Gloss and run with it. |
@hkellaway according to the doc, we have to write 2 separate methods to support transform and reverse transform, but ObjectMapper requires only one. I know if we use 2 methods there are certain benefits, but can I only write one? i think we can change it to be |
@lastcc im interpreting this as 2 separate questions
|
Is it possible to start a new version string for swift 4 branch like 1.4.x and release on Cocoapods? |
@ergunkocak |
FYI it sounds like the Cocoapods situation for Swift 4 hasn't been fully
resolved:
CocoaPods/CocoaPods#6791
This link has some potential solutions. The good news is that your Podfile
can include all Swift 3 projects, and your main project can be Swift 4, as
that's what I've been doing. During the migration, just upgrade your main
xcodeproj to Swift 4, leave all your Pods unchecked in the first screen of
the migration wizard.
Currently, it sounds like if you want to have individual pods built with
Swift 4, you need to use the `installer.pods_project.targets.each do
|target|` loop suggested in the comments, as pod specs don't yet have a
field for defining the Swift version of a project (understandably as Apple
has changed the combat story w/ every Xcode release).
So, until things shake out a little more, my suggestion would be for the
official Gloss release to remain Swift 3.2, and for most people to use
Swift 3.2-compatible pods in their Podfile. If Gloss 1.3 was released as
Swift-4 only code before Cocoapods adds Swift version support to the pod
spec DSL it'll probably just cause more confusion and Github issues to be
opened than it's worth at the moment.
…On Fri, Sep 15, 2017 at 8:26 AM, Harlan Kellaway ***@***.***> wrote:
@ergunkocak <https://github.com/ergunkocak> swift_4.0 is currently the
same as master so you can point to 1.2.4 in your private spec. once
updates for Swift 4.0 are made i can release specific betas on CocoaPods,
sure
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#296 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADREItS8FBmlNPiUdL98ESZQlp7TwqMks5sipcegaJpZM4NxFog>
.
|
thats good to know, tnx @ryanschneider |
fyi - version |
@hkellaway do you need some help fully migrating to swift 4? |
@GabrielAraujo i appreciate you asking - i could use assistance. version are there other Swift 4 migration tasks you see? |
@hkellaway I would go with something gloss unique like I don't think so.. This is the only thing the compiler is complaining. I think it would be great to release the swift 4.0 as the official so the projects that depend on gloss like moya-gloss can also be migrated! =) |
@GabrielAraujo i think i still prefer if you'd like to help move to that, that'd be great |
@hkellaway I began to perform the changes to JSONDecodable and JSONEncodable but I also noticed that Encoder, Decoder, JSONEncoder and JSONDecoder are already being used by swift. Do you think we should also change the names for Encoder and Decoder or is it just too much? hahah |
thanks @GabrielAraujo! im okay leaving those as-is |
naming will be updated to thanks @GabrielAraujo! |
@hkellaway glad to help!! Man, is there any remaining changes in the roadmap? Why is it beta? |
just giving folks time to report any issues with the Swift 4 version before the official release of 2.0 there is one outstanding PR submitted before Swift 4 transition I want to revisit |
New Swift 4 will include a new encoding/decoding protocols (https://github.com/apple/swift-evolution/blob/master/proposals/0166-swift-archival-serialization.md)
Since Gloss is sharing the same namespace for protocols
Decodable/Encodable
, I suggest we change the name of the protocols, so Gloss can be a separate library to the new solution proposed by the Swift language team.@hkellaway - thoughts?
The text was updated successfully, but these errors were encountered: