Skip to content

Releases: uber-go/fx

v1.19.1

11 Jan 18:43
d9d9838
Compare
Choose a tag to compare

Changed

  • Calling fx.Stop() after the App has already stopped no longer errors out.

Fixed

  • Addressed a regression in 1.19.0 release which caused apps to ignore OS signals
    after running for startTimeout duration.

v1.19.0

04 Jan 19:01
887c07c
Compare
Choose a tag to compare

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 and UseErrorLevel 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 at fx.Module level, setting custom logger at
    Module scope instead of the whole App.

Fixed

  • fx.OnStart and fx.OnStop Annotations now work with annotated types that was
    provided by the annotated constructor.
  • fxevent/ZapLogger: Errors from fx.Supply are now logged at Error level, not
    Info.
  • A race condition in lifecycle Start/Stop methods.
  • Typos in docs.

v1.18.2

28 Sep 19:21
2f5adb6
Compare
Choose a tag to compare

Added

  • Clarify ordering of Invokes in Modules.

Fixed

  • Fix Decorate not being applied to transitive dependencies at root App level.

v1.18.1

08 Aug 18:27
b220b95
Compare
Choose a tag to compare

Fixed

  • Fix a nil panic when nil is passed to OnStart and OnStop lifecycle methods.

v1.18.0

08 Aug 16:08
1973f9f
Compare
Choose a tag to compare

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

23 Mar 17:47
b04f014
Compare
Choose a tag to compare

Added

  • Logging for provide/invoke/decorate now includes the associated fx.Module name.

v1.17.0

01 Mar 02:56
2f82f30
Compare
Choose a tag to compare

Added

  • Add fx.Module which scopes any modifications made to the dependency graph.
  • Add fx.Decorate and fx.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 that fx.In or fx.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

03 Dec 01:31
3867885
Compare
Choose a tag to compare

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

08 Nov 20:32
d53f55f
Compare
Choose a tag to compare

Added

  • Add fx.Annotate to allow users to provide parameter and result tags easily without
    having to create fx.In or fx.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 when App.Stop is called.
  • Fix fxevent.Started or fxevent.Stopped not being logged when start or
    stop times out.

v1.14.2

16 Aug 21:41
1622a99
Compare
Choose a tag to compare

Changed

  • For fxevent console implementation: no longer log non-error case for fxevent.Invoke event, while for zap implementation, start logging fx.Invoking case without stack.