Skip to content

Releases: uber-go/fx

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.

v1.14.1

16 Aug 17:37
a857d1a
Compare
Choose a tag to compare

Changed

  • fxevent.Invoked was being logged at Error level even upon successful Invoke.
    This was changed to log at Info level when Invoke succeeded.

v1.14.0

12 Aug 21:49
af8dcf3
Compare
Choose a tag to compare

Added

  • Introduce the new fx.WithLogger option. Provide a constructor for
    fxevent.Logger objects with it to customize how Fx logs events.
  • Add new fxevent package that exposes events from Fx in a structured way.
    Use this to write custom logger implementations for use with the
    fx.WithLogger option.
  • Expose and log additional information when lifecycle hooks time out.

Changed

  • Fx now emits structured JSON logs by default. These may be parsed and
    processed by log ingestion systems.
  • fxtest.Lifecycle now logs to the provided testing.TB instead of stderr.
  • fx.In and fx.Out are now type aliases instead of structs.

v1.13.1

19 Aug 23:07
59a1838
Compare
Choose a tag to compare

Fixed

  • Fix minimum version constraint for dig. fx.ValidateGraph requires at least
    dig 1.10.

v1.13.0

16 Jun 23:00
Compare
Choose a tag to compare

Added

  • Added fx.ValidateGraph which allows graph cycle validation and dependency correctness
    without running anything. This is useful if fx.Invoke has side effects, does I/O, etc.