Releases: 7mind/izumi
0.10.2
What is it?
Izumi (jp. 泉水, spring) is an ecosystem of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.
including the following components:
- distage – Transparent and debuggable Dependency Injection framework for pure FP Scala,
- distage-testkit – Hyper-pragmatic pure FP Test framework. Shares heavy resources globally across all test suites; lets you easily swap implementations of component; uses your effect type for parallelism.
- distage-framework-docker – A distage extension for using docker containers in tests or for local application runs, comes with example Postgres, Cassandra, Kafka & DynamoDB containers.
- LogStage – Automatic structural logs from Scala string interpolations,
- BIO - A typeclass hierarchy for tagless final style with Bifunctor and Trifunctor effect types. Focused on ergonomics and ease of use with zero boilerplate.
- izumi-reflect (moved to zio/izumi-reflect) - Portable, lightweight and kind-polymorphic alternative to
scala-reflect
's Typetag for Scala, Scala.js, Scala Native and (soon) Dotty - IdeaLingua (moved to 7mind/idealingua-v1) – API Definition, Data Modeling and RPC language, optimized for fast prototyping – like gRPC or Swagger, but with a human face. Generates RPC servers and clients for Go, TypeScript, C# and Scala,
- Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
- Percept-Plan-Execute-Repeat (PPER) – A pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.
Changes since 0.10.1
Changes in BIO
:
- All bifunctor classes have been lifted to become trifunctor classes, Bifunctor classes are now type aliases to trifunctor classes that use type
lambdas ignoring the first parameter. AddedBIOFunctor3
,BIOBifunctor3
,BIOApplicative3
,BIOMonad3
,BIOGuarantee3
,BIOError3
,
BIOMonadError3
,BIOBracket3
,BIOPanic3
,BIO3
,BIOAsync3
,BIOTemporal3
,BIOFork3
(#942) - All trifunctor typeclasses will be automatically adapted to bifunctor typeclasses when required
- Added Reader trifunctor hierarchy -
BIOAsk
,BIOMonadAsk
,BIOLocal
- Added Arrow trifunctor hierarchy -
BIOProfunctor
,BIOArrow
,BIOArrowChoice
- Side hierarchies do not cause ambiguous implicit errors. It’s legal to have both
BIOMonad3
andBIOMonadAsk
as constraints, despite thatBIOMonadAsk
provides aBIOMonad3
. - Added microsite section for BIO
Changes in distage
:
- Updated to ZIO RC18-2, Added
HasConstructor
for assemblingzio.Has
environments from the object graph.
Addedmake[_].fromHas(_)
syntax for injection into ZIO environment forZLayer
,ZManaged
,ZIO
or anyF[_, _, _]: BIOLocal
:
You can now use:You can also use environment and parameter dependencies at the same time in one constructor:new ModuleDef { make[X].fromHas(zioEnvCtor) // or make[X].fromHas(zmanagedEnvCtor) // or make[X].fromHas(zlayerEnvCtor) } def zioEnvCtor: URIO[Has[Dep1] with Has[Dep2],X] def zmanagedEnvCtor: URManaged[Has[Dep1] with Has[Dep2],X] def zlayerEnvCtor: URLayer[Has[Dep1] with Has[Dep2],X]
make[X].fromHas(zioArgEnvCtor _) def zioArgEnvCtor(a: Arg1, b: Arg): RIO[Has[Dep1], X]
distage-extension-config
now usespureconfig
instead ofcirce-config
as backend - increased compatibility with HOCON (#905)- Added new syntax:
Injector.produceRunF
,Injector.produceEvalF
andDIResource[Locator].run
(#930) - Rename DIResource.
logAcquire/logRelease
towrapAcquire/wrapRelease
, deprecate old names (#949) - Added
DIResource.suspend
,.flatten
,.evalTap
(#875) - Fixed a bug where a binding could have broken equality and be filtered out after
ProviderMagnet.map
&ProviderMagnet.addUnused
(#956) - All
*Constructor
summoners now directly returnProviderMagnet
instead of their wrapper
Changes in distage-framework-docker
:
- Fixed a bug where docker containers with configuration
reuse=true
could be started multiple times if they were started at the same time (#961) - Docker network names are now also randomized, together with as ports and names. Added
ContainerNetworkDef
DSL to configure Docker networks (#963) - Added Bundled Docker containers for Cassandra and Zookeeper+Kafka (with network configuration) (#939)
- Fixed a bug where
ClientConfig.reuse
configuration was ignored in ContainerResource'srelease
action (#924)
Changes in distage-testkit-scalatest
:
- Fix compatibility with Scalatest
Matchers
and Scalamock'sMockFactory
traits, now they can be mixed in without errors (#959) - Prevent accidental ignoring of tests when test effect type doesn't match current (#948)
- Added
TestConfig.parallelEnvs
- allows control on whether to run tests in the current test environment in parallel with other test environments or not. Iffalse
, runs the test environment in a separate sequential with no other tests running in parallel (#912) - Added
TestConfig.forcedRoots
- forcibly attaches specified keys to every test as if these components are summoned as arguments in each test, can be used to forceacquire
/release
actions on resources in tests (#912) - Added
DistageBIOEnvSpecScalatest[F[_, _, _]]
syntax flavor, allows each test case to summon dependencies using ZIO environment and/or function parameters:trait PetStore[F[_, _]] { def purchasePet(name: String, cost: Int): F[Throwable, Boolean] } trait Pets[F[_, _]] def myPets: F[Throwable, List[String]] } val store = new PetStore[ZIO[Has[PetStore], ?, ?]] { def purchasePet(name: String, cost: Int): RIO[Has[PetStore], Boolean] = ZIO.accessM(_.get.purchasePet(name, cost)) } val pets = new Pets[ZIO[Has[Pets], ?, ?]] { def myPets: RIO[Has[Pets], List[String]] = ZIO.accessM(_.get.myPets) } final class PetTest extends DistageBIOEnvSpecScalatest[ZIO] with AssertIO { "test purchase pets env" in { for { _ <- store.purchasePet("Zab", 213) pets <- pets.myPets _ <- assertIO(pets.contains("Zab")) } yield () // : ZIO[Has[PetStore] with Has[Pets], Throwable, Unit] } // Lambda parameters and environment may both be used at the same time to define dependencies: "test purchase pets (param+env)" in { (store: PetStore[IO]) => for { _ <- store.purchasePet("Zab", 213) pets <- pets.myPets _ <- assertIO(pets.contains("Zab")) } yield ()) // : ZIO[Has[Pets], Throwable, Unit] } }
Changes in distage-framework
:
- Now Activations are also read from config, not only from command line. Use activations to choose between implementations to use for a component: (#911)
Toggle in
val module = new ModuleDef { make[PetStore[IO]].tagged(Repo.Dummy).from[InmemoryPetStore[IO]] make[PetStore[IO]].tagged(Repo.Prod).from[PostgresPetStore[IO]] }
Injector(Activation(Repo -> Repo.Prod))
, or in configuration:// application.conf activation { repo: prod }
- Rename
ConfigReader->DIConfigReader
. RenameDistageRolesModule->BundledRolesModule
. (#911) - Add
application.conf
to default configs in distage-framework (#909)
Changes in LogStage
:
- You can now customize JSON Rendering behavior on a per-type basis by defining instances of
LogstageCodec[A]
typeclass for your types.
LogstageCodec
can be derived in semiauto mode from Circe codecs if they exist:When usingimport io.circe.Codec import logstage.LogstageCodec import logstage.circe.LogstageCirceCodec final case class Abc(a: Int, b: String, c: Boolean) object Abc { implicit val circeCodec: Codec[Abc] = io.circe.derivation.deriveCodec[Abc] implicit val logstageCodec: LogstageCodec[Abc] = LogstageCirceCodec.derived[Abc] }
logstage.LogIO
/IzLogger
API, arguments without aLogstageCodec
instance will be rendered to JSON
as before. To forbid using any arguments without aLogstageCodec
instance in logging interpolations use
logstage.strict.LogIOStrict
/IzLoggerStrict
APIs. - Added
LogstageZIO.log
environment forwarder, you can use it to forward calls to aLogBIO[IO]
instance in your ZIO Environment - Added
LogBIO3
algebra for trifunctor effect types
Changes in fundamentals-json-circe
:
- Add
WithCirce
class...
0.10.1
What is it?
Izumi (jp. 泉水, spring) is a set of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.
including the following components:
- distage – Transparent and debuggable Dependency Injection framework for Pure FP Scala,
- logstage – Automatic structural logs from Scala string interpolations,
- idealingua – API Definition, Data Modeling and RPC Language, optimized for fast prototyping – like gRPC, but with a human face. Currently generates servers and clients for Go, TypeScript, C# and Scala,
- Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
- Percept-Plan-Execute-Repeat (PPER) – a pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.
Changes in distage
:
- Remove 22 arguments limit on class & trait constructors (#865)
- Factories can now be generated from abstract classes with parameters (
FactoryConstructor
) (#865) - Relax typeclass requirements for DIResource for
DIResource.liftF
&DIResource.LiftF
, now they need only Applicative/BIOApplicative, not Sync/BIO (#863) - Deprecate
Injector#produceUnsafe
, use lifecycle-aware.produce
instead. If you really needproduceUnsafe
behavior, useInjector().produce(_).unsafeGet()
(#862) - Fix #854 move all macro implementations into separate objects to prevent leaking references to scala-reflect (#859)
- Fix #869 workaround circe-config Boolean codec issue in logstage config circe/circe-config#12 (#871)
- Injector reboot API (#852)
Changes in distage-testkit-scalatest
:
- Enhanced parallel test reporting - reporting delay is now per-suite, not global (workaround for Intellij scalatest reporter incorrectly nesting parallel test cases) (#848)
- Fixed generated junit test reports under sbt (#861)
Changes in logstage
:
- logstage: Deprecate
ConsoleSink.json
because it requires an obscure wildcard import, useConsoleSink(LogstageCirceRenderingPolicy())
(#867)
Changes in idealingua
:
- Websocket client API is now wrapped in
F
(#847)
Merged PRs:
- Fix #853 Drop max 22 parameters restriction on class & trait constructors (#865)
- Fix #869 workaround circe-config Boolean codec issue in logstage config circe/circe-config#12 (#871)
- logstage: Deprecate
ConsoleSink.json
because it requires an obscure wildcard import, useConsoleSink(LogstageCirceRenderingPolicy())
(#867) - Improve documentation, document
Bootloader
(#866) - Compare original function in
Provider.equals
(#864) - logstage codec: macro infrastructure (#851)
- Introduce DIApplicative, relax requirements for DIResource methods (now liftF & LiftF need only Applicative, not Sync or BIO) (#863)
- Deprecate
Injector#produceUnsafe
(#862) - preserve reporters, as they should be suite based (#861)
- Fix #854 move all macro implementations into separate objects to prevent leaking references to scala-reflect (#859)
- generailized injector reboot support (#852)
- replaced unit with monoIO (#847)
- dealias types in constructor macros & ensure equality for generated singleton-type constructors (#850)
- distage-testkit scalatest sbt-runner workaround: remove restrictions on scanned packages (#849)
- distage-testkit: Enhance parallel test reporting, ensure all exceptions are caught (#848)
- Add ProviderMagnet.ap, fix incorrect return type in ProviderMagnet.zip (#844)
Dependency updates
0.10.0
What is it?
Izumi (jp. 泉水, spring) is a set of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.
including the following components:
- distage – Transparent and debuggable Dependency Injection framework for Pure FP Scala,
- logstage – Automatic structural logs from Scala string interpolations,
- idealingua – API Definition, Data Modeling and RPC Language, optimized for fast prototyping – like gRPC, but with a human face. Currently generates servers and clients for Go, TypeScript, C# and Scala,
- Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
- Percept-Plan-Execute-Repeat (PPER) – a pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.
Major Changes in distage
since 0.9.17:
- Removed dependency on runtime scala-reflect
- Type comparisons now use LightTypeTag from
izumi-reflect
(fundamentals-reflection) instead ofscala-reflect
TypeTag resulting in greatly improved stability, better runtime performance and faster compile-time - All constructors are now generated at compile-time
- Moved constructor derivation strategies
ClassConstructor
,TraitConstructor
&FactoryConstructor
fromdistage-static
todistage-core
.
- Type comparisons now use LightTypeTag from
distage-core
is now available for Scala.js- Documentation has been rewritten
distage-extension-config
has been rewritten without runtime reflection.distage-testkit-scalatest
improved test reporting & integration with SBTdistage-framework-docker
added support for networks, addedno-copy
option for docker mounts- Added syntax for binding an implementation to multiple interfaces:
make[ImplXYZ].aliased[TraitX].aliased[TraitY].aliased[TraitZ]
Major Changes in fundamentals-bio
since 0.9.17:
- Moved time & sleep-related methods to a new
BIOTemporal
typeclass aboveBIOAsync
- Fixed implicit priorities for conversions into
cats-effect
typeclasses
All merged PRs:
- Update docker-java to 3.2.0-rc2 (#765)
- Izumi 0.10: Remove runtime reflection (#741)
- Update sbt-mdoc to 2.0.3 (#766)
- Fix #374 derive higher-kinded Tags from other even-higher kinded Tags (#768)
- Merge
distage-framework-api
intodistage-framework
(#769) - Compute hashcode only based on short type name (#770)
- Move docker support to distage-framework, move Activation & PruningPlanMergingPolicy to distage-core, document AxisTags (#774)
- Do not generate constructor for
make[X]
ifmake[X]
is followed by.from[Y]
(#775) - Fix #367 Very rough de-cake of RuntimeDIUniverse (#776)
- Move old testkit to distage-legacy-testkit (#777)
- Update scala-collection-compat to 2.1.3 (#783)
- Update sbt to 1.3.5 (#784)
- Update classgraph to 4.8.59 (#786)
- Fix Tag resolution inside nested type lambdas (such as BIO BlockingIO/BlockingIO3) (#792)
- Fix cats conversions type inference & implicit priority (#793)
- Update slf4j-api, slf4j-simple to 1.7.30 (#785)
- Fix cats conversion priorities on 2.13; fix BlockingIO.apply (#794)
- Cache composite PluginSources in distage-testkit (#795)
- Really fix cats conversions priority by making all implicit result types disjoint (#796)
- test envs revisited (#799)
- Fix Scalatest test output (#800)
- Update sbt-pgp to 2.0.1 (#788)
- Add LogIO.apply(CustomContext), rename IzLogger.withMapAsCustomContext->withCustomContext (#801)
- Revert "Fix Scalatest test output (#800)"
- Bug/802 scalatest (#803)
- Fix Scalatest test output R2 (#800)
- Update sbt-mdoc to 2.1.0 (#805)
- Update fastparse to 2.2.2 (#804)
- Rename ConcreteConstructor -> ClassConstructor (#809)
- Update sbt-mdoc to 2.1.1 (#811)
- Fix factories with type parameters, with arguments of the same type and with mixed assisted/non-assisted methods (#810)
- Feature/weak reference memoization (#807)
- Update classgraph to 4.8.60 (#813)
- Fix singleton type resolution in LightTypeTag (#816)
- Regard abstract type members in current trait as weak and correctly require implicit Tags for them in TagMacro (#817)
- Feature/docker mount (#815)
- Remove outdated logstage docs (#818)
- Build distage-core for Scala.js (#791)
- Fix running individual tests under IDEA / non-sbt ScalatestRunner – scan classpath for tests only under sbt (#822)
- distage-testkit: fix running test name pattern tests in sbt (#823)
- Update scalatest to 3.1.0 (#824)
- Adopt scalafmt (#748)
- Fix #812 Support abstract classes in TraitConstructor (#825)
- feature/docker-networks (#819)
- Fix #826 Return type parameter constraints for cats Resource conversions in ModuleDefDSL (#827)
- Improve error message when user tries to create a constructor for a type parameter without
AnyConstructor
context bound (#828) - distage-testkit: Restrict overloading in
in
for non-effectful tests toUnit
&Assertion
(#829) - Add ability to abstract over
@Id
and@With
annotations using type aliases (#830) - Fix #753 Change syntax for binding to multiple interfaces. Now
make[X].aliasTo[I1].aliasTo[I2].aliasTo[I3]
(#831) - fundamentals-reflection: precompute LightTypeTag hashCode at compile-time (#832)
- Rename
aliasTo
toaliased
(#833) - In
make
DSL, allow.named
&.tagged
after.from
(#834) - Add DIResourceBase#useEffect; rename DIResource.Cats->FromCats,Zio->FromZIO (#835)
- Add an
@impl
annotation to document that a trait is used as an Auto-Trait or an Auto-Factory (#836) - Replace PluginSource with PluginConfig (#837)
0.10.0-M13
First release of distage-core
for Scala.js 🎉
0.9.17
0.9.16
0.9.15
0.9.14
fundamentals-bio:
- use unsupervised forks in BIOFork for ZIO (same as cats Concurrent instance) (a527148)
distage:
- RoleAppLauncher now needs to override pluginSource, not bootstrapConfig (397c16c)
- Changes to plan splitting algorithm in IntegrationCheck discovery
docs:
- Fix japanese typo in docs + README (#743) by @cronokirby
0.9.13
Docker containers can now be declared as test dependencies / Resources in distage-testkit
:
object PostgresDocker extends ContainerDef {
val primaryPort: DockerPort = DockerPort.TCP(5432)
override def config: Config = {
ContainerConfig(
image = "library/postgres:latest",
ports = Seq(primaryPort),
reuse = true,
)
}
}
Dependencies can be declared between docker containers:
object DockerPlugin extends DockerContainerModule[zio.Task] with PluginDef {
// this container will start once `DynamoContainer` is up and running
make[PostgresDocker.Container].fromResource {
PostgresDocker.make[zio.Task]
.dependOnDocker(DynamoDocker)
}
}
Use in test:
class DBTest extends DistageBIOSpecScalatest[zio.IO] {
"postgres docker" should {
"respond to queries" in {
(doobie: Transactor[zio.Task], pg: PostgresDocker.Container) =>
doobie.trans.apply(sql"select 1")
}
}
}
fundamentals-reflection:
- Shade boopickle dependency (#737)
- Fix LightTypeTag bug resolve prefixes of annotated types
fundamentals-bio:
- Add BIOAsync.parTraverse, parTraverse_, parTraverseN_ (1ed31c1)
distage:
- Docker resources (#732) by @pshirshov
- Move CatsDIEffectModule from distage-model to distage-roles (07d3ddd)
- Add IdentityDIEffectModule (004af1c)
distage-testkit:
- distage-testkit: Run tests in parallel, add DIEffectAsync (499f765)
- distage-testkit: Configure test class-wide options in SpecConfig (ff9a801)