-
Notifications
You must be signed in to change notification settings - Fork 296
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
Move advanced features to package documentation #1163
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The documentation for parameter structs, result structs, named values, optional values, value groups, etc. is currently scattered between In and Out. First, on the logistics end: this has made it impossible to link to some of these docs because they share the same hadings: https://pkg.go.dev/go.uber.org/fx#hdr-Named_Values goes to the named values section of fx.In. It's not possible to link to the named values section of the fx.Out struct (which is also called Named Values). More importantly, from the doc readability point of view, jumping between In and Out is annoying and doesn't make for good reading. This PR moves these to the package-level docs and improves the flow of how this information is presented: First, we introduce parameter and result structs. Then we weave through the two introducing various topics: Producing named values Result structs Consuming named values Parameter structs Optional dependencies Parameter structs Producing value groups Result structs Consuming value groups Parameter structs Soft value groups Parameter structs Value group flattening Result structs Unexported fields Parameter structs This makes the story of these topics a bit easier to follow. In the future, we can introduce annotation right after parameter and result structs, or between value groups and soft value groups. Note that this does not touch on the core operations (provide, invoke, decorate). It's just moving existing documentation around.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1163 +/- ##
=======================================
Coverage 98.79% 98.79%
=======================================
Files 30 30
Lines 3061 3061
=======================================
Hits 3024 3024
Misses 30 30
Partials 7 7 ☔ View full report in Codecov by Sentry. |
JacobOaks
approved these changes
Feb 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
sywhang
approved these changes
Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The documentation for parameter structs, result structs,
named values, optional values, value groups, etc.
is currently scattered between In and Out.
First, on the logistics end:
this has made it impossible to link to some of these docs because they
share the same hadings:
https://pkg.go.dev/go.uber.org/fx#hdr-Named_Values goes to the named
values section of fx.In. It's not possible to link to the named values
section of the fx.Out struct (which is also called Named Values).
More importantly, from the doc readability point of view, jumping
between In and Out is annoying and doesn't make for good reading.
This PR moves these to the package-level docs and improves the flow of
how this information is presented:
First, we introduce parameter and result structs.
Then we weave through the two introducing various topics:
This makes the story of these topics a bit easier to follow.
In the future, we can introduce annotation right
after parameter and result structs,
or between value groups and soft value groups.
Note that this does not touch on the core operations
(provide, invoke, decorate).
It's just moving existing documentation around.