Open frankier opened 1 month ago
Okay I managed to trigger this like so:
using HTTP
using Bonito: App
using Bonito.DOM
using Makie
#using WGLMakie
function main()
# start a blocking server
HTTP.listen() do http::HTTP.Stream
HTTP.setstatus(http, 200)
HTTP.startwrite(http)
if http.message.target == "/fragment"
app = App() do
DOM.div("hi!")
end
io = IOBuffer()
show(io, "text/html", app)
body = take!(io)
write(http, body)
else
write(http, "<html><body>")
write(http, "<script src=\"https://unpkg.com/htmx.org@2.0.2\"></script>")
write(http, "<h1>fragment insertion</h1>")
write(http, "<button hx-get=\"/fragment\" hx-target=\"#results\">Click Me</button>")
write(http, "<div id=\"results\"></div>")
write(http, "</body></html>")
end
end
end
if abspath(PROGRAM_FILE) == @__FILE__
main()
end
Related: https://github.com/MakieOrg/Makie.jl/pull/4343#issuecomment-2342745300
When we try a websocket write,
ensure_connection(...)
is called, which callssetup_connection()
without an argumenthttps://github.com/SimonDanisch/Bonito.jl/blob/1a6083e84a660cc50e25bcd13349e3106cffcc7f/js_dependencies/Websocket.js#L22
However it looks like the
config
argument is actually requiredhttps://github.com/SimonDanisch/Bonito.jl/blob/1a6083e84a660cc50e25bcd13349e3106cffcc7f/js_dependencies/Websocket.js#L159