Compare commits

...

3 Commits

Author SHA1 Message Date
benwis
7789d58e7b v0.6.14 2024-08-13 19:16:17 -07:00
Saber Haj Rabiee
4c6f3d067f fix: update wasm-bindgen and web-sys for leptos_0.6 (#2830) 2024-08-13 16:19:24 -07:00
Greg Johnston
0388903110 fix: support complex struct form submits without JS (closes #2790) 2024-08-07 09:43:19 -04:00
11 changed files with 37 additions and 33 deletions

View File

@@ -28,24 +28,24 @@ members = [
exclude = ["benchmarks", "examples"]
[workspace.package]
version = "0.6.13"
version = "0.6.14"
rust-version = "1.75"
[workspace.dependencies]
oco_ref = { path = "./oco", version = "0.1.0" }
leptos = { path = "./leptos", version = "0.6.13" }
leptos_dom = { path = "./leptos_dom", version = "0.6.13" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.13" }
leptos_macro = { path = "./leptos_macro", version = "0.6.13" }
leptos_reactive = { path = "./leptos_reactive", version = "0.6.13" }
leptos_server = { path = "./leptos_server", version = "0.6.13" }
server_fn = { path = "./server_fn", version = "0.6.13" }
server_fn_macro = { path = "./server_fn_macro", version = "0.6.13" }
leptos = { path = "./leptos", version = "0.6.14" }
leptos_dom = { path = "./leptos_dom", version = "0.6.14" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.14" }
leptos_macro = { path = "./leptos_macro", version = "0.6.14" }
leptos_reactive = { path = "./leptos_reactive", version = "0.6.14" }
leptos_server = { path = "./leptos_server", version = "0.6.14" }
server_fn = { path = "./server_fn", version = "0.6.14" }
server_fn_macro = { path = "./server_fn_macro", version = "0.6.14" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.6" }
leptos_config = { path = "./leptos_config", version = "0.6.13" }
leptos_router = { path = "./router", version = "0.6.13" }
leptos_meta = { path = "./meta", version = "0.6.13" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.13" }
leptos_config = { path = "./leptos_config", version = "0.6.14" }
leptos_router = { path = "./router", version = "0.6.14" }
leptos_meta = { path = "./meta", version = "0.6.14" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.14" }
[profile.release]
codegen-units = 1

View File

@@ -22,4 +22,4 @@ rstest = "0.17.0"
[dev-dependencies.web-sys]
features = ["HtmlElement", "XPathResult"]
version = "0.3.61"
version = "0.3.70"

View File

@@ -23,11 +23,7 @@ pub fn copy_to_clipboard(el: HtmlElement<AnyElement>, content: &str) {
evt.prevent_default();
evt.stop_propagation();
let _ = window()
.navigator()
.clipboard()
.expect("navigator.clipboard to be available")
.write_text(&content);
let _ = window().navigator().clipboard().write_text(&content);
let _ = el.clone().inner_html(format!("Copied \"{}\"", &content));
});
@@ -76,9 +72,13 @@ pub fn App() -> impl IntoView {
let data = "Hello World!";
view! {
<a href="#" use:copy_to_clipboard=data>"Copy \"" {data} "\" to clipboard"</a>
<a href="#" use:copy_to_clipboard=data>
"Copy \""
{data}
"\" to clipboard"
</a>
// automatically applies the directive to every root element in `SomeComponent`
<SomeComponent use:highlight />
<SomeComponent use:highlight/>
// no value will default to `().into()`
<button use:add_dot>"Add a dot"</button>
// `5.into()` automatically called

View File

@@ -27,7 +27,7 @@ thiserror = "1.0"
wasm-bindgen = "0.2"
serde_toml = "0.0.1"
toml = "0.8.8"
web-sys = { version = "0.3.67", features = ["FileList", "File"] }
web-sys = { version = "0.3.70", features = ["FileList", "File"] }
strum = { version = "0.25.0", features = ["strum_macros", "derive"] }
notify = { version = "6.1.1", optional = true }
pin-project-lite = "0.2.13"

View File

@@ -15,7 +15,7 @@ console_error_panic_hook = "0.1.7"
uuid = { version = "1", features = ["v4", "js", "serde"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
web-sys = { version = "0.3.60", features = ["Storage"] }
web-sys = { version = "0.3.70", features = ["Storage"] }
[dev-dependencies]
wasm-bindgen-test = "0.3.0"

View File

@@ -28,7 +28,7 @@ server_fn = { workspace = true, features = [
"url",
"cbor",
] }
web-sys = { version = "0.3.63", features = [
web-sys = { version = "0.3.70", features = [
"ShadowRoot",
"ShadowRootInit",
"ShadowRootMode",

View File

@@ -1,6 +1,6 @@
[package]
name = "leptos_meta"
version = "0.6.13"
version = "0.6.14"
edition = "2021"
authors = ["Greg Johnston"]
license = "MIT"

View File

@@ -8,9 +8,9 @@ codegen-units = 1
lto = true
[dependencies]
leptos = { version = "0.6.13", features = ["csr"] }
leptos_meta = { version = "0.6.13", features = ["csr"] }
leptos_router = { version = "0.6.13", features = ["csr"] }
leptos = { version = "0.6.14", features = ["csr"] }
leptos_meta = { version = "0.6.14", features = ["csr"] }
leptos_router = { version = "0.6.14", features = ["csr"] }
console_log = "1"
log = "0.4"
console_error_panic_hook = "0.1.7"

View File

@@ -1,6 +1,6 @@
[package]
name = "leptos_router"
version = "0.6.13"
version = "0.6.14"
edition = "2021"
authors = ["Greg Johnston", "Ben Wishovich"]
license = "MIT"

View File

@@ -40,7 +40,8 @@ where
{
async fn from_req(req: Request) -> Result<Self, ServerFnError<CustErr>> {
let string_data = req.as_query().unwrap_or_default();
let args = serde_qs::from_str::<Self>(string_data)
let args = serde_qs::Config::new(5, false)
.deserialize_str::<Self>(string_data)
.map_err(|e| ServerFnError::Args(e.to_string()))?;
Ok(args)
}
@@ -74,7 +75,8 @@ where
{
async fn from_req(req: Request) -> Result<Self, ServerFnError<CustErr>> {
let string_data = req.try_into_string().await?;
let args = serde_qs::from_str::<Self>(&string_data)
let args = serde_qs::Config::new(5, false)
.deserialize_str::<Self>(&string_data)
.map_err(|e| ServerFnError::Args(e.to_string()))?;
Ok(args)
}

View File

@@ -192,8 +192,10 @@ fn streaming_request(
let headers = Headers::new()?;
headers.append("Content-Type", content_type)?;
headers.append("Accept", accepts)?;
let mut init = RequestInit::new();
init.headers(&headers).method("POST").body(Some(&stream));
let init = RequestInit::new();
init.set_headers(&headers);
init.set_method("POST");
init.set_body(&stream);
// Chrome requires setting `duplex: "half"` on streaming requests
Reflect::set(