Skip to content

ducktape 0.2.0

Compare
Choose a tag to compare
@arainko arainko released this 28 Mar 20:57
· 179 commits to series/0.2.x since this release
c2823f8

ducktape 0.2.0

First of all, head on over to the new docs site.

The library has been rebuilt from the ground-up to not rely on automatic derivation of Transformer and Transformer.Fallible and enable further development of more advanced features (the examples of which are nested configurations and support for regional configs like Field.fallbackToDefault - with more still to come). All of that should result in a much higher quality of code that gets generated underneath (for example, fallible transformations do not generate interim Transformer.Fallible instances anymore).

While this release is not binary-compatible with ducktape 0.1.x, it's aiming to be as source-compatible as possible. All the known breakages are documented in the Coming from 0.1.x section of the docs. There are also a bunch of deprecated forwarders with (hopefully) user-friendly tips on how to make the deprecation warnings go away.

New highlight features

  • ability to configure deeply nested transformations without having to resort to building out new Transformer instances, best showcased in the Configuring transformations section of the docs

  • revamped error reporting - errors are now accumulated and shown at once and are supposed to be actionable e.g. in case of a field that's missing it'll give the user a hint and a path to that field for usage in one of the configuration options, for example:

    No field 'name' found in MdocApp0.this.wire.PaymentMethod.Card @ Person.paymentMethods.element.at[MdocApp0.this.domain.Payment.Card].name
    

    More information is available in the Motivating example section of the docs.

  • new flavor of configuration options - regional configs:

    • Field.fallbackToDefault for falling back to default values in cases where a transformation couldn't be derived,
    • Field.fallbackToNone for falling back to None for Option fields for which a transformation couldn't be derived
      Regional configs can be made to work in only user-selected subregions of the transformations, eg.:
    Field.fallbackToDefault.regional(_.field1.at[Case1])

    will make it apply only 'below' field1 at it's Case1 subtype. More info and examples are available in Configuring transformations

What's Changed

Full Changelog: v0.2.0-RC1...v0.2.0