Releases: zio/zio
2.1.1
We found a couple bugs in 2.1.0 so this we decided to release a patch version quickly:
- An application using ZIO metrics would hang forever when receiving the termination signal after interrupting all other fibers. This is because
ScopedRef
now runs acquisition in an uninterruptibe region. You might want to be careful if you useZLayer.reloadable
and its variants: fibers forked in those layers are need to be marked asinterruptible
explicitly. - ZIO test assertions were broken on Scala.js with Scala 2.12 because of unsupported reflection usage.
What's Changed
- Add a TestAspect to run tests in the blocking threadpool by @kyri-petrou in #8835
- Fix metrics causing the application to hang on termination by @ghostdogpr in #8837
- Don't use Java reflection for ScalaJS / Native by @kyri-petrou in #8841
Other changes (CI, dependencies and documentation)
- Fix Versioning On Documentation by @khajavi in #8839
- Added Scala3 + Prometheus + OpenTelemetry tracing example by @lewapek in #8831
Full Changelog: v2.1.0...v2.1.1
2.1.0
This version brings a lot of performance improvements in the fiber runtime as well as the scheduler. It is fully binary compatible with the 2.0.x branch with the exception of some internal classes that shouldn't be used anywhere else (we tested a wide range of the library ecosystem without issues).
An important change is that we disabled auto-blocking detection by default because it could cause some performance degradation in some cases. Better heuristics might be introduced in the future, but in the meantime you can enable it by using the Runtime.enableAutoBlockingExecutor
aspect. We also added an optional executor based on Loom that you can use if your Java version is 21 or higher with the Runtime.enableLoomBasedExecutor
aspect. Which one is better may vary based on your use case so we encourage you to test and measure it.
If you use sttp v3 and Scala 3, you might run into a compile error when trying to provide or access SttpClient
from/to your environment. This is because since #8612 we don't allow materializing tags for intersection types in covariant position and sttp does exactly that: type SttpClient = SttpBackend[Task, ZioStreams with WebSockets]
. Using SttpBackend[Task, Any]
or only one of ZioStreams
/WebSockets
solves the issue.
What's Changed (since 2.1.0-RC5)
- Improve throughput of
ZIO#fork
by 300% by @kyri-petrou in #8814 - Use
add
instead ofunion
when extending a Scope by @kyri-petrou in #8823 - Improve performance of
foreachPar
et.al. by @kyri-petrou in #8816
What's Changed (since 2.0.22)
- Race Interruptibly In Channel.mergeAllWith by @adamgfraser in #8600
- Return CompletableFuture Immediately by @adamgfraser in #8605
- Add
asBase64String
toChunk
by @987Nabil in #8606 - add Config methods for NonEmptyChunk by @mberndt123 in #8607
- Implement NonEmptyChunk#groupBy and NonEmptyChunk#groupMap by @adamgfraser in #8608
- [Scala 3] Prevent Tag materialization for intersection types in covariant position by @joroKr21 in #8612
- Implement ZPipeline#dimap by @adamgfraser in #8618
- Implement ZStream#takeWhileZIO by @adamgfraser in #8623
- Too big zio-test output fix by @urbit-pilled in #8614
- ZIO Test: Convert Rendering Failures to Test Failures by @adamgfraser in #8626
- Fix sequence config with shorter one issue by @kyri-petrou in #8624
- Indicate the true position of assertTrue arguments by @joroKr21 in #8642
- Execute Acquire in ScopedRef Uninterruptibly by @adamgfraser in #8638
- Propagate Regional Tags in Aspects Derived from Metrics by @adamgfraser in #8656
- Allow selecting test cases via
TestSelector
by @Duhemm in #8633 - support ZIO.readFile scala.js by @kaplan-shaked in #8632
FiberRuntime
optimizations by @kyri-petrou in #8671- Implement ZStream.fromTPriorityQueue by @adamgfraser in #8676
- fix: replace dashes in ConfigProvider.envProvider paths by @ThijsBroersen in #8680
- Compile contains in assertTrue tests. by @pablf in #8681
- Allowing comparisons between different types inside assertTrue by @pablf in #8684
- Detect defects in JUnit tests by @pablf in #8688
- Pass deprecated annotation to accessors by @pablf in #8689
- Report the current fiber in
Exception in thread "zio-fiber-X"
instead of the interruptor fiber by @neko-kai in #8687 - Avoid allocation in ZEnvironment.get [series/2.x] by @ghostdogpr in #8713
- Optimize fiber id and executor access [series/2.x] by @ghostdogpr in #8717
- Fix ConfigProvider#nested prefix by @wi101 in #8714
- Added correct fiberRef inheritance if use effect with timeout by @Roman-Statsura in #8721
- Use Chunk.single rather than Chunk.apply [series/2.x] by @ghostdogpr in #8719
- Use the requested strategy in ZStream mergeLeft/mergeRight by @ghostdogpr in #8743
- Remove never used
FiberRuntime.MaxTrampolinesBeforeYield
constant by @guizmaii in #8756 - Optimize
FiberId#isNone
by @guizmaii in #8746 - Optimize
ZIO#absolve
by @kyri-petrou in #8759 - Maintain bin compatibility with
v2.0.x
for methods used inzio/interop-cats
by @kyri-petrou in #8757 - Fix
Runtime#unsafe.fork
andRuntime#unsafe.runToFuture
by @kyri-petrou in #8752 - Optimize fork-join performance by @kyri-petrou in #8745
- ZPipeline.fromFunction benchmark and optimization by @eyalfa in #8761
- Revert binary incompatible change on
MutableConcurrentQueue
by @kyri-petrou in #8773 - Allow providing alternative implementations for generating
FiberId
s by @kyri-petrou in #8778 - Maintain backward compatibility of LinkedQueue by @ghostdogpr in #8784
- Improve UX of modifying runtime flags by @kyri-petrou in #8774
- Further optimize ch exec read by @eyalfa in #8775
- Reduce output for huge lists during pretty printing by @andrzejressel in #8692
- Fix awaiting of globally-scoped forked fibers when the app exits by @kyri-petrou in #8796
- Optimizations for FiberRuntime runloop by @kyri-petrou in #8800
- Allow application to exit on normal completion by @kyri-petrou in #8811
Other changes (CI, dependencies and documentation)
- Update Binary Compatibility Version by @adamgfraser in #8601
- Update scalajs documentation to be in line with latest zio2, scalajs by @jypma in #8613
- Fixed some minor typos by @nedmules-sked in #8616
- ZIO Ecosystem Docusaurus: Automate Project Discovery by @khajavi in #8641
- ZIO Ecosystem Contribution Guide by @khajavi in #8640
- Add Fhir Indexer to The sidebars.js File by @khajavi in #8639
- Add zio nebula graph to sidebar by @jxnu-liguobin in #8622
- zio-logging 2.2.0 website by @justcoon in #8645
- Update @zio.dev/zio-bson docs to 1.0.6 by @github-actions in #8646
- Update installation.md by @DoNotWorr in #8648
- Enable Redirection Plugin for ZIO Website #8647 by @sroopsai in #8651
- fix doc typo by @evis in #8650
- chore: removed ZTestFramework by @ezhil56x in #8652
- Update creating-sinks.md by @sangwoo-sean in #8658
- Gitter channel -> Discord Server by @hearnadam in #8628
- Update @zio.dev/zio-prelude docs to 1.0.0-RC23 by @github-actions in #8663
- Refine ZIO Ecosystem Contribution Guide by @khajavi in #8643
- Update @zio.dev/zio-sbt docs to 0.4.0-alpha.23 by @github-actions in #8665
- zio-logging 2.2.1 website by @justcoon in #8669
- Update operations.md by @gcsolaroli in #8694
- Update @zio.dev/zio-sbt docs to 0.4.0-alpha.24 by @github-actions in #8685
- Update @zio.dev/zio-query docs to 0.6.1 by @github-actions in #8698
- fix(deps): update dependency @zio.dev/zio-metrics-connectors to v2.3.1 by @renovate in #8727
- fix(deps): update dependency @zio.dev/zio-profiling to v0.3.0 by @renovate in #8728
- fix(deps): update dependency @zio.dev/zio-schema to v1 by @renovate in #8730
- chore(deps): update dependency typescript to v5.4.4 by @renovate in #8725
- fix(deps): update dependency @zio.dev/zio-http to v3.0.0-rc6 by @renovate in #8707
- fix(deps): update dependency @zio.dev/zio-logging to v2.2.2 by @renovate in #8709
- fix(deps): update dependency @zio.dev/zio-telemetry to v3.0.0-rc21 by @renovate in #8722
- fix(deps): update dependency @zio.dev/zio-kafka to v2.7.4 by @renovate in #8708
- fix(deps): update dependency @zio.dev/zio-quill to v4.8.3 by @renovate in #8710
- Update @zio.dev/zio-kafka docs to 2.7.4 by @github-actions in #8691
- fix(deps): update dependency @zio.dev/zio-config to v4.0.1 by @renovate in #8705
- fix(deps): update dependency @zio.dev/zio-ftp to v0.4.2 by @renovate...
2.1.0-RC5
An issue was found in the RC4 so we decided to release a RC5 directly.
What's Changed
- Allow application to exit on normal completion by @kyri-petrou in #8811
Full Changelog: v2.1.0-RC4...v2.1.0-RC5
2.1.0-RC4
This version contains a few more performance improvements as well as some changes to maintain binary compatibility with ZIO 2.0.x so that there is no need to upgrade all libraries using ZIO. It is expected to be the last release candidate: if no major issues are discovered, we are planning to release a final 2.1.0 in about a week. Please report if you find anything!
EDIT: one issue has been found, will cut a RC5 shortly: #8811
What's Changed
- Revert binary incompatible change on
MutableConcurrentQueue
by @kyri-petrou in #8773 - Revert changes in #8660 by @kyri-petrou in #8777
- Allow providing alternative implementations for generating
FiberId
s by @kyri-petrou in #8778 - Maintain backward compatibility of LinkedQueue by @ghostdogpr in #8784
- Improve UX of modifying runtime flags by @kyri-petrou in #8774
- Further optimize ch exec read by @eyalfa in #8775
- Reduce output for huge lists during pretty printing by @andrzejressel in #8692
- Fix awaiting of globally-scoped forked fibers when the app exits by @kyri-petrou in #8796
- Optimizations for FiberRuntime runloop by @kyri-petrou in #8800
CI Updates
- Publish with Java 11 rather than 17 by @ghostdogpr in #8780
- Update Mima checked version by @guizmaii in #8795
- Give more memory to build website CI job by @ghostdogpr in #8798
- Improve GHA execution time by @kyri-petrou in #8810
- Update Scala, dependencies and sbt plugins by @guizmaii in #8760
Documentation Updates
- fix(deps): update dependency @zio.dev/zio-telemetry to v3.0.0-rc22 by @renovate in #8776
- Remove outdated comparison with Future from the tagline by @ghostdogpr in #8788
- fix(deps): update dependency @zio.dev/zio-profiling to v0.3.1 by @renovate in #8799
- fix(deps): update dependency @zio.dev/zio-config to v4.0.2 by @renovate in #8801
- Fixed #8782 - User has incorrect rights by @Yummy-Yums in #8802
- Fix typo in docs: FiberRef reference page by @DanBondarenko in #8809
- Update these docs for 2.0 by @AndyKirsch in #8803
- Update ZIO HTTP Related Guides by @khajavi in #8806
New Contributors
- @AndyKirsch made their first contribution in #8803
- @Yummy-Yums made their first contribution in #8802
- @DanBondarenko made their first contribution in #8809
Full Changelog: v2.1.0-RC3...v2.1.0-RC4
2.1.0-RC3
We found a regression in 2.1.0-RC2 causing compile errors with ZLayer.make
or ZIO#provide
. The change causing these errors has been reverted and we're making a RC3 right away so that more people can test the recent runtime improvements.
What's Changed
- Revert "Build fresh layers once with ZLayer macro (#8678)" by @ghostdogpr in #8768
Full Changelog: v2.1.0-RC2...v2.1.0-RC3
2.1.0-RC2
This release candidate builds on the previous ZIO runtime system improvements delivered in the 2.1-RC1 to add major improvements in forking and joining fibers. Our ForkJoin
benchmark is about 6x faster than in 2.0.x, and close to 20x faster when you disable FiberRoots
(which is recommended for high performance).
We've also changed the default behavior to disable auto-blocking detection by default because it could cause some performance degradation in some cases. Better heuristics might be introduced in the future, but in the meantime you can enable it by using the Runtime.enableAutoBlockingExecutor
aspect. We also added an optional executor based on Loom that you can use if your Java version is 21 or higher. It looks like our default ZScheduler
is faster when forking a lot of fibers, but depending on your use case, you might want to try this new executor using the Runtime.enableLoomBasedExecutor
aspect.
Because of the amount of changes, we decided to release a new release candidate first, and hope to get people to test it and report any issue. We will probably do a minor RC3 with a few fixes but are hoping to release 2.1.0 soon. Note that this version is binary compatible with 2.0.x with the exception of a few internal classes that should not be used anywhere else, but if you find any incompatibility issue, please let us know.
Known issues:
- Regression in ZLayer.make #8767
What's Changed
- Add TestAspects afterFailure and afterSuccess by @hanneshauer in #8588
- Implement TestAspect.afterAll Success and Failure Variants by @adamgfraser in #8590
- Prevent implicit widening to Double by @erikvanoosten in #8594
- Restore Permits by @adamgfraser in #8599
- Race Interruptibly In Channel.mergeAllWith by @adamgfraser in #8600
- Return CompletableFuture Immediately by @adamgfraser in #8605
- Add
asBase64String
toChunk
by @987Nabil in #8606 - add Config methods for NonEmptyChunk by @mberndt123 in #8607
- Implement NonEmptyChunk#groupBy and NonEmptyChunk#groupMap by @adamgfraser in #8608
- [Scala 3] Prevent Tag materialization for intersection types in covariant position by @joroKr21 in #8612
- Implement ZPipeline#dimap by @adamgfraser in #8618
- Implement ZStream#takeWhileZIO by @adamgfraser in #8623
- Too big zio-test output fix by @urbit-pilled in #8614
- ZIO Test: Convert Rendering Failures to Test Failures by @adamgfraser in #8626
- Fix sequence config with shorter one issue by @kyri-petrou in #8624
- Indicate the true position of assertTrue arguments by @joroKr21 in #8642
- Execute Acquire in ScopedRef Uninterruptibly by @adamgfraser in #8638
- Propagate Regional Tags in Aspects Derived from Metrics by @adamgfraser in #8656
- Allow selecting test cases via
TestSelector
by @Duhemm in #8633 - support ZIO.readFile scala.js by @kaplan-shaked in #8632
- Use More Specific Type by @adamgfraser in #8660
FiberRuntime
optimizations by @kyri-petrou in #8671- Implement ZStream.fromTPriorityQueue by @adamgfraser in #8676
- Build fresh layers once with ZLayer macro by @pablf in #8678
- fix: replace dashes in ConfigProvider.envProvider paths by @ThijsBroersen in #8680
- Compile contains in assertTrue tests. by @pablf in #8681
- Allowing comparisons between different types inside assertTrue by @pablf in #8684
- Detect defects in JUnit tests by @pablf in #8688
- Pass deprecated annotation to accessors by @pablf in #8689
- Report the current fiber in
Exception in thread "zio-fiber-X"
instead of the interruptor fiber by @neko-kai in #8687 - Avoid allocation in ZEnvironment.get [series/2.x] by @ghostdogpr in #8713
- Optimize fiber id and executor access [series/2.x] by @ghostdogpr in #8717
- Fix ConfigProvider#nested prefix by @wi101 in #8714
- Added correct fiberRef inheritance if use effect with timeout by @Roman-Statsura in #8721
- Use Chunk.single rather than Chunk.apply [series/2.x] by @ghostdogpr in #8719
- Use the requested strategy in ZStream mergeLeft/mergeRight by @ghostdogpr in #8743
- Remove never used
FiberRuntime.MaxTrampolinesBeforeYield
constant by @guizmaii in #8756 - Optimize
FiberId#isNone
by @guizmaii in #8746 - Optimize
ZIO#absolve
by @kyri-petrou in #8759 - Maintain bin compatibility with
v2.0.x
for methods used inzio/interop-cats
by @kyri-petrou in #8757 - Fix
Runtime#unsafe.fork
andRuntime#unsafe.runToFuture
by @kyri-petrou in #8752 - Optimize fork-join performance by @kyri-petrou in #8745
- ZPipeline.fromFunction benchmark and optimization by @eyalfa in #8761
Documentation Updates
- Update @zio.dev/zio-telemetry docs to 3.0.0-RC20 by @github-actions in #8587
- Update @zio.dev/zio-jdbc docs to 0.1.2 by @github-actions in #8589
- Fix Broken Newsletter's Link by @khajavi in #8593
- Update Copyright by @adamgfraser in #8596
- Update scalajs documentation to be in line with latest zio2, scalajs by @jypma in #8613
- Fixed some minor typos by @nedmules-sked in #8616
- Update @zio.dev/zio-prelude docs to 1.0.0-RC22 by @github-actions in #8627
- Revert "Update @zio.dev/zio-prelude docs to 1.0.0-RC22" by @khajavi in #8637
- ZIO Ecosystem Docusaurus: Automate Project Discovery by @khajavi in #8641
- ZIO Ecosystem Contribution Guide by @khajavi in #8640
- Add Fhir Indexer to The sidebars.js File by @khajavi in #8639
- Add zio nebula graph to sidebar by @jxnu-liguobin in #8622
- zio-logging 2.2.0 website by @justcoon in #8645
- Update @zio.dev/zio-bson docs to 1.0.6 by @github-actions in #8646
- Update installation.md by @DoNotWorr in #8648
- Enable Redirection Plugin for ZIO Website #8647 by @sroopsai in #8651
- fix doc typo by @evis in #8650
- Update creating-sinks.md by @sangwoo-sean in #8658
- Gitter channel -> Discord Server by @hearnadam in #8628
- Update @zio.dev/zio-prelude docs to 1.0.0-RC23 by @github-actions in #8663
- Refine ZIO Ecosystem Contribution Guide by @khajavi in #8643
- Update @zio.dev/zio-sbt docs to 0.4.0-alpha.23 by @github-actions in #8665
- zio-logging 2.2.1 website by @justcoon in #8669
- Update operations.md by @gcsolaroli in #8694
- Update @zio.dev/zio-sbt docs to 0.4.0-alpha.24 by @github-actions in #8685
- Update @zio.dev/zio-query docs to 0.6.1 by @github-actions in #8698
- fix(deps): update dependency @zio.dev/zio-metrics-connectors to v2.3.1 by @renovate in #8727
- fix(deps): update dependency @zio.dev/zio-profiling to v0.3.0 by @renovate in #8728
- fix(deps): update dependency @zio.dev/zio-schema to v1 by @renovate in #8730
- chore(deps): update dependency typescript to v5.4.4 by @renovate in #8725
- fix(deps): update dependency @zio.dev/zio-http to v3.0.0-rc6 by @renovate in #8707
- fix(deps): update dependency @zio.dev/zio-logging to v2.2.2 by @renovate in #8709
- fix(deps): update dependency @zio.dev/zio-telemetry to v3.0.0-rc21 by @renovate in #8722
- fix(deps): update dependency @zio.dev/zio-kafka to v2.7.4 by @renovate in #8708
- fix(deps): update dependency @zio.dev/zio-quill to v4.8.3 by @renovate in #8710
- Update @zio.dev/zio-kafka docs to 2.7.4 by @github-actions in #8691
- fix(deps): update dependency @zio.dev/zio-config to v4.0.1 by @renovate in #8705
- fix(deps): update dependency @zio.dev/zio-ftp to v0.4.2 by @renovate in #8706
- chore(deps): update dependency typescript to v5.4.5 by @renovate in https...
2.0.22
This release contains a few performance improvements that were backported to the 2.0.x branch so you can benefit from them sooner (the "current" branch is for 2.1.x, for which a RC2 will probably be released in the coming weeks). These changes, in particular the FiberRuntime
one, have shown a ~10-15% improvement in some benchmarks.
What's Changed
FiberRuntime
optimizations by @kyri-petrou in #8672- Avoid allocation in
ZEnvironment.get
by @ghostdogpr in #8712 - Optimize fiber id and executor access by @ghostdogpr in #8716
- Use
Chunk.single
rather thanChunk.apply
by @ghostdogpr in #8718
Full Changelog: v2.0.21...v2.0.22
2.0.21
What's Changed
- Correct Run to Future docs and provide an example by @gnp in #8577
- ZIO Test: Include Error Message When Spec Run As App Fails by @adamgfraser in #8584
- fix ambiguity checks in ZLayer#provide macro by @myazinn in #8580
- Do not emit non-0 exit code for failing tests when running with IntelliJ by @hmemcpy in #8583
- Fix a typo in "Queue". by @martinpovolny in #8586
- Update @zio.dev/zio-telemetry docs to 3.0.0-RC20 by @github-actions in #8587
- Update @zio.dev/zio-jdbc docs to 0.1.2 by @github-actions in #8589
- Add TestAspects afterFailure and afterSuccess by @hanneshauer in #8588
- Implement TestAspect.afterAll Success and Failure Variants by @adamgfraser in #8590
- Prevent implicit widening to Double by @erikvanoosten in #8594
- Fix ScheduleSpec when run on last day of year by @erikvanoosten in #8595
- Fix Broken Newsletter's Link by @khajavi in #8593
- Update Copyright by @adamgfraser in #8596
- Restore Permits by @adamgfraser in #8599
New Contributors
- @martinpovolny made their first contribution in #8586
- @hanneshauer made their first contribution in #8588
Full Changelog: v2.0.20...v2.0.21
v2.1-RC1
What's Changed
- Correct Run to Future docs and provide an example by @gnp in #8577
- ZIO Test: Include Error Message When Spec Run As App Fails by @adamgfraser in #8584
- fix ambiguity checks in ZLayer#provide macro by @myazinn in #8580
- Do not emit non-0 exit code for failing tests when running with IntelliJ by @hmemcpy in #8583
- ZIO Runtime System Improvements (2.1 candidate) by @jdegoes in #8582
- Fix a typo in "Queue". by @martinpovolny in #8586
New Contributors
- @martinpovolny made their first contribution in #8586
Full Changelog: v2.0.20...v2.1-RC1
2.0.20
What's Changed
- ZIO Stream: Inherit FiberRefs After Running Channel Finalizers by @adamgfraser in #8535
- ZIO Test: Add Variants Of TestResult Constructors by @adamgfraser in #8536
- Update Documentation by @adamgfraser in #8545
- Preserve Interruptibility In ZPool#get by @adamgfraser in #8541
- ZIO STM: Add Convenience Methods For TMap by @adamgfraser in #8540
- Add isEmpty and clear methods to the ConcurrentMap by @ytalashko in #8548
- Optimize Differ by @adamgfraser in #8549
- Smart assertions equalTo explicitly providing optional diff by @BanyMaciej in #8550
- scala 3 smart assertions macro fix for class with same named field an… by @BanyMaciej in #8551
- optimize ZStream.absolve by @paulpdaniels in #8558
- Allow
contains
in an assertion to be passed a subtype when there's … by @shawjef3 in #8561 - Fair Semaphore by @adamgfraser in #8554
- Use Unbounded Queue by @adamgfraser in #8552
- ZIO Metrics: Simplify Quantiles Calculation by @adamgfraser in #8562
- Preserve Scopes In Stream Operators by @adamgfraser in #8574
- Propagate Interruption in ZStream#flatMapPar by @adamgfraser in #8575
New Contributors
- @ytalashko made their first contribution in #8548
- @BanyMaciej made their first contribution in #8550
Full Changelog: v2.0.19...v2.0.20