ZIO v1.0.0-RC19 Release Notes

Release Date: 2020-05-15 // almost 4 years ago
  • ๐Ÿš€ Another packed release! This version features tons of improvements to existing data types and exciting changes to ZIO Streams. Read on for more details!

    A note on our roadmap

    ๐Ÿš€ Although we've promised that RC18 would be the last (or one-before-last) release before the mythical 1.0.0 release, we've seen some regressions caused by the supervision changes introduced in RC18.

    ๐Ÿš€ We have an exciting refinement to the model coming up in the following weeks. It is not included in this release, but will be included in the next one. Therefore, we anticipate that after RC19, we will release
    ๐Ÿš€ between 1-2 additional versions: one containing the supervision refinement, and optionally another release with follow-ups.

    We appreciate your patience and help in using ZIO and sending feedback and bug reports!

    Notable changes

    ZIO Core

    ๐Ÿš€ In this release a foldAll combinator has been added to ZRef that allows transforming a Ref by "zooming in" on one field in a case class or data structure. This allows Ref and friends to function as concurrent optics. A separate ZIO Optics library will be released in the near future with tools for doing this ways to lift optics from existing libraries to work with ZRef.

    ZIO Streams

    ๐Ÿš€ This release features a major re-design to the ZIO Streams module:

    All ZStream operators now work on chunks. Previously, to work with chunked streams, one would need to use ZStreamChunk. That data type is now deleted and instead all operators benefit from chunking automatically.

    ZSink has been radically simplified.

    The previous implementation featured leftovers: a property made it possible to use ZSink as a streaming parser. We've come to realize that any parser implemented using ZSink's combinators is probably slow and inefficient compared to an actual parser library. Moreover, we would never be able to match the performance of parsing libraries while maintaining ZSink's generality.

    Instead, we've decided to re-focus ZSink on modeling aggregations and accumulations. It is now more limited, but more efficient and easier to use: the purpose of ZSink is to process a stream and emit one final result.

    ๐Ÿ‘€ If you've been using ZSink for aggregations (using ZSink.foldLeft and other operators), you should see little change to your code. In some cases, operators that were previously sinks have been migrated to ZTransducer - see next bullet point.

    ๐Ÿ“œ For actual parsing usecases, stay tuned to the github.com/zio/zio-codecs project. Some exciting developments are in work there!

    ZTransducer has been added to accomodate aggregations that emit multiple results.

    Whereas ZSink's purpose is to return one final result when processing a stream, there are several usecases where it makes sense to process a stream and emit multiple results. For example - collecting elements into batches of a certain size; weighted folds; etc.

    For these purposes, ZTransducer should now be used.

    Big thanks to @regiskuckaertz and @simpadjo for their work on this re-design!

    โœ… ZIO Test

    ๐Ÿš€ In this release the implementation of TestClock has been updated. The concept of fiberTime has been eliminated. As a result, methods such as currentTime will always return the time that is set by the user using methods such as setTime. In addition, adjust will now suspend until all scheduled tasks have been completed. This should eliminate the need for external coordination such as promises and queues in most cases.