All Versions
18
Latest Version
Avg Release Cycle
35 days
Latest Release
20 days ago

Changelog History
Page 1

  • v0.12.3

    October 22, 2019

    πŸš€ This releases undoes a change in some java.time encodings between 0.12.1 and 0.12.2 (reported by @Bunyod in #1292). Before this change in 0.12.2, the *DateTime encoders included seconds, even when the value was zero:

    scala\> import java.time.LocalDateTime, io.circe.syntax.\_import java.time.LocalDateTimeimport io.circe.syntax.\_scala\> val t = LocalDateTime.parse("2018-08-13T14:20:00") t: java.time.LocalDateTime = 2018-08-13T14:20scala\> t.asJson res0: io.circe.Json = "2018-08-13T14:20:00"
    

    In 0.12.2 this changed:

    scala\> t.asJson res0: io.circe.Json = "2018-08-13T14:20"
    

    While this new encoding isn't incorrect, it's less consistent and causes problems for some users, so Andriy Plokhotnyuk has reinstated the previous encoding.

    πŸš€ This release also includes a few new deprecations (#1302). Georgy Davityan noted that since we no longer support Scala 2.10, we can make our implicit value class fields private (#1291). While there's no reason these fields should ever be used outside the implicit class definition, I've provided deprecated methods replacing them to maintain binary compatibility until the next breaking release.

  • v0.12.2

    October 07, 2019

    πŸš€ This release maintains binary compatibility with 0.12.1 but includes two bug fixes, a couple new methods, some optimizations, and several patch version updates for dependencies.

    • βœ… Leif Warner reported and fixed a bug that affected custom Decoder[Option[X]] instances defined using or or handleErrorWith. I also added regression tests for this bug. Note that the bug shouldn't affect most users, and that in general we discourage defining custom decoders for Option.
    • πŸ—„ I fixed a bug reported by Alexandru Nedelcu that had resulted in deprecation warnings for users of the macro annotations in circe-generic-extras. I had previously fixed this issue in circe-generic-extras with a temporary workaround; the fix here makes the workaround unnecessary for both circe-generic-extras and other libraries built on circe-generic.
    • Ben Stewart added a deepMerge method to JsonObject and made the deepMerge implementation for Json a little more efficient.
    • 🚚 I added a new at method to Decoder that's shorthand for prepare and downField, which are often used together to move to a specific field before decoding.
    • Andriy Plokhotnyuk contributed an optimization for java.time encoders.
    • ⚑️ Scala Steward updated the Scala.js version from 0.6.28 to 0.6.29.

    ⚑️ Other patch dependency updates include ScalaCheck and Discipline (for circe-testing) and Refined. None of these updates should affect users (except for possibly bumping their versions).

  • v0.12.1

    September 10, 2019

    πŸš€ This release is identical to 0.12.0 but fixes a bug in one deprecated method in circe-core.

    Please do not use 0.12.0, use this one.

  • v0.12.0

    July 02, 2019

    πŸš€ I wasn't planning for there to be a fourth 0.12.0 milestone, but a few significant things have happened since M3, and the timeline for Cats 2.0.0-RC1 is up in the air (thanks to ScalaTest), so I figured I'd go ahead and publish this for anyone who wants to try out the new stuff or check out what migration will look like for them.

    Highlights

    πŸ†• New circe-generic-simple module

    This release introduces a new 2.13-only circe-generic-simple module (#1180) that is a reimplementation of circe-generic for Scala 2.13. It doesn't use Shapeless's Lazy and only contains a couple of custom macros (for the export mechanics). It passes the same tests as circe-generic, and should work as a drop-in replacement (but with much faster compilation and a much less complicated implementation). In future versions of circe this implementation will likely become circe-generic for 2.13, but first I want to give people a chance to try it out.

    No more Scala 2.11

    πŸš€ This is the first circe release that drops Scala 2.11 support (#1176). If you're still on 2.11, sorry, you need to fix that.

    Instances for literal types

    πŸ‘ Encoder and decoder instances for literal types are now available in circe-core on Scala 2.13 (#1191). Previously these instances were available via circe-literal, but now they can be implemented without macros, and now SIP-23 syntax is available to everyone, so I think it makes sense to support them without extra modules or imports.

    Cursor API clean-up

    🚚 A bunch of cursor operations have been removed or deprecated (#1186). These changes should affect very few users, but if they break your code, please open an issue or let us know in the Gitter channel.

    Other stuff

    • 🐎 There are a few runtime performance improvements (#1190); in particular map decoding should be faster.
    • πŸš€ This release reinstates a companion object in circe-jawn that was removed in 0.12.0-M3 (#1167).

    PSA for Scala.js users

    Starting with 0.12.0-M3, anyone using circe on Scala.js needs to bring their own java.time implementation. Since publishing the last milestone, I put together a minimal java.time "implementation" that eliminates the compile-time linking errors. The advantage over a real java.time implementation for Scala.js is that you avoid a few megabytes of dependencies; the disadvantage is that if you try to do anything with java.time types, your program might compile but fail at runtime.

  • v0.12.0-RC4

    August 27, 2019

    πŸš€ This release updates the Cats version to 2.0.0-RC2. It also includes a few minor consistency-related changes, including new codecForEither, codecForValidated, and codecForEnumeration methods (#1232).

    Also, circe-generic-simple is back for 2.13 (I accidentally omitted it in 0.12.0-RC3), with a few minor changes (#1231).

  • v0.12.0-RC3

    August 15, 2019

    πŸš€ This release only includes changes to circe-generic, circe-generic-extras, and circe-shapes; all other modules are identical to 0.12.0-RC2.

    πŸ‘€ The biggest change is a contribution from Felix Bruckmeier, who convinced me that it's currently too easy to confuse the derivation methods from circe-generic and circe-generic-extras (see #1220 and #1221 for discussion). This means that if you're currently using any of the deriveX methods in circe-generic-extras, you'll now see deprecation warnings pointing you to their deriveConfiguredX replacements. The old methods will be removed in 0.13.

    πŸ‘€ I've also decided to sneak in a fix for an issue where derived decoders for case classes with no members accept non-object inputs (see #1166). This has surprised people in the past, and arguably isn't consistent with the behavior of derived decoders for other case classes. Now these decoders (and the decoder for HNil in circe-shapes) will fail on any input that isn't a JSON object (#1223, #1224). While making this change I also fixed a bug that had caused io.circe.generic.extras.deriveCodec not to work for empty case classes.

    I've also added deriveEnumerationCodec and derivedUnwrappedCodec derivation methods to circe-generic-extras for consistency (#1219).

  • v0.12.0-RC2

    August 12, 2019

    πŸš€ This release includes a fix I'd forgotten I wanted to include in 0.12.0 for a couple of old-ish bugs. The first issue (#1101) involves decoding BigDecimal (both the Java and Scala versions) values from JSON:

    scala\> io.circe.jawn.decode[BigDecimal]("123.456000") res0: Either[io.circe.Error,BigDecimal] = Right(123.456)
    

    This isn't strictly wrong, since we make no explicit guarantees about preserving the scale when decoding into BigDecimal. There's also some inconsistency around scale in the Java and Scala standard librariesβ€”two scala.math.BigDecimal values can be equal even if they have a different scale, while java.math.BigDecimal includes scale in the comparison.

    πŸš€ Dropping the scale might be (and has been) surprising to some people, though, and this release fixes it:

    scala\> io.circe.jawn.decode[BigDecimal]("123.456000") res0: Either[io.circe.Error,BigDecimal] = Right(123.456000) scala\> res0.map(\_.scale) res1: scala.util.Either[io.circe.Error,Int] = Right(6)
    

    Note that this issue did not affect BigDecimal encoding, which has always preserved the scale:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigDecimal("123.456000").asJson res0: io.circe.Json = 123.456000
    

    We continue following Scala with respect to equality, with two Json values that represent numbers being considered equal even if their scale is different:

    scala\> val Right(one1) = io.circe.jawn.parse("1") one1: io.circe.Json = 1scala\> val Right(one2) = io.circe.jawn.parse("1.0") one2: io.circe.Json = 1.0scala\> one1 == one2 res0: Boolean = truescala\> cats.kernel.Eq[io.circe.Json].eqv(one1, one2) res1: Boolean = true
    

    The other bug (#1033) is a little more unpleasant, in that it affects encoding. The issue is that the representation of BigInt values with trailing zeros isn't what you'd probably expect it to be:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigInt(12300).asJson res0: io.circe.Json = 123e2
    

    πŸ›  Again this isn't necessarily incorrect, since this Json value is equal to e.g. Json.fromLong(12300L), and since it will decode back into BigInt(12300) as expected. But it was surprising, and now it's fixed:

    scala\> import io.circe.syntax.\_import io.circe.syntax.\_scala\> BigInt(12300).asJson res0: io.circe.Json = 12300
    

    🐎 The changes I made to fix these issues may have a small (negative) impact on the performance of BigDecimal decoding in some cases. I've started working on a more thorough overhaul of circe's number representation that will eliminate this extra cost, but I think it makes more sense for that to wait for 0.13.0.

  • v0.12.0-RC1

    August 06, 2019

    πŸ“š This release updates the Cats version to 2.0.0-RC1, Discipline to 1.0.0, and Refined to 0.9.9. It also includes some test improvements by Aaron S. Hawley (#1109 and #1204), some new circe-optics documentation by Michal Sitko (#1196), and some final modifier clean-up by Tanaka Takaya (#1201).

    πŸš€ I'm planning to publish the 0.12.0 release as soon as Cats 2.0.0 is available, and don't intend to include any other changes.

  • v0.12.0-M4

    July 02, 2019

    πŸš€ I wasn't planning for there to be a fourth 0.12.0 milestone, but a few significant things have happened since M3, and the timeline for Cats 2.0.0-RC1 is up in the air (thanks to ScalaTest), so I figured I'd go ahead and publish this for anyone who wants to try out the new stuff or check out what migration will look like for them.

    Highlights

    πŸ†• New circe-generic-simple module

    This release introduces a new 2.13-only circe-generic-simple module (#1180) that is a reimplementation of circe-generic for Scala 2.13. It doesn't use Shapeless's Lazy and only contains a couple of custom macros (for the export mechanics). It passes the same tests as circe-generic, and should work as a drop-in replacement (but with much faster compilation and a much less complicated implementation). In future versions of circe this implementation will likely become circe-generic for 2.13, but first I want to give people a chance to try it out.

    No more Scala 2.11

    πŸš€ This is the first circe release that drops Scala 2.11 support (#1176). If you're still on 2.11, sorry, you need to fix that.

    Instances for literal types

    πŸ‘ Encoder and decoder instances for literal types are now available in circe-core on Scala 2.13 (#1191). Previously these instances were available via circe-literal, but now they can be implemented without macros, and now SIP-23 syntax is available to everyone, so I think it makes sense to support them without extra modules or imports.

    Cursor API clean-up

    🚚 A bunch of cursor operations have been removed or deprecated (#1186). These changes should affect very few users, but if they break your code, please open an issue or let us know in the Gitter channel.

    Other stuff

    • 🐎 There are a few runtime performance improvements (#1190); in particular map decoding should be faster.
    • πŸš€ This release reinstates a companion object in circe-jawn that was removed in 0.12.0-M3 (#1167).

    PSA for Scala.js users

    Starting with 0.12.0-M3, anyone using circe on Scala.js needs to bring their own java.time implementation. Since publishing the last milestone, I put together a minimal java.time "implementation" that eliminates the compile-time linking errors. The advantage over a real java.time implementation for Scala.js is that you avoid a few megabytes of dependencies; the disadvantage is that if you try to do anything with java.time types, your program might compile but fail at runtime.

  • v0.12.0-M3

    June 12, 2019

    πŸš€ This is a big release, with a lot of breaking changes and a few important warnings. It's likely these changes and warnings won't affect you, unless you're doing something really strange with the library, but please read the release notes anyway.

    Highlights

    Scala 2.13.0

    πŸš€ This milestone is the first circe release published for Scala 2.13! We had several open generic derivation issues that seem to have been resolved somehow in 2.13 (e.g. #881, #989), and generic derivation is much fasterβ€”e.g. one of my standard test cases that compiled in around 70 seconds on 2.11 and 41 seconds on 2.12 consistently compiles in about 32 seconds on 2.13.

    Codec

    Codec is here (#1151), after years of me saying I'd never add it. Together with deriveCodec, and Codec.forProductN. Among many other things, these additions mean that instead of this:

    import io.circe.{ Decoder, ObjectEncoder }, io.circe.generic.semiauto.\_case class Foo(a: String, b: List[Boolean], c: Double)object Foo { implicit val decodeFoo: Decoder[Foo] = deriveDecoder implicit val encodeFoo: ObjectEncoder[Foo] = deriveEncoder }
    

    You can now write this:

    import io.circe.Codec, io.circe.generic.semiauto.deriveCodeccase class Foo(a: String, b: List[Boolean], c: Double)object Foo { implicit val fooCodec: Codec[Foo] = deriveCodec }
    

    πŸ‘€ This change can cut your compile times almost in half if you're using semi-automatic generic derivation for a lot of case classes. Codec is also used by default by @JsonCodec (unless you specify decodeOnly or encodeOnly), so you might see benefits from this change without touching your code.

    Other new features

    • πŸ”§ The configuration options for generic derivation in circe-generic-extras now include strictDecoding, which allows you to derive decoders that fail on unused JSON object fields (#1117, #1148). Thanks to Pablo Francisco PΓ©rez Hidalgo for adding this feature!
    • πŸ“œ Adrian Salajan added a parsing option to circe-jawn that allows you to specify that parsing should fail on JSON objects with duplicate keys (#1131, #1149).

    πŸ› Bug fixes

    • πŸ”§ Frederick Roth fixed a circe-generic-extras bug (#1142) that was introduced in the last milestone and that caused default values not to be used for null-valued fields even when the configuration says they should be (#1143).
    • πŸ“œ I fixed a bug (#1063) that was reported by Andriy Plokhotnyuk that resulted in rounding when decoding JSON numbers to Float that differed from the rounding done by Float.parseFloat (#1160).
    • πŸ›  I fixed a bug that's been around for a while (#941, #1078) that resulted in error accumulation being lost when decoding optional values (#1153).

    Clean-up

    πŸš€ This release adds a bunch of stuff but still ends up being a net negative 1930 insertions(+), 2059 deletions(-), which is pretty cool. Here's what's gone:

    • πŸš€ The entire circe-java8 project is gone (#1156, #1158). If you were using it and importing io.circe.java8, you can just stop doing these things, since the java.time instances are all now included in the Encoder and Decoder companion objects in the releases for all Scala versions (not just 2.12 and 2.13).
    • πŸ‘€ ObjectEncoder (and some related types) have been deprecated and replaced by Encoder.AsObject (#1150). In some cases these changes may break your code, but most users will just see deprecation warnings.
    • πŸ—„ I killed AccumulatingDecoder (#1155), since it never really accomplished what I intended, and I'm not sure that what I intended needed to be accomplished, anyway, and it confused a lot of people. Unless you were using it directly as a type class (which I tried to discourage), this removal shouldn't break your code, but you might get some deprecation warnings.
    • πŸ—„ I deprecated and renamed enumDecoder and enumEncoder because I was tired of them being inconsistent with everything else (#1159).

    ⚠ Warnings

    • πŸš€ Starting with this release, no modules of the library will work on Java 7 (see #1156 for why). Scala 2.12 requires Java 8, so this can only affect 2.11 users, and it will only affect 2.11 users who are still on a virtual machine that had public support EOL'd over four years ago. Hopefully this isn't you. If it is, you're stuck with 0.12.0-M2 or earlier releases.
    • πŸš€ Because the java.time instances are now included in circe-core for all Scala versions, and because Scala.js does not ship with a built-in java.time implementation, and because scala-java-time is not yet released for Scala 2.13, we are not running tests for Scala.js on 2.13. If I cared enough about Scala.js I could publish scala-java-time locally for 2.13 in order to run these tests, or I could wait for the upcoming scala-java-time release, but I don't care enough about Scala.js. It's probably fine.
    • πŸš€ As with 0.12.0-M1 and 0.12.0-M2, this is a milestone release, and it depends on milestone releases of Cats and other libraries. Please use with care (and report any issues you may run into).

    The future

    πŸš€ This is still a milestone release mostly because it depends on Cats 2.0.0-M4, which is also a milestone release. I'll probably release an identical or very similar 0.12.0 shortly after Cats 2.0.0 is available.