Avoid Makie as a dependency?

I know that in order to avoid having a package depend on Plots I can depend on RecipesBase and write some recipes.

In Makie, there is a recipe mechanism too, but in its current form it seems to rely on Makie itself.
This allows to extend Makie but does not help with dependencies.

Given this previous (unanswered) post I guess I’m not the only one with issues understanding the process…

Could someone clarify if there is a way do develop a package depending on Makie without actually needing it as a dependency ?

I thought of an alternative way based on Requires, that would only load Makie dependent code upon a Makie load in addition to my package, but I did not test it so far.

1 Like

One solution, if you want to cater to users who don’t use Makie, is to make a separate package for your recipes, i.e. YourPackageMakie.jl. For example, GraphMakie is a recipe package that has Makie as a dependency.

This is what I end up doing for my package as well, which seems to be the only option right now.

An alternative is to use Requires.jl (GitHub - JuliaPackaging/Requires.jl: Lazy code loading for Julia).

I guess that confirms my last thought…

@sdanisch Would you mind giving an official best practice ?

Ah sorry I missed that

I would be interested in that too!

There is a plan to move the recipe functionalities to the MakieCore.jl package with minimal dependencies (just Observables.jl). I am not sure if this is fully functional yet but you can try it.

Thanks! Also posting this issue for future reference