-
Notifications
You must be signed in to change notification settings - Fork 192
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
Multiple app modules no longer works #698
Comments
It works if I downgrade to: It does not work if I: So it's not just Julia 1.10, also the most recent versions of GenieFramework and Genie are causing this in Julia 1.9.4. |
Btw, the usage of Index and Form can be simplified like below, just use Index.ui instead of Main.App.Index.ui. module App
using GenieFramework
@genietools
include("Index.jl")
include("Form.jl")
@page("/", Index.ui, model=Index)
@page("/form", Form.ui, model=Form)
end |
@essenciary @hhaensel looks like the browser cannot subscribe to the channel I downgraded Genie to 5.21.2 as suggested by @MariusDrulea and it works on Julia 1.9.3. This is the code I'm testing with module App
using GenieFramework
@genietools
module Index
using GenieFramework
@app begin
@out name = "John"
end
function ui()
h1("Welcome {{name}}!")
end
end
module Form
using GenieFramework
using Statistics
@app begin
@in N = 0
@out m = 0.0
@onchange N begin
@show N
m = mean(rand(N))
end
end
function ui()
cell([
textfield("How many numbers?", :N)
p("The average of {{N}} random numbers is {{m}}")
])
end
end
using .Index
using .Form
@page("/", Main.App.Index.ui, model= Main.App.Index)
@page("/form", Main.App.Form.ui, model= Main.App.Form)
end
|
@MariusDrulea @PGimenez thanks, I'll allocate some time to debug it. |
@MariusDrulea @PGimenez this is fixed in Stipple 0.27.30 but will require an extra configuration Previous example adapted: module App
using GenieFramework
@genietools
module Index
using GenieFramework
Stipple.ALWAYS_REGISTER_CHANNELS[] = true
@app begin
@out name = "John"
end
function ui()
h1("Welcome {{name}}!")
end
end
module Form
using GenieFramework
using Statistics
Stipple.ALWAYS_REGISTER_CHANNELS[] = true
@app begin
@in N = 0
@out m = 0.0
@onchange N begin
@show N
m = mean(rand(N))
end
end
function ui()
cell([
textfield("How many numbers?", :N)
p("The average of {{N}} random numbers is {{m}}")
])
end
end
using .Index
using .Form
@page("/", Main.App.Index.ui, model= Main.App.Index)
@page("/form", Main.App.Form.ui, model= Main.App.Form)
end |
I think we can improve on this, ex in the Or better understand the difference between explicitly passing models or not... Something behaves differently. |
The example provided here does not seem to work after the most recent updates of genie, genieframework. Tested on an Ubuntu machine with Julia 1.10 and also Julia 1.9.4.
https://learn.genieframework.com/docs/guides/adding-reactive-pages#multiple-app-modules
The code compiles, but the web page does not display anything.
The text was updated successfully, but these errors were encountered: