Releases: uber-go/fx
Releases · uber-go/fx
v1.19.1
v1.19.0
Added
fx.RecoverFromPanics
Option which allows Fx to recover from user-provided constructors
and invoked functions.fx.Private
that allows the constructor to limit the scope of its outputs to the wrapping
fx.Module
.ExitCode
ShutdownOption which allows setting custom exit code at the end of app
lifecycle.Wait
which returns a channel that can be used for waiting on application shutdown.- fxevent/ZapLogger now exposes
UseLogLevel
andUseErrorLevel
methods to set
the level of the Zap logs produced by it. - Add lifecycle hook-convertible methods:
StartHook
,StopHook
,StartStopHook
that can be used with more function signatures.
Changed
fx.WithLogger
can now be passed atfx.Module
level, setting custom logger at
Module
scope instead of the wholeApp
.
Fixed
fx.OnStart
andfx.OnStop
Annotations now work with annotated types that was
provided by the annotated constructor.- fxevent/ZapLogger: Errors from
fx.Supply
are now logged atError
level, not
Info
. - A race condition in lifecycle Start/Stop methods.
- Typos in docs.
v1.18.2
v1.18.1
v1.18.0
Added
- Soft value groups that lets you specify value groups as best-effort dependencies.
- fx.OnStart and fx.OnStop annotations which lets you annotate dependencies to provide OnStart and OnStop lifecycle hooks.
- A new fxevent.Replaced event written to fxevent.Logger following an fx.Replace.
Fixed
- Upgrade Dig dependency to v1.14.1 to address a couple of issues with decorations. Refer to Dig v1.14.1 release notes for more details.
- fx.WithLogger no longer ignores decorations and replacements of types that it depends on.
- Don't run lifecycle hooks if the context for them has already expired.
- App.Start and App.Stop no longer deadlock if the OnStart/OnStop hook exits the current goroutine.
- fxevent.ConsoleLogger no longer emits an extraneous argument for the Supplied event.
Deprecated
- fx.Extract in favor of fx.Populate.
v1.17.1
v1.17.0
Added
- Add
fx.Module
which scopes any modifications made to the dependency graph. - Add
fx.Decorate
andfx.Replace
that lets you modify a dependency graph with decorators. - Add
fxevent.Decorated
event which gets emitted upon a dependency getting decorated.
Changed
fx.Annotate
: Validate thatfx.In
orfx.Out
structs are not passed to it.fx.Annotate
: Upon failure to Provide, the error contains the actual location
of the provided constructor.
v1.16.0
Added
- Add the ability to provide a function as multiple interfaces at once using
fx.As
.
Changed
fx.Annotate
: support variadic functions, and feeding value groups into them.
Fixed
- Fix an issue where OnStop hooks weren't getting called on SIGINT on Windows.
- Fix a data race between app.Done() and shutdown.
v1.15.0
Added
- Add
fx.Annotate
to allow users to provide parameter and result tags easily without
having to createfx.In
orfx.Out
structs. - Add
fx.As
that allows users to annotate a constructor to provide its result type(s) as
interface(s) that they implement instead of the types themselves.
Fixed
- Fix
fxevent.Stopped
not being logged whenApp.Stop
is called. - Fix
fxevent.Started
orfxevent.Stopped
not being logged when start or
stop times out.