Skip to content

Releases: jrothwell/VersionedCodable

v1.1.1

14 Jul 01:44
fd6866a
Compare
Choose a tag to compare

What's Changed

  • Harmonises NothingEarlier's encoding behaviour with how Never behaves if you attempt to encode it, in #13
    • This matches the behaviour of Never's conformance to Codable, new in Swift 5.9. It also means our last reason for making Never conform to VersionedCodable is gone (see #12)
  • Improves documentation.

Full Changelog: v1.1.0...v1.1.1

v1.1.0

19 Feb 16:37
6957e82
Compare
Choose a tag to compare

What's New

  • Adds support for different paths to the version field. You achieve this by creating a Codable type that adopts VersionPathSpec, and specifying this on your VersionedCodable type.
    • The default behaviour is unchanged and is available as VersionKeyAtRootVersionPathSpec. This is automatically chosen for you if you do not specify a VersionSpec in your VersionedCodable.
  • Removes support for throwing VersionedEncodingError.typeHasClashingVersionField encode time if the type has a version key. This was an expensive operation which wouldn't work anyway with different key paths to the version field. In an ideal world it would be possible to test this at compile time, but I don't currently see how this is possible without a compiler plugin.
  • Improves documentation. Documentation is now deployed with links to the source code.

Full Changelog: 1.0.2...v1.1.0

1.1.0 Beta 1

24 Jan 01:10
0b351fe
Compare
Choose a tag to compare
1.1.0 Beta 1 Pre-release
Pre-release
  • Adds support for different paths to the version field. You achieve this by creating a Codable type that adopts VersionPathSpec.
  • Removes support for throwing an error at encode time if the type has a version key. This was an expensive operation which wouldn't work anyway with different key paths to the version field - or at least not yet.

2.0.0 Beta 2

02 Jan 02:09
Compare
Choose a tag to compare
2.0.0 Beta 2 Pre-release
Pre-release

Adds support for Swift Macros to VersionedCodable. You can now declare conformance to VersionedCodable like this:

@versionedCodable(v: 2, previously: PoemV1)
struct PoemV2 {
    var authorName: String?
    var authorDateOfBirth: Date?
    var authorDateOfDeath: Date?
    var poem: String
    
    init(from old: PreviousVersion) throws {
        self.authorName = old.author
        self.poem = old.poem
    }
}

Because macros are a new feature in the compiler, VersionedCodable 2.0 will require Swift 5.9.

This supersedes v2.0.0-beta.1, fixing a bug where nested types declared as PreviousVersion using the macro would only have their first token carried through to the resulting expansion (e.g. PreviousVersions.Version1 would be carried through as PreviousVersion, causing a compile error.) This was fixed by sending through the whole expression rather than just the first token.

As a side effect, the macro now does not use the usage of .self at the end of the previously parameter. This does look very weird, so a future enhancement would be to have compiler diagnostics help people stop doing this.

v1.0.2

01 Jan 21:26
863f1de
Compare
Choose a tag to compare

Adds a privacy manifest file. This fulfils Apple's upcoming requirements for third party SDKs to provide a privacy manifest file, which will be combined with an adopting app's privacy manifest file to create the app's privacy nutrition label.

For the avoidance of doubt, VersionedCodable does not, and will never, collect any user-identifying information, nor does it ever send anything off the device.

What's Changed

  • Adds a privacy manifest file #7

Full Changelog: 1.0.1...1.0.2

v1.0.1

30 Apr 17:17
Compare
Choose a tag to compare

A performance improvement and some documentation fixes.

What's Changed

  • Fix #2: Only decode the version number once in #3. This should result in performance improvements.
  • Add one performance test.
  • Fix some slight problems with the documentation examples not quite matching up.
  • Fix some incorrect failure messages in the tests which refer to the old name of an error which has since been renamed.

Full Changelog: 1.0.0...1.0.1

v1.0.0

30 Apr 01:17
Compare
Choose a tag to compare

Version 1.0.0.

  • The API can now be considered stable.
  • Documentation has been considerably improved.

Full Changelog: 0.5.2...1.0.0

Please raise an issue if you have a feature request or found a bug, or write to the email address in @jrothwell's profile. Thanks for your interest!

0.5.2

29 Apr 00:31
Compare
Choose a tag to compare
0.5.2 Pre-release
Pre-release
  • Marks encodeTransparently as public when it was previously internal.

Full Changelog: 0.5.1...0.5.2

v0.5.1

29 Apr 00:25
Compare
Choose a tag to compare
v0.5.1 Pre-release
Pre-release

Adds a way of adding support for VersionedCodable to non-Foundation encoders and decoders.

Full Changelog: 0.5.0...0.5.1

v0.5.0

22 Apr 01:15
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

Adds a new error that's thrown when you try to encode a type with version on it.

Also improves documentation such that extended symbols now appear.

Full Changelog: 0.4.2...0.5.0