From 54951621e4fbff248a7ecb37051765517d8830fe Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 15 Nov 2024 12:20:55 +0100 Subject: [PATCH 01/16] wip: upgrade leptos --- Cargo.lock | 760 +++++++++--------- Cargo.toml | 12 +- src/backend/assets.rs | 2 +- src/backend/mod.rs | 4 +- src/common/mod.rs | 20 + src/frontend/api.rs | 4 +- src/frontend/app.rs | 55 +- src/frontend/components/article_nav.rs | 28 +- src/frontend/components/connect.rs | 21 +- src/frontend/components/credentials.rs | 14 +- src/frontend/components/editor.rs | 10 +- .../components/instance_follow_button.rs | 8 +- src/frontend/components/nav.rs | 16 +- src/frontend/dark_mode.rs | 2 +- src/frontend/mod.rs | 2 +- src/frontend/pages/article/actions.rs | 20 +- src/frontend/pages/article/create.rs | 21 +- src/frontend/pages/article/edit.rs | 23 +- src/frontend/pages/article/history.rs | 2 +- src/frontend/pages/article/list.rs | 7 +- src/frontend/pages/article/read.rs | 2 +- src/frontend/pages/diff.rs | 6 +- src/frontend/pages/instance/details.rs | 10 +- src/frontend/pages/instance/list.rs | 8 +- src/frontend/pages/login.rs | 12 +- src/frontend/pages/mod.rs | 10 +- src/frontend/pages/notifications.rs | 16 +- src/frontend/pages/register.rs | 13 +- src/frontend/pages/search.rs | 12 +- src/frontend/pages/user_profile.rs | 10 +- 30 files changed, 599 insertions(+), 531 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f4b086..5d76a59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,7 +36,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.65", "tokio", "tower 0.4.13", "tracing", @@ -110,6 +110,18 @@ dependencies = [ "libc", ] +[[package]] +name = "any_spawner" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9747eb01aed7603aba23f7c869d5d7e5d37aab9c3501aced42d8fdb786f1f6e3" +dependencies = [ + "futures", + "thiserror 1.0.65", + "tokio", + "wasm-bindgen-futures", +] + [[package]] name = "anyhow" version = "1.0.91" @@ -139,17 +151,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.85", -] - [[package]] name = "async-trait" version = "0.1.83" @@ -158,7 +159,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -178,7 +179,7 @@ dependencies = [ "manyhow", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -194,7 +195,7 @@ dependencies = [ "proc-macro2", "quote", "quote-use", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -290,7 +291,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -415,38 +416,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" -[[package]] -name = "cached" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eb5776f28a149524d1d8623035760b4454ec881e8cf3838fa8d7e1b11254b3" -dependencies = [ - "cached_proc_macro", - "cached_proc_macro_types", - "hashbrown 0.13.2", - "instant", - "once_cell", - "thiserror", -] - -[[package]] -name = "cached_proc_macro" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c878c71c2821aa2058722038a59a67583a4240524687c6028571c9b395ded61f" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cached_proc_macro_types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" - [[package]] name = "camino" version = "1.1.9" @@ -495,33 +464,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "cipher" version = "0.4.4" @@ -538,7 +480,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d3ad3122b0001c7f140cf4d605ef9a9e2c24d96ab0b4fb4347b76de2425f445" dependencies = [ - "thiserror", + "serde", + "serde_json", + "thiserror 1.0.65", ] [[package]] @@ -641,6 +585,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "const_str_slice_concat" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b" + [[package]] name = "convert_case" version = "0.4.0" @@ -827,7 +777,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -860,16 +810,17 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown 0.14.5", "lock_api", "once_cell", @@ -885,7 +836,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -927,7 +878,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -969,7 +920,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -989,7 +940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1002,7 +953,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1029,7 +980,7 @@ checksum = "d5adf688c584fe33726ce0e2898f608a2a92578ac94a4a92fcecf73214fe0716" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1042,7 +993,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1062,7 +1013,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1099,7 +1050,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1157,7 +1108,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1191,6 +1142,15 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "either_of" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e22feb4d5cacf9f2c64902a1c35ef0f2d766e42db316a98b93992bbce669cb" +dependencies = [ + "pin-project-lite", +] + [[package]] name = "encoding_rs" version = "0.8.35" @@ -1398,7 +1358,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -1485,7 +1445,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.65", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1516,6 +1476,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "guardian" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "493913a18c0d7bebb75127a26a432162c59edbe06f6cf712001e3e769345e8b5" + [[package]] name = "h2" version = "0.4.6" @@ -1535,22 +1501,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" - [[package]] name = "hashbrown" version = "0.14.5" @@ -1665,7 +1615,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "sha2", - "thiserror", + "thiserror 1.0.65", "tokio", ] @@ -1681,6 +1631,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hydration_context" +version = "0.2.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571a2756b518de368146ba56d4feeba265b0b555d176d49b8debd9ce9b69a6fa" +dependencies = [ + "futures", + "js-sys", + "once_cell", + "or_poisoned", + "pin-project-lite", + "serde", + "throw_error", + "wasm-bindgen", +] + [[package]] name = "hyper" version = "1.5.0" @@ -1829,7 +1795,7 @@ dependencies = [ "time", "tokio", "tower 0.5.1", - "tower-http", + "tower-http 0.6.1", "tower-layer", "tracing", "url", @@ -1881,15 +1847,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "interpolator" version = "0.5.0" @@ -1917,15 +1874,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -1943,9 +1891,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1987,7 +1935,7 @@ dependencies = [ "ducc", "itertools 0.10.5", "js-sys", - "thiserror", + "thiserror 1.0.65", "wasm-bindgen", ] @@ -2002,18 +1950,35 @@ dependencies = [ [[package]] name = "leptos" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cbb3237c274dadf00dcc27db96c52601b40375117178fb24a991cda073624f0" +checksum = "87a99b3ca2611376257a8b29466dc5ebf22c6bbed8715f86847808c269844785" dependencies = [ + "any_spawner", + "base64 0.22.1", "cfg-if", + "either_of", + "futures", + "hydration_context", "leptos_config", "leptos_dom", + "leptos_hot_reload", "leptos_macro", - "leptos_reactive", "leptos_server", + "oco_ref", + "or_poisoned", + "paste", + "rand", + "reactive_graph", + "rustc-hash", + "send_wrapper", + "serde", + "serde_qs", "server_fn", - "tracing", + "slotmap", + "tachys", + "thiserror 1.0.65", + "throw_error", "typed-builder", "typed-builder-macro", "wasm-bindgen", @@ -2022,9 +1987,9 @@ dependencies = [ [[package]] name = "leptos-use" -version = "0.13.6" +version = "0.14.0-rc3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f918fb333772f6401d671f996689e7258e3bee31e4108d5e142566897c678a50" +checksum = "fc40bd3ae7bf4dd84b5a67f7fc0e91d0335341e07430900001242dd81ac7aec2" dependencies = [ "cfg-if", "codee", @@ -2038,7 +2003,8 @@ dependencies = [ "leptos", "leptos_axum", "paste", - "thiserror", + "send_wrapper", + "thiserror 2.0.3", "unic-langid", "wasm-bindgen", "wasm-bindgen-futures", @@ -2047,14 +2013,15 @@ dependencies = [ [[package]] name = "leptos_axum" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910681b920c48a43508b2bd0261bdb67c4ef9456a0b3613f956a0d30e832e9de" +checksum = "1f62374846ed04ab8b4e1ed27e0f276f692ef4f4955e0ba62509bc25fa392987" dependencies = [ + "any_spawner", "axum", - "cfg-if", + "dashmap", "futures", - "http-body-util", + "hydration_context", "leptos", "leptos_integration_utils", "leptos_macro", @@ -2062,61 +2029,45 @@ dependencies = [ "leptos_router", "once_cell", "parking_lot", - "serde_json", "server_fn", "tokio", - "tokio-util", - "tracing", + "tower 0.4.13", + "tower-http 0.5.2", ] [[package]] name = "leptos_config" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ed778611380ddea47568ac6ad6ec5158d39b5bd59e6c4dcd24efc15dc3dc0d" +checksum = "04c89503f59940cef245827075362107d4d53f9a710db31bfc361151866ba39e" dependencies = [ "config", "regex", "serde", - "thiserror", + "thiserror 1.0.65", "typed-builder", ] [[package]] name = "leptos_dom" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8401c46c86c1f4c16dcb7881ed319fcdca9cda9b9e78a6088955cb423afcf119" +checksum = "b108dc3960fac70b98d2302e568cd51c4d09255f1925bb797eba95575acc69b8" dependencies = [ - "async-recursion", - "cfg-if", - "drain_filter_polyfill", - "futures", - "getrandom", - "html-escape", - "indexmap", - "itertools 0.12.1", "js-sys", - "leptos_reactive", - "once_cell", - "pad-adapter", - "paste", - "rustc-hash 1.1.0", - "serde", - "serde_json", - "server_fn", - "smallvec", - "tracing", + "or_poisoned", + "reactive_graph", + "send_wrapper", + "tachys", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] name = "leptos_hot_reload" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb53d4794240b684a2f4be224b84bee9e62d2abc498cf2bcd643cd565e01d96" +checksum = "10230c3b99bffd7490f192c54e02f0b35411d08089aba7f662d78be2adfbb736" dependencies = [ "anyhow", "camino", @@ -2126,35 +2077,36 @@ dependencies = [ "quote", "rstml", "serde", - "syn 2.0.85", + "syn 2.0.87", "walkdir", ] [[package]] name = "leptos_integration_utils" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a96976631c2225ec116a7bf9c0ed5bf6999a19fed33f5e3cbcf37af44c384dc" +checksum = "e66a88bbaf3f6689f7878c2a40bb80af84a9e23acfde483b34c811cdcc975a40" dependencies = [ "futures", + "hydration_context", "leptos", "leptos_config", - "leptos_hot_reload", "leptos_meta", - "tracing", + "leptos_router", + "reactive_graph", ] [[package]] name = "leptos_macro" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b13bc3db70715cd8218c4535a5af3ae3c0e5fea6f018531fc339377b36bc0e0" +checksum = "0e948a21600d13a6e91d9a0fb56de9c58692f79890caeaec7dabb1cd63e8ec92" dependencies = [ "attribute-derive", "cfg-if", "convert_case 0.6.0", "html-escape", - "itertools 0.12.1", + "itertools 0.13.0", "leptos_hot_reload", "prettyplease", "proc-macro-error2", @@ -2162,99 +2114,80 @@ dependencies = [ "quote", "rstml", "server_fn_macro", - "syn 2.0.85", - "tracing", + "syn 2.0.87", "uuid", ] [[package]] name = "leptos_meta" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25acc2f63cf91932013e400a95bf6e35e5d3dbb44a7b7e25a8e3057d12005b3b" +checksum = "15ad116cab8a1073bb6556d65c153d4c951ff06fa84387f723289ee16bb6a7b4" dependencies = [ - "cfg-if", - "indexmap", - "leptos", - "tracing", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "leptos_reactive" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4161acbf80f59219d8d14182371f57302bc7ff81ee41aba8ba1ff7295727f23" -dependencies = [ - "base64 0.22.1", - "cfg-if", "futures", "indexmap", - "js-sys", - "oco_ref", - "paste", - "pin-project", - "rustc-hash 1.1.0", - "self_cell", - "serde", - "serde-wasm-bindgen", - "serde_json", - "slotmap", - "thiserror", - "tokio", - "tracing", + "leptos", + "once_cell", + "or_poisoned", + "send_wrapper", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] name = "leptos_router" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71dea7d42c0d29c40842750232d3425ed1cf10e313a1f898076d20871dad32" +checksum = "9924f84cfc4dbe4440c2e58bf54694471e96b21557cb1e693e5bd73f3acae355" dependencies = [ - "cached", - "cfg-if", + "any_spawner", + "either_of", + "futures", "gloo-net", - "itertools 0.12.1", "js-sys", - "lazy_static", "leptos", - "leptos_integration_utils", - "leptos_meta", - "linear-map", - "lru", + "leptos_router_macro", "once_cell", + "or_poisoned", "percent-encoding", - "regex", + "reactive_graph", "send_wrapper", - "serde", - "serde_json", - "serde_qs 0.13.0", - "thiserror", - "tracing", + "tachys", + "thiserror 1.0.65", "url", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] -name = "leptos_server" -version = "0.6.15" +name = "leptos_router_macro" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a97eb90a13f71500b831c7119ddd3bdd0d7ae0a6b0487cade4fddeed3b8c03f" +checksum = "cf8fc6fbb1d1f8f3656b8e33265a2e92319fb877b38014407767d85362f528cb" dependencies = [ - "inventory", - "lazy_static", - "leptos_macro", - "leptos_reactive", + "proc-macro-error2", + "proc-macro2", + "quote", +] + +[[package]] +name = "leptos_server" +version = "0.7.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd1abdb945660f19f7510bdf208069d3bc391aa9bb7183aa58e4af5429e6115" +dependencies = [ + "any_spawner", + "base64 0.22.1", + "codee", + "futures", + "hydration_context", + "or_poisoned", + "reactive_graph", + "send_wrapper", "serde", + "serde_json", "server_fn", - "thiserror", - "tracing", + "tachys", ] [[package]] @@ -2274,10 +2207,6 @@ name = "linear-map" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" -dependencies = [ - "serde", - "serde_test", -] [[package]] name = "linked-hash-map" @@ -2316,15 +2245,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "lru" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" -dependencies = [ - "hashbrown 0.14.5", -] - [[package]] name = "manyhow" version = "0.10.4" @@ -2334,7 +2254,7 @@ dependencies = [ "manyhow-macros", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -2524,7 +2444,7 @@ dependencies = [ "rustc_version", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.65", "triomphe", "uuid", ] @@ -2563,6 +2483,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "next_tuple" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3615947b64839fe27e9ee557f282b04ad13ead564a543a6548b0cfd17457ff4" + [[package]] name = "nom" version = "7.1.3" @@ -2656,12 +2582,12 @@ dependencies = [ [[package]] name = "oco_ref" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51ebcefb2f0b9a5e0bea115532c8ae4215d1b01eff176d0f4ba4192895c2708" +checksum = "64b94982fe39a861561cf67ff17a7849f2cedadbbad960a797634032b7abb998" dependencies = [ "serde", - "thiserror", + "thiserror 1.0.65", ] [[package]] @@ -2693,7 +2619,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -2714,6 +2640,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "or_poisoned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c04f5d74368e4d0dfe06c45c8627c81bd7c317d52762d118fb9b3076f6420fd" + [[package]] name = "ordered-multimap" version = "0.7.3" @@ -2724,12 +2656,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "pad-adapter" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d80efc4b6721e8be2a10a5df21a30fa0b470f1539e53d8b4e6e75faf938b63" - [[package]] name = "parking" version = "2.2.1" @@ -2803,7 +2729,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.65", "ucd-trie", ] @@ -2827,7 +2753,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -2858,7 +2784,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -2954,7 +2880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -2999,6 +2925,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", + "syn 2.0.87", ] [[package]] @@ -3040,7 +2967,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", "version_check", "yansi", ] @@ -3104,10 +3031,10 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.0.0", + "rustc-hash", "rustls", "socket2", - "thiserror", + "thiserror 1.0.65", "tokio", "tracing", ] @@ -3121,10 +3048,10 @@ dependencies = [ "bytes", "rand", "ring", - "rustc-hash 2.0.0", + "rustc-hash", "rustls", "slab", - "thiserror", + "thiserror 1.0.65", "tinyvec", "tracing", ] @@ -3171,7 +3098,7 @@ dependencies = [ "proc-macro-utils 0.10.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3224,6 +3151,55 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "reactive_graph" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cdfe96bdf3d95c9bdd15af1cfc82252ef85c026ea960f83df53feca9fec61a" +dependencies = [ + "any_spawner", + "async-lock", + "futures", + "guardian", + "hydration_context", + "or_poisoned", + "pin-project-lite", + "rustc-hash", + "send_wrapper", + "serde", + "slotmap", + "thiserror 1.0.65", + "web-sys", +] + +[[package]] +name = "reactive_stores" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fa994eaec6638c22faeedd4524cbd5a3653e7f32a67e130a60a0c8c9e1ee81" +dependencies = [ + "guardian", + "itertools 0.13.0", + "or_poisoned", + "paste", + "reactive_graph", + "reactive_stores_macro", + "rustc-hash", +] + +[[package]] +name = "reactive_stores_macro" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d7cfe1c6d9f1005605ac7c928aef7e037d6808d6eda0429e73f0ca90cb9cb5" +dependencies = [ + "convert_case 0.6.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "readonly" version = "0.2.12" @@ -3232,7 +3208,7 @@ checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3336,7 +3312,7 @@ dependencies = [ "http", "reqwest", "serde", - "thiserror", + "thiserror 1.0.65", "tower-service", ] @@ -3401,16 +3377,17 @@ dependencies = [ [[package]] name = "rstml" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" +checksum = "51187e564f12336ef40cd04f6f4d805d6919188001dcf1e0a021898ea0fe28ce" dependencies = [ + "derive-where", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.85", + "syn 2.0.87", "syn_derive", - "thiserror", + "thiserror 1.0.65", ] [[package]] @@ -3429,12 +3406,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.0.0" @@ -3571,12 +3542,6 @@ dependencies = [ "libc", ] -[[package]] -name = "self_cell" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" - [[package]] name = "semver" version = "1.0.23" @@ -3601,17 +3566,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" version = "1.0.214" @@ -3620,7 +3574,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3646,17 +3600,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_qs" version = "0.13.0" @@ -3665,7 +3608,7 @@ checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.65", ] [[package]] @@ -3677,15 +3620,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_test" -version = "1.0.177" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f901ee573cab6b3060453d2d5f0bae4e6d628c23c0a962ff9b5f1d7c8d4f1ed" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3700,13 +3634,12 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fae7a3038a32e5a34ba32c6c45eb4852f8affaf8b794ebfcd4b1099e2d62ebe" +checksum = "166689e862d227e838f359cce92681cf338e60a8cbcbd029bae03548d5a6d785" dependencies = [ "axum", "bytes", - "ciborium", "const_format", "dashmap", "futures", @@ -3717,12 +3650,14 @@ dependencies = [ "inventory", "js-sys", "once_cell", + "pin-project-lite", "send_wrapper", "serde", "serde_json", - "serde_qs 0.12.0", + "serde_qs", "server_fn_macro_default", - "thiserror", + "thiserror 1.0.65", + "throw_error", "tower 0.4.13", "tower-layer", "url", @@ -3735,26 +3670,26 @@ dependencies = [ [[package]] name = "server_fn_macro" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaaf648c6967aef78177c0610478abb5a3455811f401f3c62d10ae9bd3901a1" +checksum = "4230cd52992681cc370885a613a5aad9fb56d61995b789de5c42dc55ff628e98" dependencies = [ "const_format", "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", "xxhash-rust", ] [[package]] name = "server_fn_macro_default" -version = "0.6.15" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2aa8119b558a17992e0ac1fd07f080099564f24532858811ce04f742542440" +checksum = "b8d4b8ee78096ff2b09c64afacb83f023f4edfdace60c00590b2aea215fea8a4" dependencies = [ "server_fn_macro", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3801,7 +3736,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.65", "time", ] @@ -3820,7 +3755,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ - "serde", "version_check", ] @@ -3838,7 +3772,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3911,9 +3845,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3929,7 +3863,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -3964,7 +3898,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "thiserror", + "thiserror 1.0.65", "walkdir", "yaml-rust", ] @@ -3990,6 +3924,38 @@ dependencies = [ "libc", ] +[[package]] +name = "tachys" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b24784a27f391dedcc8160ea4b2ba7a6ad0f5484ca89ff88a10494f960aee270" +dependencies = [ + "any_spawner", + "const_str_slice_concat", + "drain_filter_polyfill", + "either_of", + "futures", + "html-escape", + "indexmap", + "itertools 0.13.0", + "js-sys", + "linear-map", + "next_tuple", + "oco_ref", + "once_cell", + "or_poisoned", + "parking_lot", + "paste", + "reactive_graph", + "reactive_stores", + "rustc-hash", + "send_wrapper", + "slotmap", + "throw_error", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "tagptr" version = "0.2.0" @@ -4015,7 +3981,16 @@ version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.65", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] @@ -4026,7 +4001,27 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "throw_error" +version = "0.2.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84bf87b0433891f1029e5868d4de3a11e794a206899082ebb4e82fca139b0d70" +dependencies = [ + "pin-project-lite", ] [[package]] @@ -4119,7 +4114,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -4152,8 +4147,6 @@ dependencies = [ "bytes", "futures-core", "futures-sink", - "futures-util", - "hashbrown 0.14.5", "pin-project-lite", "tokio", ] @@ -4198,6 +4191,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", "tower-layer", "tower-service", "tracing", @@ -4219,6 +4216,31 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.6.0", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-http" version = "0.6.1" @@ -4276,7 +4298,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -4302,22 +4324,22 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-builder" -version = "0.18.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77739c880e00693faef3d65ea3aad725f196da38b22fdc7ea6ded6e1ce4d3add" +checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.18.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" +checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] @@ -4468,9 +4490,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4479,16 +4501,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -4506,9 +4528,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4516,22 +4538,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -4548,9 +4570,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -4776,7 +4798,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ee4c72a..29cf167 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,8 +32,6 @@ ssr = [ ] hydrate = [ "leptos/hydrate", - "leptos_meta/hydrate", - "leptos_router/hydrate", "katex/wasm-js", ] diesel-derive-newtype = ["dep:diesel-derive-newtype"] @@ -61,9 +59,9 @@ unwrap_used = "deny" [dependencies] anyhow = "1.0.89" -leptos = "0.6.15" -leptos_meta = "0.6.15" -leptos_router = "0.6.15" +leptos = "0.7.0-rc1" +leptos_meta = "0.7.0-rc1" +leptos_router = "0.7.0-rc1" chrono = { version = "0.4.38", features = ["serde"] } env_logger = { version = "0.11.5", default-features = false } futures = "0.3.30" @@ -88,7 +86,7 @@ markdown-it-heading-anchors = "0.3.0" markdown-it-footnote = "0.2.0" markdown-it-sub = "1.0.0" markdown-it-sup = "1.0.0" -leptos-use = "0.13.6" +leptos-use = "0.14.0-rc2" codee = "0.2.0" # backend-only features @@ -111,7 +109,7 @@ diesel-derive-newtype = { version = "2.1.2", optional = true } diesel_migrations = { version = "2.2.0", optional = true } doku = { version = "0.21.1", optional = true } jsonwebtoken = { version = "9.3.0", optional = true } -leptos_axum = { version = "0.6.15", optional = true } +leptos_axum = { version = "0.7.0-rc1", optional = true } bcrypt = { version = "0.15.1", optional = true } diffy = { version = "0.4.0", optional = true } enum_delegate = { version = "0.2.0", optional = true } diff --git a/src/backend/assets.rs b/src/backend/assets.rs index 3bda404..7a3b78f 100644 --- a/src/backend/assets.rs +++ b/src/backend/assets.rs @@ -5,7 +5,7 @@ use axum::{ response::{IntoResponse, Response}, }; use axum_macros::debug_handler; -use leptos::LeptosOptions; +use leptos::prelude::*; use tower::ServiceExt; use tower_http::services::ServeDir; diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 2b2cd12..e2933dd 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -47,7 +47,7 @@ use federation::objects::{ articles_collection::local_articles_url, instance_collection::linked_instances_url, }; -use leptos::*; +use leptos::prelude::*; use leptos_axum::{generate_route_list, LeptosRoutes}; use log::info; use std::net::SocketAddr; @@ -93,7 +93,7 @@ pub async fn start(config: IbisConfig, override_hostname: Option) -> setup(&data.to_request_data()).await?; } - let leptos_options = get_configuration(Some("Cargo.toml")).await?.leptos_options; + let leptos_options = get_configuration(Some("Cargo.toml"))?.leptos_options; let mut addr = leptos_options.site_addr; if let Some(override_hostname) = override_hostname { addr = override_hostname; diff --git a/src/common/mod.rs b/src/common/mod.rs index a7b9ae8..be4666a 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -3,6 +3,7 @@ pub mod utils; pub mod validation; use chrono::{DateTime, Utc}; +use codee::{Decoder, Encoder}; use newtypes::{ArticleId, ConflictId, EditId, InstanceId, PersonId}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -351,6 +352,25 @@ pub struct SiteView { pub config: Options, } +// TODO: using () doesnt make much sense +impl Encoder<()> for SiteView { + type Error = serde_json::Error; + type Encoded = String; + + fn encode(val: &()) -> Result { + serde_json::to_string(val) + } +} + +impl Decoder<()> for SiteView { + type Error = serde_json::Error; + type Encoded = str; + + fn decode(stored_value: &Self::Encoded) -> Result<(), Self::Error> { + serde_json::from_str(stored_value) + } +} + #[test] fn test_edit_versions() { let default = EditVersion::default(); diff --git a/src/frontend/api.rs b/src/frontend/api.rs index abfc016..b4cba97 100644 --- a/src/frontend/api.rs +++ b/src/frontend/api.rs @@ -56,7 +56,7 @@ impl ApiClient { } #[cfg(feature = "ssr")] { - use leptos::leptos_config::get_config_from_str; + use leptos::config::get_config_from_str; let leptos_options = get_config_from_str(include_str!("../../Cargo.toml")).unwrap(); hostname = leptos_options.site_addr.to_string(); ssl = false; @@ -287,7 +287,7 @@ where #[cfg(feature = "ssr")] { use crate::common::{Auth, AUTH_COOKIE}; - use leptos::use_context; + use leptos::prelude::use_context; use reqwest::header::HeaderName; let auth = use_context::(); diff --git a/src/frontend/app.rs b/src/frontend/app.rs index 69a53c0..bc69252 100644 --- a/src/frontend/app.rs +++ b/src/frontend/app.rs @@ -23,9 +23,12 @@ use crate::{ }, }, }; -use leptos::*; +use leptos::prelude::*; use leptos_meta::{provide_meta_context, *}; -use leptos_router::{Route, Router, Routes}; +use leptos_router::{ + components::{Route, Router, Routes}, + path, +}; pub fn site() -> Resource<(), SiteView> { use_context::>().unwrap() @@ -43,6 +46,7 @@ pub fn is_admin() -> bool { }) } +// TODO: can probably get rid of this pub trait DefaultResource { fn with_default(&self, f: impl FnOnce(&T) -> O) -> O; } @@ -58,9 +62,8 @@ impl DefaultResource for Resource<(), T> { #[component] pub fn App() -> impl IntoView { - // TODO: should create_resource() but then things break - let site_resource = - create_local_resource(move || (), |_| async move { CLIENT.site().await.unwrap() }); + // TODO: should Resource::new() but then things break + let site_resource = LocalResource::new(|| async move { CLIENT.site().await.unwrap() }); provide_context(site_resource); provide_meta_context(); @@ -68,33 +71,33 @@ pub fn App() -> impl IntoView { provide_context(darkmode.clone()); view! { - - + + <>