How to take advantage of Weak Dependencies? #4222
Replies: 6 comments
-
Do you mean by The MWE on the doc page seems that is a feature that provides better support for mono repos via |
Beta Was this translation helpful? Give feedback.
-
No the purpose is to split out functionality from the main package into a submodule that only gets loaded if some other packages have also been loaded by the user. Thereby avoiding the overhead of the dependency for all but those that installed it separately. For example, making |
Beta Was this translation helpful? Give feedback.
-
ups my bad, I totally ignored the text when reading the MWE ... |
Beta Was this translation helpful? Give feedback.
-
I have found two candidates for the package extension treatment in #2683:
The |
Beta Was this translation helpful? Give feedback.
-
I'd love to use extensions more, but I'm also a bit worried that it will decrease usability... Maybe we can revisit our dependencies and make some notes for each? |
Beta Was this translation helpful? Give feedback.
-
If I understand correctly, the usability problem when using extensions would be that people wanting to e.g. make a |
Beta Was this translation helpful? Give feedback.
-
There's a new feature in Julia coming up which allows to specify weak dependencies for a package. That's basically the sanctioned way of what was previously done with
Requires.jl
but it's better integrated and doesn't break precompilation.Downstream packages are expected to use this going forward to implement Makie plotting functionality without taking on full dependency on it. But can we also improve Makie loading times by factoring out some functionality? I'm not sure, as I think a plotting package would be expected to work fully without installing additional packages to "unlock" something like contour plots (contour plots were the example used in the documentation of the new feature).
Beta Was this translation helpful? Give feedback.
All reactions