Lift Framework 3.2.0-M3
Pre-releaseThe Lift Committers are pleased to announce the release of Lift 3.2.0-M3 on November 16th, 2017. This release is the third of three milestone releases for Lift 3.2.0. The first release candidate is tentatively scheduled for December 15th, 2017 with plans to finalize Lift 3.2 around the end of the year. As always, you can follow along with our progress in the GitHub Milestone View.
Please read below for the changes in this milestone.
Changes
New Features
(#1864) Add transform and flip methods to Box
Our Box
data type has learned a few new tricks.
The new transform
method allows callers to take a Box
and, via PartialFunction
, turn it into any other Box. If the PartialFunction
fails, the original Box is returned.
Some examples:
// Returns Full("alternative") because the partial function covers the case.
Full("error") transform {
case Full("error") => Full("alternative")
}
// Returns Full(1), this Full box unchanged, because the partial function doesn't cover the case.
Full(1) transform {
case Full(2) => Failure("error")
}
// Returns this Failure("another-error") unchanged because the partial function doesn't cover the case.
Failure("another-error") transform {
case Failure("error", Empty, Empty) => Full("alternative")
}
// Returns Full("alternative") for an Empty box since `partialFn` is defined for Empty
Empty transform {
case Empty => Full("alternative")
}
// Returns Empty because the partial function is not defined for Empty
Empty transform {
case Failure("error", Empty, Empty) => Full("alternative")
}
The new flip
method allows callers to take a Box
and, if it is an EmptyBox
(which is an Empty
or any sort of Failure
), flip it into a Full
with a specific type. If it is a Full
, an Empty
is returned.
Many thanks to @Bhashit for this contribution!
Bug Fixes
- (#1923) Validate that no-arg comet constructor doesn't exist before attempting backup constructor. This fixes a long-standing bug in Lift regarding Comet instantiation. Previously, if you had a comet that threw an exception in it's no-argument constructor we would unintentionally swallow that exception and attempt the backup, comet info constructor. Then we'd complain to the developer that the comet info constructor didn't exist. We're now a bit smarter about how we handle those errors, and check the Exception that the no-arg instantiation returns. If it's anything other than a "no such method" Exception, we'll re-throw immediately instead of trying the comet info constructor.
Improvements
- (#1921) @joescii shipped some minor tweaks to support session serialization with lift-cluster.
- (#1908)
MetaProtoExtendedSession
cookies can now be restricted to the context path of your application. Or, really, any path you want - though we're skeptical restricting your cookies to/bananas
if your application isn't hosted at/bananas
would really be that useful.
About Lift
The Lift Framework is a mature, advanced framework for the modern software engineer. There are Seven Things that set Lift apart from the other frameworks out there today: it's secure-by-default, developer-centric, scalable, capable of rich interactive behavior, modular, and designer-friendly. If you're new to Lift or interested in checking out what these things mean, we recommend checking out Simply Lift and The Lift Cookbook.
The Lift Mailing List is also a good resource for anyone to ask questions or just meet other Lift users. The Lift README is a good resource for figuring out how to use Lift in your project.