Repository: timholy/Revise.jl

Issue #692: Can't track changes in module loaded via "using ..Module"?
Created: 2022-07-01T14:53:14Z
Hello!
I have a Genie app looking like this:
routes.jl:
using Genie.Router, Stipple, StipplePlotly #modules belonging to the Genie framework
using Presentations
Presentations.jl: (a file containing a local module I am working on)
module Presentations
using Stipple, StipplePlotly
This works fine with revise: If I update Presentations.jl, revise tracks the changes.
However, I found that my app loads much faster (45 sec versus 90 sec) when I use the following way of importing modules:
in routes.jl:
using Genie.Router, Stipple, StipplePlotly
include("src/Presentations.jl")
using ..Presentations
in Presentations.jl:
module Presentations
using ..Stipple, ..StipplePlotly
Unfortunately, revise does not work anymore with this setup. Do I need to live with the fact that I cannot have a fast startup time AND revise? Reorganizing my code into bigger modules would also work to reduce startup time by reducing the number of times I have to import stuff (while being able to keep revise), and I'll probably do it. However, it won't be as fast (I have to import the Genie framework at least twice), and arguably not as nice, so I am wondering whether I am missing something here.
Note: Omitting the include statement and writing "using Presentations" in routes.jl does not work (as I wrote here)
Cheers

Duplicate issue #692: Can't track changes in module loaded via "using ..Module"?
Created: 2022-07-01T14:53:14Z
Hello!
I have a Genie app looking like this:
routes.jl:
using Genie.Router, Stipple, StipplePlotly #modules belonging to the Genie framework
using Presentations
Presentations.jl: (a file containing a local module I am working on)
module Presentations
using Stipple, StipplePlotly
This works fine with revise: If I update Presentations.jl, revise tracks the changes.
However, I found that my app loads much faster (45 sec versus 90 sec) when I use the following way of importing modules:
in routes.jl:
using Genie.Router, Stipple, StipplePlotly
include("src/Presentations.jl")
using ..Presentations
in Presentations.jl:
module Presentations
using ..Stipple, ..StipplePlotly
Unfortunately, revise does not work anymore with this setup. Do I need to live with the fact that I cannot have a fast startup time AND revise? Reorganizing my code into bigger modules would also work to reduce startup time by reducing the number of times I have to import stuff (while being able to keep revise), and I'll probably do it. However, it won't be as fast (I have to import the Genie framework at least twice), and arguably not as nice, so I am wondering whether I am missing something here.
Note: Omitting the include statement and writing "using Presentations" in routes.jl does not work (as I wrote here)
Cheers

Closing comment (2024-01-07T17:47:30Z): I've tested a setup that is similar to #692 (comment). To be completely explicit:
tim@diva:~/tmp/Genie$ ls
A  Manifest.toml  Project.toml
tim@diva:~/tmp/Genie$ ls A
Project.toml  src
tim@diva:~/tmp/Genie$ ls A/src
A.jl  B.jl
tim@diva:~/tmp/Genie$ cat A/src/A.jl
module A
include("B.jl")
using .B
function test()
  println("111")
end
end
tim@diva:~/tmp/Genie$ cat A/src/B.jl
module B
function foo()
    println("bbb")
end
end
tim@diva:~/tmp/Genie$ cat Project.toml
name = "Genie"
uuid = "6a8f542f-de03-4d19-bfd3-4fcc20d8e9e1"
authors = ["Tim Holy <tim.holy@gmail.com>"]
version = "0.1.0"

[deps]
A = "a69466e2-2ca7-41fc-94e8-fe53742bfb11"
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
tim@diva:~/tmp/Genie$ cat A/Project.toml
name = "A"
uuid = "a69466e2-2ca7-41fc-94e8-fe53742bfb11"
authors = ["Tim Holy <tim.holy@gmail.com>"]
version = "0.1.0"
Revise seems to work just fine in Revising B. (This is with locally-developed branches of Revise & JuliaInterpreter, but those are either out or will be soon.)
I'll close this, but I can reopen it if someone provides a minimal working example.