uber-go/fx

Module docs mentions features not released yet

pfernandom opened this issue · 4 comments

Describe the bug
The official documentation on modules mentions the use of fx.Private. However, this struct is not exported in the latest released version 1.18.2. In order to use it, one would have to use the master branch in the Github repo.

To Reproduce
Use the latest published version 1.18.2 and try to use fx.Private in a module, as described in the docs.

The compiler complains with:

Private not declared by package fx  compiler[UndeclaredImportedName]
(https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredImportedName)

Expected behavior
fx.Private should be present.

Additional context
While it is understandable that some features are not released yet, either:

  • The official documents shouldn't mention unreleased features
  • The latest published version should include all features mentioned by the published docs

If this feature is not fully ready for production use, maybe tag an alpha version which does include it and mention it in the docs.
Thank you for all the good work!

@sywhang Some options to mitigate this:

  1. Change the docs workflow to run only on pushes of tagged releases.
  2. Change development workflow so 'main' is always the most recent release plus any documentation updates for existing features, and do active development on a 'dev' branch. Each release will involve a merge commit to main. This is how one of our other libraries did things.
  3. Continue developing as today, but create a 'release' branch that tracks the latest tagged release. Documentation fixes will happen on release branch and merge back into main.

I've opened #1009 in case you decide to go with option 1 above.

@pfernandom sorry you ran into that; Re: Private, we'll be doing a release shortly that has this feature so please keep an eye out for that!

That was quick! Thank you for getting to this so fast.

Overall, I've been having a great experience using this tool, so I will definitely look out for this release.

Thank you!