From f4aff7ee2fa9348463020f7812644262ef74020c Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Fri, 26 Jan 2024 18:09:06 -0500 Subject: [PATCH] migrate leptos to 0.6 and axum to 0.7 --- Cargo.lock | 562 ++++++++++++++++++----------------------- Cargo.toml | 24 +- server/src/fileserv.rs | 9 +- server/src/main.rs | 7 +- 4 files changed, 261 insertions(+), 341 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6649b9..3247f6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,21 +49,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "allocator-api2" version = "0.2.16" @@ -82,7 +67,7 @@ version = "0.1.0" dependencies = [ "cfg-if", "femark", - "http", + "http 1.0.0", "leptos", "leptos_axum", "leptos_meta", @@ -92,22 +77,6 @@ dependencies = [ "toml 0.8.8", ] -[[package]] -name = "async-compression" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" -dependencies = [ - "brotli", - "flate2", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", - "zstd", - "zstd-safe", -] - [[package]] name = "async-recursion" version = "1.0.5" @@ -166,23 +135,24 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" dependencies = [ "async-trait", "axum-core", - "axum-macros", - "bitflags 1.3.2", "bytes", "futures-util", - "http", + "http 1.0.0", "http-body", + "http-body-util", "hyper", + "hyper-util", "itoa", "matchit", "memchr", "mime", + "multer", "percent-encoding", "pin-project-lite", "rustversion", @@ -195,35 +165,28 @@ dependencies = [ "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", "bytes", "futures-util", - "http", + "http 1.0.0", "http-body", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper", "tower-layer", "tower-service", -] - -[[package]] -name = "axum-macros" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdca6a10ecad987bda04e95606ef85a5417dcaac1a78455242d72e031e2b6b62" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.48", + "tracing", ] [[package]] @@ -271,27 +234,6 @@ dependencies = [ "wyz", ] -[[package]] -name = "brotli" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.14.0" @@ -377,7 +319,6 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "jobserver", "libc", ] @@ -493,31 +434,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -559,6 +475,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "deranged" version = "0.3.11" @@ -653,16 +582,6 @@ dependencies = [ "tree-sitter-typescript", ] -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" @@ -822,7 +741,28 @@ dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.1.7", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils 0.2.0", + "http 0.2.11", "js-sys", "pin-project", "serde", @@ -847,17 +787,30 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.3.24" +name = "gloo-utils" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "h2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", + "http 1.0.0", "indexmap 2.1.0", "slab", "tokio", @@ -910,12 +863,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "hermit-abi" version = "0.3.4" @@ -943,21 +890,44 @@ dependencies = [ ] [[package]] -name = "http-body" -version = "0.4.6" +name = "http" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", - "http", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.0.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body", "pin-project-lite", ] [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" [[package]] name = "httparse" @@ -973,26 +943,39 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", - "http", + "http 1.0.0", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdea9aac0dbe5a9240d68cfd9501e2db94222c6dc06843e06640b9e07f0fdc67" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.0.0", + "http-body", + "hyper", + "pin-project-lite", "socket2", "tokio", - "tower-service", "tracing", - "want", ] [[package]] @@ -1058,22 +1041,6 @@ version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "iri-string" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21859b667d66a4c1dacd9df0863b3efb65785474255face87f5bca39dd8407c0" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "itertools" version = "0.12.0" @@ -1089,15 +1056,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" -[[package]] -name = "jobserver" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.67" @@ -1115,9 +1073,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leptos" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269ba4ba91ffa73d9559c975e0be17bd4eb34c6b6abd7fdd5704106132d89d2a" +checksum = "3478784b7ea7f4329bfa6d222c79e67bdcb8541339682124b7e01f657debf89c" dependencies = [ "cfg-if", "leptos_config", @@ -1137,22 +1095,23 @@ dependencies = [ [[package]] name = "leptos_axum" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbfb557aa186ab4c3a693d3e23402805d879ead5d25096a4ab3fca06ee7688b4" +checksum = "78d5965dea7f63b50a0049fd7ccd710340025fcaf677715895cf1b1ee301f1ff" dependencies = [ "axum", "cfg-if", "futures", - "http", - "hyper", + "http-body-util", "leptos", "leptos_integration_utils", + "leptos_macro", "leptos_meta", "leptos_router", "once_cell", "parking_lot", "serde_json", + "server_fn", "tokio", "tokio-util", "tracing", @@ -1160,9 +1119,9 @@ dependencies = [ [[package]] name = "leptos_config" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72d8689d54737991831e9b279bb4fba36d27a93aa975c75cd4241d9a4a425ec" +checksum = "66923ee5dfe1f46b35bd46140fb697a8f1ed876556f2d95af774ff53eb83a91d" dependencies = [ "config", "regex", @@ -1173,9 +1132,9 @@ dependencies = [ [[package]] name = "leptos_dom" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad314950d41acb1bfdb8b5924811b2983484a8d6f69a20b834a173a682657ed4" +checksum = "f32aac29058236930139a25566bfae50aa1aed3f5a9535f73dad498d7198f629" dependencies = [ "async-recursion", "cfg-if", @@ -1203,9 +1162,9 @@ dependencies = [ [[package]] name = "leptos_hot_reload" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f62dcab17728877f2d2f16d2c8a6701c4c5fbdfb4964792924acb0b50529659" +checksum = "018635fa2c4d9df22b22a5db0a99ecdaa54fe0b8071e03804730e01ab6ee7dad" dependencies = [ "anyhow", "camino", @@ -1221,9 +1180,9 @@ dependencies = [ [[package]] name = "leptos_integration_utils" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddda3a3b768dad90f80fb56ac6e250bc5c60755f8e3df225913aba4364ed7ee" +checksum = "ac17f1781bca258ea4b1d9807805e7ed29f179be331beb693ee10629baf0c782" dependencies = [ "futures", "leptos", @@ -1235,9 +1194,9 @@ dependencies = [ [[package]] name = "leptos_macro" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57955d66f624265222444a5c565fea38efa5b0152a1dfc7c060a78e5fb62a852" +checksum = "d2e3b52e7e463f075ff453c225b4ca0fef3a306a11900f573a94a4e39a3b727f" dependencies = [ "attribute-derive", "cfg-if", @@ -1258,9 +1217,9 @@ dependencies = [ [[package]] name = "leptos_meta" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc25c0f7f14ed5daf42b8d0d273ed790b0449e8ba8cff1c2fa800dc90a75acb" +checksum = "41631f5793f6e8e1f76b126f3bbfde586e9224483f25a58ad0709d3d36da1412" dependencies = [ "cfg-if", "indexmap 2.1.0", @@ -1272,15 +1231,16 @@ dependencies = [ [[package]] name = "leptos_reactive" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f54a525a0edfc8c2bf3ee92aae411800b8b10892c9cd819f8e8a6d4f0d62f3" +checksum = "4d14dbf84793e5dd44c6c87bf7819839033671ae45da3242546cde253e670db7" dependencies = [ "base64", "cfg-if", "futures", "indexmap 2.1.0", "js-sys", + "miniserde", "paste", "pin-project", "rkyv", @@ -1300,13 +1260,13 @@ dependencies = [ [[package]] name = "leptos_router" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b31087173c60e25c329a1c6786756dd9ee97750b378622df4d780db160a09040" +checksum = "404829710124417613cc311040420dce1f13e51bee2ffe7420bd6a91961ed300" dependencies = [ "cached", "cfg-if", - "gloo-net", + "gloo-net 0.2.6", "itertools", "js-sys", "lazy_static", @@ -1318,6 +1278,7 @@ dependencies = [ "once_cell", "percent-encoding", "regex", + "send_wrapper", "serde", "serde_json", "serde_qs", @@ -1331,9 +1292,9 @@ dependencies = [ [[package]] name = "leptos_server" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1517c2024bc47d764e96053e55b927f8a2159e735a0cc47232542b493df9d" +checksum = "35019328184d6328846913c5a1ce3b491472b59a46ab0b8cda0c4dcdfda629d0" dependencies = [ "inventory", "lazy_static", @@ -1437,12 +1398,34 @@ dependencies = [ "unicase", ] +[[package]] +name = "mini-internal" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51c55587ac25c2d63a75e4171221b2803a9b9e83aeb7bdfde5833c4cd578b50d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniserde" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621df4a46e5de4c1541242407da38281ea0e320b94e238477688a36a1a059f7" +dependencies = [ + "itoa", + "mini-internal", + "ryu", +] + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1463,6 +1446,24 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "multer" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15d522be0a9c3e46fd2632e272d178f56387bdb5c9fbb3a36c649062e9b5219" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 1.0.0", + "httparse", + "log", + "memchr", + "mime", + "spin", + "version_check", +] + [[package]] name = "nom" version = "7.1.3" @@ -1595,12 +1596,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" - [[package]] name = "powerfmt" version = "0.2.0" @@ -1835,41 +1830,6 @@ dependencies = [ "bytecheck", ] -[[package]] -name = "reqwest" -version = "0.11.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - [[package]] name = "rkyv" version = "0.7.43" @@ -1964,6 +1924,15 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +dependencies = [ + "futures-core", +] + [[package]] name = "serde" version = "1.0.195" @@ -1975,9 +1944,9 @@ dependencies = [ [[package]] name = "serde-wasm-bindgen" -version = "0.5.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +checksum = "b9b713f70513ae1f8d92665bbbbda5c295c2cf1da5542881ae5eefe20c9af132" dependencies = [ "js-sys", "serde", @@ -2074,49 +2043,58 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c265de965fe48e09ad8899d0ab1ffebdfa1a9914e4de5ff107b07bd94cf7541" +checksum = "a385f47db08f9d14c124c0e2a342bacac34ba4597c38ed6608ae00f4a2e1bdde" dependencies = [ + "axum", + "bytes", "ciborium", "const_format", - "gloo-net", + "dashmap", + "futures", + "gloo-net 0.5.0", + "http 1.0.0", + "http-body-util", + "hyper", "inventory", "js-sys", - "lazy_static", "once_cell", - "proc-macro2", - "quote", - "reqwest", + "send_wrapper", "serde", "serde_json", "serde_qs", "server_fn_macro_default", - "syn 2.0.48", "thiserror", + "tower", + "tower-layer", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", "xxhash-rust", ] [[package]] name = "server_fn_macro" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77000541a62ceeec01eef3ee0f86c155c33dac5fae750ad04a40852c6d5469a" +checksum = "42c807bed78dcfe0357474f887a3d6820cc7b7b22afa65eb6e74986aa8192c7f" dependencies = [ "const_format", - "proc-macro-error", + "convert_case", "proc-macro2", "quote", - "serde", "syn 2.0.48", "xxhash-rust", ] [[package]] name = "server_fn_macro_default" -version = "0.5.7" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3353f22e2bcc451074d4feaa37317d9d17dff11d4311928384734ea17ab9ca" +checksum = "6a24237266f429382c90f4329a6358a4ad9ecf4dfd445d0ccd5cdd2f02cead38" dependencies = [ "server_fn_macro", "syn 2.0.48", @@ -2194,6 +2172,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.10.0" @@ -2240,27 +2224,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tap" version = "1.0.1" @@ -2445,32 +2408,27 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "0da193277a4e2c33e59e09b5861580c33dd0a637c3883d0fa74ba40c0374af2e" dependencies = [ - "async-compression", - "base64", "bitflags 2.4.2", "bytes", - "futures-core", "futures-util", - "http", + "http 1.0.0", "http-body", + "http-body-util", "http-range-header", "httpdate", - "iri-string", "mime", "mime_guess", "percent-encoding", "pin-project-lite", "tokio", "tokio-util", - "tower", "tower-layer", "tower-service", "tracing", - "uuid", ] [[package]] @@ -2648,12 +2606,6 @@ dependencies = [ "tree-sitter", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "typed-builder" version = "0.18.1" @@ -2764,15 +2716,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2845,6 +2788,19 @@ version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.67" @@ -2961,16 +2917,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys", -] - [[package]] name = "wyz" version = "0.5.1" @@ -3011,31 +2957,3 @@ dependencies = [ "quote", "syn 2.0.48", ] - -[[package]] -name = "zstd" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index 4d1bc45..99d3e74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,22 +9,26 @@ lto = true opt-level = 'z' [workspace.dependencies] -leptos = { version = "0.5", features = ["nightly", "experimental-islands"] } -leptos_meta = { version = "0.5", features = ["nightly"] } -leptos_router = { version = "0.5", features = ["nightly"] } -leptos_axum = { version = "0.5", features = ["experimental-islands"]} +leptos = { version = "0.6", features = [ + "nightly", + "experimental-islands", + "miniserde", +] } +leptos_axum = { version = "0.6", features = ["experimental-islands"] } +leptos_meta = { version = "0.6", features = ["nightly"] } +leptos_router = { version = "0.6", features = ["nightly"] } -axum = "0.6.20" +axum = "0.7" cfg-if = "1" -console_error_panic_hook = "0.1.7" +console_error_panic_hook = "0.1" console_log = "1" -http = "0.2.9" +http = "1" log = "0.4.20" simple_logger = "4.2.0" thiserror = "1" -tokio = { version = "1.33.0", features = ["full"] } -tower = { version = "0.4.13", features = ["full"] } -tower-http = { version = "0.4", features = ["full"] } +tokio = { version = "1", features = ["full"] } +tower = { version = "0.4", features = ["full"] } +tower-http = { version = "0.5", features = ["fs"] } wasm-bindgen = "0.2.89" # See https://github.com/akesson/cargo-leptos for documentation of all the parameters. diff --git a/server/src/fileserv.rs b/server/src/fileserv.rs index 2713ec5..3ec1e0e 100644 --- a/server/src/fileserv.rs +++ b/server/src/fileserv.rs @@ -1,7 +1,7 @@ use app::App; use axum::response::Response as AxumResponse; use axum::{ - body::{boxed, Body, BoxBody}, + body::Body, extract::State, http::{Request, Response, StatusCode, Uri}, response::IntoResponse, @@ -21,13 +21,12 @@ pub async fn file_and_error_handler( if res.status() == StatusCode::OK { res.into_response() } else { - let handler = - leptos_axum::render_app_to_stream(options.to_owned(), move || view! { }); + let handler = leptos_axum::render_app_to_stream(options.to_owned(), App); handler(req).await.into_response() } } -async fn get_static_file(uri: Uri, root: &str) -> Result, (StatusCode, String)> { +async fn get_static_file(uri: Uri, root: &str) -> Result, (StatusCode, String)> { let req = Request::builder() .uri(uri.clone()) .body(Body::empty()) @@ -35,7 +34,7 @@ async fn get_static_file(uri: Uri, root: &str) -> Result, (Sta // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot` // This path is relative to the cargo root match ServeDir::new(root).oneshot(req).await { - Ok(res) => Ok(res.map(boxed)), + Ok(res) => Ok(res.into_response()), Err(err) => Err(( StatusCode::INTERNAL_SERVER_ERROR, format!("Something went wrong: {err}"), diff --git a/server/src/main.rs b/server/src/main.rs index 72a3c8e..4843122 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,5 +1,5 @@ use app::*; -use axum::{routing::post, Router}; +use axum::Router; use fileserv::file_and_error_handler; use leptos::*; use leptos_axum::{build_static_routes, generate_route_list_with_exclusions_and_ssg, LeptosRoutes}; @@ -23,16 +23,15 @@ async fn main() { // build our application with a route let app = Router::new() - .route("/api/*fn_name", post(leptos_axum::handle_server_fns)) .leptos_routes(&leptos_options, routes, App) .fallback(file_and_error_handler) .with_state(leptos_options); // run our app with hyper // `axum::Server` is a re-export of `hyper::Server` + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); log::info!("listening on http://{}", &addr); - axum::Server::bind(&addr) - .serve(app.into_make_service()) + axum::serve(listener, app.into_make_service()) .await .unwrap(); }