Changelog History
Page 1
-
v1.0.3 Changes
October 08, 2020π This minor release contains a fix to a regression introduced in
v1.0.2
regarding tags. Upgrading is recommended for all users. This release is binary compatible withv1.0.0
.Notable Changes
ZIO Core
- Implement a ZIO#foreach Variant for Array (#4297) (by @adamgfraser)
- β± Implement ZIO#schedule (#4296) (by @adamgfraser)
- π Handle Heterogeneous Collections in ChunkBuilder (#4295) (by @adamgfraser)
- Generalize returnValue access in accessible macro (#4266) (by @timaliberdov)
ZIO Stream
- accessible accessors for ZStream/ZSink (#4223) (#4224) (by @dpovey)
- π Fix GZip compression for input >= 216 (#4299) (by @fsvehla )
β ZIO Test
- π Fixing JUnit test runner failure reporting (#4286) (by @dkarlinsky)
- β ZIO Test: Implement TestAspect.sized (#4301) (by @adamgfraser )
-
v1.0.2 Changes
October 06, 2020π This is a minor release containing bug fixes as well as some new features. It is binary compatible with
v1.0.0
.
π There's one breaking change on the ZStream data type - see the section below for details.Notable changes
ZIO Core
Implement ZLayer#project (#4123) (by @adamgfraser)
Immediately Shift to ZIO Thread Pool In UnsafeRunAsync (#4120) (by @adamgfraser)
π Improve Support For Single Threaded Environments (#4115) (by @adamgfraser)
π Support unsafeRunAsyncCancelable on Scala Native (#4131) (by @sideeffffect)
Implement TSet#toSet (#4132) (by @mijic)
π Fix Documentation of ZIO#firstSuccessOf (#4134) (by @ghostdogpr)
Implement ZLayer#tap (#4138) (by @adamgfraser)
π Fix Delay Computation In Schedule#fixed (#4147) (by @iravid)
Implement ZIO#getOrFailUnit (#4163) (by @politrons)
Implement ZIO.fromPromise (#4165) (by @politrons)
Don't transform to Chunk when using foreach in ZManaged (#4169) (by @ghostdogpr)
π Improve ZLayer how-to documentation (#4156) (by @leszekgruchala)
Implement ZIO#forkInternal (#4142) (@adamgfraser)
π Fix Memory Leak in FiberContext#await (#4171) (by @adamgfraser)
Prevent Interruption While Closing Scopes (#4121) (by @adamgfraser)
β Add some Schedule constructors for cron-like functionality (#4174) (by @heaven-born)
π Fix signature of effectBlockingIO (#4182) (by @adamgfraser)
Enable effectual filtering of Sets (#4188) (by @kelvin-chappell)
β Add some Schedule constructors for cron-like functionality: dayOfWeek (#4195) (by @heaven-born)
π Fix Bug in Chunk#foldRight (#4199) (by @adamgfraser)
Implement ZIO.not (#4201) (by @evis)
Introduce ZManaged.runtime (#4215) (by @fsvehla)
β± Use SetRemoveOnCanceledPolicy In Scheduler To Prevent Memory Leaks (#4237) (by @adamgfraser)
Don't Leak Fibers From Within ZIO#foreachParN (#4253) (by @adamgfraser)
β Remove thread factory hash from thread name (#4256) (by @mijicd)
Avoid Recomputing Hash Code In ZLayer (#4258) @adamgfraser)
β Add some Schedule constructors for cron-like functionality: dayOfMonth (#4212) (by @heaven-born)
Switch to java.lang.Class comparisons in Chunk.Tags (#4274) (by @iravid)
β± Implement Schedule#contramapM (#4271) (by @adamgfraser)ZIO Streams
π₯ BREAKING CHANGE: This release changes the behavior of
ZStream#collectWhileSuccess
to end the stream onExit.Failure
values instead of emitting those failures. Please useZStream#flattenExitOption
for the previous behavior.π Fix Gunzipper when consuming multiple gzipped parts as a single chunk (#4124) (by @ghostbuster91)
π Fix Bug In ZStream#fixed (#4140) (by @luis3m)
π Make ZStream#aggregateAsyncWithin fail fast (#4141) (by @luis3m)
β Add Back ZStream#effectAsync to JS (#4143) (by @luis3m)
β Add ZStream#takeRight (#4154) (by @luis3m)
π Fix BufferedPull#pullChunk (#4164) (by @mikearnaldi)
β Add ZStream#scan and its variants (#4153) (by @luis3m)
β‘οΈ Optimize ZStream.range to emit chunks (#4006) (by @TobiasPfeifer)
β Add a promise poll to ZStream#interruptWhen (#4166) (by @luis3m)
β Add ZStream.fromResource (#4228) (by @fsvehla)
β Add maxChunkSize to ZStream.fromQueue (#4205) (by @svroonland)
β Remove Some Extraneous Type Parameters (#4244) (by @adamgfraser)
Compile ZIO Streams for Scala Native (#4252) (by @sideeffffect)
β Add UStream alias for streams that can't fail (#4267) (by @erdeszt)
π Fix ZStream#takeWhile stopping on empty chunks (#4273) (by @iravid)
β Add a bunch of collect combinators (#4279) (by @iravid)β ZIO Test
Implement parallel checkM (#4221) (by @lightning95)
β Add LawfulF and LawsF for Divariant (#4220) (by @lemastero)
β Delete Gen.usASCII (#4236) (by @adamgfraser)
Evaluate Effects Sequentially In Gen#zipWith (#4238) (by @adamgfraser)
β Add example of testing layered effects with Clock (#4219) (by @leszekgruchala)
β Harden TestClock (#4248) (by @adamgfraser)
π Build ZIO Test for Scala Native (#4260) (by @sideeffffect)
Preserve Original Failure When Shrinks Is Set To Zero (#4265) (by @adamgfraser) -
v1.0.1 Changes
August 19, 2020π Maintenance release with some important bugfixes and nice feature additions. This release is binary compatible with
v1.0.0
.Notable changes
ZIO Core
π Improve Stack Safety Of Chunk (#4114) (by @adamgfraser)
π Fix Division By Zero In Schedule#fixed (#4111) (by @adamgfraser)
β± Implement Schedule#unionWith (#4113) (by @adamgfraser)
Don't Memoize Fresh Layers (#4095) (by @adamgfraser)
Implement ZManaged#reserve (#4056) (by @adamgfraser)
π make Chunk#append and Chunk#prepend stack safe (#4088) (by @adamgfraser)
β add a ZIO#foreach variant for Map (#4089) (by @adamgfraser)
suspend evaluation of by name parameter (#4086) (by @adamgfraser)
π Small fixes to Java interop (#4077) (by @sideeffffect)
π UseputStrLnErr
instead ofputStrLn
inZIO.exitCode
(#4080) (by @taeguk)
π Fix Schedule.unfold causing stack overflow (#4064) (by @tuleism)
report root fibers to the supervisor (#4048) (by @jczuchnowski )
π Fix Schedule#forever (#4057) (by @mikearnaldi)
π Fix Schedule.windowed repeating too fast (#4053) (by @tuleism)ZIO Streams
β Add ZStream#onError (#4097) (by @joroKr21)
β Add a GZIP transducer (#4075) (by @LGLO)
π Fix ZStream.grouped to produce correct group size (#4060) (by @tuleism)β ZIO Test
β Implement TestConfig (#4094) (by @adamgfraser)
β ZIO Test: Make ExecutedSpec Its Own Data Type (#3699) (by @adamgfraser) -
v1.0.0 Changes
August 03, 2020π We are excited to announce the release of version 1.0 of ZIO! This is the culmination of work by more than 300 contributors and countless users. From here we will be preserving binary compatibility for ZIO Core across the 1.0 cycle. This should facilitate further development of the ecosystem and adoption of ZIO, though this has been happening rapidly even without a 1.0 release!
π The vast majority of the changes in this version are bug fixes and implementation of new stream constructors and combinators.
π¨ The one material change to the API is to Schedule. Schedule has been refactored with a new design by @jdegoes to make it easier to build and compose schedules that occur at specific points in time. This will allow implementing cron job like functionality directly with Schedule. To facilitate this, combinators that use schedules such as
repeat
orretry
now depend onClock
. For simple use cases of repeating or retrying that do not involve time, such asretryWhile
, implementations have bene provided that do not depend onClock
. For more details see #3976.π Once again, thank you to everyone who has contributed to ZIO and to all the users who have tried it and given their feedback. We can't wait to see what you go out and build with it!
Notable changes:
ZIO Core
- π Handle Partial Ordering in TPriorityQueue (#3923) (by @adamgfraser)
- Unseal CanFilter(#3929) (by @neko-kai)
- β‘οΈ Update AccessibleMacro to properly handle ZManaged (#3807) (by @kentfrazier)
- β Add Console support for printing to standard error (#3925) (by @BardurArantsson)
- Chunk.foldWhileM should not advance iterator twice (#3967) (@YuvalItzchakov)
- β Add ZTransducer.utf16decode, ZTransducer.branchAfter (#3934) (by @mschuwalow)
- β Add ZInputZStream, ZOutputStream, ZManaged integrations with Java IO facilities (#3901) (by @adrianfilip)
- Prevent potential deadlock in ZIO#foreachPar (#3970) (by @adamgfraser)
- Harden stack corruption fix during interruption (#3992) (by @iravid)
- π Fix Potential Nontermination When Layer Fails With Error (#3994) (by @adamgfraser)
- β Add Chunk#reduceMapLeft/Right (#3998) (by @adamgfraser)
- β Add Either.cond Like Constructor to ZIO (#3854) (by @gerdreiss)
- β Add Schedule#resetAfter (#4000) (by @ghostdogpr)
- Convert ZManaged to an abstract class to allow binary-compatible evolution (#4009) (by @iravid)
- π Make Relevant Errors By Name (#3839) (by @yoohaemin)
- Prevent Corruption In Tags.fromValue on Scala.js (#4014) (by @adamgfraser)
- β Add isEmpty method to TMap (#4015) (by @tusharmath)
- Generalize Has.AreHas to Has.Union (#4013) (by @adamgfraser)
- β Add TSet.isEmpty (#4016) (by @tusharmath)
- β‘οΈ Update Dotty Version (#4030) (by @adamgfraser)
- Generalize Combinators for Effectually Transforming Collections (#4037) (by @adamgfraser)
- π Fix Bugs In Chunk#indexWhere and Chunk#mapAccumM (#4033) (by @adamgfraser)
- π Fix ZManaged parallel combinators: nested finalizer ordering (#4040) (by @iravid)
- Convert Traits To Abstract Classes (#4045) (by @adamgfraser)
- π¦ Implement Package Private Unsafe Combinators on ZRef (#4024) (by @adamgfraser)
- π Use Java Time Duration In ZIO (#4034) (by @adrianfilip)
- β Add Java Time Dependency On Scala.js (#3958) (by @mgenereu)
- β± Preview New Schedule (#3976) (by @jdegoes)
ZIO Streams
- β Integrate ZStream with java.io.Reader (#3928) (by @mijicd)
- β Add ZTransducer#8859_1 (#3920) (by @mschuwalow)
- β Add chunked pagination to ZStream (#3931) (by @mijicd)
- Implement ZStream.flattenChunks via BufferedPull (#3935) (by @mijicd)
- Implement ZStream.flattenIterable (#3936) (by @mijicd)
- β Add ZStream.unfoldChunk (#3945) (by @mijicd)
- inflate and gunzip transducers (#3825) (by @LGLO)
- ZStream.repeatEffectWith delays its outputs (#3959) (by @svroonland)
- Replace List with Chunk in ZTransducer.collectAllN (#3886) (by @svranesevic)
- β Add ZStream constructor from an OutputStream writer (#3664) (by @joroKr21)
- β Add ZSink.timed (#3982) (by @mijicd)
- π BOM fixes for ZTransducer#utfXXX (#3981) (by @mschuwalow)
- β Add ZTransducer.splitOnChunk (#3914) (by @TobiasPfeifer)
- refineToOrDie for ZStream (#3983) (@quelgar)
- Implement ZStream@takeUntilM (#4011) (by @adamgfraser)
- β Add ZTransducer.utfDecode to auto-detect byte order marks (#3980) (by @er1c)
- β Add ZTranducer#US-ASCII (#3947) (by @vinhhv)
- β Add ZTransducer.deflate (#4021) (by @LGLO)
- Implement ZTransducer@filterInput/filterInputM (#4036) (by @unclebob418)
- Implement ZSink.take (#4031) (by @adamgfraser)
β ZIO Test
- β Added LocalDateTime, LocalDate and BigGen to DeriveGen instances (#3951) (by @Adriani-Furtado)
- β Add Variance Annotations (#4027) (by @adamgfraser)
ZIO Macros
- β Add polymorphic service support in accessible macro (#3960) (by @timaliberdov)
- π New BoolAlgebra.all operator (#3857) (by @fokot)
- β Add TestAspect.untraced (#3984) (by @joroKr21)
- β Add default service method implementation support in accessible and mockable macros (#4022) (by @timaliberdov)
-
v1.0.0-RC21 Changes
June 19, 2020π We are excited to announce the release of ZIO 1.0.0-RC21, what we hope will be the final release candidate before version 1.0.
π From here we do not expect significant API changes and will be focused on fixing any bugs that are identified and polishing the API in anticipation of the 1.0 release. Please report any issues you experience with this release candidate so we can address them immediately. Thank you for your support!
Notable changes
ZIO Core
π The most significant change in this release candidate is refinements to the fiber supervision model. There is now a concept of explicit scopes, modeled by
ZScope
. Each fiber has a scope and when fibers are forked they are forked within a scope. Fibers forked withfork
are forked in the scope of the parent fiber and fibers forked withforkDaemon
are forked in the global scope. Fibers can now also be forked in another scope using theforkIn
operator. A variety of combinators are provided for composing scopes, offering powerful tools for library authors to achieve fine grained control of fiber lifetimes.π In general we do not expect significant user facing impact as a result of these improvements. The main changes that users should see are that fibers can now be safely forked in
zipPar
(for exampleleft.fork zipPar right
) and parallel construction of layers inZLayer
has been reenabled.π In addition, this release candidate features significant improvements to
Chunk
, including implementing fast single element prepend, addressing a stack safety issue, and improving the efficiency of operations on chunks created through concatenation.π¦ Finally, a new
TPriorityQueue
data structure has been included in thestm
package.- π ZIO.fromFuture: remove lazy val (#3707) (by @simpadjo)
- π Fix Type Inference Issue with ZIO.whenM and ZIO.unlessM (#3720) (by @adamgfraser)
- π Fix: unsafeRunToFuture should not block (#3718) (by @runtologist)
- Align Methods on Blocking Service with Accessors (#3725) (by @adamgfraser)
- β‘οΈ Update type aliases in ZLayer from succeed (#3736) (by @ahoy-jon)
- β Add resurrect (#3739) (by @ahoy-jon)
- Implement Fast Single Element Prepend for Chunk (#3747) (by @adamgfraser)
- π Better compile errors for pattern guards in for-comp (#3530) (by @simpadjo)
- π Make fromCompletionStage Referentially Transparent (#3755) (by @adamgfraser)
- π Replace ZIO[R, E, A] by aliases if possible + update documentation (#3741) (by @ahoy-jon and @bernit77)
- Implement Balanced Concatenation for Chunk (#3754) (by @adamgfraser)
- β Add conversion from Executor to Java (#3774) (by @tabdulradi)
- Implement TMap#size (#3790) (by @adamgfraser)
- Implement TMap#putIfAbsent (#3792) (by @adamgfraser)
- Implement TPriorityQueue (#3756) (by @adamgfraser)
- β‘οΈ Optimize TPriorityQueue (#3798) (by @adamgfraser)
- β Add rightOrFailWith and leftOrFailWith and error transform docs (#3408) (by @Fristi)
- Implement Chunk#zip and Chunk#zipAll (#3810) (by @adamgfraser)
- Implement TArray#size (#3815) (by @adamgfraser)
- β‘οΈ Implement updateService (#3812) (by @adamgfraser)
- π Improve Efficiency Of Chunk (#3831) (by @adamgfraser)
- π Synchronize access to the FiberRefLocals in inheritRefs (#3836) (by @iravid)
- π Make ChunkBuilder Public (#3837) (by @adamgfraser)
ZIO Streams
This release candidate features a variety of improvements and bug fixes thanks to feedback from users. In particular, sinks now maintain leftovers. This aspect of sink was dropped in the RC19 release, and has now been brought back due to popular demand. In addition,
ZStream#runHead
will now only consume the first element of the stream before exiting.- π Fix Stream#mapMPar (#3705) (by @luis3m)
- π Make ZInputStream construction lazy (#3701) (by @simpadjo)
- ZSink.collectAll and Zstream.runAll use chunk (#3587) (by @borissmidt)
- Prevent ZStream.repeatEffectChunkOption from evaluating after end (#3731) (by @iravid)
- π Fix ZStream#intersperse (#3730) (by @iravid)
- Correct a wrong type parameter name in method doc for ZStream.aggregateAsyncWithin (#3734) (by @svroonland)
- β Delete Transducer#zip (#3742) (by @simpadjo)
- β Add ZStream.repeat,repeatWith,tick (#3749) (by @iravid)
- π Fix ZStream#zipWithLatest (#3752) (by @luis3m)
- β Add ZSink.fromFile functionality (#3712) (by @lvitaly)
- π Fix interruption issue in aggregateAsyncWithinEither (#3751) (by @svroonland)
- π Make ZStream.runHead only pull one element (#3768) (by @iravid)
- β Add back support for leftovers in ZSink (#3722) (by @simpadjo)
- β Add ZStream.fromTcpSocketServer (#3677) (by @regis-leray)
- βͺ Restore ZSink#collectAllWhileWith (#3779) (by @simpadjo)
- ZSink#untilOutputM should respect leftovers (#3778) (by @simpadjo)
- β Add ZStream#runManaged (#3764) (by @simpadjo)
- π Fix ZStream#debounce interruption issue (#3765) (by @luis3m)
- π Fix ZStream.grouped (#3819) (by @simpadjo)
- β Add ZSink.managed (#3788) (by @simpadjo)
- Transducer.collect*N shouldn't emit empty chunks (#3827) (by @simpadjo)
- Introduce Concept of Explicit Scopes (#3829) (by @jdegoes)
- Reenable Parallel Construction of Layers (#3833) (by @adamgfraser)
- β Add a new
fromOptionError
operator (#3813) (by @paulpdaniels)
β ZIO Test
- β Add Additional Type Aliases for Laws (#3743) (by @adamgfraser)
- π Fix Type Signature of Contravariant Compose Law (#3746) (by @adamgfraser)
-
v1.0.0-RC20 Changes
May 25, 2020π This release features a number of important bugfixes for ZStream. Upgrading is advised!
Notable changes
ZIO Core
The return type for the
run
method inzio.App
has changed toZIO[ZEnv, Nothing, ExitCode]
.ExitCode
is a simple wrapper around an integer, with handy constructors for error and success (ExitCode.success
,ExitCode.failure
). In addition, a convenience combinatorZIO#exitCode
was added that converts aZIO
value to anExitCode
.- [Breaking] Add App ExitCode (#3583) (by @luis3m)
- β Add Chunk#nonEmptyOrElse (#3687) (by @simpadjo)
- Implement Fast Single Element Append for Chunk (#3416) (by @adamgfraser)
- π Fix Chunk.splitWhere (#3644) (by @KadekM)
- β Add combinators collectSome and collectSomePar (#3568) (by @ghidei)
- β Add ZIO#validateWith (#3617) (by @luis3m)
- ensure ZIO#fromFutureJava runs the parameter only once (#3702) (#3704) (by @fsarradin)
ZIO Streams
π We've seen in the last release that removing
Take[E, A]
and relying onExit[Option[E], Chunk[A]]
instead degrades ergonomics significantly when working with ZStream. So we went ahead and re-added it, this time as a wrapper overExit[Option[E], Chunk[A]]
. Apologies for the inconvenience!- π Modify ZStream#mergeWith implementation to use a queue (#3691) (by @luis3m)
- [Breaking] Add back ZStream.Take (#3669) (by @luis3m)
- Modify ZStream#debounce to take chunk last element (#3689) (by @luis3m)
- π Fix ZTransducer.splitLines (#3690) (by @iravid)
- π Fix debounce to properly handle empty chunks (#3611) (by @luis3m)
- π Fix memory leak in ZStream#forever (#3681) (by @iravid)
- β Add ZStream#zipWithNext & ZStream#zipWithPrevious (#3596) (by @luis3m)
- π Allow schedule on ZStream.repeatEffectWith rely on effect value (#3618) (by @luis3m)
- π Fix ZStream.fromInputStream (#3678) (by @iravid)
- π Maintain ZStream's laziness on chunks at the expense of performance (#3666) (by @iravid)
- β Add ZStream#flattenTake (#3661) (by @luis3m)
- π Fix ZSink#collectAllWhileWith (#3665) (by @simpadjo)
- [Breaking] ZSink.fromOutputStream should return Long (#3652) (by @simpadjo)
- π Fix ZStream#toInputStream error handling (#3700) (by @simpadjo)
- β Add ZStream.fromFile (#3697) (by @iravid)
β ZIO Test
- β ZIO Test: Close Resources Earlier In ProvideLayerShared (#3696) (by @adamgfraser)
-
v1.0.0-RC19 Changes
May 15, 2020π 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)
-
v1.0.0-RC18 Changes
March 03, 2020π ZIO 1.0.0-RC18 is the last expected release candidate for ZIO 1.0. There are no breaking changes between RC18 and 1.0, but no guarantees. The current plan is to release 1.0 within a few weeks after RC18, to ensure production-worthiness of 1.0.
Note: All deprecated methods will be deleted for ZIO 1.0.
ZIO Environment
Previously, the official recommended way to use ZIO Environment was to assemble pieces using inheritance to create larger environments out of smaller environments.
In the absence of proxies, this led to some pain around construction of the environment, because creating one class from other classes is not done using value-based operators, but inheritance-specific language features that do not permit abstraction.
Moreover, this approach had several drawbacks:
- Providing just part of an environment was difficult, and was not possible to do generically (the remaining part of the environment had to be known statically).
- β‘οΈ It was not possible to dynamically update parts of the environment inside scoped regions, which led to pain when trying to customize services in parts of the application.
Finally, the principal way to make a first service depend on a second service was to list a reference to the second service inside the first (recalling the Cake Pattern self-type). This led to a pattern whereby business logic would express its dependencies by using ZIO Environment, but all other parts of the application would express their dependencies using fields.
These problems have been solved in RC18 with the introduction of two new data types: Has and ZLayer. Together they have led to a new pattern of encoding environmental dependencies, which has been rolled out in ZIO Core services (Clock, Console, Random, System).
While it is still technically possible to use the older pattern, the official ZIO ecosystem (all projects in the ZIO organization on Github) will be migrated to the new pattern.
Has
The new recommended way to assemble environments involves using a new structure called Has. The Has data type has operators for building bigger environments out of smaller environments, including add, which adds a service to a Has, and concat, which merges two Has into one.
ZLayer
ZLayer is a value that represents a recipe for constructing some services in terms of other services. It is similar to a constructor in a Java or Scala application, which takes the services it depends on, and returns the service it constructs (constructor-based dependency injection). Unlike constructors, however, ZLayers are first-class values that compose type-safely in several ways, and they can construct many services, not just one. Additionally, they can describe the effectful and resourceful construction, such as connecting to a database, creating a database thread pool, and when the service is no longer required, freeing the thread pool, and disconnecting from the database.
π ZLayer represents the most power you could ever want in describing the construction of a service. In the end, almost all applications need something with this power (as witnessed by the fact that, generally, users of previous ZIO versions resorted to building the environment using ZManaged).
π ZLayers can be constructed using a variety of constructors in the companion object of ZLayer. They can be composed horizontally (when one service depends on another), and vertically (for two independent services). Services that are repeated in the graph are automatically shared, to avoid duplicate construction and release. Further, services that can be constructed in parallel are automatically constructed in parallel, to optimize service construction time.
The general pattern of ZIO Environment is now as follows:
type UserRepo = Has[UserRepo.Service]object UserRepo { trait Service { def getUserById(id: Id): Task[User] } def getUserById(id: Id): RIO[UserRepo, User] = ZIO.accessM(\_.get.getUserById(id)) }
Then typically, a
live
value is placed in the companion object of the service, which uses ZLayer to construct a production version of the service in terms of its dependencies:val live: ZLayer[Database, Nothing, UserRepo] = ???
Services may be provided to effects that need them using the ZIO#provideLayer method, e.g.
myEffect.provideLayer(UserRepo.live)
.ZIO Runtime System
Weak automatic supervision
Supervision is now backed by weak sets, which means that child fibers may be freely garbage collected when they cannot resume. This should address memory leaks in scenarios where large numbers of non-terminating fibers are created.
Structured concurrency
0οΈβ£ All child fibers are automatically bound to their parent fiber. When the parent fiber exits, the child fiber will be interrupted or disowned, as determined by the
SuperviseMode
it is forked with. The default supervision mode for forked fibers is interruption, which means that by default, when a parent fiber exits, its child fibers will be interrupted. This ensures fibers do not leak.π In order to recapture the previous behavior, one may use
forkDaemon
, ordisown
, which explicitly disowns a child fiber and moves it to a root set of fibers.Safer race
Race no longer forces either side to be interruptible. Users may have to perform
left.interruptible.race(right.interruptible)
to acquire the old behavior (which punched holes in uninterruptible regions); or possibly,left.disconnect.race(right.disconnect)
(if they want the effects to be keep running when interrupted, but in the background).π New combinators
Several new combinators are added:
πdisconnect
β disconnects interruption of the effect from its parent. This allows "early interruption" without waiting for finalization. It replaces the need for allxyzFork
variants, which are now deprecated. It's quite useful withrace
, with or withoutinterruptible
.
disown
β Called by a parent fiber to disown a child fiber. Relocates the child to the root set.π New ZIO.never
β When
ZIO.never
is forked, it will be garbage collected, soZIO.never.onInterrupt(putStrLn("Bye"))
will never execute the finalizer. This can be inconvenient for testing, soZIO.infinity
is added which is likenever
, but won't be garbage collected.Deletion of Daemon Mode
Daemon mode has been deleted because in practice, code never knows whether grandchildren should be daemons, only whether immediate children should be daemons; and generally, daemon mode is a one-off for a specific forked fiber.
In place of daemon mode,
effect.forkDaemon
can be used, which is the composition of two other operators: ordinaryfork
, followed by an immediatedisown
of the child fiber.π Deprecation of *Fork Variations
π All
xyzFork
variants are deprecated or removed. For example,bracketFork
. This is thanks to the newdisconnect
operator which allows for a much more compositional approach to solving this problem. Now if you don't want interruption of something to wait around for completion, just useeffect.disconnect
.π Performance enhancements for blocking effects
π Blocking effects has seen several enhancement regarding performance, with potential change in semantic:
- π Now, calling
lock
on a fiber first checks to see if the fiber is already on the correct Executor and does nothing if in that case; - βͺ
effectBlocking
doesnβt interrupt the underlying thread anymore in case of fiber interruption. If you want to revert to previous behavior, useeffectBlockingInterrupt
. - β‘οΈ
Blocking
executor ergonomics were updated to enhance thread reuse and limit risk to crash the server in case of massive thread leak.
ZIO General API
Laziness
Effect constructors are now lazy. This is done to ensure that if users embed side-effects in unexpected places, then errors are managed by ZIO.
π Deprecated traverse/sequence
π Rather than have duplicate names for operators, the decision was made to deprecate the "classic names" for traverse/sequence, in favor of friendlier and more descriptive names foreach/collectAll.
β ZIO Test
Inheritance Based Specs
0οΈβ£ Spes are now defined by inheriting from
DefaultRunnableSpec
instead of using constructor arguments:object ExampleSpec extends DefaultRunnableSpec { def spec = suite(βExampleSpec)( test(βaddition worksβ) { assert(1 + 1)(equalTo(2)) } ) }
β This provides a more natural syntax for writing tests and allows defining data or helper methods in the same object instead of requiring a separate utility object.
Type Safe Equality
β To provide increased type safety, the syntax for assertions has changed from
assert(1 + 1, equalTo(2))
toassert(1 + 1)(equalTo(2))
. This curried syntax allows the test framework to issue a compilation error if an equality assertion is comparing two unrelated types, catching bugs earlier. A ScalaFix migration rule is provided to automatically rewrite assertions to the new curried syntax.π Improved Test Console Behavior
π§ To facilitate debugging, by default the
TestConsole
will now render output to the standard output in addition to writing it to the output buffer. This feature is configurable on a scoped basis using thedebug
andsilent
methods onTestConsole
or the corresponding test aspects.β Test Annotations
π Test annotations provide flexible information for reporting metadata about tests. ZIO Test ships with a variety of test annotations that will automatically track metrics such as the number of ignored tests, the number of times a test was retried using
flaky
and the number of times a test was repeated usingnonFlaky
. Users can apply additional annotations using test aspects, for example timing the execution of tests and showing the slowest tests usingtimed
or labeling tests withtag
.β In the future test annotations will be the basis for additional structured test reporting to support rich analysis of test results both across suites and over time.
π€‘ Spy Mocking Functionality
π The
mock
package contains new functionality for spy mocks in theSpyable
trait. Spies have the ability to wrap an existing service and capture all method calls to the service being spied on as well as inputs and outputs, making it easy to verify the behavior of elements of complex systems. See the Scaladoc for additional information on this new feature.Providing The Environment
β The functionality provided by layers discussed above makes it much for users to provide tests with additional environmental requirements. In particular, the
provideCustomLayer
andprovideCustomLayerShared
methods make it extremely easy to add an additional dependency to theTestEnvironment
, which previously required significant boilerplate.π New Aspects
β A variety of new test aspects have been added to provide more flexibility than ever in modifying test execution:
- β
debug
β RendersTestConsole
output to standard output for the scope of a test. - β
diagnose
β Runs a test on its own fiber and performs a fiber dump of the test fiber and all of its children if the test does not complete within the specified time. This can be extremely useful for diagnosing concurrency bugs. - β
forked
β Runs each test on its own fiber. - β
noDelay
β Automatically runs all effects involving theTestClock
without it needing to be manually adjusted. - β
nonTermination
β Tests that an effect does not terminate within a specified time. - π
nondeterministic
β Runs each test with a random seed generated from the system time. - π
setSeed
β Sets the random seed for a test. This is useful to deterministically "replay" tests. - β
silent
β PreventsTestConsole
output from being rendered to standard output for the scope of a test. - β
tag
β labels tests with the specified tag. Tests can be filtered based on tags and tags will be displayed along with test output. - β
verify
β Verifies that a postcondition holds after each test.
β Additional Generator Combinators
A variety of additional combinators have been provided for composing generators. In particular, the
zip
variants allow composing multiple generators in parallel when the generators do not depend on each other. This allows for more efficient shrinking and can be particularly good for large case classes or similar data structure. Additional generators are also provided for types such asjava.util.UUID
.JUnit integration *
π A custom JUnit runner is provided for running ZIO Test specs under other build tools (like Maven, Gradle, Bazel, etc.) and under IDEs.
π To get the runner, add the equivalent of following dependency definition under your build tool:
libraryDependencies ++= Seq("dev.zio" %% "zio-test-junit"% zioVersion % "test")
π To make your spec appear as a JUnit test to build tools and IDEs, convert it to a class and annotate it with
@RunWith(classOf[zio.test.junit.ZTestJUnitRunner])
or simply extendzio.test.junit.JUnitRunnableSpec
.Automatic Derivation of Generators Powered By Magnolia
Automatic derivation of generators for case classes and sealed traits is now available powered by Magnolia. To get it, add the following to your dependencies:
libraryDependencies ++= Seq( βdev.zioβ %% βzio-test-magnoliaβ %% zioVersion % βtest )
You can then automatically derive generators for your own data types:
final case class Person(name: String, age: Int)val genPerson: Gen[Random with Sized, Person] = DeriveGen[Person]sealed trait Colorcase object Redextends Colorcase object Green extends Colorcase object Blueextends Colorval genColor: Gen[Random with Sized, Color] = DeriveGen[Color]
Experimental Polymorphic Generators
π ZIO Test now includes experimental support for polymorphic generators. These generators do not require the user to specify a particular type but instead generate random data from a variety of types that satisfy specified constraints, such as having an
Ordering
. This can be useful for testing highly polymorphic code in a generic way. See the examples in thezio.test.poly
package and please provide feedback on this feature.ZIO Streams
ZIO Streams includes a number of new combinators, which can be explored through the Scaladoc, but no significant breaking changes were introduced.
ZIO STM
ZIO STM has undergone a large amount of development work, adding more power, more safety, and more structures.
More Methods
STM now features many more methods, which mirror those on ZIO structures; and STM structures like TArray now have many more useful methods on them.
Stack Safety
π STM is now stack safe and can handle transactions of any size without stack overflows. This is achieved not with trampolining but by using exceptions for control-flow. There is a performance hit but it is minimal for the added stack safety.
Environment
STM itself has been generalized to ZSTM, permitting use of ZIO Environment. This is useful to embed STM structures directly into the environment, which allows transactions to operate against application-wide data structures, such as caches, counters, and the like.
π New Structures
TMap
TQueue
TReentrantLock
Contributors
There were a total of 67 contributors to RC18.
Thank you to Adam Fraser, Ajay Chandran, Alex Savin, Alexander van Olst, Bojan BabiΔ, Bojan BlagojeviΔ, Boris V.Kuznetsov, Chris Andre, dariusrobson, Dejan MijiΔ, Dmitry Karlinsky, Dragutin MarjanoviΔ, Evgeny Veretennikov, Fabio Serragnoli, felher, Ferdinand Svehla, Greg Holland, Ievgen Garkusha, Igal Tabachnik, ioleo, Isaias Bartelborth, Itamar Ravid, Jan Toebes, Jens Hoffmann, John A. De Goes, Jonathan Winandy, Kai, Koleman Nix, Laurynas Lubys, Luis Miguel MejΓa SuΓ‘rez, Marek Kadek, Mateusz SokΓ³Εβ, Matthias Langer, Maxim Davydov, Maxim Schuwalow, montrivo, Nadav Samet, Oleksandra Holubitska, Oliver Wickham, Pascal Mengelt, Pavel Shirshov, Pavels Sisojevs, PaweΕ Kiersznowski, peterlopen, Philippe Derome, Pierangelo Cecchetto, Pierre Ricadat, Rafael Saraiva Figueiredo, Regis Kuckaertz, reibitto, Richard Whaling, Roberto Leibman, Salar Rahmanian, Sergey Rublev, simpadjo, sken, svroonland, TapanVaishnav, Tibor Erdesz, Unclebob, Vasil Vasilev, Vasiliy Levykin, Vitalii, Wiem Zine El Abidine, wongelz, and Zachary Albia for your contributions to ZIO.
It is our incredible community of users and contributors that make ZIO possible.
-
v1.0.0-RC17 Changes
November 18, 2019Notable changes
π This release contains major changes related to how fiber supervision is working.
The new behavior is that a fiber will automatically be interrupted when its parent fiber is interrupted. To make forked fibers independent of their parents, use.daemon
.
π Previously existinginterruptChildren
,supervised
,unsupervised
,checkSupervised
,superviseStatus
have been removed in favor ofdaemon
,nonDaemon
,checkDaemon
anddaemonStatus
.ZIO
- Complete overhaul of supervision (#2169) by @jdegoes
- β Add fiber dumps with pretty printing for easier diagnostics (#2228) by @jdegoes
- β Add a new implicit instance
CanFail[E]
which provides implicit evidence that an effect with an error type E can fail, that is that E is not equal to Nothing. Requires such evidence to exist for ZIO combinators such as orElse that only make sense if an effect can fail (#2049) by @adamgfraser - Similarly, implements
NeedsEnv
so that useless combinators involving effects that don't require an environment don't compile (#2065) by @adamgfraser - β Add
ZIO.fromFunctionFuture
(#1961) by @jczuchnowski effectAsync
should not resume fiber twice after interruption (#1939) by @darl- β Add
withFilter
(#2114) by @wi101 - π Use
URIO
in type signatures where possible (#2092) by @joroKr21 - β Add
ZIO#doUntil
andZIO#doWhile
(#2147) by @adamgfraser Ignore
should not recover from unchecked exceptions (#2148) by @alexvanolst- π Reimplement
RaceWith
in the ZIO runloop for better performance (#2091) by @YuvalItzchakov - Adapt
ZIO.someOrFailException
to improve interop with error types (#2087) by @mlangc - π Fix
Cause
Definition of Equals and HashCode (#2220) by @adamgfraser - π Improve implementation of
InterruptStatus#isInterruptible
(#2188) by @sirthias
ZIO Stream
- β Add
ZStreamChunk#mapError
(#2064) by @vasilmkd - β Add missing
extends Serializable
to ZStream codebase (#2063) by @vasilmkd - π Make
ZStream.empty
,ZStream.fail
,ZStream.effectAsync
and others safe to pull again (#2051 #2139 #2189 #2197 #2198 #2199 #2227) by @vasilmkd - β Add
ZSink.fromFunctionM
(#2112) by @regiskuckaertz - β Add
ZStream#collectM
,collectWhileM
(#2094) by @saraiva132 - π Make
ZStream#chunkN
return an instance ofZStreamChunk
(#2125) by @saraiva132 - π Rename
transduce
,aggregate
andaggregateWithin
toaggregate
,aggregateAsync
andaggregateAsyncWithin
(#2099) by @simpadjo - β Add new shorthands for running ZStream:
runHead
andrunLast
(#2113) by @alexvanolst - β Add
access
andaccessM
to ZStream (#2249) by @pk044 - β Add more
ZStream#distributed
based combinators (#2157) by @mschuwalow
β ZIO Test
- β Add a new assertion
compile
that requires the specified string to be valid Scala code (#2215) by @adamgfraser - β Make Companion Objects of Test Environments Serializable (#2067) by @adamgfraser
- β
Implement
TestClock#setDateTime
(#2072) by @adamgfraser - Implement
Gen#long
(#2132) by @adamgfraser - β
Implement Overloaded Version of
TestAspect#nonFlaky
(#2140) by @adamgfraser - β
Implement
Except
Variants of Test Aspects (#2146) by @adamgfraser - β Adding
hasFirst
,hasLast
andhasAt
assertions (#2156) by @13h3r - π¨ Refactor
ZSpec
to Move All Test Failures to Error Channel (#2145) by @adamgfraser - Limit number of runs when using
flaky
(#2170) by @adamgfraser - β
Implement
TestAspect#nonFlakyPar
(#2176) by @adamgfraser - π Fix Type Inference Issue in
checkM
Variants (#2175) by @adamgfraser - π Fix Naming Conflict with
TestAspect#ignore
(#2184) by @adamgfraser - β
Suspend Effects in
testM
(#2190) by @adamgfraser - β Implement Warnings for Test Clock (#2191) by @adamgfraser
- π¦ Move Check Variants Back Into Package Object (#2181) by @adamgfraser
- π Improvements to
provideManagedShared
(#2192) by @adamgfraser - π Support Labeled Assertions (#2200) by @adamgfraser
- β Prevent Spurious TestClock Warnings (#2210) by @adamgfraser
- β Remove Creation of New Runtimes (#2213) by @adamgfraser
- π New Test Aspect
only
that when applied on a suite will ignore all tests that don't have the given substring in their label (#1838) by @dkarlinsky - π Fix Bug in
Gen#alphaNumericChar
(#2233) by @adamgfraser - π Improve Order of Parameters in
checkSome
(#2224) by @adamgfraser - π Fix Type Inference Issue With
TestAspect#retry
(#2218) by @adamgfraser - β Add generators for time datatypes (#2173) by @dieproht
STM
- β Add
TMap.merge
(#2097) by @regiskuckaertz - β Remove notion of immutability from TArray (#2111) by @Stefanqn
- π Make
TArray
factories return STM (#2141) by @smart-ass - π Support keys with negative hashCodes in
TMap
(#2203) by @laurynasl-wix
β± Schedule
- β± Rename
ZSchedule
toSchedule
(#2242) by @adamgfraser - π Rename
logInput
/logOutput
totapInput
/tapOutput
(#2050) by @mschuwalow - π Improve
onDecision
signature (#2089) by @YuvalItzchakov
ZManaged
- π Make parts of
ZManaged
private (#2124) by @stkeky - β Add
asError
,catchAllCause
,catchSomeCause
,collect,
collectM` (#2135 #2137 #2149) by @dkarlinsky - β Add
sandboxWith
,eventually
(#2151 #2161) by @saraiva132 - β Add
allocated
(#2158) by @mschuwalow - β Add
absorb
andabsorbWith
(#2116) by @alexvanolst - β Add
ZManaged.memoize
(#2016) by @mlangc
Chunk
- In
Chunk#flatMap
, construct result array from the back (#2165) by @vasilmkd - β Add
collectM
,collectWhileM
combinators (#2150) by @saraiva132 - π Fix
Chunk.size
that was always returning 0 (#2217) by @ajaychandran
Semaphore
- π Deprecate
acquire
,acquireN
,release
,releaseN
in favor ofwithPermits
(#1523) by @adamgfraser
Duration
- π Use
toMillis
for java infinity duration (#2209) by @TapanVaishnav
-
v1.0.0-RC16 Changes
October 28, 2019Notable changes
ZIO
- π¨ Refactor Schedule's encoding to accurately reflect required environment (#1798) by @mschuwalow
- β Add ZManaged.makeInterruptible (#2046) by @neko-kai
- π Make Fiber Composition Parallel (#2038) by @adamgfraser
- β Add TSet (#2029) by @mijicd
- β Add TMap (#2017) by @mijicd
- π Make Cause#foldLeft Stack Safe (#1990) by @adamgfraser
- β Add ZManaged aliases (#1999) by @ioleo
ZIO Stream
- β Add Chunk#mapAccumM and ZStreamChunk#mapAccumM (#2041) by @vasilmkd
- Implement ZSink#tapInput and ZSink#tapOutput (#2044) by @adamgfraser
- β Add
ZSink.splitOn
(#2006) by @regiskuckaertz - β Add error handling combinators to ZStreamChunk (#2002) by @vasilmkd
- Properly name ZStream#mapConcat* combinators (#2012) by @vasilmkd
- β Add ZStreamChunk#provide combinators (#2015) by @vasilmkd
- β Add ZStreamChunk#ensuring and ZStreamChunk#ensuringFirst (#2010) by @vasilmkd
- β Add Chunk#filterM and ZStreamChunk#filterM (#2011) by @vasilmkd
- Correct the type signature for
zio.stream.ZSink#optional
(#1988) by @gerdreiss - β Add dropUntil and takeUntil to ZStreamChunk (#1982) by @vasilmkd
β ZIO Test
π In this release, the mocking framework API has gone through complete overhaul to be more concise and feature better type inference. Notable changes:
- π The capability tags for default mock services are moved directly to modules companion object. Use
MockClock.nanoTime
instead ofMockClock.Service.nanoTime
; - π€‘ The expectations are now methods on capability tags. Use
MockRandom.nextInt._0(equalTo(1)) returns value(42)
instead ofMockSpec.expect_(MockRandom.Service.nextInt._0)(equalTo(1))(42)
; - π€‘ Assertions for input are now passed as arguments, e.g.
MockConsole.putStrLn(equalTo("foo")) returns unit
; - β
Stubbing returns is done via static methods
value
,valueF
,valueM
,failure
,failureF
,failureM
,unit
, andnever
inzio.test.mock.Expectation
; - β
Dummy services (expecting no calls) are constructed using a static method
nothing
fromzio.test.mock.Expectation
. For example,val dummyConsole = Expectation.nothing[MockConsole]
; - π€‘ The conversion to managed mock service is automatic and does not require any imports or type hints.
π For more examples, see MockingExampleSpec.
β Additional changes:
- β Make flaky retry tests that die (#2045) by @adamgfraser
- β Implement decorators for test environment (#2043) by @adamgfraser
- β Add Expectation.nothing (#2042) by @ioleo
- β Add assertCompletes (#2035) by @adamgfraser
- π¨ Refactor FailureDetails to report the entire error hierarchy (#1985) by @adamgfraser
- β Implement TestAspect#ifEnv (#1962) by @adamgfraser
- β Add suite selection and support multiple terms (#2014) by @reibitto
- π€‘ Overhaul the mocking framework (#2000) by @ioleo