Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency co.fs2:fs2-io to v3 #3963

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 21, 2022

WhiteSource Renovate

This PR contains the following updates:

Package Update Change
co.fs2:fs2-io (source) major 2.5.10 -> 3.2.7

Release Notes

typelevel/fs2

v3.2.7

Compare Source

Bug Fixes

Full Changelog: typelevel/fs2@v3.2.6...v3.2.7

v3.2.6

Compare Source

NOTICE: DO NOT USE

A NullPointerException has been reported for this version. We recommend you avoid using this version and upgrade to next one.

Changes in the release
New Features
Bug Fixes
Refactoring
Upgrades
New Contributors

Full Changelog: typelevel/fs2@v3.2.5...v3.2.6

v3.2.5

Compare Source

New Features
Bug Fixes
Tech Debt
Upgrades

Full Changelog: typelevel/fs2@v3.2.4...v3.2.5

v3.2.4

Compare Source

Improvements
Bugfixes
Build
Upgrades

Full Changelog: typelevel/fs2@v3.2.3...v3.2.4

v3.2.3

Compare Source

New Features
Bug Fixes
Docs
Build & Upgrades
New Contributors

Full Changelog: typelevel/fs2@v3.2.2...v3.2.3

v3.2.2

Compare Source

What's Changed
New Contributors

Full Changelog: typelevel/fs2@v3.2.1...v3.2.2

v3.2.1

What's Changed

Full Changelog: typelevel/fs2@v3.2.0...v3.2.1

v3.2.0

Compare Source

FS2 3.2.0 supports Scala 2.12, 2.13, and 3.1 and Cats Effect 3.

This release features the incorporation of scodec-stream and codec-protocols in to fs2 proper.

  • The fs2-core module has a new fs2.Scan type for building compositional, pure, stateful transformations.
  • The fs2-core module also has a new fs2.timeseries package for working with time stamped streams.
  • The new fs2-scodec module defines the fs2.interop.scodec package, defining StreamDecoder and StreamEncoder
  • The new fs2-protocols module provides various examples of using these types.

Checkout the time series and scodec sections of the guide for more information.

What's Changed

Full Changelog: typelevel/fs2@v3.1.6...v3.2.0

v3.1.6

Compare Source

What's Changed
New Contributors

Full Changelog: typelevel/fs2@v3.1.5...v3.1.6

v3.1.5

Compare Source

What's Changed

Full Changelog: typelevel/fs2@v3.1.4...v3.1.5

v3.1.4

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

FS2 3.1.4 is a bug fix release focused on performance.

What's Changed
New Contributors

Full Changelog: typelevel/fs2@v3.1.3...v3.1.4

v3.1.3

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

FS2 3.1.3 is a bug fix release focused on performance.

Bugfixes:
  • Fix bug in translate (#​2614)
  • Fix UnixSockets class path detection logic (#​2624)
Improvements:
  • Remove unnecessary indexing in Chunk combinators (#​2630)
  • Make indexed traversal of Chunk.Queue amortized logarithmic time (#​2631)
  • Improve performance of parEvalMapUnordered (#​2626)
  • Implement Files#realPath (#​2622)
  • Simplify internals (#​2625)
  • Refactor implementation of groupWithin (#​2619)
  • Reworked parJoin to work with transformers (#​2563)
Acknowledgments
➜  git shortlog -sn --no-merges "v3.1.2".."v3.1.3"
     8  mpilquist
     7  Michael Pilquist
     6  Scala Steward
     5  Vasil Vasilev
     2  Arman Bilge
     2  Diego E. Alonso Blas
     1  Tim Spence

v3.1.2

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

FS2 3.1.2 is a bug fix release which addresses a couple of memory leaks in certain types of streams.

Improvements:
  • Fixed memory leak when parJoin is used with merge (#​2602)
  • Add a convenient shorthand for predicating effects on a boolean signal (#​2596)
  • Make Compression[F] cross-platform and implement on Node.js (#​2587)
  • Introduce fs2.io.ClosedChannelException (#​2582)
  • Special case for parEvalMap with max concurrency of 1 (#​2577)
Acknowledgments
➜  git shortlog -sn --no-merges "v3.1.1".."v3.1.2"
    12  Scala Steward
    11  Arman Bilge
     3  Stephen Judkins
     3  Diego E. Alonso Blas
     2  slice
     2  Michael Nikolich
     1  Ben Stewart
     1  mpilquist
     1  Adam Rosien

v3.1.1

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

FS2 3.1.1 is a bug fix release which addresses a memory leak in map on certain types of streams.

Improvements:
Acknowledgments
➜  git shortlog -sn --no-merges "v3.1.0".."v3.1.1"
     6  Michael Pilquist
     3  Arman Bilge
     2  Diego E. Alonso Blas
     2  Scala Steward
     1  Ross A. Baker
     1  Vasil Vasilev
     1  Christopher Davenport
     1  Philipp Hoffmann
     1  Rehan Mahmood

v3.1.0

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

FS2 3.1.0 features new support for Node.js in the fs2-io module, including cross platform APIs for TCP, UDP, TLS, and file management. The fs2.io.file package has been substantially revamped, removing all dependencies on Java APIs, providing a much nicer experience (though binary compatibility with 3.0.x is provided). The biggest change is the introduction of fs2.io.file.Path as an alternative for java.nio.file.Path -- the former has an idiomatic Scala API and works on both the JVM and Node.js. See the Files section of the microsite for some examples.

Features:
  • Update fs2.io.net to build for Node.js and JVM (#​2453)
  • Update fs2.io.file package to build for Node.js and JVM and remove dependencies on Java APIs (#​2519)
  • Implement unchunks as the inverse of chunks (#​2506)
Improvements:
Acknowledgments

Special thanks to @​armanbilge who implemented all of the Node.js support in fs2-io as well as in a number of downstream libraries!

➜  git shortlog -sn --no-merges "v3.0.6".."v3.1.0"
   121  Arman Bilge
    89  Michael Pilquist
     9  Scala Steward
     6  Andrew Valencik
     6  Diego E. Alonso Blas
     3  Jordi Olivares Provencio
     2  Stanislav Kovalenko
     2  nikiforo
     1  Jordi Olivares
     1  Giovanni Ruggiero

v3.0.6

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

Fixes:
  • Fixed regression in readOutputStream (#​2459)
  • Fix TLS socket read stall immediately after handshake (#​2461)
  • Avoid allocations in TLSEngine when logging is disabled (#​2462)
Improvements:
Acknowledgments
➜  git shortlog -sn --no-merges "v3.0.5".."v3.0.6"
     3  Vasil Vasilev
     2  Michael Pilquist
     1  Diego E. Alonso Blas
     1  Scala Steward
     1  nikiforo

v3.0.5

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

Fixes:
  • Fixed thread handling gotcha when using readOutputStream (#​2037 #​2383)
  • Fixed bug in sliding that delayed output by a chunk (#​2428)
  • Fixed a bug in TLSContext.insecure where TLS sessions would fail with NPE (#​2431)
  • Fixed TCP socket options to server and client sockets get correct options (#​2421)
Improvements:
Acknowledgments
➜  git shortlog -sn --no-merges "v3.0.4".."v3.0.5"
    24  Vasil Vasilev
    12  Scala Steward
     6  Diego E. Alonso Blas
     4  Erlend Hamnaberg
     1  Arman Bilge
     1  jilen
     1  Artem Nikiforov
     1  Ivan V. Smirnov
     1  Michael Pilquist

v3.0.4

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

Fixes:
  • Fixed memory leak in Channel which also impacted merge and other concurrent combinators (#​2408)
Acknowledgments
➜  git shortlog -sn --no-merges "v3.0.3".."v3.0.4"
     2  Scala Steward
     1  Diego E. Alonso Blas
     1  Jens Halm
     1  Juraj
     1  Michael Pilquist
     1  Rehan Mahmood
     1  nikiforo

v3.0.3

Compare Source

Supports Cats Effect 3 and built for Scala 2.12, 2.13, and 3 final.

Fixes:
  • Fixed memory leak in Stream#map (#​2394)
  • Fixed bug in file watching support when watching multiple files in same directory (#​2375)
  • Fixed bug in fixedRate and derived operations where dampening was not working (#​2386)
  • Fixed ClassCastException in Chunk (#​2380)
New Features:
  • Added fs2.io.net.unixsocket package to fs2-io, providing support for working with unix domain sockets. Supports both JEP380 (if running on JDK16+) or JNR (if dependency is added to class path) (#​2376)
  • Added Stream#meteredStartImmediately (#​2369)
  • Added Pull.loopEither (#​2368)
Performance
  • Reimplemented readOutputStream to avoid using JDK Piped{Input/Output}Stream (#​2383)
Acknowledgments
➜  git shortlog -sn --no-merges "v3.0.2".."v3.0.3"
    36  Vasil Vasilev
    24  Michael Pilquist
     6  Christopher Davenport
     6  Scala Steward
     2  shogan
     2  Pau Alarcón
     2  nikiforo
     1  Hugo van Rijswijk
     1  Fabio Labella
     1  Diego E. Alonso Blas
     1  Rehan Mahmood

v3.0.2

Compare Source

Built for Scala 2.12, 2.13, and 3.0.0-RC2/RC3.

Fixes:

  • Fixed stack safety of Stream#map (#​2354)

Documentation:

  • Clarified proper use of TLS servers and socket connection handling (#​2358)
Acknowledgments
➜  git shortlog -sn --no-merges "v3.0.0".."v3.0.2"
     9  Scala Steward
     5  Michael Pilquist
     4  Tim Spence
     1  Ross A. Baker
     1  William Narmontas

v3.0.0

Compare Source

FS2 3.0.0 is the first official release built for Cats Effect 3, focusing on integration with the new Cats Effect typeclasses and standard library.

Concurrency Support

The biggest API changes to FS2 are in the fs2.concurrent package:

  • The Queue (and InspectableQueue) types are gone in favor of cats.effect.std.Queue (#​2201)
  • There's a brand new implementation of Topic which no longer requires an initial element and is significantly faster. (#​2252)
  • There's a Channel type -- a multiple producer, single consumer concurrency primitive (#​2326)
  • Support for fanout via broadcast operations has been revamped and simplified (#​2312)
  • Support for balanced fanout has been removed, though it may return in a future release (#​2340)
  • The experimental PubSub type has been removed
  • There's a new TimedPull API which allows simpler implementations of custom pulls that timeout while awaiting elements (#​2062)
  • There's a new implementation of groupWithin which is significantly faster (#​2327)
Core Changes

One of the most exciting changes yet least visible changes in FS2 3.0.0 is the new interpreter. Stream compilation and evaluation is now handled by the Pull type thanks primarily to the work of @​diesalbla. This new interpreter is much easier to work with than the old FreeC based implementation.

Another notable change to core APIs is that they no longer take Sync constraints. Instead, they take the least powerful type class or capability trait possible. For example, Stream.duration requires a Clock[F] constraint instead of Sync[F].

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 an F[Unit] and returns a Stream[F, Nothing]
  • Stream(1, 2, 3).foreach(IO.println) - The foreach method on Stream takes a O => F[Unit] and returns a Stream[F, Nothing]
  • s.unitary - The unitary method on Stream converts a Stream[F, Nothing] to a Stream[F, Unit] which emits a single unit at termination of s
  • Calling flatMap on a Stream[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.

FS2 ships with some other capability traits:

  • fs2.io.net.Network -- revamped support for TCP, UDP, and TLS, built on Java NIO and ip4s
  • fs2.compression.Compression -- support for deflate and gzip
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
Acknowledgements

FS2 3.0.0 has been in the making for over a year and is the work of many individuals. Thanks to everyone who has contributed ideas, discussions, pull requests, etc.

➜  git shortlog -sn --no-merges "v2.5.3".."v3.0.0"
   375  Fabio Labella
   135  Michael Pilquist
   114  mpilquist
    50  Diego E. Alonso Blas
    21  Scala Steward
    19  nikiforo
    11  anikiforov
    10  LLCampos
     9  Domas Poliakas
     6  Dmitry Golubets
     5  Diego E. Alonso-Blas
     5  Raas Ahsan
     2  Ben Plommer
     1  Daniel Spiewak
     1  Luís Campos
     1  Niklas Klein
     1  Luis Martinez
     1  Rafał Krzewski
     1  Rob Norris
     1  Robert Marek
     1  Ryan Peters
     1  Lars Hupel
     1  Zach McCoy
     1  agadek
     1  Kirill
     1  Georgi Krastev
     1  Martins Purins

v2.5.11

Compare Source

Supports Cats Effect 2 and built for Scala 2.12, 2.13, and 3 final.

What's Changed

Full Changelog: typelevel/fs2@v2.5.10...v2.5.11


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/major-fs2version branch from b236f45 to b4a7cd6 Compare March 22, 2022 23:44
@renovate renovate bot force-pushed the renovate/major-fs2version branch 2 times, most recently from 7c7372b to 20a15d3 Compare March 30, 2022 12:29
@PenghaiZhang
Copy link
Contributor

Hold on until #3886 is completed.

@edalex-ian
Copy link
Member

Okay, #3886 now merged. Ready for you to proceed @PenghaiZhang

@PenghaiZhang
Copy link
Contributor

The problem is the dependency conflicts caused by sttp.

We're using sttp v1.7.2, but the latest version is v3.5.1.

@PenghaiZhang
Copy link
Contributor

Yes, after I updated sttp to v3.5.1, the dependency conflicts disappear. However, lots of Scala code now require changes...

@renovate renovate bot force-pushed the renovate/major-fs2version branch from 20a15d3 to fca4f30 Compare April 13, 2022 23:38
@PenghaiZhang
Copy link
Contributor

Cats-effect 3 has lots of breaking changes (it basically re-implements the whole IO according to the official migration guide) so here a few options for us.

  1. We update Cats to 3 and drop the use of IO.
  2. We update Cats to 3 and probably rework wherever IO is used.
  3. We update Cats and Fs2 to the latest v2. This means we can close this PR and merged chore(deps): update dependency co.fs2:fs2-io to v2.5.10 #3905 .

@PenghaiZhang
Copy link
Contributor

#3905 is now merged so we can close this one.

@renovate renovate bot force-pushed the renovate/major-fs2version branch from fca4f30 to 1774db8 Compare April 20, 2022 05:55
@edalex-ian
Copy link
Member

It does seem like maybe we do leave this as an incremental thing - i.e. option 3 above (get both on latest v2 versions) - and move to three next year... But I just want to have a quick look at current usage first.

@edalex-ian
Copy link
Member

@PenghaiZhang would you be able to cast your eye over #3324 and confirm it's still current/up to date. Because if needs be, we may end up closing this PR and using that to track next steps.

@PenghaiZhang
Copy link
Contributor

I can confirm that #3324 must be sorted before we upgrade fs2 to v3.

@edalex-ian
Copy link
Member

Okay, will close this in favour of tracking with #3324 and hopefully addressing in a future tech-debt push.

@edalex-ian edalex-ian closed this Apr 26, 2022
@edalex-ian edalex-ian deleted the renovate/major-fs2version branch April 26, 2022 22:33
@renovate
Copy link
Contributor Author

renovate bot commented Apr 26, 2022

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 3.x releases. But if you manually upgrade to 3.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants