This big release bring some long-awaited features: transformations, which take more than 1 case class
as input (well, not only case class
es 😄 ) and improved Patcher
s which handle: recursive patching, overriding values.
Changelog:
- merging transformations - now it's possible to start transformation DSL with 1 value, and keep adding more values as "fallbacks", so that if the field is not found in the first one, it will be looked for in the second, then third, etc, effectively allowing us to merge several input values into 1 output value (#115, fixed in #614)
- this includes merging several tuples into 1
- and merging several
Option
s orEither
s usingorElse
(opt-in) - and merging several collections using
++
(opt-in) - and more!
- added policies for checking if some source field was not used during transformation, or that some target sealed trait subtype was not matched - (#248, fixed in #614)
- we can set Chimney to fail compilation until we mark some source field explicitly not-used, ditto for sealed subtype
- rewritten
Patcher
s as specialized merging transformations (#538, fixed in #614)- this allowed us to make
Patcher
s recursive (fixing #119) - and take implicit
Patcher
in nested fields (fixing #133) - and made it east to add
withFieldConst
,withFieldComputed
andwithFieldomputedFrom
toPatcher
s (fixing #134) - and, combined with policies, allowed us to ignore some fields in
Patchers
and updating from another instance of the same type (fixing #161 and #57)
- this allowed us to make
- additionally we added (opt-in!) support for using implicit conversions and
<:<
during derivation (#667) - added support for generating transformation out of implicit
F ~> G
in Cats integration (#666) - improved
withFieldComputedFrom
to handle more expected cases (#660) - added/expanded a few sections in our documentation (#657)
- explained how to define transformers between
String
and enums - how to avoid using nested
.into.transform
when we need only 1 - the common issue of how to change the naming convention when decoding JSON and then using Chimney
- expanded Cats section on examples with
parMapN
and similar - updated Ducktape comparison
- explained how to define transformers between
- updated Scala 2.13 to 2.13.16, Scala.js to 1.18.1
With this release I feel that all of my personal ambitions for Chimney has been realized.