[ANN] Lift 4.0.0-M3 - now supporting Scala 3

9 views
Skip to first unread message

Matt Farmer

unread,
10:07 AM (11 hours ago) 10:07 AM
to Lift

We are pleased to announce the availability of Lift 4.0.0-M3. This is the first milestone build for Lift 4.0.0 that cross-builds for both Scala 2.13 and Scala 3 LTS with a fully passing test suite in Scala 2.13 across all supported JVM versions.

Breaking Changes

A number of breaking changes are included in this milestone in order to facilitate cross-building between Scala 2 and Scala 3. Particularly impactful changes are going to be called out in these release notes, but there may be smaller breaking changes that we didn't expect. Please report any issues using this build that occurred since using Lift 4.0.0-M2.

Removal of lift-json

This one is bittersweet. I cut my teeth on the Scala 2 type system heavily on contributing to Lift JSON. I'm still insanely proud of what we were able to accomplish with that library. When it was in active development I will still contend that, at the time, it was the best JSON library for Scala. However, as the Lift Committers have had busy lives other solutions continued marching forward and improving.

With Lift 4.0.0-M3 we've fully removed lift-json and replaced it with json4s. Json4s was originally forked from lift-json, so the work to migrate to it made a lot more sense than trying to get lift-json caught up on all the changes required to build under Scala 3. There are some small differences in how json4s handles fields in objects, but by and large the public API is the same.

Most of the time replacing your imports with the json4s equivalents will be enough.

We went through the process of migrating all other Lift components to using json4s in the associated pull request, so you can take a look at that if you need to see how we fixed a particular part of the migration.
Structural Types Removed

Scala 3 doesn't support structural types. In order to support cross building we've removed them from the API across all modules that were using them. Where possible we replaced these with specific classes. Where that wasn't possible we do have some use of Any. We welcome any contributions to improve that further in these milestones.

Method Renames, removals

Some notable method renames and removals occurred:

  • lift-markdown: The inline method was renamed inlineParser to avoid collision with the inline keyword
  • lift-util: Remove SourceInfo as it was tightly coupled to Scala 2 reflection.
  • lift-util: Remove deprecated TimeHelpers implicit conversions
Status of Tests
  • Test build and pass for all modules for Scala 2.13
  • Lift WebKit tests additionally build and pass for Scala 2+3.
  • Other modules do not build tests for Scala 3 yet.
Call for Help

Please please please take this out for a spin and let us know what you find. These changes certainly had unintended consequences and we would love to be able to enumerate or fix those for the final Lift 4.0 release.

Credit where due

My personal life is full. I want to note that getting this done and getting caught up on all the changes with Scala 3 since I've been inactive in the community wouldn't be possible without Claude Code.

What's Changed

Full Changelog4.0.0-M2-release...4.0.0-M3-release

Reply all
Reply to author
Forward
0 new messages