47 Degrees joins forces with Xebia read more

Fetch v1.0.0 released

Fetch v1.0.0 released

We’ve been hinting at a major redesign of the Fetch library in terms of cats-effect abstractions for awhile now, and finally, we can announce the release of v1.0.0. Fetch is an open source library for simple and efficient data access for Scala and Scala.js.

It’s a backwards-incompatible release that introduces numerous breaking changes as well as a couple of new features. It now should be easier to use and require less work from the user of the library, especially when you are already using cats-effect.

Breaking changes

  • Introduced the Data typeclass to identify requests to a data source
  • Redesigned DataSource to take an extra F[_] type parameter
  • Renamed fetchOne to fetch and fetchMany to batch
  • Data sources now can be implicitly constructed
  • Automatic parallel implementation of DataSource#batch in terms of ConcurrentEffect[F]
  • Removed FetchMonadError, a Fetch is now interpreted to a ConcurrentEffect
  • Removed Query, a data source now returns a F that has an implicit ConcurrentEffect[F]
  • Renamed DataSourceCache to DataCache, it now takes a Data instance as a parameter for insert and lookup and is parameterized to F
  • Renamed Env to Log

New features

  • Introduced Fetch#optional, an alternative to Fetch#apply for optional fetches
  • Different Data Sources now can have the same identity and result types

API changes

  • Fetch#run now requires a Timer[F] and ContextShift[F] from cats-effect
  • Fetch#apply no longer requires an implicit DataSource and must be passed explicitly
  • Renamed Fetch#runEnv to Fetch#runLog
  • Fetch#traverse, Fetch#sequence, Fetch#join & Fetch#collect deleted in favor of using cats typeclass ops

Documentation

  • Proof-of-concept Redis cache implementation of DataCache - #161
  • Removed Monix, Future and Twitter Future subprojects, most of them should work with cats-effect abstractions already
  • GrapQL query interpreter example - #178
  • Example using Monix Scheduler and Task to run fetches - #178

Massive thanks to Alejandro Gomez for all his work on the library and the rest of the Fetch contributors for helping get this project to where it is today.

Join us in the Fetch Gitter channel for questions, comments, or to get started contributing.

Ensure the success of your project

47 Degrees can work with you to help manage the risks of technology evolution, develop a team of top-tier engaged developers, improve productivity, lower maintenance cost, increase hardware utilization, and improve product quality; all while using the best technologies.