Skip to content

Releases: scalalandio/chimney

v1.8.2

10 Jul 18:19
Compare
Choose a tag to compare

Changelog:

v1.8.1

27 May 10:40
Compare
Choose a tag to compare

Changelog:

  • Prioritize value class unwrapping rules over Option rules to fix unnecessary unwrapping of Option in some wrapper transformations by @bdmendes (#741, fixed in #742) - thank you for your contribution!

v2.0.0-M1

08 May 12:14
be072a8
Compare
Choose a tag to compare
v2.0.0-M1 Pre-release
Pre-release

Important

Since Chimney got affected by 3.7.0 change in givens resolution we had to analyze the possible ways of fixing the issue.

While there is a temporary workaround the proper fix requires releasing a new major version of the library, which ideally would commit to a new Scala 3 LTS. In the meantime, a milestone 2.0.0 release series is planned. All bug fixes and issues would be still implemented on stable version, and then ported to 2.0.0 milestones, until a proper release could be made.

To make maintanance of 2 lines easier, we extracted chimney-macro-commons to a separate repository and decoupled its lifecycle from Chimney's lifecycle - the code is used only in macros and no other library seem to rely on it, so binary incomptible changes to chimney-macro-commons (mandating major version update) should not affect anyone, and it should be safe to just increase minor version of Chimney when updating macro commons.

This release is the first milestone of 2.0.0 series.

Changelog:

  • rewrite API to not rely on the pattern that breaks in 3.7.0 (#713)
  • cleanup the API (#712, #713)
    • remove deprecated withCoproduct methods
    • remove .toPartialResult since .asResult is available (since 0.8.5)
    • rework internal type-level config representation (which should not be used directly, but which has to be publicly visible to work)
    • remove __mergeResultNullable method (which was documented to not be used but which was publicly visible, or at least package visible due to historical reasons)
    • fix typo in Protobuf support trait name
    • make com.google.protobuf.ByteString and com.google.protobuf.ByteValue TotallyBuildIterables (which are more flexible than just conversion to underlying type)
    • remove unneeded implicits from java-collections Maps' implementation signatures

v1.8.0

08 May 12:01
9949345
Compare
Choose a tag to compare

Important

Since Chimney got affected by 3.7.0 change in givens resolution we had to analyze the possible ways of fixing the issue.

While there is a temporary workaround the proper fix requires releasing a new major version of the library, which ideally would commit to a new Scala 3 LTS. In the meantime, a milestone 2.0.0 release series is planned. All bug fixes and issues would be still implemented on stable version, and then ported to 2.0.0 milestones, until a proper release could be made.

To make maintanance of 2 lines easier, we extracted chimney-macro-commons to a separate repository and decoupled its lifecycle from Chimney's lifecycle - the code is used only in macros and no other library seem to rely on it, so binary incomptible changes to chimney-macro-commons (mandating major version update) should not affect anyone, and it should be safe to just increase minor version of Chimney when updating macro commons.

This release is the first using a new chimney-macro-commons version.

Changelog:

v1.7.3

08 Feb 20:30
Compare
Choose a tag to compare

Changelog:

  • cache some intermediate results during the macro expansion (#691) - feedback (improvement, no change, regression) is appreciated!
  • more examples in documentation (#693)
    • explanation why some usages lead to infinite recursion
    • usage of Transformer.derive/Transformer.define
    • examples of overrides with Options/Eithers/collections
    • examples of updating Option types when the patch is decoded JSON

v1.7.2

04 Feb 07:29
0a049ff
Compare
Choose a tag to compare

Changelog:

  • fix regression in Patchers by @hughsimpson (#687)
  • update Scala 3 to 3.3.5
  • update scala-collection.compat to 2.13.0

v1.7.1

30 Jan 13:18
Compare
Choose a tag to compare

Changelog:

  • bugfixes
    • increased test coverage for semiautomatic derivation methods and fixed a bug in Scala 3 implementation of TransformerDefinition.withFallbackFrom (#685)
    • enabling macro debugging for a single derivation (rather than globally) is no longer treated as an override changing behavior of some cases (#682)
    • fix some rename edge cases broken by 1.6.0 refactor (#683, fixed in #684)
  • updated documentation

v1.7.0

23 Jan 18:26
Compare
Choose a tag to compare

This big release bring some long-awaited features: transformations, which take more than 1 case class as input (well, not only case classes 😄 ) and improved Patchers which handle: recursive patching, overriding values.

Changelog:

With this release I feel that all of my personal ambitions for Chimney has been realized.

v1.6.0

31 Dec 14:07
Compare
Choose a tag to compare

Changelog:

  • now we are testing that macros in Scala 2.13 can read Scala 3 code and vice versa - while people might take it for granted, there are some differences in AST between both versions so support for e.g. default values or @BeanProperty requires additional work (done in #647)

  • withFieldComputed/withFieldComputedPartial can now be used in a version that does NOT take the whole input, and so removes the need for writing nested transformers (done in #650)

    // before
    foo.into[Bar]
      .withFieldComputed(_.baz, foo => f(foo.field)) // cannot just use f, does not work with .everyItem etc
      .transform
    
    // or
    implicit val inner: Transformer[Field, Baz] = ...
    
    foo.into[Bar]
     .withFieldComputed(_.baz, _.field.transformInto[Baz]) // actually never needed -> withFieldRenamed is enough
     .transform
    
    // now
    foo.into[Bar]
      .withFieldComputedFrom(_.field)(_.baz, f) // just f, can be used as ComputedFrom(_.everyItem)(_.everyItem, f) etc
      .transform
  • flags can be provided not only globally, but for nested scope as well, which further removed any need for nesting transformers (done in #653)

    // before
    foo.into[Bar]
      .withFieldComputed(_.baz, _.field.into[Baz].enableDefaultValues.transform)
      .transform
    
    // now
    foo.into[Bar]
      .withFieldRenamed(_.field, _.baz)
      .withTargetFlag(_.baz).enableDefaultValues
      .transform
  • make Path DSL more consistent - now Chimney should handle more overrides where we want to rewrite e.g. from _.everyItem._1 into _.everyMapKey, .matchingSome is consistent with .matching[Some[InferredA]].value, etc (done in #654)

  • for a long time when .withFieldConstPartial or .withFieldComputed(something that might throw) or .withFieldComputedPartial were used, the error Path contained the target field name - if such transformation happens in nesting you would receive an error path like sourceField.nestedSourceField.targetField which makes no sense. This is changed now, so that the Path would be <const for _.targetField>, <computed for _.targetField> or sourceField.anotherSourceField => <computed for _.targetField> to make it explicit that the failure didn't come from some value in input, but in a value provided explicitly, or returned from a function (done in #655 and #656)

  • documentation improvements by @ghostdogpr (#628) - thank you for your first contribution!

v1.5.0

08 Oct 16:21
Compare
Choose a tag to compare

Changelog: