Please, is there a way to get hot-reload while I work on the app in Bonito.jl? I have tried revise, liveServer, but nothing worked. I want to change some logic, style in the Bonito app and see the changes in browser.
The only way now to see the changes I’m making is to restart the whole application.
Thank in advance 
/m
I too hit the same problem, that if I launch the server, then relaunching the server Revise doesn’t work. However, individual apps like
my_app() = App(; title="My App") do
can be relaunched at the REPL with my_app(), and for that Revise works fine.
@sdanisch Is there any way to stop the server and relaunch it with the updated code (ideally on the same port?)
1 Like
Have you tried route!(server, route => new_app) ?
Or App(app_function) and then revising/evaling app_function?
I must admit I haven’t use LiveServer in a while - it was a bit fragile as far as I remember.
1 Like
Thanks for both!
Not sure if ideal but a working setup I have now is below. Now I just run the refresh!(server) and all layouts, styles, logic is updateded.
module WebApp
using Bonito
using WGLMakie
using Markdown
include(“styles/styles.jl”)
include(“plots/plots.jl”)
include(“pages/system_page.jl”)
include(“pages/local_page.jl”)
include(“ui/components.jl”)
include(“ui/layout.jl”)
function ui(session)
layout(session)
end
function start_server(host = “127.0.0.1”, port=8888)
Server(
App(ui; indicator = ConnectionIndicator()),
host,
port)
end
function refresh!(server)
include(“webapp/styles/styles.jl”)
include(“webapp/plots/plots.jl”)
include(“webapp/pages/system_page.jl”)
include(“webapp/pages/local_page.jl”)
include(“webapp/ui/components.jl”)
include(“webapp/ui/layout.jl”)
route!(server, “/” => App(ui; indicator=ConnectionIndicator()))
end
end
1 Like