More fullstack fixes (#4737)

* allow `--server` only builds!

* rollback example

* capture `/:route` routes

* fix: properly implement file uploads in forms

* implement desktop form uploads

* Performant serialization of form bytes

* finish up file stuff

* cleanups

* add request headers to streaming context

* remove some unwraps
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-07 23:07:43 -07:00
1 parent fc01a002fd
commit 92792aded9
47 files changed
+1241 -703

No files matched your search

+4 -9
View File
@@ -13,7 +13,7 @@ use axum::{
};
use dioxus_core::{Element, VirtualDom};
use futures::Stream;
use http::header::*;
use http::{header::*, request::Parts};
use std::path::Path;
use std::sync::Arc;
use tower::util::MapResponse;
@@ -297,13 +297,8 @@ impl RenderHandleState {
};
let (parts, _) = request.into_parts();
let url = parts
.uri
.path_and_query()
.ok_or(StatusCode::BAD_REQUEST)?
.to_string();
match state.render(url, cfg, build_virtual_dom).await {
match state.render(parts, cfg, build_virtual_dom).await {
Ok((freshness, rx)) => {
let mut response =
axum::response::Html::from(Body::from_stream(rx)).into_response();
@@ -338,7 +333,7 @@ impl RenderHandleState {
/// Render the application to HTML.
pub async fn render<'a>(
&'a self,
route: String,
parts: Parts,
cfg: &'a ServeConfig,
virtual_dom_factory: impl FnOnce() -> VirtualDom + Send + Sync + 'static,
) -> Result<
@@ -350,7 +345,7 @@ impl RenderHandleState {
> {
self.renderers
.clone()
.render_to(cfg, route, virtual_dom_factory)
.render_to(parts, cfg, virtual_dom_factory)
.await
}
}