Unbox v2.2.0 Release Notes

Release Date: 2016-10-23 // over 4 years ago
  • This version is focused on increasing Unbox's speed - it's now up to 50% faster compared to the previous version! It also contains error reporting improvements.


    • Unboxing collections is now up to 25% faster, because of decreased iteration complexity.
    • Unboxing with key paths is now up to 50% faster, since associated enum values is no longer used.

    ๐Ÿš€ The next releases of Unbox will continue to make performance improvements in order to make decoding your JSON even more... eh... swift ๐Ÿ˜‰

    Error reporting

    ๐Ÿ–จ Unbox now produces a coherent, easy to read error type. UnboxError has been made into a struct instead of an enum, and when printed - it produces easily debuggable information.

    For example, here's how an invalid array element would be reported in Unbox 2.1 or earlier:

    [UnboxError] Invalid value ([1, "Bad value", 3]) for key "array"

    And here's how Unbox 2.2 reports the same error:

    [UnboxError] An error occured while unboxing path "model.array": Invalid array element ("Bad value") at index 1. 

    This also means you only have to catch one error type (UnboxError) instead of performing complex pattern matching.