Lift 4.0.0-M3
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:
import org.json4s._
import org.json4s.native._
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
inlinemethod was renamedinlineParserto avoid collision with theinlinekeyword - lift-util: Remove
SourceInfoas it was tightly coupled to Scala 2 reflection. - lift-util: Remove deprecated
TimeHelpersimplicit 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
- feat(lift-json)!: Prepare for scala 3 with type extractor by @farmdawgnation in https://github.com/lift/framework/pull/2030
- feat(lift-common)!: scala 3 support by @farmdawgnation in https://github.com/lift/framework/pull/2031
- Configurable LAPinger.service by @andreak in https://github.com/lift/framework/pull/2002
- feat(lift-actor)!: support scala 3 by @farmdawgnation in https://github.com/lift/framework/pull/2033
- feat(lift-markdown)!: cross compile for scala 3 by @farmdawgnation in https://github.com/lift/framework/pull/2034
- feat!: migrate from lift-json to json4s by @farmdawgnation in https://github.com/lift/framework/pull/2038
- feat(lift-util)!: add support for Scala 3 cross build by @farmdawgnation in https://github.com/lift/framework/pull/2039
- feat(lift-testkit): working Scala 3 build by @farmdawgnation in https://github.com/lift/framework/pull/2040
- Lift WebKit Building and Passing Tests in Scala 3 by @farmdawgnation in https://github.com/lift/framework/pull/2041
Full Changelog: https://github.com/lift/framework/compare/4.0.0-M2-release...4.0.0-M3-release