-
-
Notifications
You must be signed in to change notification settings - Fork 283
add support for package extensions #3264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
e0954b9
2d6adbb
83ad655
1a69736
8ae5d35
041e9f0
f2376f8
6eb01e1
b591e39
e23c49e
941998b
2bfd2ab
abc9e21
92bed4c
49cd28a
a9e5ffa
c52bf27
f1a47ed
169e128
fa6dbfe
abe7000
5085eb7
644a176
50a0938
0c2bafd
acefa5f
a2aef89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -245,6 +245,111 @@ using Test | |||||
| Every dependency should in general have a compatibility constraint on it. | ||||||
| This is an important topic so there is a separate chapter about it: [Compatibility](@ref Compatibility). | ||||||
|
|
||||||
| ## Conditional loading of code in packages (Glue packages) | ||||||
|
|
||||||
| !!! note | ||||||
| This is a somewhat advanced section which can be skipped for people new to Julia and Julia packages. | ||||||
|
|
||||||
| It is sometimes desirable to be able to extend some functionality of a package without having to | ||||||
| unconditionally take on the cost (in terms of e.g. load time) of adding an extra dependency. | ||||||
| A *glue package* is a file that gets automatically loaded when some other set of packages are | ||||||
| loaded into the Julia session. This is very similar to functionality that the external package | ||||||
| Requires.jl used to provide, but which is now aviable directly through Julia. | ||||||
|
|
||||||
| A useful application of glue packages could be for a plotting package that should be able to plot | ||||||
| objects from a wide variety of different Julia packages. | ||||||
| Adding all those different Julia packages as dependencies | ||||||
| could be expensive since they would end up getting loaded even if they were never used. | ||||||
| Instead, these code required to plot objects for specific packages can be put into separate files | ||||||
|
||||||
| Instead, these code required to plot objects for specific packages can be put into separate files | |
| Instead, the code required to plot objects for specific packages can be put into separate files |
KristofferC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
KristofferC marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if isdefined(Base, :get_gluepkg) | |
| if !isdefined(Base, :get_gluepkg) |
If I understand correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks :)
Uh oh!
There was an error while loading. Please reload this page.