One of the reasons why the page is not reloading when changing the UI code is that it is in an anonymous function. In this example, after editing the code in ui and uianon while the app is running, only the pages /page /file and /route are refreshed with the new content.
using GenieFramework
@genietools
@app begin
@out var1 = 0
end
function ui()
# StippleUI.layout(["aaa"])
"<h1>test</h1>"
end
uianon = () -> "<h1>test</h1>"
@page("/page", ui)
@page("/file", "ui.jl")
route("/route") do
model = @init
page(model, ui) |> html
end
@page("/pageanon", uianon)
route("/routeanon") do
model = @init
page(model, uianon) |> html
end
However, changing the uidefinition in ui.jlto a standard function does not fix the reload issue. What does fix it is placing the entire uifunction inside app.jl, all in one file. Therefore, I guess the issue lies in how the code is imported via include.
Ideally we'd use @app("/", "ui.jl"), but we can't yet as there's an error related to q-layout(issue here). We'll look into it.
One of the reasons why the page is not reloading when changing the UI code is that it is in an anonymous function. In this example, after editing the code in
uianduianonwhile the app is running, only the pages/page/fileand/routeare refreshed with the new content.However, changing the
uidefinition inui.jlto a standard function does not fix the reload issue. What does fix it is placing the entireuifunction insideapp.jl, all in one file. Therefore, I guess the issue lies in how the code is imported viainclude.Ideally we'd use
@app("/", "ui.jl"), but we can't yet as there's an error related toq-layout(issue here). We'll look into it.