Skip to content

@travisbrown travisbrown released this Feb 10, 2020 · 6 commits to master since this release

This release maintains binary compatibility with Circe 0.12.x for all of the non-testing modules that don't depend on Jawn. We've updated Jawn to the new 1.0.0 release, which means that circe-jawn, circe-literal, and circe-parser (on the JVM) are not binary-compatible with 0.12.x. If you're using a library that depends only on circe-core, circe-generic, circe-shapes, etc., though, you don't need to wait for it to be published for 0.13.x.


This release drops the circe-rs module, which has been renamed to circe-pattern and is now available in the circe-droste repository. The ScalaCheck instances for circe-rs types have been removed from circe-testing, but circe-testing is otherwise compatible with 0.12.x.

Other changes

This release includes a couple of binary-compatible changes in the core modules, including a new deepDropNullValues method (added by @keiSunagawa in #1350), and a fix for a circe-generic bug (reported by @dcastro in #1388) that meant that @JsonCodec users always needed both Encoder and Decoder instances for element types of generic case classes, even when only an Encoder or Decoder was needed for the case class itself (see #1389 for the details).

Scala.js support

This is the last Circe release that will support Scala.js 0.6, and I'll be publishing 0.13.0 artefacts for Scala.js 1.0.0 as soon as our dependencies are available.

Dotty support

This release also introduces Dotty 0.22 artefacts for the following Circe modules:

  • circe-core
  • circe-generic
  • circe-jawn
  • circe-numbers
  • circe-numbers-testing
  • circe-testing

While it's possible to use the Scala 2.13 circe-core artefacts from Dotty, choosing the new Dotty version allows you to use the new derives Codec.AsObject mechanism for generic derivation (which is roughly equivalent to circe-generic's @JsonCodec annotation):

import io.circe.Codec

sealed trait Event derives Codec.AsObject

case class Foo(i: Int) extends Event
case class Bar(s: String) extends Event
case class Baz(c: Char) extends Event
case class Qux(values: List[String]) extends Event

And then:

scala> import io.circe.jawn.decode, io.circe.syntax._

scala> val events = List[Event](Qux(List("a", "b", "c")), Foo(101), Bar("xyz"), Baz('-'))
val events: List[Event] = List(Qux(List(a, b, c)), Foo(101), Bar(xyz), Baz(-))

scala> events.asJson.noSpaces
val res0: String = [{"Qux":{"values":["a","b","c"]}},{"Foo":{"i":101}},{"Bar":{"s":"xyz"}},{"Baz":{"c":"-"}}]

scala> decode[List[Event]](res0)
val res1: Either[io.circe.Error, List[Event]] = Right(List(Qux(List(a, b, c)), Foo(101), Bar(xyz), Baz(-)))

You can try this out now with the following build.sbt configuration:

scalaVersion := "0.22.0-RC1"

libraryDependencies += "io.circe" %% "circe-jawn" % "0.13.0"

You'll also need to add the Dotty sbt plugin to project/plugins.sbt:

addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.0")

On Dotty the circe-generic module does not depend on Shapeless and does not implement generic derivation (since this is now in circe-core). Instead it simply provides (partial) source compatibility for users who want to cross-compile on Scala 2 and Dotty. Some features are not currently supported (and may not ever be): for example the @JsonCodec annotation is not available on Dotty, and fully-automatic derivation does not support recursive case classes.

See #1375 for more detail about Dotty support, and please note that the Dotty artefacts should be considered experimental—we make no guarantees about binary or source compatibility, and features are likely to be added and removed in future releases.

Assets 2
You can’t perform that action at this time.