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:
1 parent
fc01a002fd
commit
92792aded9
47 files changed
+1241
-703
No files matched your search
@@ -14,7 +14,7 @@ use futures_util::{pin_mut, FutureExt};
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::LazyLock;
|
||||
use std::task::{Context as TaskContext, Waker};
|
||||
use std::{any::Any, collections::HashMap, rc::Rc};
|
||||
use std::{any::Any, rc::Rc};
|
||||
|
||||
fn wrap_event_data<T: Any>(value: T) -> Rc<dyn Any> {
|
||||
Rc::new(PlatformEventData::new(Box::new(value)))
|
||||
@@ -262,7 +262,7 @@ impl EventHandler for DioxusEventHandler<'_> {
|
||||
|
||||
DomEventData::Input(data) => Some(wrap_event_data(NativeFormData {
|
||||
value: data.value.clone(),
|
||||
values: HashMap::new(),
|
||||
values: vec![],
|
||||
})),
|
||||
|
||||
// TODO: Implement IME handling
|
||||
|
||||
@@ -13,7 +13,6 @@ use dioxus_html::{
|
||||
};
|
||||
use keyboard_types::{Code, Key, Location, Modifiers};
|
||||
use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub struct NativeConverter {}
|
||||
|
||||
@@ -110,7 +109,7 @@ impl HtmlEventConverter for NativeConverter {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct NativeFormData {
|
||||
pub value: String,
|
||||
pub values: HashMap<String, FormValue>,
|
||||
pub values: Vec<(String, FormValue)>,
|
||||
}
|
||||
|
||||
impl HasFormData for NativeFormData {
|
||||
@@ -122,9 +121,13 @@ impl HasFormData for NativeFormData {
|
||||
self.value.clone()
|
||||
}
|
||||
|
||||
fn values(&self) -> HashMap<String, FormValue> {
|
||||
fn values(&self) -> Vec<(String, FormValue)> {
|
||||
self.values.clone()
|
||||
}
|
||||
fn valid(&self) -> bool {
|
||||
// todo: actually implement validation here.
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl HasFileData for NativeFormData {
|
||||
|
||||
Reference in new issue
Block a user