Preferred way of using dependencies of a module

I wonder what is the difference between:

] add GLMakie # Note that this installs several dependencies, including GeometryBasics
using GLMakie
using GLMakie.GeometryBasics
] add GLMakie GeometryBasics
using GLMakie
using GeometryBasics

Is there any preference / difference between these two approaches? I have been using the first one as it means fewer direct dependencies in my Project.toml, but I usually see the second approach.

If you actually use the package directly, you should probably make it an explicit and direct dependency. You could then later control the revision of that dependency directly via Project.toml.

Accessing indirect dependencies via direct dependencies is a bit of a hack, but can be useful when using conditional dependencies. I would generally avoid doing this.

Thanks, that makes sense! Although it means more dependencies to manage, it also offers a finer control over the version being used.