From d1759bcde8e662e6bb7aaff94466b3ca1f3cf43b Mon Sep 17 00:00:00 2001 From: Sam Buercklin Date: Thu, 10 Aug 2023 04:55:45 -0400 Subject: [PATCH] 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. --- doc/src/base/base.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/base/base.md b/doc/src/base/base.md index aa5d23281dd6b..a4f90ba6c6d0a 100644 --- a/doc/src/base/base.md +++ b/doc/src/base/base.md @@ -465,6 +465,7 @@ Base.locate_package Base.require Base.compilecache Base.isprecompiled +Base.get_extension ``` ## Internals