This release contains primarily bug fixes as we zero in on the final release of ZIO 2.0.
The only significant API changes are that the toLayer
syntax has been replaced with ZLayer.fromFunction
. Instead of (Users.apply _).toLayer
you can do ZLayer.fromFunction(User.apply _)
. ZLayer.fromAcquireRelease(acquire)(release)
has also been deleted and can be replaced with ZLayer.scoped(ZIO.acquireRelease(acquire)(release))
. Similarly zio.toLayer
can be replaced with ZLayer(zio)
.
With these changes, there are now just three ways to construct all layers:
ZLayer.fromFunction
for "simple" layers that depend on other services but do not require other ZIO workflows for their construction or finalizationZLayer.apply
with a for comprehension for layers that require ZIO workflows for their construction but do not require finalizationZLayer.scoped
with a for comprehension for layers that require finalization
This brings us to where we have always wanted to be with making defining the layers of your application as simple as possible. Please continue to report any bugs to us and we will be working diligently to prepare for the final release of ZIO 2.0. Thank you as always for your support.