Improve the _eval_panel wrapper to ensure that functions are given the correct pn.state.curdoc context and that we run Panel's onload handlers
Add integration with Panel's immediate dispatch mechanism, ensuring that Panel does not error when it dispatches events across the websocket.
In the long run we will have to work out whether the _eval_panel code really should live in this repo or whether we should simply merge bokeh-fastapi support upstream. The same is true with the dispatch_fastapi hook.
This PR does two things:
_eval_panel
wrapper to ensure that functions are given the correctpn.state.curdoc
context and that we run Panel's onload handlersIn the long run we will have to work out whether the
_eval_panel
code really should live in this repo or whether we should simply merge bokeh-fastapi support upstream. The same is true with thedispatch_fastapi
hook.Depends on https://github.com/holoviz/panel/pull/6820