travisbrown
released this
This release introduces Scala 3.0.0-RC1 support (and drops 3.0.0-M3), updates several dependencies, and includes one new feature (instances for the java.util.Currency
representation of ISO 4217 currency values, introduced by @isomarcte in #1578).
The modules listed below are published for Scala 3.0.0-RC1 on the JVM. They should all be considered experimental at this point, but the Scala 3.0 version of circe-generic in particular should be used with care (and shouldn't be used at all in projects that don't need to cross-build for Scala 2, in which case you can use the new derives
mechanism supported in circe-core).
- circe-core
- circe-extras
- circe-generic
- circe-jawn
- circe-numbers
- circe-numbers-testing
- circe-parser
- circe-pointer
- circe-refined
- circe-scalajs
- circe-testing
With a couple of exceptions these modules are also published for Scala 3.0 on Scala.js, although the Scala 3.0 artifacts for Scala.js are currently completely untested and should be considered even more experimental than the Scala 3.0 artifacts for the JVM.
Please the 0.14.0-M3 release notes for more information about circe-pointer, which is new in the 0.14 release series.
This milestone release is backward-binary-compatible with 0.13.x on Scala 2, but the eventual 0.14.0 release is not guaranteed to be compatible with any of these milestones.
Assets
2
travisbrown
released this
This release introduces a new circe-pointer module, which provides a JSON Pointer implementation that aims to be compliant with RFC 6901 and the Relative JSON Pointers memo from the IETF, with a minimal API and reasonable performance.
Usage looks like this:
scala> import io.circe.Decoder, io.circe.pointer.literal._
import io.circe.Decoder
import io.circe.pointer.literal._
scala> case class Foo(x: Int)
class Foo
scala> implicit val decodeFoo: Decoder[Foo] = Decoder[Int].map(Foo(_)).prepare(pointer"/a/2/b/c")
val decodeFoo: io.circe.Decoder[Foo] = io.circe.Decoder$$anon$11@7a4dad50
scala> io.circe.jawn.decode[Foo]("""{"a": [true, null, {"b": {"c": 123}}]}""")
val res0: Either[io.circe.Error,Foo] = Right(Foo(123))
The pointer
string interpolator returns a io.circe.pointer.Pointer
, which is a new type that implements ACursor => ACursor
, allowing it to be used conveniently in contexts like prepare
. The Pointer.Relative
subtype additionally supports position evaluation.
There are currently some limitations to the interpolation macro; for example the initial depth for relative pointers can't be interpolated, and the JSON pointer string is parsed both during compilation, to verify its validity, and at runtime (unlike for example the JSON interpolator in circe-literal, which allows you to avoid runtime parsing). These limitations may be removed in future releases.
The circe-pointer module is published for Scala 3.0.0-M3, along with circe-core, circe-generic, and several other core modules. Please see the 0.13.0 release notes for more information about Dotty / Scala 3 support in Circe.
This release also includes a few new helper methods for cursors (#1627 and #1629), and ongoing MUnit migration by @diesalbla (#1622).
Like the previous 0.14 milestones, all modules in this release are verified by MiMa to be backward-binary-compatible with 0.13.x on Scala 2.
Assets
2
travisbrown
released this
This release introduces support for Scala 3.0.0-M3 for the core modules, including circe-core, circe-generic, and circe-jawn. It also introduces Scala.js artifacts for Scala 3. We are not running most tests on Scala 3 at the moment, because some ScalaTest-related dependencies are not yet available for the latest milestone (we've begun migrating all tests from ScalaTest to MUnit, but still have some ScalaTest tests).
Once all dependencies are available for the latest Scala 3 milestone, we'll backport some of the changes in the 0.14.x milestone series and publish them as 0.13.1. Please see the 0.13.0 release notes for more information about Dotty / Scala 3 support in Circe.
This release includes a number of other changes:
- Replace "welcoming" with "inclusive" by @travisbrown in #1496.
- Migrate to GitHub Actions by @erwan in #1587.
- Migrate to sbt-github-actions by @travisbrown in #1607.
- Update circe-literal to work with Jawn 1.0.2 by @travisbrown in #1591.
- Add overrides for applicative operations by @travisbrown in #1603.
- Clean up JVM options by @joroKr21 in #1487.
- Add convenience methods for
JawnParser
by @BalmungSan in #1502. - Improve documentation by @x3ro in #1552 and #1558.
- Fix
taggedBooleanCodec
by @vincentdehaan in #1512. - Migrate tests to MUnit by @diesalbla, @joe-warren, and @guymers in #1595, #1596, #1601, and #1602.
All modules in this release are verified by MiMa to be backward-binary-compatible with 0.13.0 and 0.14.0-M1 on Scala 2 (but please note that this release of circe-literal requires Jawn 1.0.2+, thanks to some macro-related reflection).
Assets
2
travisbrown
released this
This milestone release includes several changes:
Invariant
instance forCodec
by @ybasket in #1438.- New circe-extras module by @kevinmeredith in #1436.
- Laws for
KeyEncoder
andKeyDecoder
by @tmccarthy in #1472. - Instances for Shapeless's
@@
in circe-shapes by @vincentdehaan in #1480. - Some new methods on
JawnParser
by @BalmungSan in #1502. - More inclusive parameter names by @kevinmeredith in #1478.
- New
dropEmptyValues
method by @droptheplot in #1399. - Error accumulation for
validate
onDecoder
by @pfcoperez in #1477.
This release is cross-published for Scala 2.12, Scala 2.13, Scala.js 1.x, and Dotty 0.26. The same modules are published for Dotty as in the 0.13.0 release. We're currently waiting on ScalaTest to update Dotty support to 0.27, which should allow us to publish Dotty Scala.js artifacts.
Assets
2
travisbrown
released this
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.
Removals
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; I'll be publishing 0.13.0 artefacts for Scala.js 1.0.0 as soon as our dependencies are available please see the final section below for updates.
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.
Scala.js 1.0 support
Updates
All Scala.js-compatible modules have now been published for Scala.js 1.0, and we're now able to run the full suite of tests on 1.0. The following Circe modules from other repositories are also now available for Scala.js 1.0:
- circe-derivation (0.13.0-M2)
- circe-derivation-annotations (0.13.0-M2)
- circe-generic-extras (0.13.0)
- circe-optics (0.13.0)
All of these 0.13.0 releases for Scala.js 1.0 should still be considered experimental because of the patch version mismatches mentioned below.
Original release notes
The following modules include experimental support for Scala.js 1.0.0:
- circe-core
- circe-numbers
- circe-numbers-testing
- circe-parser
- circe-scalajs
- circe-testing
While the Scala.js 1.0 artifacts should work correctly, we're not currently able to run the full Circe test suite for them, because the dependencies of some Circe modules (including Shapeless) aren't available for Scala.js 1.0 yet. Also note that the patch versions of Cats and some testing dependencies differ between the Scala.js 1.0 artifacts and the JVM and Scala.js 0.6 ones.
We expect the next Circe release to be able to remove these limitations and provide full support for Scala.js 1.0.
Assets
2
travisbrown
released this
This release candidate differs from the two 0.13.0 milestones in that it maintains binary compatibility with Circe 0.12.x (verified with MiMa) for all of the modules that don't depend on Jawn. We've updated Jawn to the new 1.0.0, which means that circe-jawn, circe-literal, and circe-parser (on the JVM) are not binary-compatible with 0.12.x.
We've chosen to use 0.13 only for introducing Jawn 1.0.0, and wanted to make the update easy for people who have dependencies that may still be on circe-core or circe-generic 0.12.x.
This release is cross-published for Scala.js 1.0.0-RC2 for the same modules as the last two milestones.
I'll publish 0.13.0 in the next day or two if no issues come up before then.
Assets
2
travisbrown
released this
This release is identical to 0.13.0-M1 except that it bumps the Jawn version from 1.0.0-RC2 to 1.0.0-RC3, which is a breaking change.
Assets
2
travisbrown
released this
This is an early pre-release that's designed to let people try out Circe with two specific pre-release dependencies: Jawn 1.0.0-RC2 and Scala.js 1.0.0-RC2. Note that not all of our dependencies are available for Scala.js 1.0.0-RC2, so not all of the modules in this repository are published for it, and the ones that are are largely untested. The following modules currently support Scala.js 1.0.0-RC2:
- circe-core
- circe-numbers
- circe-numbers-testing
- circe-parser
- circe-rs
- circe-scalajs
- circe-testing
Scala.js 1.0.0 is currently scheduled to be published at the end of this month (January 2020), and once it's available Circe will immediately drop Scala.js 0.6, so this may be the only Circe release that's cross-published for 0.6 and 1.0.
This release also updates the Cats dependency from 2.0.0 to 2.1.0, and includes a couple of minor changes (post-0.12 deprecation clean-up and the reinstatement of one HCursor
method). Apart from the Jawn update and the removal of previously deprecated methods, this release should be fully binary-compatible and source-compatible with 0.12.x, although that's not guaranteed in any way. There are also no guarantees that future 0.13 releases will be compatible with this one.
Assets
2
travisbrown
released this
This is a bug-fix release for 0.11.x that backports #1272, fixing #1271 (thanks to Eric Meisel; see #1317).
I also updated sbt-mima from 0.3.0 to 0.6.1 before publishing this release, and it turns up several binary compatibility issues in circe-jawn that it didn't previously catch. This release of circe-jawn is identical to 0.11.1. If you need compatibility with circe-jawn 0.11.0 you'll need to set that version manually.
Assets
2
travisbrown
released this
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.LocalDateTime
import io.circe.syntax._
scala> val t = LocalDateTime.parse("2018-08-13T14:20:00")
t: java.time.LocalDateTime = 2018-08-13T14:20
scala> 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.