2.1.16
Highlights
This seemingly small release brings 2 new features to ZIO which library authors can utilize in order to provide a better DX for users. As usually, it also contains a number of optimizations, bug fixes, and it's fully binary and source-compatible with the rest of the v2.x series.
HasNoScope
evidence (#9604)
In ZIO, having a Scope
as an environment requirement indicates that the effect contains finalizers (e.g., closing an HTTP connection) which need to be handled at some point in the evaluation of the effect or the application's lifetime. In certain cases, we might want to ensure that an effect provided to a method does not contain any finalizers. Starting with this version of ZIO, users / library authors can use the HasNoScope
evidence for methods where the environment is generic, e.g.,:
def foo[R, A](f: ZIO[R, Nothing, A)(using HasNoScope[R]) = ???
val f1 = foo(ZIO.succeed("foo")) // compiles
val f2 = foo(ZIO.acquireRelease(ZIO.succeed("foo"))(_ => ZIO.unit)) // fails to compile
Note that this feature is primarily intended for use in libraries such as zio-http
where we need to ensure that a user-provided effect does not contain any finalizers.
Generic interfaces for non-empty collections (#9560)
This release introduces the NonEmptySeq
type class (which NonEmptyChunk
now extends) so that users / library authors can write generic code which requires non-empty collections as arguments.
What's Changed
- Mark
broacastDynamic
tests as flaky by @kyri-petrou in #9558 - Mark
Fiber
as sealed by @hearnadam in #9554 - Optimise
zio.stream.ZChannel#mapOutZIOPar
code by @guizmaii in #9556 - #9467 add peekAll to TQueue by @IgorDorokhov in #9476
- more general type for ZSink.last by @mberndt123 in #9506
- Add internal
Promise#succeedUnit
method to avoidExit
allocation when possible by @guizmaii in #9571 - Improve warning to
Chunk.fromArray
about array mutability by @kyri-petrou in #9576 - fix to SuiteAll macro, fail on missing type Spec if not imported by @kaplan-shaked in #9575
- Use an
inline given
for CanFail evidence in Scala 3 by @kyri-petrou in #9568 - add
stringValue
method tozio.Config.Secret
by @mberndt123 in #9580 - Implement generic interfaces for non-empty collections (#9559) by @987Nabil in #9560
- Optimise
ZIO::exit
encoding by @guizmaii in #9586 - Optimize
ZIO::flatMapError
encoding by @guizmaii in #9585 - Reduce cost of
Promise
creation by @guizmaii in #9603 - Clean
zio.stream.ZStream#toPull
code by @guizmaii in #9400 - Add
HasNoScope
type class (#9597) by @987Nabil in #9604
Other changes (CI, dependencies and documentation)
- fix(deps): update dependency @zio.dev/zio-json to v0.7.15 by @renovate in #9551
- Update magnolia to 1.3.11 by @zio-scala-steward in #9553
- fix(deps): update dependency @zio.dev/zio-json to v0.7.16 by @renovate in #9561
- Remove community project
zio-aws-s3
from doc as it's not maintained by @guizmaii in #9564 - Update zio-aws doc by @guizmaii in #9563
- Update magnolia to 1.3.12 by @zio-scala-steward in #9567
- chore(deps): update dependency prettier to v3.5.0 by @renovate in #9566
- Deprecate accessor methods in zio-kafka tutorial by @erikvanoosten in #9565
- fix(deps): update dependency @zio.dev/zio-json to v0.7.17 by @renovate in #9572
- fix(deps): update dependency @zio.dev/zio-prelude to v1.0.0-rc39 - autoclosed by @renovate in #9573
- fix: Flaky broadcastDynamic tests (#9555) by @gkfabs in #9557
- Bump actions/create-github-app-token from 1.11.2 to 1.11.3 by @dependabot in #9577
- fix(deps): update dependency postcss to v8.5.2 by @renovate in #9578
- fix(deps): update dependency @zio.dev/zio-bson to v1.0.8 by @renovate in #9579
- Update reactor-core to 3.7.3 by @zio-scala-steward in #9581
- fix(deps): update dependency @zio.dev/zio-json to v0.7.18 by @renovate in #9582
- fix(deps): update dependency @zio.dev/zio-redis to v1.0.1 by @renovate in #9583
- fix(deps): update dependency @zio.dev/zio-sbt to v0.4.0-alpha.31 by @renovate in #9584
- fix(deps): update dependency @zio.dev/zio-json to v0.7.19 by @renovate in #9588
- fix(deps): update dependency @zio.dev/zio-json to v0.7.20 by @renovate in #9591
- chore(deps): update dependency prettier to v3.5.1 by @renovate in #9590
- Update magnolia to 1.3.13 by @zio-scala-steward in #9594
- fix(deps): update dependency @zio.dev/zio-json to v0.7.21 by @renovate in #9599
- Update sbt-mdoc to 2.6.4 by @zio-scala-steward in #9595
- Update spring-core to 6.2.3 by @zio-scala-steward in #9596
- chore(deps): update dependency @types/react to v19.0.9 by @renovate in #9605
- Bump actions/create-github-app-token from 1.11.3 to 1.11.5 by @dependabot in #9607
- chore(deps): update dependency @types/react to v19.0.10 by @renovate in #9606
- Update magnolia to 1.3.14 by @zio-scala-steward in #9609
- fix(deps): update dependency @zio.dev/zio-json to v0.7.22 by @renovate in #9612
- fix(deps): update dependency @zio.dev/zio-json to v0.7.23 by @renovate in #9613
- fix(deps): update dependency react-icons to v5.5.0 by @renovate in #9615
- fix(deps): update dependency @zio.dev/zio-json to v0.7.24 by @renovate in #9614
- fix(deps): update dependency @zio.dev/zio-json to v0.7.25 by @renovate in #9618
- Tweaking the zio-kafka tutorial by @erikvanoosten in #9617
- fix(deps): update dependency postcss to v8.5.3 by @renovate in #9620
- fix(deps): update dependency @zio.dev/zio-schema to v1.6.2 by @renovate in #9619
- fix(deps): update dependency @zio.dev/zio-kafka to v2.11.0 by @renovate in #9621
- fix(deps): update dependency @zio.dev/zio-json to v0.7.26 by @renovate in #9627
- fix(deps): update dependency @zio.dev/zio-schema to v1.6.3 by @renovate in #9623
- fix(deps): update dependency react-markdown to v10 by @renovate in #9626
- chore(deps): update dependency prettier to v3.5.2 by @renovate in #9631
- fix(deps): update dependency @zio.dev/zio-json to v0.7.28 by @renovate in #9632
- Update sbt-scalafix, scalafix-testkit to 0.14.2 by @zio-scala-steward in #9628
- Update junit-platform-engine to 1.12.0 by @zio-scala-steward in #9630
- fix(deps): update dependency @zio.dev/zio-redis to v1.1.0 by @renovate in #9634
- fix(deps): update dependency @zio.dev/zio-json to v0.7.29 by @renovate in #9635
- fix(deps): update dependency @zio.dev/zio-logging to v2.5.0 by @renovate in #9636
- fix(deps): update dependency @zio.dev/zio-json to v0.7.30 by @renovate in #9637
- fix(deps): update dependency @zio.dev/zio-json to v0.7.31 by @renovate in #9641
- Bump JamesIves/github-pages-deploy-action from 4.7.2 to 4.7.3 by @dependabot in #9639
- fix(deps): update dependency @zio.dev/zio-json to v0.7.32 by @renovate in #9643
- Bump peter-evans/create-pull-request from 7.0.6 to 7.0.7 by @dependabot in #9640
- fix(deps): update dependency @zio.dev/zio-json to v0.7.33 by @renovate in #9644
- Update slf4j-simple to 2.0.17 by @zio-scala-steward in #9646
- Update magnolia to 1.3.15 by @zio-scala-steward in #9645
Full Changelog: v2.1.15...v2.1.16