All Versions
59
Latest Version
Avg Release Cycle
57 days
Latest Release
-

Changelog History
Page 5

  • v0.11.1.3 Changes

    • ๐Ÿ›  Fix build on TH-less GHCs
  • v0.11.1.2 Changes

    • ๐Ÿ›  Fix build with base < 4.8 and unordered-containers < 0.2.6.
    • โž• Add missing field in docs for defaultOptions.
  • v0.11.1.1 Changes

    • ๐Ÿ›  Fixes a bug where the hashes of equal values could differ.
  • v0.11.1.0 Changes

    The only changes are added instances.

    These are new:

    • ToJSON a => ToJSON (NonEmpty a)
    • FromJSON a => FromJSON (NonEmpty a)
    • ToJSON (Proxy a)
    • FromJSON (Proxy a)
    • ToJSON b => ToJSON (Tagged a b)
    • FromJSON b => FromJSON (Tagged a b)
    • ToJSON a => ToJSON (Const a b)
    • FromJSON a => FromJSON (Const a b)

    These are now available for older GHCs:

    • ToJSON Natural
    • FromJSON Natural
  • v0.11.0.0 Changes

    ๐Ÿš€ This release should be close to backwards compatible with aeson 0.9.

    โฌ†๏ธ If you are upgrading from aeson 0.10 it might be easier to go back in history to the point you were still using 0.9.

    ๐Ÿ’ฅ Breaking changes:

    • โช Revert .:? to behave like it did in 0.9. If you want the 0.10 behavior use .:! instead.

    • โช Revert JSON format of Either to 0.9, Left and Right are now serialized with an initial uppercase letter. If you want the names in lowercase you can add a newtype with an instance.

    • All ToJSON and FromJSON instances except for [a] are no longer OVERLAPPABLE. Mark your instance as OVERLAPPING if it overlaps any of the other aeson instances.

    • All ToJSON and FromJSON instances except for [Char] are no longer incoherent, this means you may need to replace your incoherent instances with a newtyped instance.

    โž• Additions:

    • Introduce .:! that behaves like .:? did in 0.10.

    • ๐Ÿ‘ Allow HH:MM format for ZonedTime and UTCTime. This is one of the formats allowed by ISO 8601.

    • โž• Added ToJSON and FromJSON instances for the Version, Ordering, and Natural types.

    ๐Ÿ› Bug fixes:

    • JSONPath identifiers are now escaped if they contain invalid characters.

    • ๐Ÿ›  Fixed JSONPath messages for Seq to include indices.

    • ๐Ÿ›  Fixed JSONPath messages for Either to include left/right.

    • ๐Ÿ›  Fix missing quotes surrounding time encodings.

    • ๐Ÿ›  Fix #293: Type error in TH when using omitNothingFields = True.

    Compatibility:

    • โšก๏ธ Various updates to support GHC 8.
  • v0.10.0.0 Changes

    ๐ŸŽ Performance improvements

    • Direct encoding via the new toEncoding method is over 2x faster than toJSON. (You must write or code-gen a toEncoding implementation to unlock this speedup. See below for details.)

    • ๐Ÿ‘Œ Improved string decoding gives a 12% speed win in parsing string-heavy JSON payloads (very common).

    • Encoding and decoding of time-related types are 10x faster (!!) as a result of bypassing Data.Time.Format and the arbitrary-precision Integer type.

    • When using toEncoding, [Char] can be encoded without a conversion to Text. This is fast and efficient.

    • ๐Ÿ“œ Parsing into an Object is now 5% faster and more allocation-efficient.

    SUBTLE API CHANGES, READ CAREFULLY

    ๐Ÿ—„ With the exception of long-deprecated code, the API changes below should be upwards compatible from older versions of aeson. If you run โฌ†๏ธ into upgrade problems, please file an issue with details.

    • The ToJSON class has a new method, toEncoding, that allows direct encoding from a Haskell value to a lazy bytestring without construction of an intermediate Value.

    The performance benefits of direct encoding are significant: more than 2x faster than before, with less than 1/3 the memory usage.

    To preserve API compatibility across upgrades from older versions of this library, the default implementation of toEncoding uses toJSON. You will not see any performance improvement unless you write an implementation of toEncoding, which can be very simple:

      instance ToJSON Coord where
        toEncoding = genericToEncoding defaultOptions
    

    (Behind the scenes, the encode function uses toEncoding now, so if you implement toEncoding for your types, you should see a speedup immediately.)

    If you use Template Haskell or GHC Generics to auto-generate your ToJSON instances, you'll benefit from fast toEncoding implementations for free!

    • When converting from a Value to a target Haskell type, FromJSON instances now provide much better error messages, including a complete JSON path from the root of the object to the offending element. This greatly eases debugging.

    • It is now possible to use Template Haskell to generate FromJSON and ToJSON instances for types in data families.

    • If you use Template Haskell or generics, and used to use the camelTo function to rename fields, the new camelTo2 function is smarter. For example, camelTo will rename CamelAPICase to camelapi_case (ugh!), while camelTo2 will map it to camel_api_case (yay!).

    • ๐Ÿ†• New ToJSON and FromJSON instances for the following time-related types: Day, LocalTime.

    • ๐Ÿ“œ FromJSON UTCTime parser accepts the same values as for ZonedTime, but converts any time zone offset into a UTC time.

    • The Result type is now an instance of Foldable and Traversable.

    • ๐Ÿšš The Data.Aeson.Generic module has been removed. It was deprecated in late 2013.

    • ๐Ÿ‘ GHC 7.2 and older are no longer supported.

    • The instance of Monad for the Result type lacked an implementation of fail (oops). This has been corrected.

    • Semantics of (.:?) operator are changed. It's doesn't anymore accept present Null value.

    • โž• Added (Foldable t, ToJSON a) => ToJSON (t a) overlappable instance. You might see No instance for (Foldable YourPolymorphicType) arising from a use of โ€˜.=โ€™ -errors due this change.

  • v0.9.0.1 Changes

    • A stray export of encodeToBuilder got away!
  • v0.9.0.0 Changes

    • ๐Ÿ“œ The json and json' parsers are now synonyms for value and value', in conformance with the looser semantics of RFC 7159.

    • โœ… Renamed encodeToByteStringBuilder to the more compact encodeToBuilder.

  • v0.8.1.1 Changes

    • ๐Ÿ“ฆ The dependency on the unordered-containers package was too lax, and has been corrected.
  • v0.8.1.0 Changes

    • Encoding a Scientific value with a huge exponent is now handled efficiently. (This would previously allocate a huge arbitrary-precision integer, potentially leading to a denial of service.)

    • Handling of strings that contain backslash escape sequences is greatly improved. For a pathological string containing almost a megabyte of consecutive backslashes, the new implementation is 27x faster and uses 42x less memory.

    • The ToJSON instance for UTCTime is rendered with higher (picosecond) resolution.

    • ๐Ÿ“œ The value parser now correctly handles leading whitespace.

    • ๐Ÿ†• New instances of ToJSON and FromJSON for Data.Sequence and Data.Functor.Identity. The Value type now has a Read instance.

    • ๐Ÿ“œ ZonedTime parser ordering now favours the standard JSON format, increasing efficiency in the common case.

    • ๐Ÿ— Encoding to a Text.Builder now escapes '<' and '>' characters, to reduce XSS risk.