Uber Go Fx Versions Save

A dependency injection based application framework for Go.

v1.21.1

3 weeks ago

Changed

  • Register Fx provides (e.g. fx.Lifecycle, fx.Shutdowner, fx.DotGraph) before user provides, to increase likelihood of successful custom logger creation.

v1.21.0

2 months ago

Added

  • fxtest: Add WithTestLogger option that uses a testing.TB as the Fx event logger.
  • An fxevent logger that can log events using a slog logger has been added.

Changed

  • Upgrade Dig dependency to v1.17.1

Thanks to @robbert229 for their contribution to the release.

v1.20.1

7 months ago

Added

  • Provided, Decorated, Supplied, and Replaced events now include a trace of module locations through which the option was given to the App.
  • wasi support.

v1.20.0

11 months ago

Added

  • A new event fxevent.Run is now emitted when Fx runs a constructor, decorator, or supply/replace stub.

Changed

  • fx.Populate now works with fx.Annotate.
  • Upgrade Dig dependency to v1.17.0.

v1.19.3

1 year ago

Changed

  • Fixed several typos in docs.
  • WASM build support.
  • Annotating In and Out structs with From/As annotations generated invalid results. The annotation check now blocks this.
  • Shutdown: Support calling from Invoke.

Deprecated

  • Deprecate ShutdownTimeout option.

Fixed

  • Respect Shutdowner ExitCode from calling Run.

v1.19.2

1 year ago

Changed

  • Upgrade Dig dependency to v1.16.1.

v1.19.1

1 year ago

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

1 year ago

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

1 year ago

Added

  • Clarify ordering of Invokes in Modules.

Fixed

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

v1.18.1

1 year ago

Fixed

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