All Versions
Latest Version
Avg Release Cycle
49 days
Latest Release
744 days ago

Changelog History
Page 3

  • v0.10.1 Changes

    October 30, 2018

    ๐Ÿš€ This is a patch release that fixes one bug and adds a couple of features. It's verified by MiMa to be binary compatible with 0.10.0.

    ๐Ÿ“œ The number parsing bug

    ๐Ÿ“œ The bug was reported by Shira Smith and involves circe's number parsing:

    scala\> io.circe.numbers.BiggerDecimal.parseBiggerDecimal("-") java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt( at io.circe.numbers.BiggerDecimal$.parseBiggerDecimalUnsafe(BiggerDecimal.scala:250) at io.circe.numbers.BiggerDecimal$.parseBiggerDecimal(BiggerDecimal.scala:237) ... 36 elided

    ๐Ÿ“œ This would be bad enough, since we claim that no method in circe's public API will ever throw an exception, but to make matters worse you can actually run into this using plain old io.circe.jawn.decode, although only in a corner case (via the fallback behavior that tries to parse a JSON string when a number is expected):

    scala\> io.circe.jawn.decode[Int](""""-"""") java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt( at io.circe.numbers.BiggerDecimal$.parseBiggerDecimalUnsafe(BiggerDecimal.scala:250) at io.circe.JsonNumber$.fromString(JsonNumber.scala:223) at io.circe.Decoder$$anon$6.apply(Decoder.scala:626) at io.circe.Decoder.decodeJson(Decoder.scala:52) at io.circe.Decoder.decodeJson$(Decoder.scala:52) at io.circe.Decoder$DecoderWithFailure.decodeJson(Decoder.scala:320) at io.circe.Parser.finishDecode(Parser.scala:12) at io.circe.Parser.finishDecode$(Parser.scala:9) at io.circe.jawn.JawnParser.finishDecode(JawnParser.scala:9) at io.circe.Parser.decode(Parser.scala:26) at io.circe.Parser.decode$(Parser.scala:25) at io.circe.jawn.JawnParser.decode(JawnParser.scala:9) ... 36 elided

    Which is pretty bad, so thanks much to Shira for catching and fixing this.

    (For what it's worth, this bug has been around since circe 0.7.0-M1, which is nearing its second birthday, and as far as I know nobody else has run into it.)

    ๐Ÿ‘ Modifier support for macro annotations

    I said above that this was a new feature, but to be honest the previous behavior should probably be considered a bug (fortunately in this case it's all compile-time stuff and I'm not too worried about how to categorize it). Michael Lampe noticed that the @JsonCodec annotation does not work with e.g. access modifiers on the annotated object, and provided a fix. So now you can write this:

    package mypackageimport [email protected] private[mypackage] final case class MyCaseClass(a: Int)private[mypackage] object MyCaseClass { /\* ... \*/ }

    ๐Ÿ”ง It also works with the @ConfiguredJsonCodec in generic-extras.

    Time instance trait publicity

    ๐Ÿ“ฆ Adam Warski and others noted that the trait providing java.time instances is no longer public in 0.10.0, and Adam provided a fix, which means that if you had mixed the TimeInstances trait into a protocol object in earlier circe versions, you can now do the same with JavaTimeDecoders and JavaTimeEncoders. (Note that most people should not need to use the io.circe.java8 package at all, since these instances are now provided in implicit scope for Scala 2.12.)

  • v0.10.0 Changes

    September 24, 2018

    ๐Ÿš€ This release drops Scala 2.10 support and adds artifacts for 2.13.0-M4. It also updates many dependency versions, including Cats (from 1.0.1 in 0.9.x to 1.4.0), Scala.js (from 0.6.22 to 0.6.24), refined (from 0.8.7 to 0.9.2), and jawn (from 0.11.1 to 0.13.0).

    Java 8 instances

    ๐Ÿšš The encoder and decoder instances for all java.time types have been moved into the circe-core JVM artifacts for Scala 2.12 and 2.13.0-M4 (since both of these Scala versions require Java 8, anyway). The circe-java8 artifacts are still published for all Scala versions and platforms, since you'll still need them if you're using Scala.js or Scala 2.11 and want these instances. Thanks to Guillaume Poirier for helping with this effort, and to Felix Bruckmeier for improving the failure messages for these instances.

    Other additions

    ๐Ÿš€ This release introduces encoder and decoder instances for Cats's new Chain and NonEmptyChain data structures, as well as instances for NonEmptyMap and NonEmptySet (all thanks to Diogo Castro). It also introduces a new ensure method for Decoder (thanks, @saint1991).

    ๐Ÿ› Bug fixes


    Known issues

    ๐Ÿš€ The Macro Paradise compiler plugin is not currently available for 2.13.0-M4, which means that @JsonCodec and the related annotations in circe-generic-extras will not work on 2.13. When (or if) the plugin is published for 2.13.0-M4 it should work as expected with this release. (See Seth Tisue's note here.)

    Future plans

    ๐Ÿš€ We'll probably publish 0.10.x releases for Scala 2.13.0-M5 if Cats publishes 1.4.x releases for it, but Scala.js 0.6.25+ (which is currently blocked by failures on 2.13.0-M4) will wait for 0.11.0, which is probably only a couple of months away.

  • v0.10.0-M2 Changes

    August 20, 2018

    ๐Ÿš€ This release is the first that's cross-published for Scala 2.13 (specifically for 2.13.0-M4). It includes a couple of major organizational changes that specifically support the 2.13 release:

    • ๐Ÿš€ The circe-optics module is being split out into its own repository, which will live in the circe organization. I've been intending to make this move for a while, and the fact that Monocle doesn't yet have a 2.13 build means that it's convenient to do it now. I'm not planning to publish any circe-optics releases until circe 0.10.0 is out.
    • ๐Ÿ”€ The circe-java8 module is also being split out into its own repository, but its functionality is now available in circe-core for all platforms that are guaranteed to support it. On the JVM, java.time instances are provided for 2.12 and 2.13, but not 2.11. On Scala.js, they are available for 2.12 only, since scala-java-time is not yet published for 2.13. Thanks to Guillaume Poirier for kicking off the work of moving these instances into circe-core last year (I wish it hadn't taken so long to get this merged).

    I'm trying to avoid using scala-collection-compat, and instead there are a few small differences in the Decoder companion object across versions, with 2.11 and 2.12 using CanBuildFrom and 2.13 using the new Factory type class.

    Many dependency versions have also been bumped, including Cats (to 1.2.0), Jawn (to 0.13.0), and Scala.js (to 0.6.23).

    ๐Ÿš€ Note that at the time that I'm writing this, the Macro Paradise compiler plugin is not available for 2.13.0-M4. This means that @JsonCodec and the related annotations in circe-generic-extras will not work on 2.13 at the moment, but once the plugin is published for 2.13.0-M4 it should work as expected with this release.

    ๐Ÿš€ Please use with care! This is a milestone release that introduces an artifact built with a milestone version of the Scala compiler. If you don't want to have to worry about running into weird bugs, please choose 0.9.3 instead, but if you don't mind a little risk, I would very much appreciate any feedback about the experience of using this release on 2.13.0-M4.

  • v0.10.0-M1 Changes

    April 24, 2018

    ๐Ÿš€ This milestone release bumps several dependency versions, including Cats (from 1.0.1 to 1.1.0), Jawn (from 0.11.1 to 0.12.1), refined (from 0.8.7 to 0.9.0), and Monocle (from 1.5.0 to 1.5.1-cats).

    It includes a few other changes, including the following:

    • A fix for a bug involving optional fields and stateful decoding (#708) by Jonas Adler (#880).
    • A fix for a bug involving an inconsistency in the behavior of optional decoders by Hugh Giddens (#851).
    • An optimization for name transformations in circe-generic-extras by vndzzz (#860).
    • ๐Ÿ‘Œ Support for encodeOnly and decodeOnly for @ConfiguredJsonCodec by Espen Wiborg (#847).
    • ๐Ÿ—„ Removal of all methods deprecated in 0.9 (#888).
    • A small optimization for JsonObject (#889).
    • No more Scala 2.10!

    ๐Ÿš€ The 0.10.0 release is likely also to include versions of #697, #856, and #754, and to fix #885, #855, and #792. Feedback about other features or priorities you want to see in 0.10 would be appreciated. I'm hoping to publish 0.10.0 by mid-May, but no promises.

    ๐Ÿš€ I don't currently intend to publish other circe projects depending on this milestone release, but if there's demand (and pull requests) I'd be happy to.