Releases: typelevel/fs2
v2.5.0
The 2.5.0 release is the first stable release on Cats 2.3.0 and Cats Effect 2.3.0, built for Scala 2.12, 2.13, 3.0.0-M3 and 3.0.0-M2.
➜ git shortlog -sn --no-merges "v2.4.6".."v2.5.0"
16 Scala Steward
8 Michael Pilquist
4 mpilquist
2 Diego E. Alonso Blas
1 Lars Hupel
1 Channing Walton
1 Gabriel Volpe
1 Akhtiam Sakaev
v3.0.0-M6
FS2 3.0.0-M3 is the fourth milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.
The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-Mx release notes provide a great overview of the changes.
If you're coming from FS2 2.x, be sure to check out the release notes for v3.0.0-M1.
The primary changes in this release are:
- Support for Scala 3.0.0-M2
git shortlog -sn --no-merges "v3.0.0-M3".."v3.0.0-M6"
12 Scala Steward
9 Michael Pilquist
5 mpilquist
4 Diego E. Alonso Blas
1 anikiforov
1 Lars Hupel
1 Channing Walton
1 Gabriel Volpe
1 Akhtiam Sakaev
v2.5.0-M3
v2.4.6
This is a maintenance release for the 2.4 series and is fully backwards compatible with previous releases.
This release is built for Scala 2.12, 2.13, and Scala.js 1.3.0. Scala.js 0.6 support has been dropped now that it is EOL.
This release fixes a bug that prevented interruption of a stream that had been translated (#2143).
v3.0.0-M3
FS2 3.0.0-M3 is the third milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.
The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-Mx release notes provide a great overview of the changes.
If you're coming from FS2 2.x, be sure to check out the release notes for v3.0.0-M1.
The primary changes in this release are:
- Support for Scala 3.0.0-M1
- All dependencies are natively built for Scala 3.0.0-M1 now (no _2.13 cross builds)
git shortlog -sn --no-merges "v3.0.0-M2".."v3.0.0-M3"
56 Fabio Labella
12 Michael Pilquist
9 Domas Poliakas
9 Scala Steward
8 Diego E. Alonso Blas
7 mpilquist
2 Diego E. Alonso-Blas
v2.5.0-M1
v.2.4.5
This is a maintenance release for the 2.4 series and is fully backwards compatible with previous releases.
This release is built for Scala 2.12, 2.13, and Scala.js 1.3.0. Scala.js 0.6 support has been dropped now that it is EOL.
This release fixes 2 important bugs found in the 2.4.4 release:
- Keep chunk structure when encoding text (#2096)
- Slightly optimize
Monad.pure
forStream
(#2099) - Fix race condition in reactive streams (#2076)
- Fix resource leak that occurs when parent scope is closed during resource acquisition (#2074)
- Prevent double completion of deferred during scope interruption (#2056)
- Support TLS application protocol selection (#2036)
- Add
scan1Semigroup
toStream
(#2029) - Improve buffer usage in
compression
(#2014) - Create chunks in
Stream.fromIterator
(#2013)
git shortlog -sn --no-merges "v2.4.4".."v2.4.5"
35 Scala Steward
34 mpilquist
11 Michael Pilquist
10 Daniel Vigovszky
4 Chris Davenport
4 Ben Plommer
4 Gabriel Volpe
3 Sarunas Valaskevicius
2 vbergeron
2 Lars Hupel
2 Lucas Satabin
2 Robert Marek
1 Piotr Gawryś
1 Akshay Sachdeva
1 Fabio Labella
1 Diego E. Alonso-Blas
1 Andreas Büchel
1 satorg
1 Gavin Bisesi
v3.0.0-M2
FS2 3.0.0-M2 is the second milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.
The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-M2 release notes provide a great overview of the changes.
If you're coming from FS2 2.x, be sure to check out the release notes for v3.0.0-M1.
Besides integration with cats.effect.std.Dispatcher
, this release contains a few new features:
TimedPull
, a new type which simplifies implementing pulls that timeout (#2062)Stream.bracketFull
, providing the ability to have controlled interruptible resource acquisition (#2088)- Removal of
Stream#translateInterruptible
(#2082) - Addition of the
fs2.io.Network[F]
capability trait (#2071)
git shortlog -sn --no-merges "v3.0.0-M1".."v3.0.0-M2"
75 Fabio Labella
21 mpilquist
10 Daniel Vigovszky
7 Scala Steward
6 Michael Pilquist
3 Diego E. Alonso Blas
1 Lucas Satabin
1 Rafał Krzewski
1 Lars Hupel
1 satorg
v3.0.0-M1
FS2 3.0.0-M1 is the first milestone in the 3.x release series, featuring support for Cats Effect 3. Like Cats Effect 3, we expect a number of milestone releases before a 3.0.0 final release. Neither binary nor source compatibility with FS2 2.x is provided, though APIs are largely the same and porting should not be a large task.
The primary feature of FS2 3.0 is support for the Cats Effect 3 type class hierarchy. The Cats Effect 3.0.0-M1 release notes provide a great overview of the changes.
FS2 3 also includes some notable changes:
Stream Compilation
Streams are converted to effects via expressions like s.compile.toList
and s.compile.drain
. Calling s.compile
on a Stream[F, O]
requires an implicit Compiler[F, X]
(where X
is chosen based on the type of compilation requested).
In FS2 2.x, getting a Compiler[F, X]
instance for the effect F
generally required a Sync[F]
(this is not true for the Pure
and Fallible
effects but is otherwise accurate). In FS2 3, compilation now only requires a Concurrent[F]
. If a Concurrent[F]
is not available, then compilation falls back to using a Sync[F]
-- this allows stream compilation for effects like SyncIO
which do not have a Concurrent
instance.
In a polymorphic context, compilation is supported by either adding a Concurrent[F]
constraint, or if compilation of non-concurrent effects is needed as well, a Compiler.Target
constraint:
import fs2.{Compiler, Stream}
import cats.effect.Concurrent
// Allows compilation for any Concurrent[F] but not for things like SyncIO
def compileThis[F[_]: Concurrent, O](f: Stream[F, O]): F[Unit] = f.compile.drain
// Allows compilation for any Concurrent[F] or any Sync[F]
def compileThat[F[_]: Compiler.Target, O](f: Stream[F, O]): F[Unit] = f.compile.drain
No More Blocker
The cats.effect.Blocker
type was removed in CE 3 -- instead, Sync[F]
supports blocking calls via Sync[F].blocking(thunk)
. As a result, FS2 APIs that took a Blocker
have been simplified and in some cases, operations have been combined (e.g., lines
& linesAsync
have been combined to just lines
).
Sinks
The deprecated Sink
trait has finally been removed and we now represent sinks via a stream transformation that discards all output values -- Stream[F, O] => Stream[F, Nothing]
aka Pipe[F, O, Nothing]
. This is different than the old definition of Sink
which emitted an undefined number of Unit
values -- and as a result of the behavior being undefined, implementations varied widely. Implementations included emitting:
- 0 unit values
- 1 unit at termination of the source stream
- 1 unit per output element from source stream
- 1 unit per output chunk from source stream
- etc.
There are a few ergonomic improvements related to the new encoding of sinks:
Stream.exec(IO.println(...))
-Stream.exec
takes anF[Unit]
and returns aStream[F, Nothing]
Stream(1, 2, 3).foreach(IO.println)
- Theforeach
method onStream
takes aO => F[Unit]
and returns aStream[F, Nothing]
s.unitary
- Theunitary
method onStream
converts aStream[F, Nothing]
to aStream[F, Unit]
which emits a single unit at termination ofs
- Calling
flatMap
on aStream[F, Nothing]
no longer compiles, which avoids mistakes that result in unexpected behavior.
Capability Traits
The fs2-io project provides support for working with files and networks, abstracting the Java NIO APIs. The implementations require either Async[F]
or Sync[F]
depending on whether the underlying NIO API is non-blocking or blocking.
One of the main features of CE3 is the position of the Sync
and Async
type classes in the hierarchy. As the most powerful type classes, they are now firmly at the bottom of the hierarchy. To avoid requiring Sync
/ Async
constraints in code that uses fs2-io, we are adding capability traits -- traits which limit the capabilities of an effect to a discrete set of operations. The new fs2.io.file.Files[F]
capability trait provides the ability to work with files in the effect F
. For example:
def readAllText[F[_]: Files](directory: Path): Stream[F, String] =
Files[F].directoryStream(directory).flatMap { f =>
Files[F].readAll(f, 1024*1024)
.through(text.utf8Decode)
.through(text.lines)
}
The readAllText
method takes a Files[F]
capability instead of an Async[F]
, providing better parametric reasoning.
In future FS2 3 milestones, we'll be adding additional capability traits -- e.g., for networking / sockets.
Roadmap
Our goal is to release FS2 3.0.0 final in conjunction with Cats Effect 3.0.0 and Scala 3.0.0. We're planning on including some additional improvements in the milestones between now and then, including:
- Simplifying time limited pull operations via a new
TimedPull
construct (#2062) - Improving
Queue
-- both supporting the plannedQueue
in CE3 as well as providing a new, optimized queue implementation that supports stream concepts more directly (e.g., termination & error propagation).
Please provide feedback, both on existing features and the roadmap.
v2.4.4
This is a maintenance release for the 2.4 series which addresses and is fully backwards compatible with previous releases.
This release is built for Scala 2.12, 2.13, 0.26.0-RC1 and Scala.js 1.1.1. Scala.js 0.6 support has been dropped now that it is EOL.
This release fixes 2 important bugs found in the 2.4.3 release:
- Fix Chunk.traverse losing elements (#2002)
- Revert to released versions of cats and cats-effect (#2003)
git shortlog -sn --no-merges "v2.4.3".."v2.4.4"
3 Fabio Labella
2 Michael Pilquist
2 mpilquist