Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fx.Annotate: make variadic params optional by default #831

Merged
merged 18 commits into from Feb 10, 2022

Commits on Feb 8, 2022

  1. fx.Annotate: make variadic params optional by default

    If annotate is passed a variadic function, the dependency
    listed as the variadic parameter should be optional
    unless otherwise specified with the `optional:false`
    parameter tag. This commit addresses that bug.
    josephinedotlee committed Feb 8, 2022
    Copy the full SHA
    f195ead View commit details
    Browse the repository at this point in the history
  2. Update annotated_test.go

    Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com>
    josephinedotlee and sywhang committed Feb 8, 2022
    Copy the full SHA
    ab3ccde View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7ea7b90 View commit details
    Browse the repository at this point in the history
  4. fx.Annotate: make variadic params optional by default

    If annotate is passed a variadic function, the dependency
    listed as the variadic parameter should be optional
    unless otherwise specified with the `optional:false`
    parameter tag. This commit addresses that bug.
    josephinedotlee committed Feb 8, 2022
    Copy the full SHA
    5a8abec View commit details
    Browse the repository at this point in the history
  5. Update annotated_test.go

    Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com>
    josephinedotlee and sywhang committed Feb 8, 2022
    Copy the full SHA
    24c501b View commit details
    Browse the repository at this point in the history
  6. Temporarily pin Dig dependency to master (#827)

    This temporarily pins the Dig dependency in Fx to the master branch which has dig.Scope in preparation for adding fx.Module which is the corresponding user-facing API in Fx.
    
    In addition, this fixes a few tests to expect the new error message format that was changed with the graph refactoring PR in uber-go/dig#301.
    sywhang authored and josephinedotlee committed Feb 8, 2022
    Copy the full SHA
    34519fa View commit details
    Browse the repository at this point in the history
  7. Add fx.Module (#830)

    This adds fx.Module Option which is a first-class object for supporting scoped operations on dependencies. A Module can consist of zero or more fx.Options.
    
    By default, Provides to a Module is provided to the entire App, but there is a room for adding an option to scope that to a Module. Module can wrap Options such asSupply/Extract, Provide, and Invoke but there are some Options that don't make sense to put under Module. For example, StartTimeout, StopTimeout, WithLogger explicitly errors out when supplied to a Module.
    
    Implementation-wise, a Module corresponds to dig.Scope which was added in uber-go/dig#305. Extra bookkeeping is done by the module struct which contains the provides and invokes to a Scope.
    
    Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
    Co-authored-by: Abhinav Gupta <abg@uber.com>
    Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
    3 people authored and josephinedotlee committed Feb 8, 2022
    Copy the full SHA
    d173aa3 View commit details
    Browse the repository at this point in the history
  8. fx.Module: Reorganize code (#832)

    In #830, I reverted some of the code moves to make reviewing the change
    easier. This change adds back those moves on top of that PR.
    
    This reverts commit e4d006b.
    
    This reverts commit 8aa68c0.
    
    Co-authored-by: Abhinav Gupta <abg@uber.com>
    2 people authored and josephinedotlee committed Feb 8, 2022
    Copy the full SHA
    d9ebe58 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    9032ca9 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    3735ca9 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2022

  1. Copy the full SHA
    5595e7e View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    16b497e View commit details
    Browse the repository at this point in the history
  3. Update annotated.go

    Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com>
    josephinedotlee and sywhang committed Feb 10, 2022
    Copy the full SHA
    1fbdc13 View commit details
    Browse the repository at this point in the history
  4. add extra test

    josephinedotlee committed Feb 10, 2022
    Copy the full SHA
    96c8e4c View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    a987c12 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    2926652 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    e0429a1 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    f8878d1 View commit details
    Browse the repository at this point in the history