Updated to use the new Dioxus v0.7.0-rc.1

The system is using the nightly toolchain now due to Dioxus needing it.
This commit is contained in:
2025-10-08 15:17:48 -04:00
parent ce80af94ee
commit 725824003b
8 changed files with 1345 additions and 553 deletions

1854
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "bard" name = "bard"
version = "0.3.5" version = "0.3.6"
edition = "2024" edition = "2024"
description = "Dioxus components that will display a Tavern blogging system Blog." description = "Dioxus components that will display a Tavern blogging system Blog."
repository = "/CyberMages/tavern" repository = "/CyberMages/tavern"
@ -14,12 +14,12 @@ name = "blog"
path = "examples/blog.rs" path = "examples/blog.rs"
[dependencies] [dependencies]
dioxus = { version = "*", features = ["router", "fullstack"] } dioxus = { version = "=0.7.0-rc.1", features = ["router", "fullstack"] }
tavern = { version = "0.3.0", path = "../tavern", registry="cybermages", optional = true} tavern = { version = "0.3.0", path = "../tavern", registry="cybermages", optional = true}
tokio = { version = "1.0", features = ["rt", "macros"], optional = true } tokio = { version = "1.0", features = ["rt", "macros"], optional = true }
[features] [features]
default = ["web"] default = ["tavern"]
web = ["tavern", "dioxus/web"] web = ["tavern", "dioxus/web"]
server = ["tavern/database", "dioxus/server", "tokio"] server = ["tavern/database", "dioxus/server", "tokio"]

View File

@ -182,7 +182,7 @@ pub fn ToggleTag(tag: String, toggled_tags: Signal<HashSet<String>>) -> Element
// which tags should be selected based on the current URL, returning both pieces // which tags should be selected based on the current URL, returning both pieces
// of data together for clean state management. // of data together for clean state management.
#[component] #[component]
pub fn TagSelector(url_tag: ReadOnlySignal<String>, pub fn TagSelector(url_tag: ReadSignal<String>,
toggled_tags: Signal<HashSet<String>>) -> Element toggled_tags: Signal<HashSet<String>>) -> Element
{ {
// Use use_resource to handle both fetching tags AND initializing selection // Use use_resource to handle both fetching tags AND initializing selection

View File

@ -8,7 +8,7 @@ use crate::components::{BlogList, TagSelector};
/// Blog page /// Blog page
#[component] #[component]
pub fn Blog(tag: ReadOnlySignal<String>) -> Element pub fn Blog(tag: ReadSignal<String>) -> Element
{ {
let categories: Signal<HashSet<String>> = let categories: Signal<HashSet<String>> =
use_signal(|| HashSet::new()); use_signal(|| HashSet::new());

View File

@ -6,7 +6,7 @@ use crate::components::{BlogPost, TagNav};
/// Blog page /// Blog page
#[component] #[component]
pub fn Post(slug: ReadOnlySignal<String>) -> Element pub fn Post(slug: ReadSignal<String>) -> Element
{ {
// Create a copy of the current slug to detect changes. // Create a copy of the current slug to detect changes.
let url_slug = use_signal(|| slug()); let url_slug = use_signal(|| slug());

View File

@ -1,23 +1,23 @@
[package] [package]
name = "blog_test" name = "blog_test"
version = "0.3.1" version = "0.3.2"
authors = ["Myrddin Dundragon <myrddin@cybermages.tech>"] authors = ["Myrddin Dundragon <myrddin@cybermages.tech>"]
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
axum = { version = "0.7.0", optional = true } axum = { version = "0.8.4", optional = true }
axum-server = { version = "0.7.1", optional = true } axum-server = { version = "0.7.2", optional = true }
dioxus = { version = "*", features = ["router", "fullstack"] } dioxus = { version = "=0.7.0-rc.1", features = ["router", "fullstack"] }
dioxus-cli-config = { version = "*", optional = true } #dioxus-cli-config = { version = "*", optional = true }
bard = { version = "*", path="../bard", optional = true } bard = { version = "*", path="../bard", optional = true }
tokio = { version = "1.0", optional = true } tokio = { version = "1.0", optional = true }
[features] [features]
default = ["web"] default = ["bard"]
web = ["dioxus/web", "bard"] web = ["dioxus/web", "bard/web"]
server = ["dioxus/server", "axum", "axum-server", "tokio/rt-multi-thread", "tokio/macros", "dioxus-cli-config", "bard/server"] server = ["dioxus/server", "axum", "axum-server", "tokio/rt-multi-thread", "tokio/macros", "bard/server"]
[profile.wasm-dev] [profile.wasm-dev]
inherits = "dev" inherits = "dev"

View File

@ -8,18 +8,20 @@ const FAVICON: Asset = asset!("/assets/favicon.ico");
const BLOG: Asset = asset!("/assets/blog.css"); const BLOG: Asset = asset!("/assets/blog.css");
fn main() fn main()
{ {
#[cfg(feature = "server")] #[cfg(feature = "server")]
{ {
let _ = tokio::runtime::Runtime::new() let rt = tokio::runtime::Runtime::new().unwrap();
.unwrap() rt.block_on(async
.block_on(async move { bard::init_database("/home/myrddin/cybermages/website/tavern.db").await }); {
let db_path = "/home/myrddin/cybermages/website/tavern.db";
let _ = bard::init_database(db_path).await;
});
} }
#[cfg(feature = "web")] LaunchBuilder::new().launch(App);
dioxus::launch(App);
} }
#[component] #[component]

2
rust-toolchain.toml Normal file
View File

@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"