Redundant resolving of packages #1955
Replies: 2 comments 23 replies
-
I think the problem is that you are not just moving an already imported package to a different place. When you hit backspace on the second cell to delete it, you are also removing StatsBase from the notebook environment, and so Pluto rightly asks you to restart the notebook to sync things up. I think the act of the notebook updating after a cell is deleted can been seen a bit more clearly here: example-2022-02-24_21.29.22.mp4So to get the expected behavior when moving packages around, I would just do all my moving first, and then run all the cells at once by pressing Ctrl+S on the keyboard after I am finished: example-2022-02-24_21.27.24.mp4btw, thanks for including a video. It made it a lot easier to see what you were trying to do! |
Beta Was this translation helpful? Give feedback.
-
Hey all! Very interesting question! I have seen other people confused/annoyed by this behaviour. Like pointed out in the discussion above (I only read parts of it): the behaviour is "intentional": our current model is that deleting a cell should immediately "commit" that change, hence causing this issue. The feature suggestion by @yha makes a lot of sense: allow you to delete a cell without committing, just like you can currently delete a line within a cell without committing. This strategy of "making multiple edits, and running them later with a single Ctrl+S" is actually really useful, so that would be cool. But! It would need some good new UI to pull this off, and I imagine that this new behaviour would then become a source of confusion/annoyance for its own reasons. (Especially for new users.) We could also go at the underlying issue (moving imports around can lead to "restart required") in another way, by keeping track of which imports at which versions existed before. That way, removing an import, committing, and then adding it, committing, would become a no-op as a whole. This "restart recommended" message would appear, and then disappear again. But! I think this would be too difficult to implement correctly, especially because we try to only expose public Pkg API through GUI, without touching internals. (And the gain might be too small.) Now, if this were done by Julia itself, then that might be the way to go! There is some ongoing work in this direction: JuliaLang/Pkg.jl#3002 (read "sysimage" as "already loaded in the process") and JuliaLang/julia#44329 . All in all, I would say that right now, this is something we have to live with, because a fix would be too difficult and time-consuming to implement. But I can imagine a future where we have more API to work with from Pkg and Julia. Specifically:
|
Beta Was this translation helpful? Give feedback.
-
Sometimes Pluto re-resolves packages and says "Restart notebook (recommended)" when I just moved a
using
to a different place.Beta Was this translation helpful? Give feedback.
All reactions