feat: Experimental dioxus fullstack support
Based off https://github.com/marc2332/dioxus-query/pull/44 Closes https://github.com/marc2332/dioxus-query/issues/45
@marc2332 just had a go with this, but the use_server_query somehow never returns (just keeps blocking while page loading).
@marc2332 just had a go with this, but the use_server_query somehow never returns (just keeps blocking while page loading).
So, in other words the suspense does not get "resolved" in the server side? Can you share how you call use_server_query?
I don't have a minimal example (yet), but I call it something like this:
#[component]
fn Foobar(id: ReadOnlySignal<Uuid>) -> Element {
let foobar_query = use_server_query(Query::new(id(), GetFoobar())).suspend()?;
// …
}
#[derive(Clone, PartialEq, Hash, Eq)]
struct GetFoobar();
impl QueryCapability for GetFoobar {
type Ok = String;
type Err = String;
type Keys = Uuid;
async fn run(&self, id: &Self::Keys) -> Result<Self::Ok, Self::Err> {
let foobar = load_foobar(id).await; // this calls the server function
Ok(foobar)
}
}
I don't have a minimal example (yet), but I call it something like this:
#[component] fn Foobar(id: ReadOnlySignal<Uuid>) -> Element { let foobar_query = use_server_query(Query::new(id(), GetFoobar())).suspend()?; // … } #[derive(Clone, PartialEq, Hash, Eq)] struct GetFoobar(); impl QueryCapability for GetFoobar { type Ok = String; type Err = String; type Keys = Uuid; async fn run(&self, id: &Self::Keys) -> Result<Self::Ok, Self::Err> { let foobar = load_foobar(id).await; // this calls the server function Ok(foobar) } }
Can you try with the last commit I pushed?
@marc2332 behaviour did not change for ssr, it seems to not resolve at all. While I don't really need ssr, fullstack is just so convenient,
id like to see server functions n hydration supported :(