Move REPL support into a package extension#978
Move REPL support into a package extension#978JamesWrigley wants to merge 3 commits intotimholy:masterfrom
Conversation
In some cases Pkg still prints the extension name without the parent package name, which can make debugging tricky.
|
(rebased to fix merge conflicts) |
|
(bump) |
1 similar comment
|
(bump) |
|
Loading Revise even when not starting a REPL seems to be a startup-file issue on the user side. So I agree with the optimization in this PR, but I have concerns about whether the added complexity required to support package extensions is actually justified by the benefits. |
|
My motivation isn't actually the startup time, it's making Revise more lightweight to use in other libraries that don't need the REPL (i.e. mine 😛). But I do understand the complexity concern. Having to load the REPL would be unfortunate but not a deal breaker for me, so I leave the final decision to you :) |
|
Actually, I need to do something similar to your use case (calling Revise from a library that doesn't need REPL). Specifically, I'll be calling Revise's subcomponents from JETLS, so I'll need this kind of mechanism in the But if we use the package extension method, these codes would be automatically loaded by packages that load REPL no matter if the package want to use this REPL extension, which might cause a different problem. Or, maybe we should just refactor Revise subcomponents into something like ReviseCore.jl, by defining reasonable subcomponents of Revise that can be used independently. This change wouldn't affect its design. |
|
Having a ReviseCore also sounds good to me 👍 I'm happy to take a shot at it if you prefer that over a package extension. |
|
Shall I make a ReviseCore? |
The main reason for this is to make Revise a bit more light-weight for packages that only need the revision API, and to reduce the overhead of loading Revise by default outside of the REPL. The load time when loaded without the REPL is almost halved:
I also renamed the Distributed extension in 8d4a07f to make it easier to distinguish where the extension module comes from.
Written with help from Claude 🤖