Releases: zio/zio
2.0.1
This release contains miscellaneous bug fixes.
What's Changed
- Add Prezi to adopters list by @bmateusz in #6864
- Fix ZIO 1.x sidebars by @khajavi in #6863
- issue #5878 - Backport ThreadLocalBridge by @dkarlinsky in #5980
- add 7 and 8 arg for check, checkM, checkAll and checkAllM by @strokyl in #6916
- Fix frontmatters by @vigoo in #6949
- Series2.x/consolidate docs by @atooni in #6952
- Remove provideCustom from migration guide by @senia-psm in #6954
- Make docs jdk8 compatible by @vigoo in #6955
- Series2/polish docs by @atooni in #6973
- Get rid of the rest of the toSeconds by @vigoo in #6975
- Update Migration Guide: Unsafe Marker by @khajavi in #6972
- Remove Scope from writeFile Env by @kitlangton in #6985
- Update cause.md by @felix-hedenstrom in #6988
- Fix trigger branches by @mijicd in #6989
- Replace References To Transducer With Pipeline by @adamgfraser in #6983
- Migration Guide: Runtime#unsafe* methods by @khajavi in #6990
- Scala Native on Scala 3 by @sideeffffect in #6310
- Fix sbt exit issue by @kitlangton in #6995
- Add Remember The Milk to adopters list. by @omarkilani in #6993
- Scala Native 0.4.5 by @sideeffffect in #6996
- Migration Guide Cleanup by @khajavi in #7001
- Fix scaladoc for FiberRef by @landlockedsurfer in #6997
- Make Migration Guide Regarding unsafe Methods More Accurate by @khajavi in #7005
- Unify Unsafe Operators by @adamgfraser in #7010
- Tutorial: How to Run Our First ZIO Project With IntelliJ IDEA? by @khajavi in #7014
- Update MIMA Version by @adamgfraser in #6977
- Compile tests on Scala Native by @sideeffffect in #6283
- Update REPL Settings by @adamgfraser in #6981
- Fix multiple acquire-releases in ZIOSpecAbstract by @kitlangton in #7020
- Remove Renovate by @adamgfraser in #6984
- Fix
ZIOApp#<>
producing an invalid tag by @neko-kai in #7026 - Merge 1.x to 2.x by @sideeffffect in #7021
- Scala Native: compile and package as JS and JVM by @sideeffffect in #7027
- izumi-reflect 2.1.3 (series/1.x) by @sideeffffect in #7025
- Revert "Merge 1.x to 2.x (#7021)" by @sideeffffect in #7033
- Rts work by @jdegoes in #7034
- Use Report Fatal by @adamgfraser in #7028
- Improve ZEnvironment Rendering by @adamgfraser in #7018
- Merge 1.x to 2.x (second try) by @sideeffffect in #7036
- Rewrite overview by @jdegoes in #7035
- Implement ZEnvironment Apply With No Arguments by @adamgfraser in #7017
- Documentation: Sharing Services Between Multiple Specs by @khajavi in #6999
- Increase swap size as a safety net in case of sudden surge of memory demand by @sideeffffect in #7043
- "Runtime" entry already appears in "Core Data Types" list by @bataillec in #7038
- Preserve Throwable Stack Trace by @adamgfraser in #7016
- Build all projects for Scala Native by @sideeffffect in #7048
- Pull out some non-essential pieces of the Shared Layer examples by @swoogles in #7040
- Doc: Scala 3.x instead of dotty by @ouertani in #7051
- Doc: input is the event param by @ouertani in #7050
- Reverse arrow direction in Layer Mermaid diagram by @swoogles in #7047
- Make
ZChannel#embedInput
Private by @khajavi in #7052 - Doc fix for Rezilience - libraryDependencies by @m-kalai in #7055
- Allow aspects to be used by ZStreams using @@ by @calvinlfer in #7042
- Backport #6743 to 1.x by @kubukoz in #6991
- Fix missing trace information when throwing outside of ZIO.attempt by @kitlangton in #6994
- Fix SmartAssertionOps match for Scala 3.1.3 by @andrzejressel in #7057
- Log Errors Inside Scope Of Bootstrap Layer In ZIOApp by @adamgfraser in #7046
- Cleanup Migration Guide: Monix and Cats Effect by @khajavi in #7062
- Update Migration Guide Regarding
ZIO.access
andZIO.fromFunction
by @khajavi in #7061 - Update zio-config version number by @DaniRey in #7059
- Tutorial: How to Debug a ZIO Application? by @khajavi in #7060
- CI: split compile step by Scala version by @sideeffffect in #7049
- Documentation of ZChannel by @khajavi in #7041
- Documentation: Remove Built-in Services From Examples by @khajavi in #7030
- Add fail-fast assertion to ZIO test by @guersam in #6923
- Update Documentation For ZIO.suspendSucceed by @adamgfraser in #7070
- Fix Typo In Documentation by @adamgfraser in #7071
- Remove Observer If Awaiting Fiber Is Interrupted by @adamgfraser in #7069
- Start Test Clock Warning When Time Is Accessed by @adamgfraser in #7054
- Start Test Clock Warning When Time Is Accessed by @adamgfraser in #7073
- Redo concurrency section by @jdegoes in #7039
- Make ZIO Mock Documentation Accessible by @khajavi in #7075
- Documentation: Rename "Data Types" to "References" and "ZIO Test" to "Testing" by @khajavi in #7076
- Documentation: Add Installation Section for ZIO Concurrent by @khajavi in #7077
- Prevent Snippet Evaluation by @khajavi in #7080
- Remove Spurious Warning by @adamgfraser in #7083
- Remove Debug Statements by @adamgfraser in #7081
- Update contributing.md by @ouertani in #7086
- Documentation: Update Index Page of The Reference Section by @khajavi in #7087
- Publish Sets To SubscriptionRef by @adamgfraser in #7088
- Separate unidoc and mdoc Commands by @khajavi in #7092
- Upgrade: sbt version from 1.6.2 -> 1.7.1 silencer and scala 2.12 by @ouertani in #7090
- Tutorial: How to Build a RESTful Web Service by @khajavi in #7065
- Add Documentation To Contributors Guide Regarding Unsafe by @adamgfraser in #7078
- Upgrade: scala version from 3.1.2 -> 3.1.3 by @ouertani in #7089
- Make Unsafe Operators Package Private by @adamgfraser in #7079
- Remove unidoc Command Temporary by @khajavi in #7093
- Do Not Inherit InterruptedCause On Fork by @adamgfraser in #7094
- Implement Schedule#passthrough by @adamgfraser in #7095
- Add methods to convert
Chunk[Byte]
andChunk[Char]
to a string by @987Nabil in #7023 - Increase Heap Size by @khajavi in #7096
- Fix Website Build Errors by @khajavi in #7097
- Make
Chunk.IsText
serializable by extendingSerializable
by @987Nabil in #7099 - Check The Whole Website on Pull Requests by @khajavi in #7098
- Merge 1.x to 2.x / July by @sideeffffect in #7100
- Make Tutorials Type-Safe by @khajavi in #7091
- Fix:
equalTo
compare CharSequence type by @gciuloaica in #7104 - Fix Chunk Packed Boolean Hash Code by @adamgfraser in #7109
- Prevent 2nd TestRunnerJVM instantiation causing a shutdown hook error by @swoogles in #7110
- Tutorial: How to Build GraphQL Web Service by @khajavi in #7112
- Improve Stack Traces Of Die Failures by @adamgfraser in #7114
- Make ConcurrentMap.compute consistent with Java implementation by @mhodovaniuk in #7106
- Documentation: Reorganize Sidebars by @khajavi in #7113
- Preserve Cause In ZIO#mapError by @adamgfraser in #7122
- Clean docs space and l...
v1.0.16
What's Changed
- chore(deps): update zio.version to v1.0.15 by @renovate in #6899
- add 7 and 8 arg for check, checkM, checkAll and checkAllM by @strokyl in #6916
- Fix frontmatters by @vigoo in #6949
- Update cause.md by @felix-hedenstrom in #6988
- Scala Native on Scala 3 by @sideeffffect in #6310
- Scala Native 0.4.5 by @sideeffffect in #6996
- Compile tests on Scala Native by @sideeffffect in #6283
- Scala Native: compile and package as JS and JVM by @sideeffffect in #7027
- izumi-reflect 2.1.3 (series/1.x) by @sideeffffect in #7025
- Build all projects for Scala Native by @sideeffffect in #7048
- Backport #6743 to 1.x by @kubukoz in #6991
- CI: split compile step by Scala version by @sideeffffect in #7049
- Start Test Clock Warning When Time Is Accessed by @adamgfraser in #7054
New Contributors
- @strokyl made their first contribution in #6916
- @felix-hedenstrom made their first contribution in #6988
Full Changelog: v1.0.15...v1.0.16
2.0.0
The future of asynchronous and concurrent programming is finally here. We are excited to announce the release of ZIO 2.0!
Since we started on the journey to ZIO 2.0 we have focused on four key themes:
- Performance - Frameworks such as ZIO are the base layer that higher level solutions are built on so they must be extremely efficient so you can build high performance applications on top of them.
- Developer Experience - Just as important, you must be able to quickly and joyfully write clear, bug free code with ZIO.
- Operations - ZIO must scale with you to support the needs of the most complex industry scale application with support for logging, metrics, and execution tracing.
- Streams - Streaming is a fundamental paradigm for describing data flow pipelines and ZIO must provide support for it in a way that is both highly performant and deeply principled.
We believe we have achieved all of these goals to a greater extent than we could have hoped for when we started this journey.
These release notes will provide a high level overview of what we have done with regard to each of these points but when you are upgrading to ZIO 2.0 we would encourage you to check out the detailed migration guide available here. The migration guide also contains information about the automated migration tool you can use to do most of the heavy lifting for you.
Performance
ZIO 2.0 ships with the first ever "third generation" runtime that breaks new ground, avoiding use of the JVM stack whenever possible. This delivers dramatically higher performance than other runtimes for synchronous code, as shown in the following benchmark between ZIO 1.0, Cats Effect 3, and ZIO 2.0 that is typically used to compare runtimes.
[info] Benchmark (depth) Mode Cnt Score Error Units
[info] ZIO 1.x 20 thrpt 20 647.268 ± 12.892 ops/s
[info] Cats Effect 3.x 20 thrpt 20 947.935 ± 124.824 ops/s
[info] ZIO 2 20 thrpt 20 1903.838 ± 21.224 ops/s
This runtime is highly optimized for Project Loom because in a post-Loom world there is never a need for asynchronous operations.
We will be continuing to optimize the performance of the new runtime for asynchronous operations and publish additional information regarding the new runtime. Until then, you can check out this blog post by John De Goes to learn more about the motivations and development process for the new runtime.
ZIO 2.0 also comes with a variety of other optimizations to improve performance of your application and prevent bottlenecks.
For example, appropriately managing blocking code is a typical "gotcha" for developers.
Runtimes such as ZIO typically perform all work on a small number of threads, typically equal to the number of operating system threads, to minimize contention and context switching. However, this means that if blocking work is inadvertently run on the core threadpool it can have a very negative impact on application performance, potentially resulting in deadlock.
ZIO 1.0 was the first runtime to provide tools to manage this through its Blocking
service, which was later copied by other runtimes. However, this still required users to manually identify blocking work, which could be an error prone process, especially when legacy APIs did not clearly document blocking code.
ZIO 2.0 takes another giant leap forward here with the introduction of autoblocking. Now the ZIO runtime will automatically identify blocking work for you and safely shift it to a dedicated blocking thread pool. You can still use ZIO.blocking
to provide a "hint" to the runtime that a certain section of code is blocking, but this is now merely an optimization. Early users have reported dramatic simplifications to their code by replacing all previous manual usages of blocking with this functionality.
Developer Experience
The speed of writing high quality code and onboarding developers can often be just as or more important than the speed of the code itself.
ZIO 1.0 broke new ground in developer productivity and teachability by taking a highly principled approach while eschewing unnecessary abstractions and jargon.
However, as we innovated in many areas in ZIO 1.0 such as the introduction of the environment type and support for dependency injection there were inevitably learning opportunities. We incorporated all that feedback and poured it back into ZIO 2.0 to make ZIO easier to use than ever before.
The area this is most visible is in the way you build your application’s required dependencies. This process is dramatically simplified in ZIO 2.0 with the deletion of the Has
data type, automatic construction of layers, and a new more straightforward design pattern for defining layers.
trait MyService {
def doSomething: ZIO[Any, MyDomainError, MyValue]
}
final case class MyServiceImplementation(dependency1: Dependency1, dependency2: Dependency2) extends MyService {
def doSomething: ZIO[Any, MyDomainError, MyValue] =
???
}
val layer: ZLayer[Dependency1 & Dependency2, Nothing, MyService] =
ZLayer {
for {
dependency1 <- ZIO.service[Dependency]
dependency2 <- ZIO.service[Dependency2]
... <- // do any necessary setup and finalization here
} yield MyServiceImplementation(dependency1, dependency2)
In this way, layers leverage everything you already know about constructor based dependency injection while giving you the ability to perform ZIO workflows to setup and finalize your services in a principled way.
Even better, once you define these layers you can use automatic layer construction to assemble them together with extremely helpful compiler messages to help you as you go.
object MyApp extends ZIOAppDefault {
val myAppLogic: ZIO[MyService, Nothing, Unit] =
???
val run: ZIO[Any, Nothing, Unit] =
myAppLogic.provide(layer)
// compiler message guides you to provide layers for required dependencies
}
Another area where ZIO 2.0 is dramatically simplifying the user experience is around resources. ZIO 1.0 pioneered safe, powerful resource management with the ZManaged
data type, which was the first to describe a resource as a value with powerful composition operators such as parallel acquisition of resources.
However, as great as ZManaged
was, it was "one more thing to learn" and could create issues when users had to mix ZIO
data types with ZManaged
data types.
ZIO 2.0 makes this a thing of the past by deleting ZManaged
and introducing the concept of a Scope
, which is just something that we can add finalizers to and eventually close to run all those finalizers. A resource in ZIO 2.0 is now just represented as a scoped ZIO:
val resource: ZIO[R with Scope, E, A] = ???
This is a workflow that requires a Scope
, indicating that part of this workflow requires finalization and needs a Scope
to add that finalizer to. To remove the requirement for a Scope
, the equivalent of ZManaged#use
in ZIO 1.0, we simply use the ZIO.scoped
operator:
ZIO.scoped {
resource.flatMap(doSomethingWithIt)
}
In this way ZIO workflows that require finalization compose seamlessly with other ZIO workflows, because they all are just ZIO workflows. During the development process of ZIO 2.0 almost every ZIO ecosystem library has migrated to using scopes exclusively, typically resulting in dramatic simplifications to code.
We have also made significant efforts to simplify naming conventions, focusing on consistency of naming and accessibility.
For example, the constructor for creating a ZIO
from a block of code that could throw exceptions was called effect
in ZIO 1.0, which was really a holdover from a more Haskell / category theoretic perspective where throwing exceptions was a "side effect" versus a pure function (never mind that there are a variety of other "side effects" that do not consist of throwing exceptions).
In contrast, in ZIO 2.0 this constructor is simply called attempt
. We "attempt" to do something which might fail, safely capturing the possibility of failure.
Similarly the constructor for creating a resource in ZIO 1.0 was bracket
, which was another holdover from Haskell. While it has a certain metaphorical appeal (we are "bracketing" the use of a resource with acquire and release actions) it does not really tell us what is going on. In contrast in ZIO 2.0 this is called acquireRelease
, saying precisely what it is.
Operations
While ZIO 2.0 makes it easier than ever to write correct code, it is inevitable in large applications that issues will arise, and you will need to be able to quickly diagnose and fix those issues.
ZIO 1.0 took significant steps to address these needs, including introducing asynchronous execution traces and providing support for logging and metrics through libraries such as ZIO Logging and ZIO Metrics.
However, there were some problems. While execution traces allowed you to see the trace for an asynchronous program in a way you never could before, traces could be hard to read and contained a lot of unnecessary information. Libraries such as ZIO Logging required you to add and integrate another dependency for what should be table stakes.
ZIO 2.0 is taking this to another level.
Execution traces now look just like JVM stack traces, letting you translate everything you know about reading stack traces into reading execution traces.
Logging is now build directly into ZIO so logging a line is as simple as:
val myAppLogic: ZIO[Any, Nothing, Unit] =
ZIO.logInfo("Hello logging!")
Of course you can use operators like logLevel
, logSpan
, and logAnnotate
just like you would with any other logging solution.
...
v1.0.15
What's Changed
- Add Nike.com to the list of adopters by @pmukhin in #6610
- chore(deps): update zio.version to v1.0.14 by @renovate in #6606
- chore(deps): update actions/checkout action to v3.0.1 by @renovate in #6621
- chore(deps): update dependency async to 2.6.4 [security] by @renovate in #6623
- Bump async from 2.6.3 to 2.6.4 in /website by @dependabot in #6622
- Zio1 stream bench by @justcoon in #6445
- chore(deps): update actions/checkout action to v3.0.2 by @renovate in #6685
- Update fiber.md by @scottjad in #6488
- Publish scala3 javadoc artifacts by @mijicd in #6712
- Java's CompletionStage: make cancellable only the async part by @sideeffffect in #6717
- add sample project by @jxnu-liguobin in #6719
- Add Anduin Transactions to ZIO user list by @ngbinh in #6728
- Avoid double evaluation of by-name parameter by @swachter in #6757
- Add Undo to the list of adopters by @pellekrogholt in #6782
- chore: fix a typo in the comment by @contrun in #6797
- Updated Adopters list with Rapidor by @pawank in #6791
- Readme Adopters fix alphabetic order for Bpp.it by @fabio-rizzello-omnia in #6795
- ZIO 1.x: Fix URL of can_fail Page by @khajavi in #6805
- fix re-slice in chunk cause OOM. by @mingyang91 in #6807
- Docs: Use Blocking Executor for Awaiting Connections by @khajavi in #6803
- izumi-reflect 2.1.0 by @sideeffffect in #6822
- Update Scala JS and Scala Native by @sideeffffect in #6821
- Remove dottySettings by @sideeffffect in #6825
- Scala Native: Don't use sjavatime, use scala-java-time instead by @sideeffffect in #6826
- Update some libraries, especially
scalacheck
to unblock Scala 3 Native by @sideeffffect in #6830 - Fix CODE_OF_CONDUCT.md symlink trget by @dmytr in #6824
- fix transducer documentation by @dannashirn in #6842
- Added Automatic-Module-Name to JAR manifest by @ajaychandran in #6843
- Added
summarized
combinator to ZSink which returns start time and stop time. by @ithinkicancode in #6818 - Update README.md by @Nestor10 in #6857
- Add Prezi to adopters list by @bmateusz in #6864
- Fix ZIO 1.x sidebars by @khajavi in #6863
- issue #5878 - Backport ThreadLocalBridge by @dkarlinsky in #5980
New Contributors
- @pmukhin made their first contribution in #6610
- @scottjad made their first contribution in #6488
- @ngbinh made their first contribution in #6728
- @pellekrogholt made their first contribution in #6782
- @pawank made their first contribution in #6791
- @fabio-rizzello-omnia made their first contribution in #6795
- @dmytr made their first contribution in #6824
- @Nestor10 made their first contribution in #6857
- @bmateusz made their first contribution in #6864
Full Changelog: v1.0.14...v1.0.15
2.0.0-RC6
Given the changes since RC5
, we are doing one more release candidate for ZIO 2.0. This release candidate brings the following changes.
Autoblocking
Blocking work will now automatically be identified and shifted to the blocking executor. You can continue to use operators like blocking
to give a "hint" to the runtime that a particular operator is blocking for efficiency but this should no longer be needed for correctness. This is a new feature and a significant innovation so please report any issues!
Simplification Of Runtime Customization
The RuntimeConfig
and RuntimeConfigAspect
data types have been deleted. Instead, you can customize the runtime using layers. This allows you to use ZIO workflows in setting up your runtime, for example to load some configuration information using ZIO Config.
If you need to access information about the current configuration you can use more specialized operators such as ZIO.logger
or ZIO.executor
.
If you want to customize the runtime you can use basic layers defined in the Runtime
companion object such as addLogger
or ZIO ecosystem libraries will provide their own layers that do all necessary setup. The layer in ZIOApp
has been renamed bootstrap
to more clearly indicate this.
Other Simplifications
The type alias "companion objects" have been deleted. So instead of Task.attempt(???)
do ZIO.attempt(???)
. This promotes consistency and is one less thing to think about.
Variants of acquireRelease
on the ZIO
trait have been deleted in favor of the versions on the ZIO companion object. So instead of acquire.acquireReleaseWith(release)(use)
do ZIO.acquireReleaseWith(acquire)(release)(use)
. This is more idiomatic as constructors belong on the companion object and promotes consistency between different ways of using resources.
The Accessible
trait has been deleted. This proved a relatively unpopular alternative to implementing accessors compared to just using the macro annotation in Scala 2 or defining them manually, which has become easier with automatic completion tools. We are continuing to explore solutions for replacing macro annotations on Scala 3.
The Spec
data type has been simplified to "build in" the TestFailure
data type. So if you ever did layer.mapError(TestFailure.fail)
in your tests before you can delete that.
The provideService
operator has also been deleted. Instead of provideService(service)
do provideLayer(ZLayer.succeed(service))
. Layers are the idiomatic way of providing ZIO workflows with their dependencies and this operator generally should not be needed anymore with the elimination of the default services from the environment.
1.0.14
This release contains enhancements and bug fixes. It is binary compatible with prior ZIO 1.0 releases.
What's Changed
- Improve Array Diffing by @adamgfraser in #6141
- chore(deps): update zio.version to v1.0.13 by @renovate in #6170
- Add Diff[Seq] by @nigredo-tori in #6175
- Back Port STM Bug Fix by @adamgfraser in #6195
- Update SBT Script by @adamgfraser in #6221
- Update License by @adamgfraser in #6235
- Update cookbooks.md by @jczuchnowski in #6238
- chore(deps): update dependency org.scala-lang:scala-library to v2.13.8 by @renovate in #6242
- chore(deps): update dependency shelljs to 0.8.5 [security] by @renovate in #6252
- Bump shelljs from 0.8.4 to 0.8.5 in /website by @dependabot in #6251
- Add REWE Digital to
Adopters
by @987Nabil in #6259 - Fix maven coordinates for zio-rezilience by @vitaliis in #6267
- Backport ZPool from ZIO 2 by @guizmaii in #6265
- Simplify a bit
ZPool
code by @guizmaii in #6271 - Update README.md, added Demandbase by @rleibman in #6272
- Add Credit Karma as a company that is using ZIO by @tkolleh in #6248
- Add Vivid Money as a company that is using ZIO by @vsobakekot in #6279
- Added Tinka as company that is using ZIO by @arcilli in #6285
- add SGCIB to adopters list by @ymeherzi in #6290
- RR19 uses ZIO by @mayonesa in #6293
- Adding Caesars Digital to list of adopters by @stevetursi in #6294
- Propagate Errors From Original Stream In ZStream#mapMPar by @adamgfraser in #6295
- Add waylay to adopters list by @francisdb in #6296
- Fix Diff[Nothing] issue by @kitlangton in #6304
- Scala Native 0.4.3 by @sideeffffect in #6307
- Update Scala.js by @sideeffffect in #6284
- chore(deps): update dependency is-svg to 4.3.0 [security] by @renovate in #6312
- Handle Cancellation In ZIO.fromCompletableFuture by @adamgfraser in #6316
- Scala Native loop 0.2.1 by @sideeffffect in #6320
- Replace setup-scala with setup-java by @mijicd in #6318
- TreuTech uses ZIO by @uurl in #6323
- add instance to enable derivation of chunks by @mikail-khan in #6325
- Add Valsea to Adopters by @ipereziriarte in #6335
- Close Java Stream After Use by @adamgfraser in #6336
- ConcurrentSet Scaladocs by @uurl in #6322
- Fix Flaky Test by @adamgfraser in #6337
- Check Whether To Continue While Folding Over Chunk by @adamgfraser in #6340
- Add Unzer to adopters list by @zeal18 in #6342
- Documentation for
zio.concurrent
data types by @uurl in #6332 - chore(deps): update dependency ansi-regex to 5.0.1 [security] by @renovate in #6311
- Remove zio-concurrent by @mijicd in #6343
- Restore zio-concurrent by @mijicd in #6344
- Add
DeriveGen[LocalTime]
by @DroidPsychoPT in #6346 - Add Radix Labs to the list of users in README.md by @orreksu in #6367
- Add IHS Markit to Adopters list by @landerlo in #6372
- Optimise Chunk's dropRight & takeRight by @RafalSumislawski in #6376
- Fork in SBT by @adamgfraser in #6359
- Report error messages to sbt events which end up in JUnit XML by @joroKr21 in #6387
- Java interop: make CompletionStage cancellable by @sideeffffect in #6386
- Add Lottoland to Adopters list by @FcoLopera in #6394
- Update README.md by @sasanet in #6391
- Bump prismjs from 1.25.0 to 1.27.0 in /website by @dependabot in #6389
- chore(deps): update dependency prismjs to 1.27.0 [security] by @renovate in #6390
- chore(deps): update actions/checkout action to v3 by @renovate in #6398
- Add ZIO.raceFirst by @cipriansofronia in #6402
- Added Trainor to the list of adopters in README by @xkrillex in #6406
- Add Reentrantlock by @regiskuckaertz in #6373
- Add Lernkunst to list of adopters by @jdsalchow in #6413
- Add company: Trackabus by @ajrnz in #6415
- Hypefactors uses ZIO by @andreabrduque in #6409
- add Disney Streaming to list of end-user companies by @aberoham in #6432
- Add Garner Distributed Workflow to list of adopters by @lzm0 in #6473
- Bump minimist from 1.2.5 to 1.2.6 in /website by @dependabot in #6493
- ReentrantLockSpec Mark test as flaky by @regiskuckaertz in #6523
- Add instance for BigInt for DeriveGen by @ghidei in #6569
- Add DeriveGen instances for java BigInteger and BigDecimal by @ghidei in #6586
- Add Broad to list of adopters by @juliano in #6595
- fix memory leak with reportFailure and child FiberContexts by @hcoa in #6591
- ZIO 1: Handle Fiber Failures In ZIO App by @adamgfraser in #6600
New Contributors
- @nigredo-tori made their first contribution in #6175
- @987Nabil made their first contribution in #6259
- @tkolleh made their first contribution in #6248
- @vsobakekot made their first contribution in #6279
- @arcilli made their first contribution in #6285
- @ymeherzi made their first contribution in #6290
- @mayonesa made their first contribution in #6293
- @stevetursi made their first contribution in #6294
- @uurl made their first contribution in #6323
- @mikail-khan made their first contribution in #6325
- @ipereziriarte made their first contribution in #6335
- @DroidPsychoPT made their first contribution in #6346
- @orreksu made their first contribution in #6367
- @landerlo made their first contribution in #6372
- @RafalSumislawski made their first contribution in #6376
- @FcoLopera made their first contribution in #6394
- @sasanet made their first contribution in #6391
- @xkrillex made their first contribution in #6406
- @jdsalchow made their first contribution in #6413
- @ajrnz made their first contribution in #6415
- @andreabrduque made their first contribution in #6409
- @aberoham made their first contribution in #6432
- @lzm0 made their first contribution in #6473
- @hcoa made their first contribution in #6591
Full Changelog: v1.0.13...v1.0.14
2.0.0-RC5
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.
2.0.0-RC4
We are excited to bring you what we hope will be the final release candidate of ZIO 2.0!
The theme of this release candidate is simplification. Throughout the development process we have striven to add features and performance while simplifying everything we possibly could, including the deletion of Has
and ZManaged
. This release builds on that in two ways.
First, the default ZIO services of Clock
, Console
, Random
, and System
have been removed from the environment and built into the ZIO runtime. These interfaces are very low level. Unlike other services, they describe functionality that users may want to use in any service or in their main application. And users rarely provide alternative implementations other than the test implementations provided by ZIO Test.
This change eliminates the boilerplate that was previously associated with manually providing these services in the implementation of higher level services. You can still modify the implementation of these services using ZEnv.services
but we expect users will rarely need to do this themselves. All the operators you are used to like Console.printLine
still work, they just won't add a requirement to the environment. And you can also use a new set of operators like ZIO.clock
to access one of the default services directly.
As a user you should be able to just delete all references to these services from the environment.
Second, ZIO concurrent data structures such as Ref
, Queue
, and Hub
have been simplified to delete their more polymorphic variants. While elegant, this functionality was rarely used and could be confusing for new users.
This release candidate also includes new support for streaming test results from ZIO Test based on work by @swoogles! Please let us know your feedback and we hope you enjoy the new more real time test output.
We continue to be on track to release the final version of ZIO 2.0 by the end of April. Between now and then will be continuing to optimize, fix bugs, and make minor API changes but we do not expect to make any further major changes at this point.
Thank you again for your support! Things just keep getting better and better!
2.0.0-RC3
We are excited to bring you the third release candidate of ZIO 2.0!
This release candidate brings several exciting features. In particular it introduces scopes as first class values, which provide the basis for safe, composable resource handling.
We can construct a scoped resource using constructors such as ZIO.acquireRelease
:
def file(name: String): ZIO[Scope, IOException, File] =
ZIO.acquireRelease(openFile(name))(closeFile)
The Scope
in the environment indicates that this workflow uses a scoped resource. We can work with the resource as much as we want and then when we are done with it we can close the scope with the ZIO.scoped
operator:
ZIO.scoped {
file(name).flatMap(useFile)
}
Any resources acquired within a Scope
are guaranteed to be released when the Scope
is closed, whether by success, failure, or interruption.
Scopes let us safely use resources while working with ordinary ZIO
values without having to use any other data types like ZManaged
. This means we have all the operators we are used to on ZIO
and can work with any code that accepts a ZIO
value.
Based on this work the ZManaged
data type has been removed from ZIO but for backward compatibility it is still available as a separate zio-managed
dependency.
This release also contains an overhauled metrics interface to make it easier for you to capture metrics about how your application is performing as well as a variety of other improvements.
Based on these changes we expect to do one more release candidate in approximately two weeks before pushing for a final version of ZIO 2.0.
Thank you as always for your support! We can't wait to all be able to use ZIO 2.0 together!
2.0.0-RC2
This release contains bug fixes and additional features to make it easier than ever to upgrade to ZIO 2, including new ZPipeline
constructors that let you convert any transducer into a pipeline. This is also the first release in which ZIO Mock has been moved into its own project. Check out the new repository here if you are using it in your tests.
We expect that all major ZIO ecosystem libraries will be able to publish versions supporting RC2
shortly after it is released, allowing users to begin testing their applications on ZIO 2 if they are not already doing so. Thank you as always for your support and please continue to share your feedback as we drive towards the final release of ZIO 2!