github zio/zio v2.0.0-RC5
2.0.0-RC5

latest releases: v2.1.1, v2.1.0, v2.1.0-RC5...
2 years ago

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:

  1. ZLayer.fromFunction for "simple" layers that depend on other services but do not require other ZIO workflows for their construction or finalization
  2. ZLayer.apply with a for comprehension for layers that require ZIO workflows for their construction but do not require finalization
  3. ZLayer.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.

Don't miss a new zio release

NewReleases is sending notifications on new releases.