All Versions
16
Latest Version
Avg Release Cycle
30 days
Latest Release
1267 days ago

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 with v1.0.0.

    Notable Changes

    ZIO Core

    ZIO Stream

    βœ… ZIO Test

  • 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 on Exit.Failure values instead of emitting those failures. Please use ZStream#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)
    πŸ‘‰ Use putStrLnErr instead of putStrLn in ZIO.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 or retry now depend on Clock. For simple use cases of repeating or retrying that do not involve time, such as retryWhile, implementations have bene provided that do not depend on Clock. 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

    ZIO Streams

    βœ… ZIO Test

    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 with fork are forked in the scope of the parent fiber and fibers forked with forkDaemon are forked in the global scope. Fibers can now also be forked in another scope using the forkIn 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 example left.fork zipPar right) and parallel construction of layers in ZLayer 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 the stm package.

    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.

    βœ… ZIO Test

  • 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 in zio.App has changed to ZIO[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 combinator ZIO#exitCode was added that converts a ZIO value to an ExitCode.

    ZIO Streams

    πŸš€ We've seen in the last release that removing Take[E, A] and relying on Exit[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 over Exit[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 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.

  • 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, or disown, 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 all xyzFork variants, which are now deprecated. It's quite useful with race, with or without interruptible.
    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, so ZIO.never.onInterrupt(putStrLn("Bye")) will never execute the finalizer. This can be inconvenient for testing, so ZIO.infinity is added which is like never, 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: ordinary fork, followed by an immediate disown of the child fiber.

    πŸ—„ Deprecation of *Fork Variations

    🚚 All xyzFork variants are deprecated or removed. For example, bracketFork. This is thanks to the new disconnect 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 use effect.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, use effectBlockingInterrupt.
    • ⚑️ 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)) to assert(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 the debug and silent methods on TestConsole 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 using nonFlaky. Users can apply additional annotations using test aspects, for example timing the execution of tests and showing the slowest tests using timed or labeling tests with tag.

    βœ… 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 the Spyable 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 and provideCustomLayerShared methods make it extremely easy to add an additional dependency to the TestEnvironment, 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 β€” Renders TestConsole 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 the TestClock 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 β€” Prevents TestConsole 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 as java.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 extend zio.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 the zio.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, 2019

    Notable 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 existing interruptChildren, supervised, unsupervised, checkSupervised, superviseStatus have been removed in favor of daemon, nonDaemon, checkDaemon and daemonStatus.

    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 and ZIO#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

    βœ… ZIO Test

    STM

    ⏱ Schedule

    ZManaged

    Chunk

    Semaphore

    • πŸš€ Deprecate acquire, acquireN, release, releaseN in favor of withPermits (#1523) by @adamgfraser

    Duration

  • v1.0.0-RC16 Changes

    October 28, 2019

    Notable changes

    ZIO

    ZIO Stream

    βœ… 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 of MockClock.Service.nanoTime;
    • 🀑 The expectations are now methods on capability tags. Use MockRandom.nextInt._0(equalTo(1)) returns value(42) instead of MockSpec.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, and never in zio.test.mock.Expectation;
    • βœ… Dummy services (expecting no calls) are constructed using a static method nothing from zio.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: