Skip to content

Commit bba08a4

Browse files
SBuercklinKristofferC
authored andcommitted
Add Base.get_extension to docs/API (#50860)
The documentation of `Pkg.jl` is instructing developers to rely on the existence of this function, and there doesn't seem to be any alternative which is a part of the API that developers can use instead on to guarantee forward compatibility for the same behavior. `Base.get_extension` is [referred to explicitly](https://pkgdocs.julialang.org/v1.9/creating-packages/#Backwards-compatibility) in the `Pkg.jl` docs to conditionally use package extensions vs `Requires.jl`. The `Pkg.jl` docs suggest ```julia if !isdefined(Base, :get_extension) include("../ext/PlottingContourExt.jl") end ``` to transition from "normal dependency to extension," which will break and automatically load the extension in future versions should `Base.get_extension` go away. `Base.get_extension` is the only way (that I know of) to directly access the module associated with a package extension, which can be a useful utility as well. (cherry picked from commit d1759bc)
1 parent 016cb5f commit bba08a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/src/base/base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ Base.identify_package
449449
Base.locate_package
450450
Base.require
451451
Base.compilecache
452+
Base.get_extension
452453
```
453454

454455
## Internals

0 commit comments

Comments
 (0)