Skip to content

v2.0.0-M4

Pre-release
Pre-release

Choose a tag to compare

@MateuszKubuszok MateuszKubuszok released this 14 Jul 07:44
c9b08b4

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, the macro backend - originally extracted into chimney-macro-commons - has now been migrated to Hearth, a standalone, cross-platform macro-utilities library that supersedes chimney-macro-commons and lives on its own release cycle. Since it is used only in macros and nothing else relies on it, it should be safe to just bump Chimney's minor version when updating the metaprogramming layer.

This release is the fourth milestone of the 2.0.0 series.

Note

Starting with this milestone the Scala 3 artifacts of the 2.x line target JDK 17+ (the Scala 2.13 artifacts still target JDK 11+), following Hearth's own JDK 11+ baseline. Make sure your runtime matches.

Note

I am going to release 2.0.0 on Scala 3.9.0 (LTS) right after its release. Perhaps it might have get a feature or two, but it will be almost identical to this milestone release: 2.12 dropped, Scala 2 requiring 2.13.18+ and JDK 11+ and Scala 3 moving from previous LTS to the new one + JDK 17+, with majority of integrations being handled in the macro extensions rather than imported implicits.

The master branch from now on tracks the development of Chimney 2.0.0.

Changelog (since 2.0.0-M3):

  • migrated the macro backend from chimney-macro-commons to Hearth 0.4.1 (#903) - the whole derivation engine now runs on Hearth's cross-platform metaprogramming primitives, sharing the macro-utilities layer with other Hearth-based libraries; this also fixes several long-standing 1.x bugs that were resolved on the Hearth line (see the regression tests below)
  • added map/contramap combinators (and the invariant imapFirst/imapSecond, imapDomain/imapDto) to Transformer, PartialTransformer, Iso and Codec by @danicheg (#913, re-lands @danicheg's original #591) - adapt an existing type class instance without re-deriving it; the PartialTransformer variants thread the failFast flag through
  • added an opt-in derivation policy (#909) - -Xmacro-settings:chimney.policy.* (plus the io.scalaland.chimney.policy.allowDerivationForChimney import) let you gate automatic structural derivation to explicitly allowed scopes, so accidental deep derivations become compile-time errors
  • added a Hearth-style debugging API (#908):
    • import io.scalaland.chimney.debug._ places a LogDerivation implicit in scope, printing the derivation log per-file without touching the transformation
    • -Xmacro-settings:chimney.logDerivation=true enables it project-wide
    • -Xmacro-settings:chimney.timeout=30s overrides the macro-expansion timeout
  • bugfixes (#914):
    • #707 - derive between a generic and a non-generic sealed hierarchy (an abstract type parameter on the source no longer drops every subtype)
    • #718 - relativize the renamed-field source path for recursive derivation (nested withFieldRenamed ending in everyItem/matchingSome/etc. now compiles)
    • #765 - drop the stray } in the ambiguous-override withFieldRenamed suggestion
  • added regression tests for #739, #899 and #720 (#919) - three bugs reported against 1.x that are already fixed on the 2.0.0/Hearth line, now guarded so they cannot silently regress

Contains all features/bugfixes added since 2.0.0-M3 (1.10.0, 1.11.0).