Out of curiosity, what was the alternative you found?
I remodelled the struct to be more general (in my case a struct that among others used some caches, now generic caches).
And I had to rethink/remodel a few functions that were working with said struct.
I am also not saying my original model was a good one (just because it was possible with Revise.jl), just that this rethinking and remodelling might be a con due to time constraints (eventually). So it might sometimes take a bit more time (especially when still learning details of extensions, which I definetly nearly know not much about).
Seems like FileIO
can use extensions for different file formats, isnât it?
Not exactly, itâs possible to keep a kind of backward compatibility, but this ârequiresâ (pun intended) additional work, though.
If anyone can help on Loading main package from higher-level env fails with extension of package in current env ¡ Issue #49886 ¡ JuliaLang/julia ¡ GitHub, it would be appreciated.
We moved to extensions in Plots in an effort to tidy up things, but the Ijulia problem might force us to go back to using Requires, and this is irritating.
It would be nice to have a package that defines a macro to handle this backward compatibility. To be honest, the package extensions functionality feels a bit hacky for someone looking at it for the first time.
Could someone with the expertise take a look at MethodError in diff print: no method matching stat_rep(::Nothing) ¡ Issue #3327 ¡ JuliaLang/Pkg.jl ¡ GitHub? This is leading to the invalidation check failing in two packages that I know of, which is stalling the work on package extensions. Presumably, other packages checking for invalidation using a standard script would also be impacted by this.
@cjdoris how would you adapt the following PR to use the PackageExtensionTools.jl?
Only if you also want to provide the functionality to earlier julia versions (through Requires). This part is hacky indeed.
But package extensions by themselves look pretty clean, aside from a lot of unnecessary repetitions.
Like, really?? StructArraysStaticArraysExt = "StaticArrays"
ref
I remember that there was a reason for the long name, that pkgs could clash if pkg A and pkg B both load a C extension as CExt
. Using ACExt
and BCExt
seems to disambiguate names. But i donât know if this is still a problem on the current release
Yeah, that was a PackageCompiler bug, didnât affect normal usage of packages and is already fixed for some time (ref).
Another, remaining, case of repetition is the weakdep package name repetition (3x) in the common scenario of single-dependency extensions:
[weakdeps]
StaticArrays = ...
[extensions]
StaticArraysExt = "StaticArrays"
from another thread: Fixing Package Fragmentation - #94 by odow