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

doc: Add FAQ page #1160

Merged
merged 4 commits into from
Feb 14, 2024
Merged

doc: Add FAQ page #1160

merged 4 commits into from
Feb 14, 2024

Conversation

abhinav
Copy link
Collaborator

@abhinav abhinav commented Feb 13, 2024

Adds an FAQ page to the Fx documentation,
aiming to address frequently asked questions.

This includes two entries that came up at work recently.

Includes a test for the fx.Supply entry
because I couldn't find the test for it right away.
(I found it in annotated_test.go later but you won't hear me complain
about additional tests.)

Adds an FAQ page to the Fx documentation,
aiming to address frequently asked questions.

This includes two entries that came up at work recently.

Includes a test for the `fx.Supply` entry
because I couldn't find the test for it right away.
(I found it in annotated_test.go later but you won't hear me complain
about additional tests.)
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (793a644) 98.78% compared to head (15fa6e9) 98.78%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1160   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          30       30           
  Lines        3057     3057           
=======================================
  Hits         3020     3020           
  Misses         30       30           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@JacobOaks JacobOaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! One small comment.

## Does the order of `fx.Option`s matter?

No, the order in which you provide various Fx options
to `fx.Options`, `fx.New`, `fx.Module`, and others does not matter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is true for determining the order in which fx.Invoked functions get run, which was a recent point of confusion (ref: #1152). Consider exempting Invoke from this statement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. There's a weird situation here.
On paper, there's no guarantee about the order in which invokes run.
But you're right, their order matters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JacobOaks I realized that this was actually too simplified and lost some information.
Ordering of options relative to fx.New is irrelevant, but ordering of operations relative to each other can matter.
I've rewritten this section to better clarify this.

LMK what you think

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looks like we do document the fx.Invoke invocation order.
I'll update this entry.

Copy link
Contributor

@JacobOaks JacobOaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks!

@JacobOaks JacobOaks merged commit d6beb49 into uber-go:master Feb 14, 2024
12 checks passed
@abhinav abhinav deleted the abg/faq branch February 14, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants