From a6a3e382c791c2ec666cc97c81b3946416661d67 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Fri, 1 Nov 2024 15:32:48 -0700 Subject: [PATCH] upgrade to new cli for ssg --- .github/workflows/gh-pages.yml | 2 +- .vscode/settings.json | 8 +- Cargo.lock | 457 ++++++++++++++++++++------------- Cargo.toml | 3 +- Dioxus.toml | 3 - build.rs | 2 +- src/components/learn.rs | 4 +- src/main.rs | 45 ++-- 8 files changed, 322 insertions(+), 202 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f69bf9f0..c0555ee7 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -31,7 +31,7 @@ jobs: - name: Install CLI run: cargo install --force --git https://github.com/DioxusLabs/dioxus dioxus-cli - name: Build - run: dx build --release + run: DIOXUS_LOG=dx=trace dx build --platform web --ssg --profile release-tiny - name: Copy output run: cp -r target/dx/dioxus_docs_site/release/web/public docs - name: Add gh pages 404 diff --git a/.vscode/settings.json b/.vscode/settings.json index e3b18669..a9dd7725 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,10 +3,10 @@ // so it doesn't break code blocks "editor.formatOnSave": false }, - // "rust-analyzer.cargo.features": [ - // "web", - // "doc_test" - // ] + "rust-analyzer.cargo.features": [ + "web", + "server" + ] // "editor.formatOnSave": false // "files.autoSaveDelay": 10 } diff --git a/Cargo.lock b/Cargo.lock index 56d2dc59..e83ae09c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,12 +66,6 @@ version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" -[[package]] -name = "anymap2" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" - [[package]] name = "arrayvec" version = "0.7.6" @@ -423,6 +417,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "blocking" version = "1.6.1" @@ -1003,7 +1006,7 @@ dependencies = [ [[package]] name = "dioxus" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "axum", "dioxus-config-macro", @@ -1012,6 +1015,7 @@ dependencies = [ "dioxus-devtools", "dioxus-document", "dioxus-fullstack", + "dioxus-history", "dioxus-hooks", "dioxus-html", "dioxus-liveview", @@ -1027,7 +1031,7 @@ dependencies = [ [[package]] name = "dioxus-autofmt" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-rsx", "prettyplease", @@ -1040,12 +1044,12 @@ dependencies = [ [[package]] name = "dioxus-cli-config" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" [[package]] name = "dioxus-config-macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "proc-macro2", "quote", @@ -1054,7 +1058,7 @@ dependencies = [ [[package]] name = "dioxus-core" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "const_format", "dioxus-core-types", @@ -1074,7 +1078,7 @@ dependencies = [ [[package]] name = "dioxus-core-macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "convert_case 0.6.0", "dioxus-rsx", @@ -1086,12 +1090,12 @@ dependencies = [ [[package]] name = "dioxus-core-types" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" [[package]] name = "dioxus-desktop" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "async-trait", "cocoa 0.25.0", @@ -1100,6 +1104,7 @@ dependencies = [ "dioxus-core", "dioxus-devtools", "dioxus-document", + "dioxus-history", "dioxus-hooks", "dioxus-html", "dioxus-interpreter-js", @@ -1111,7 +1116,7 @@ dependencies = [ "global-hotkey", "infer", "lazy-js-bundle", - "muda", + "muda 0.11.5", "objc", "objc_id", "once_cell", @@ -1125,6 +1130,7 @@ dependencies = [ "thiserror", "tokio", "tracing", + "tray-icon", "urlencoding", "webbrowser", "wry", @@ -1133,7 +1139,7 @@ dependencies = [ [[package]] name = "dioxus-devtools" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "dioxus-devtools-types", @@ -1148,7 +1154,7 @@ dependencies = [ [[package]] name = "dioxus-devtools-types" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "serde", @@ -1157,7 +1163,7 @@ dependencies = [ [[package]] name = "dioxus-document" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "dioxus-core-macro", @@ -1175,7 +1181,7 @@ dependencies = [ [[package]] name = "dioxus-fullstack" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "async-trait", "axum", @@ -1184,6 +1190,7 @@ dependencies = [ "ciborium", "dioxus-cli-config", "dioxus-devtools", + "dioxus-history", "dioxus-interpreter-js", "dioxus-isrg", "dioxus-lib", @@ -1212,10 +1219,19 @@ dependencies = [ "web-sys", ] +[[package]] +name = "dioxus-history" +version = "0.6.0-alpha.3" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" +dependencies = [ + "dioxus-core", + "tracing", +] + [[package]] name = "dioxus-hooks" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "dioxus-signals", @@ -1231,7 +1247,7 @@ dependencies = [ [[package]] name = "dioxus-html" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "async-trait", "dioxus-core", @@ -1255,7 +1271,7 @@ dependencies = [ [[package]] name = "dioxus-html-internal-macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "convert_case 0.6.0", "proc-macro2", @@ -1266,7 +1282,7 @@ dependencies = [ [[package]] name = "dioxus-interpreter-js" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "dioxus-core-types", @@ -1285,7 +1301,7 @@ dependencies = [ [[package]] name = "dioxus-isrg" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "chrono", "http 1.1.0", @@ -1298,12 +1314,13 @@ dependencies = [ [[package]] name = "dioxus-lib" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-config-macro", "dioxus-core", "dioxus-core-macro", "dioxus-document", + "dioxus-history", "dioxus-hooks", "dioxus-html", "dioxus-rsx", @@ -1313,13 +1330,14 @@ dependencies = [ [[package]] name = "dioxus-liveview" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "axum", "dioxus-cli-config", "dioxus-core", "dioxus-devtools", "dioxus-document", + "dioxus-history", "dioxus-html", "dioxus-interpreter-js", "futures-channel", @@ -1373,27 +1391,22 @@ dependencies = [ [[package]] name = "dioxus-router" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-cli-config", - "dioxus-fullstack", + "dioxus-history", "dioxus-lib", "dioxus-router-macro", - "gloo", - "gloo-utils 0.1.7", - "js-sys", "rustversion", "tracing", "url", "urlencoding", - "wasm-bindgen", - "web-sys", ] [[package]] name = "dioxus-router-macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "proc-macro2", "quote", @@ -1404,7 +1417,7 @@ dependencies = [ [[package]] name = "dioxus-rsx" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", @@ -1476,7 +1489,7 @@ dependencies = [ [[package]] name = "dioxus-signals" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "dioxus-core", "futures-channel", @@ -1492,7 +1505,7 @@ dependencies = [ [[package]] name = "dioxus-ssr" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "askama_escape", "dioxus-core", @@ -1503,7 +1516,7 @@ dependencies = [ [[package]] name = "dioxus-static-site-generation" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "axum", "dioxus-cli-config", @@ -1524,15 +1537,17 @@ dependencies = [ [[package]] name = "dioxus-web" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "async-trait", "ciborium", "console_error_panic_hook", + "dioxus-cli-config", "dioxus-core", "dioxus-core-types", "dioxus-devtools", "dioxus-document", + "dioxus-history", "dioxus-html", "dioxus-interpreter-js", "dioxus-signals", @@ -1577,8 +1592,8 @@ dependencies = [ "futures", "futures-util", "gloo-history", - "gloo-storage 0.3.0", - "gloo-timers 0.3.0", + "gloo-storage", + "gloo-timers", "http 1.1.0", "include_dir", "js-sys", @@ -1608,7 +1623,7 @@ dependencies = [ [[package]] name = "dioxus_server_macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "proc-macro2", "quote", @@ -1616,6 +1631,27 @@ dependencies = [ "syn 2.0.85", ] +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -2147,7 +2183,7 @@ dependencies = [ [[package]] name = "generational-box" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "parking_lot", "tracing", @@ -2298,48 +2334,6 @@ dependencies = [ "x11-dl", ] -[[package]] -name = "gloo" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28999cda5ef6916ffd33fb4a7b87e1de633c47c0dc6d97905fee1cdaa142b94d" -dependencies = [ - "gloo-console", - "gloo-dialogs", - "gloo-events", - "gloo-file", - "gloo-history", - "gloo-net 0.3.1", - "gloo-render", - "gloo-storage 0.2.2", - "gloo-timers 0.2.6", - "gloo-utils 0.1.7", - "gloo-worker", -] - -[[package]] -name = "gloo-console" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" -dependencies = [ - "gloo-utils 0.1.7", - "js-sys", - "serde", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gloo-dialogs" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" -dependencies = [ - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-events" version = "0.1.2" @@ -2350,18 +2344,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-file" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" -dependencies = [ - "gloo-events", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-history" version = "0.1.5" @@ -2378,27 +2360,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-net" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils 0.1.7", - "http 0.2.12", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "gloo-net" version = "0.5.0" @@ -2441,31 +2402,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-render" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" -dependencies = [ - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gloo-storage" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" -dependencies = [ - "gloo-utils 0.1.7", - "js-sys", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "gloo-storage" version = "0.3.0" @@ -2481,16 +2417,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gloo-timers" version = "0.3.0" @@ -2529,23 +2455,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-worker" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" -dependencies = [ - "anymap2", - "bincode", - "gloo-console", - "gloo-utils 0.1.7", - "js-sys", - "serde", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "gobject-sys" version = "0.18.0" @@ -3142,7 +3051,7 @@ dependencies = [ [[package]] name = "lazy-js-bundle" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" [[package]] name = "lazy_static" @@ -3150,12 +3059,56 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + [[package]] name = "libc" version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + [[package]] name = "libxdo" version = "0.6.0" @@ -3258,7 +3211,7 @@ dependencies = [ [[package]] name = "manganis" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "anyhow", "base64 0.22.1", @@ -3272,7 +3225,7 @@ dependencies = [ [[package]] name = "manganis-core" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "serde", "serde_json", @@ -3281,7 +3234,7 @@ dependencies = [ [[package]] name = "manganis-macro" version = "0.6.0-alpha.3" -source = "git+https://github.com/dioxuslabs/dioxus#6216a26a40f576d027bc79ec0c20cfc5a66ffd1e" +source = "git+https://github.com/dioxuslabs/dioxus#85c4c09811a11be887af551b7c6de7c30c823ae0" dependencies = [ "manganis-core", "proc-macro2", @@ -3474,6 +3427,26 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "muda" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18047edf23933de40835403d4b9211ffd1dcc65c0eec569df38a1fb8aebd719" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "libxdo", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "png", + "thiserror", + "windows-sys 0.59.0", +] + [[package]] name = "multer" version = "3.1.0" @@ -3644,6 +3617,105 @@ dependencies = [ "objc_id", ] +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + [[package]] name = "objc_exception" version = "0.1.2" @@ -3743,6 +3815,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "ordered-stream" version = "0.2.0" @@ -4306,6 +4384,17 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror", +] + [[package]] name = "regex" version = "1.11.1" @@ -5650,6 +5739,26 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "tray-icon" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c92af36a182b46206723bdf8a7942e20838cde1cf062e5b97854d57eb01763b" +dependencies = [ + "core-graphics 0.24.0", + "crossbeam-channel", + "dirs", + "libappindicator", + "muda 0.15.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", + "png", + "thiserror", + "windows-sys 0.59.0", +] + [[package]] name = "try-lock" version = "0.2.5" diff --git a/Cargo.toml b/Cargo.toml index 456183da..c24678f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus = { version = "0.6.0-alpha.3", features = ["router"] } +dioxus = { version = "0.6.0-alpha.3", features = ["router", "fullstack"] } dioxus-web = { version = "0.6.0-alpha.3", features = ["hydrate"], optional = true } dioxus-ssr = { version = "0.6.0-alpha.3", optional = true } dioxus-desktop = { version = "0.6.0-alpha.3", optional = true } @@ -110,7 +110,6 @@ lto = true codegen-units = 1 opt-level = 'z' strip = "debuginfo" -incremental = true [profile.dev.build-override] opt-level = 3 diff --git a/Dioxus.toml b/Dioxus.toml index b3aef736..13b098ad 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -1,6 +1,3 @@ [application] name = "docsite" -[web.app] -[web.watcher] -index_on_404 = true diff --git a/build.rs b/build.rs index f5f5923e..c9e9095f 100644 --- a/build.rs +++ b/build.rs @@ -3,7 +3,7 @@ use std::{env::current_dir, path::PathBuf}; fn main() { // re-run only if the "example-book" directory changes - // println!("cargo:rerun-if-changed=docs-src"); + println!("cargo:rerun-if-changed=docs-src/"); make_docs("blog"); make_docs("0.3"); diff --git a/src/components/learn.rs b/src/components/learn.rs index 87d258ed..7988c6c4 100644 --- a/src/components/learn.rs +++ b/src/components/learn.rs @@ -142,7 +142,7 @@ fn TypedVersionSelectItem() -> Element { } #[component] fn UntypedVersionSelectItem( - route: IntoRoutable, + route: NavigationTarget, full_version: &'static str, short_version: &'static str, ) -> Element { @@ -343,7 +343,7 @@ fn VersionWarning() -> Element { "You are currently viewing the docs for Dioxus 0.6.0 which is under construction." } }, - CurrentDocsVersion::V05(_) => rsx! {}, + CurrentDocsVersion::V05(_) => rsx! { }, CurrentDocsVersion::V04(_) => rsx! { div { class: "flex flex-row items-center justify-start w-full bg-yellow-200 opacity-80 text-yellow-800 text-sm font-normal py-2 px-2 rounded-md mb-4 gap-2", crate::icons::IconWarning {} diff --git a/src/main.rs b/src/main.rs index 6426c7bf..8a4e03e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,11 +13,24 @@ pub mod snippets; pub use components::*; fn main() { - dioxus::LaunchBuilder::new().launch(|| { - rsx! { - Router:: {} - } - }); + dioxus::LaunchBuilder::new() + .with_cfg(server_only! { + // Only in release do we SSG + if cfg!(debug_assertions) { + ServeConfig::new().expect("Unable to build ServeConfig") + } else { + ServeConfig::builder() + .incremental(IncrementalRendererConfig::new().static_dir(std::env::current_exe().unwrap().parent().unwrap().join("public")).clear_cache(false)) + .build() + .expect("Unable to build ServeConfig") + } + + }) + .launch(|| { + rsx! { + Router:: {} + } + }); } #[component] @@ -140,7 +153,7 @@ pub enum Route { #[route("/")] BlogList {}, #[layout(BlogPost)] - #[child("/")] + #[child("")] BlogPost { child: crate::docs::router_blog::BookRoute }, #[end_layout] #[end_nest] @@ -148,16 +161,16 @@ pub enum Route { #[layout(Learn)] #[nest("/learn")] #[redirect("/", || Route::Docs05 { child: crate::docs::router_05::BookRoute::Index {} })] - #[child("/0.6/")] + #[child("/0.6")] Docs06 { child: crate::docs::router_06::BookRoute }, - #[child("/0.5/")] + #[child("/0.5")] Docs05 { child: crate::docs::router_05::BookRoute }, - #[child("/0.4/")] + #[child("/0.4")] Docs04 { child: crate::docs::router_04::BookRoute }, - #[child("/0.3/")] + #[child("/0.3")] Docs03 { child: crate::docs::router_03::BookRoute }, #[end_nest] #[end_layout] @@ -187,9 +200,11 @@ static SEARCH_INDEX: dioxus_search::LazySearchIndex = dioxus_search::load "search" }; -#[test] -fn write_routes() { - for route in Route::static_routes() { - println!("{route}"); - } +#[server(endpoint = "static_routes")] +async fn static_routes() -> Result { + Ok(Route::static_routes() + .into_iter() + .map(|route| route.to_string()) + .collect::>() + .join("\n")) }