In https://github.com/DioxusLabs/dioxus/pull/1944, DioxusRouterExt::register_server_fns_with_handler was removed without providing a suitable replacement.
I used this method to provide state to Axum so that it could be extracted in the #[server(..)] functions. I know it is otherwise possible using Axum layers, but that isn't particularly ergonomic at the moment.
What strikes me as odd is that the argument's type signature is impl Fn() + 'static + Clone + Send, when I think it should be impl Fn(&mut DioxusServerContext) + 'static + Clone + Send,, so that there is a context to modify.
Feature Request
In https://github.com/DioxusLabs/dioxus/pull/1944,
DioxusRouterExt::register_server_fns_with_handler
was removed without providing a suitable replacement. I used this method to provide state to Axum so that it could be extracted in the#[server(..)]
functions. I know it is otherwise possible using Axum layers, but that isn't particularly ergonomic at the moment.Observed in Dioxus 0.5.0-alpha-2
Implement Suggestion
It was suggested in Discord that the following function could be made public or form the basis of another public function: https://github.com/DioxusLabs/dioxus/blob/b19a546c0ac639a5cf9e942fff7729ad30e91a5e/packages/fullstack/src/axum_adapter.rs#L485
What strikes me as odd is that the argument's type signature is
impl Fn() + 'static + Clone + Send,
when I think it should beimpl Fn(&mut DioxusServerContext) + 'static + Clone + Send,
, so that there is a context to modify.