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 toZRef
that allows transforming aRef
by "zooming in" on one field in a case class or data structure. This allowsRef
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 withZRef
.- implement retry (#3566) (by @adamgfraser)
- โ Add ZIO.tupled (#3565) (by @luis3m)
- ๐ Redesign ZManaged around an embedded ReleaseMap (#3510) (by @iravid)
- โ Add someOrElse to ZSTM, ZIO and ZManaged (#3560) (by valenterry)
- โ Add Schedule noDelay and run (#3554) (by @reibitto)
- Explore Initial Encoding of ZLayer (#3483) (by @adamgfraser)
- โ Add Operators (#3541) (by @adamgfraser)
- โ Add ZQueue.takeBetween (#3520) (by @mijicd)
- ๐ Synchronize Tag typeclass naming with izumi-reflect, rename Tagged->Tag, deprecate old names (#3508) (by @neko-kai)
- ๐ improve reentrant lock performance (#3099) (by @unclebob418)
- โ Add NonEmptyChunk constructors (#3517) (by @simpadjo)
- implement ZLayer#tapError (#3505) (by @adamgfraser)
- โ Add ZIO#filterNot and ZSTM#filterNot (#3477) (by @taeguk)
- ๐ Use ChunkBuilder more prominently in Chunk (#3453) (by @mschuwalow)
- Implement ZManaged#useNow (#3466) (by @adamgfraser)
- Implement ZManaged#flattenM (#3464) (by @adamgfraser)
- Implement ZIO#service (#3422) (by @adamgfraser)
- โ Add specialized accessor operations to Chunk (#3431) (by @whysoserious)
- โฌ๏ธ Scala.js upgrade to v1.0.0 (#2392) (#2479) (by @lvitaly)
- Back up Chunk[Boolean] by Chunk.BitChunks (#3419) (by @whysoserious)
- โก๏ธ Optimize TQueue (#3421) (by @mijicd)
- โ Add alternative combinator to ZSTM (#3414) (by @mijicd)
- implement ZLayer#launch (#3415) (by @adamgfraser)
- ๐ Improve TArray's performance (#3407) (by @mijicd)
- Implement ZIO#mapEffect (#3404) (by @adamgfraser)
- Implement ZRefM (#3391) (by @adamgfraser)
- ๐ Boost TMap performance (#3382) (by @mijicd)
- ๐ Improve Support for NonEmptyChunk (#3374) (by @adamgfraser)
- โ Add support for setting Random seed (#3367) (by @reibitto)
- โฌ๏ธ drop implicit CanFail constraint from stm orElse combinator (and related ones) (#3370) (by @swachter)
- implement variants for other ZIO effect types (#3351) (by @adamgfraser)
- ๐ Make Chunk Extend IndexedSeq (#3342) (by @adamgfraser)
- ๐ Improve TMap's performance (#3343) (by @mijicd)
- Implement BitChunk (#3318) (by @adamgfraser)
- implement orElseOptional (#3339) (by @adamgfraser)
- Bring Chunk to (Z)STM (#3345) (by @mijicd)
- ๐ Improve TMap transformations (#3340) (by @mijicd)
- Implement Optics for ZRef (#3258) (by @adamgfraser)
- ๐ Improve Error Messages with Has (#3319) (by @adamgfraser)
- implement corresponds (#3320) (by @adamgfraser)
- ๐ Performance on Chunk.apply (#3297) (by @ahoy-jon)
- implement convenience methods (#3313) (by @adamgfraser)
- โก๏ธ Optimize unsafe ZQueue methods (#3274) (by @mijicd)
- Prototype for NonEmptyChunk (#3241) (by @ahoy-jon)
- implement unwrap (#3267) (by @adamgfraser)
- โ add andTo and >+> to ZLayer (#3269) (by @felher)
- Introduce ZTRef (#3266) (by @vasilmkd)
- ๐ Improve fiber dump output (#3192) (by @simpadjo)
- core: Add
unless/unlessM
as dual ofwhen/whenM
(#3259) (by @sirthias) - โ Add *WithTrace variants for error handling combinators (#3145) (by @mvv)
- implement envs and properties (#3244) (by @adamgfraser)
- implement isFailure and isSuccess (#3228) (by @adamgfraser)
- JS Promise interop (#3163) (by @vasilmkd)
- implement ++ (#3224) (by @adamgfraser)
- implement fromDuration (#3221) (by @adamgfraser)
- Check if queue is empty before polling (#3222) (by @mijicd)
- ๐ Improve ZQueue performance (#3216) (by @mijicd)
- implement dimap (#3209) (by @adamgfraser)
- ZIO Core: Implement Cause#stripDefects (#3206) (by @adamgfraser)
- Prevent retry storms on ZSTM (#3210) (by @mijicd)
- ZIO Core: Disconnect Children in Uninterruptible Race (#3125) (by @adamgfraser)
- โ Add managed option combinators (#3186) (by @paulpdaniels)
- โ Add operator alias for
andThenEither
(#3185) (by @ioleo) - implement forkAs (#3131) (by @adamgfraser)
- Implement ZIO#collectAll_ (#3148) (by @adamgfraser)
- Implement Random#between (#3149) (by @adamgfraser)
- ๐ fix randomDelay (#3147) (by @adamgfraser)
- โ Add STM aliases (#3129) (by @mijicd)
- ZIO Core: Add Named Aliases for ZLayer Operators (#3116) (by @adamgfraser)
- Port reject/rejectM to ZManaged (#3109) (by @vpavkin)
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 useZStreamChunk
. 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 usingZSink
'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 maintainingZSink
'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 ofZSink
is to process a stream and emit one final result.๐ If you've been using
ZSink
for aggregations (usingZSink.foldLeft
and other operators), you should see little change to your code. In some cases, operators that were previously sinks have been migrated toZTransducer
- 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!
- โ Add termination strategies for ZStream#merge (#3543) (by @luis3m)
- โ Add ZStream#interruptAfter and ZStream#haltAfter (#3534) (by @luis3m)
- Modify ZStream.fromQueue to no longer use singleton chunks (#3571) (by @luis3m)
- Modify ZStream#toIterator to use chunks (#3569) (by @luis3m)
- โ Add Transducer#zip (#3551) (by @simpadjo)
- Implement ZStream#intersperse (#3514) (by @fagossa)
- ๐ Fix ZStream.toInputStream handling of signed bytes (#3546) (by @lancelet)
- โ add ZTransducer#mapOutput (#3523) (by @simpadjo)
- โ Add ZTransducer.splitOn (#3519) (by @regiskuckaertz)
- โ Add ZSink#mapError (#3501) (by @simpadjo)
- Redesign ZStream as the ZConduit hierarchy (#3079) (by @iravid)
- โ Add
ZStream#haltWhen(IO)
andZStream#interruptWhen(IO)
(#3306) (by @jeremyrsmith) - โ Add ZStream.fromIterator versions that capture exceptions. (#3195) (by @alexknvl)
- ZStream error refinement. (#3196) (by @alexknvl)
- โ Added drop and skip constructors. (#3190) (by @alexknvl)
- โ Added ZStream.fromInputStreamEffect and ZStream.fromInputStreamManaged. (#3198) (by @alexknvl)
โ ZIO Test
๐ In this release the implementation of
TestClock
has been updated. The concept offiberTime
has been eliminated. As a result, methods such ascurrentTime
will always return the time that is set by the user using methods such assetTime
. 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.- โ ZIO Test: Make TestClock Run Effects In Order (#3424) (by @adamgfraser)
- โ ZIO Test: Improve Ergonomics of Laws for Higher Kinded Types (#3356) (by @adamgfraser)
- ๐ Fix handling of zero probability values in Gen.weighted (#3544) (by @felher)
- check bounds (#3532) (by @adamgfraser)
- โ ZIO Test: Improve Management of Resources in Specs (#3456) (by @adamgfraser)
- โ ZIO Test: Support Laws for Capabilities Parameterized on Two Types (#3420) (by @adamgfraser)
- โ Add AssertionM for effectfull assertions (#3403) (by @senia-psm)
- โ ZIO Test: Support Laws for Higher Kinded Types (#3326) (by @adamgfraser)
- implement generators for chunks (#3321) (by @adamgfraser)
- implement advance (#3304) (by @adamgfraser)
- ๐คก Varargs support in mockable (#3292) (by @senia-psm)
- ๐ Varargs support in accessible (#3283) (by @senia-psm)
- implement Gen#bigDecimal (#3295) (by @adamgfraser)
- โ ZIO Test: Use Suite Execution Strategy in ProvideSomeLayerShared (#3256) (by @adamgfraser)
- implement bigInt (#3282) (by @adamgfraser)
- ๐คก ZIO Mock support for impure methods, ZStream and ZSink (#3247) (by @ioleo)
- suspend generators (#3245) (by @adamgfraser)
- โ implement only test aspect (#3248) (by @adamgfraser)
- โ Rename TestAspect failure -> failing (#3231) (by @ioleo)
- ๐คก ZIO Mock handle polymorphic methods (#3136) (by @ioleo)
- โ Add assertions to zio-test (#3142) (by @Michaelt293)
- ZIO Macros: Polymorphic accessors (#3170) (by @ioleo)
- โ Add isNative to TestAspect, TestPlatform, and TestAspectSpec (#3160) (by @LeeTibbert)
- ๐ Move macros into main repository (#3122) (by @ioleo)
- implement generators for map and set (#3123) (by @adamgfraser)
- โ add type aliases (#3120) (by @adamgfraser)
- โ ZIO Test: Implement Laws (#3111) (by @adamgfraser)