] 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.