diff --git a/.github/workflows/everything.yml b/.github/workflows/everything.yml index 5b4fe28..4e57ac1 100644 --- a/.github/workflows/everything.yml +++ b/.github/workflows/everything.yml @@ -55,7 +55,10 @@ jobs: run: | for d in "examples/"* do - trunk build --release $d/index.html + echo $d + cd $d + trunk build --release true || exit 1 + cd - done test: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ce04a1..12513ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Release 0.10.0 + +### Breaking Changes + +- Compatible with Yew 0.22. Due to the breaking API changes in Yew 0.22 not backwards compatible with Yew 0.21. + ## Release 0.9.0 ### Breaking Changes diff --git a/Cargo.toml b/Cargo.toml index 9fda8db..c0a551f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,6 @@ lto = true codegen-units = 1 panic = "abort" opt-level = "z" + +[workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(documenting)'] } \ No newline at end of file diff --git a/crates/bounce/Cargo.toml b/crates/bounce/Cargo.toml index cb05b69..f8e861a 100644 --- a/crates/bounce/Cargo.toml +++ b/crates/bounce/Cargo.toml @@ -16,12 +16,12 @@ rust-version = "1.64.0" anymap2 = "0.13.0" once_cell = "1.18.0" wasm-bindgen = "0.2.87" -yew = "0.21" +yew = "0.22" bounce-macros = { path = "../bounce-macros", version = "0.9.0" } futures = "0.3.28" async-trait = { version = "0.1.68", optional = true } -gloo = { version = "0.10.0", features = ["futures"], optional = true } +gloo = { version = "0.11.0", features = ["futures"], optional = true } html-escape = { version = "0.2.13", optional = true } serde = { version = "1.0.164", features = ["derive"] } tracing = "0.1" @@ -47,8 +47,8 @@ helmet = ["gloo", "web-sys"] [dev-dependencies] wasm-bindgen-test = "0.3.37" -gloo = { version = "0.10.0", features = ["futures"] } -yew = { version = "0.21", features = ["csr", "ssr"] } +gloo = { version = "0.11.0", features = ["futures"] } +yew = { version = "0.22", features = ["csr", "ssr"] } thiserror = "1" [dev-dependencies.web-sys] @@ -58,3 +58,6 @@ features = ["HtmlInputElement"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "documenting"] + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(documenting)', 'cfg(releasing)'] } \ No newline at end of file diff --git a/crates/bounce/src/helmet/bridge.rs b/crates/bounce/src/helmet/bridge.rs index 5ab66f2..c94c0e5 100644 --- a/crates/bounce/src/helmet/bridge.rs +++ b/crates/bounce/src/helmet/bridge.rs @@ -210,7 +210,7 @@ fn render_tags( /// } /// # } /// ``` -#[function_component(HelmetBridge)] +#[component(HelmetBridge)] pub fn helmet_bridge(props: &HelmetBridgeProps) -> Html { #[cfg(debug_assertions)] { diff --git a/crates/bounce/src/helmet/comp.rs b/crates/bounce/src/helmet/comp.rs index 460a8f9..dc2ec64 100644 --- a/crates/bounce/src/helmet/comp.rs +++ b/crates/bounce/src/helmet/comp.rs @@ -89,7 +89,7 @@ struct ScriptHelmetProps { } // A special component to render the script tag with a unique id. -#[function_component(ScriptHelmet)] +#[component(ScriptHelmet)] fn script_helmet(props: &ScriptHelmetProps) -> Html { let id = *use_state(Id::new); let ScriptHelmetProps { attrs, content } = props.clone(); @@ -128,7 +128,7 @@ fn script_helmet(props: &ScriptHelmetProps) -> Html { /// } /// # } /// ``` -#[function_component(Helmet)] +#[component(Helmet)] pub fn helmet(props: &HelmetProps) -> Html { let mut script_helmets = Vec::new(); diff --git a/crates/bounce/src/provider.rs b/crates/bounce/src/provider.rs index 3a9f535..71dc33f 100644 --- a/crates/bounce/src/provider.rs +++ b/crates/bounce/src/provider.rs @@ -40,7 +40,7 @@ pub struct BounceRootProps { /// } /// /// ``` -#[function_component(BounceRoot)] +#[component(BounceRoot)] pub fn bounce_root(props: &BounceRootProps) -> Html { let BounceRootProps { children, diff --git a/crates/bounce/src/query/query_states.rs b/crates/bounce/src/query/query_states.rs index c0b65db..74d7850 100644 --- a/crates/bounce/src/query/query_states.rs +++ b/crates/bounce/src/query/query_states.rs @@ -213,7 +213,7 @@ where } Self::Action::LoadPrepared { id, input, result } => { - if self.queries.get(&input).is_none() { + if !self.queries.contains_key(&input) { let this = Rc::make_mut(&mut self); this.ctr += 1; diff --git a/crates/bounce/src/states/artifact.rs b/crates/bounce/src/states/artifact.rs index 4c43c67..c43ca0e 100644 --- a/crates/bounce/src/states/artifact.rs +++ b/crates/bounce/src/states/artifact.rs @@ -154,7 +154,7 @@ where /// /// let rendered = html! { value={artifact} />}; /// ``` -#[function_component(Artifact)] +#[component(Artifact)] pub fn artifact(props: &ArtifactProps) -> Html where T: PartialEq + 'static, diff --git a/crates/bounce/tests/init_states.rs b/crates/bounce/tests/init_states.rs index fe50790..e0e0604 100644 --- a/crates/bounce/tests/init_states.rs +++ b/crates/bounce/tests/init_states.rs @@ -27,7 +27,7 @@ struct State { inner: u32, } -#[function_component(Comp)] +#[component(Comp)] fn comp() -> Html { let a = use_atom_value::(); @@ -40,7 +40,7 @@ fn comp() -> Html { #[test] async fn test_without_init_states() { - #[function_component(Root)] + #[component(Root)] fn root() -> Html { html! { @@ -58,7 +58,7 @@ async fn test_without_init_states() { #[test] async fn test_with_init_states() { - #[function_component(Root)] + #[component(Root)] fn root() -> Html { fn get_init_states(_: ()) -> AnyMap { let mut map = AnyMap::new(); diff --git a/crates/bounce/tests/notion.rs b/crates/bounce/tests/notion.rs index f80eb4d..35b303e 100644 --- a/crates/bounce/tests/notion.rs +++ b/crates/bounce/tests/notion.rs @@ -42,7 +42,7 @@ async fn test_notion_generic() { } } - #[function_component(Comp)] + #[component(Comp)] fn comp() -> Html { let a = use_atom::>(); let b = use_atom::>(); @@ -66,7 +66,7 @@ async fn test_notion_generic() { } } - #[function_component(Root)] + #[component(Root)] fn root() -> Html { html! { diff --git a/crates/bounce/tests/query.rs b/crates/bounce/tests/query.rs index c7fab37..737fb26 100755 --- a/crates/bounce/tests/query.rs +++ b/crates/bounce/tests/query.rs @@ -54,7 +54,7 @@ async fn test_query_requery_upon_state_change() { } } - #[function_component(Comp)] + #[component(Comp)] fn comp() -> Html { let my_query = use_query_value::(().into()); let set_my_state = use_atom_setter(); @@ -80,7 +80,7 @@ async fn test_query_requery_upon_state_change() { } } - #[function_component(App)] + #[component(App)] fn app() -> Html { html! { diff --git a/examples/divisibility-input/Cargo.toml b/examples/divisibility-input/Cargo.toml index b69abbc..0c15b20 100644 --- a/examples/divisibility-input/Cargo.toml +++ b/examples/divisibility-input/Cargo.toml @@ -8,8 +8,8 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } -stylist = { version = "0.13", features = ["yew"] } +yew = { version = "0.22", features = ["csr"] } +stylist = { version="0.14", features = ["yew"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/divisibility-input/index.html b/examples/divisibility-input/index.html index 1b8f501..67ad70e 100644 --- a/examples/divisibility-input/index.html +++ b/examples/divisibility-input/index.html @@ -3,5 +3,7 @@ Divisibility Input Example + + diff --git a/examples/divisibility/Cargo.toml b/examples/divisibility/Cargo.toml index bfdfb14..5964dcd 100644 --- a/examples/divisibility/Cargo.toml +++ b/examples/divisibility/Cargo.toml @@ -8,8 +8,8 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } -stylist = { version = "0.13", features = ["yew"] } +yew = { version = "0.22", features = ["csr"] } +stylist = { version="0.14", features = ["yew"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/divisibility/index.html b/examples/divisibility/index.html index a597aaf..f07731a 100644 --- a/examples/divisibility/index.html +++ b/examples/divisibility/index.html @@ -3,5 +3,7 @@ Divisibility Example + + diff --git a/examples/helmet-ssr/Cargo.toml b/examples/helmet-ssr/Cargo.toml index 9da0086..18a8584 100644 --- a/examples/helmet-ssr/Cargo.toml +++ b/examples/helmet-ssr/Cargo.toml @@ -14,11 +14,11 @@ required-features = ["ssr"] [dependencies] bounce = { path = "../../crates/bounce", features = ["helmet"] } -yew = { version = "0.21" } +yew = { version = "0.22" } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" -yew-router = "0.18" +yew-router = "0.19" gloo = { version = "0.10.0", features = ["futures"] } web-sys= "0.3.64" bytes = "1.4.0" diff --git a/examples/helmet-ssr/src/lib.rs b/examples/helmet-ssr/src/lib.rs index ec61512..b3a7402 100644 --- a/examples/helmet-ssr/src/lib.rs +++ b/examples/helmet-ssr/src/lib.rs @@ -18,7 +18,7 @@ pub enum Route { Home, } -#[function_component(A)] +#[component(A)] fn a() -> Html { html! { <> @@ -32,14 +32,14 @@ fn a() -> Html { } } -#[function_component(B)] +#[component(B)] fn b() -> Html { html! {
{"This is page B. This page does not have a specific title, so default title will be used instead."}
} } -#[function_component(Home)] +#[component(Home)] fn home() -> Html { html! { <> @@ -52,7 +52,7 @@ fn home() -> Html { } } -#[function_component(Links)] +#[component(Links)] fn links() -> Html { html! { <> @@ -75,7 +75,7 @@ fn format_title(s: AttrValue) -> AttrValue { format!("{s} - Example").into() } -#[function_component(App)] +#[component(App)] pub fn app() -> Html { html! { @@ -109,7 +109,7 @@ mod feat_ssr { pub helmet_writer: StaticWriter, } - #[function_component] + #[component] pub fn ServerApp(props: &ServerAppProps) -> Html { let history = AnyHistory::from(MemoryHistory::new()); history diff --git a/examples/helmet-title/Cargo.toml b/examples/helmet-title/Cargo.toml index 8208456..7075bfe 100644 --- a/examples/helmet-title/Cargo.toml +++ b/examples/helmet-title/Cargo.toml @@ -8,11 +8,11 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce", features = ["helmet"] } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" -yew-router = "0.18" +yew-router = "0.19" gloo = { version = "0.10.0", features = ["futures"] } web-sys= "0.3.64" diff --git a/examples/helmet-title/index.html b/examples/helmet-title/index.html index 17e36ed..22c5217 100644 --- a/examples/helmet-title/index.html +++ b/examples/helmet-title/index.html @@ -3,5 +3,7 @@ Helmet Title Example + + diff --git a/examples/helmet-title/src/main.rs b/examples/helmet-title/src/main.rs index bbbbef4..78815b2 100644 --- a/examples/helmet-title/src/main.rs +++ b/examples/helmet-title/src/main.rs @@ -19,7 +19,7 @@ pub enum Route { Home, } -#[function_component(A)] +#[component(A)] fn a() -> Html { html! { <> @@ -33,14 +33,14 @@ fn a() -> Html { } } -#[function_component(B)] +#[component(B)] fn b() -> Html { html! {
{"This is page B. This page does not have a specific title, so default title will be used instead."}
} } -#[function_component(Home)] +#[component(Home)] fn home() -> Html { html! { <> @@ -53,7 +53,7 @@ fn home() -> Html { } } -#[function_component(Links)] +#[component(Links)] fn links() -> Html { html! { <> @@ -76,7 +76,7 @@ fn format_title(s: AttrValue) -> AttrValue { format!("{s} - Example").into() } -#[function_component(App)] +#[component(App)] fn app() -> Html { html! { diff --git a/examples/notion/Cargo.toml b/examples/notion/Cargo.toml index 689fba4..07e62a4 100644 --- a/examples/notion/Cargo.toml +++ b/examples/notion/Cargo.toml @@ -8,8 +8,8 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } -stylist = { version = "0.13", features = ["yew"] } +yew = { version = "0.22", features = ["csr"] } +stylist = { version="0.14", features = ["yew"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/notion/index.html b/examples/notion/index.html index 2faf09e..ee2498a 100644 --- a/examples/notion/index.html +++ b/examples/notion/index.html @@ -3,5 +3,7 @@ Notion Example + + diff --git a/examples/partial-render/Cargo.toml b/examples/partial-render/Cargo.toml index 4575b76..ed685d4 100644 --- a/examples/partial-render/Cargo.toml +++ b/examples/partial-render/Cargo.toml @@ -8,8 +8,8 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } -stylist = { version = "0.13", features = ["yew"] } +yew = { version = "0.22", features = ["csr"] } +stylist = { version="0.14", features = ["yew"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/partial-render/index.html b/examples/partial-render/index.html index 2dd6acb..d101350 100644 --- a/examples/partial-render/index.html +++ b/examples/partial-render/index.html @@ -3,5 +3,7 @@ Partial Render Example + + diff --git a/examples/persist/Cargo.toml b/examples/persist/Cargo.toml index 8881788..4dc1ac3 100644 --- a/examples/persist/Cargo.toml +++ b/examples/persist/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/persist/index.html b/examples/persist/index.html index 9c0bfcc..4ef0f1d 100644 --- a/examples/persist/index.html +++ b/examples/persist/index.html @@ -3,5 +3,7 @@ Persist Example + + diff --git a/examples/persist/src/main.rs b/examples/persist/src/main.rs index 67ad98a..1a4ace2 100644 --- a/examples/persist/src/main.rs +++ b/examples/persist/src/main.rs @@ -40,14 +40,14 @@ impl Observed for Username { } } -#[function_component(Reader)] +#[component(Reader)] fn reader() -> Html { let username = use_atom_value::(); html! {
{"Hello, "}{username}
} } -#[function_component(Setter)] +#[component(Setter)] fn setter() -> Html { let username = use_atom::(); @@ -68,7 +68,7 @@ fn setter() -> Html { } } -#[function_component(App)] +#[component(App)] fn app() -> Html { html! { diff --git a/examples/queries-mutations/Cargo.toml b/examples/queries-mutations/Cargo.toml index b10c2b1..2e7396a 100644 --- a/examples/queries-mutations/Cargo.toml +++ b/examples/queries-mutations/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce", features = ["query"] } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } reqwest = { version = "0.11.18", features = ["json"] } diff --git a/examples/queries-mutations/index.html b/examples/queries-mutations/index.html index 9290735..ea1668b 100644 --- a/examples/queries-mutations/index.html +++ b/examples/queries-mutations/index.html @@ -3,5 +3,7 @@ Bounce Query Example + + diff --git a/examples/queries-mutations/src/main.rs b/examples/queries-mutations/src/main.rs index 27325f3..03ee445 100644 --- a/examples/queries-mutations/src/main.rs +++ b/examples/queries-mutations/src/main.rs @@ -92,7 +92,7 @@ struct ContentProps { ord: usize, } -#[function_component(Content)] +#[component(Content)] fn content(props: &ContentProps) -> Html { let uuid_state = use_query_value::(().into()); @@ -112,7 +112,7 @@ fn content(props: &ContentProps) -> Html { } } -#[function_component(SuspendContent)] +#[component(SuspendContent)] fn suspend_content(props: &ContentProps) -> HtmlResult { let uuid_state = use_query::(().into())?; @@ -131,7 +131,7 @@ fn suspend_content(props: &ContentProps) -> HtmlResult { }) } -#[function_component(Refresher)] +#[component(Refresher)] fn refresher() -> Html { let uuid_state = use_query_value::(().into()); @@ -151,7 +151,7 @@ fn refresher() -> Html { } } -#[function_component(Echo)] +#[component(Echo)] fn echo() -> Html { let echo_state = use_mutation::(); let value = use_state_eq(|| "".to_string()); @@ -201,7 +201,7 @@ fn echo() -> Html { } } -#[function_component(App)] +#[component(App)] fn app() -> Html { let fallback = html! { <> diff --git a/examples/queries-ssr/Cargo.toml b/examples/queries-ssr/Cargo.toml index 2213e05..f7954a8 100644 --- a/examples/queries-ssr/Cargo.toml +++ b/examples/queries-ssr/Cargo.toml @@ -16,7 +16,7 @@ required-features = ["ssr"] [dependencies] bounce = { path = "../../crates/bounce", features = ["query"] } -yew = { version = "0.21" } +yew = { version = "0.22" } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } reqwest = { version = "0.11.18", features = ["json"] } diff --git a/examples/queries-ssr/index.html b/examples/queries-ssr/index.html index 2076310..cfb256e 100644 --- a/examples/queries-ssr/index.html +++ b/examples/queries-ssr/index.html @@ -7,5 +7,6 @@ + diff --git a/examples/queries-ssr/src/lib.rs b/examples/queries-ssr/src/lib.rs index 60c9df8..6fd5737 100644 --- a/examples/queries-ssr/src/lib.rs +++ b/examples/queries-ssr/src/lib.rs @@ -4,6 +4,7 @@ use async_trait::async_trait; use bounce::prelude::*; use bounce::query::{use_prepared_query, Query, QueryResult}; use bounce::BounceRoot; +use bounce::__vendored::yew::component; use serde::{Deserialize, Serialize}; use thiserror::Error; use uuid::Uuid; @@ -39,7 +40,7 @@ struct ContentProps { ord: usize, } -#[function_component(SuspendContent)] +#[component(SuspendContent)] fn suspend_content(props: &ContentProps) -> HtmlResult { let uuid_state = use_prepared_query::(().into())?; @@ -55,7 +56,7 @@ fn suspend_content(props: &ContentProps) -> HtmlResult { }) } -#[function_component(Refresher)] +#[component(Refresher)] fn refresher() -> HtmlResult { let uuid_state = use_prepared_query::(().into())?; @@ -73,7 +74,7 @@ fn refresher() -> HtmlResult { }) } -#[function_component(App)] +#[component(App)] pub fn app() -> Html { let fallback = html! { <> diff --git a/examples/random-uuid/Cargo.toml b/examples/random-uuid/Cargo.toml index 454ee58..06643eb 100644 --- a/examples/random-uuid/Cargo.toml +++ b/examples/random-uuid/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } reqwest = { version = "0.11.18", features = ["json"] } diff --git a/examples/random-uuid/index.html b/examples/random-uuid/index.html index a942824..64081d4 100644 --- a/examples/random-uuid/index.html +++ b/examples/random-uuid/index.html @@ -3,5 +3,7 @@ Random UUID Example + + diff --git a/examples/random-uuid/src/main.rs b/examples/random-uuid/src/main.rs index 76629c2..c3e249c 100644 --- a/examples/random-uuid/src/main.rs +++ b/examples/random-uuid/src/main.rs @@ -24,20 +24,15 @@ async fn fetch_uuid(_input: &()) -> String { uuid_resp.uuid } -#[derive(PartialEq, Atom, Eq)] +#[derive(PartialEq, Atom, Eq, Default)] #[bounce(with_notion(Deferred))] enum UuidState { + #[default] NotStarted, Pending, Complete(String), } -impl Default for UuidState { - fn default() -> UuidState { - Self::NotStarted - } -} - impl WithNotion> for UuidState { fn apply(self: Rc, notion: Rc>) -> Rc { match notion.output() { @@ -47,7 +42,7 @@ impl WithNotion> for UuidState { } } -#[function_component(Reader)] +#[component(Reader)] fn reader() -> Html { let uuid_state = use_atom_value::(); @@ -62,7 +57,7 @@ fn reader() -> Html { html! {
{text}
} } -#[function_component(Loader)] +#[component(Loader)] fn loader() -> Html { let uuid_state = use_atom::(); let run_fetch_uuid = use_future_notion_runner::(); @@ -74,7 +69,7 @@ fn loader() -> Html { html! { } } -#[function_component(App)] +#[component(App)] fn app() -> Html { html! { diff --git a/examples/simple/Cargo.toml b/examples/simple/Cargo.toml index c6b0ede..0323ee4 100644 --- a/examples/simple/Cargo.toml +++ b/examples/simple/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" diff --git a/examples/simple/index.html b/examples/simple/index.html index 1ff934d..d899238 100644 --- a/examples/simple/index.html +++ b/examples/simple/index.html @@ -3,5 +3,7 @@ Simple Example + + diff --git a/examples/simple/src/main.rs b/examples/simple/src/main.rs index ea1c458..a7aad13 100644 --- a/examples/simple/src/main.rs +++ b/examples/simple/src/main.rs @@ -31,14 +31,14 @@ impl fmt::Display for Username { } } -#[function_component(Reader)] +#[component(Reader)] fn reader() -> Html { let username = use_atom_value::(); html! {
{"Hello, "}{username}
} } -#[function_component(Setter)] +#[component(Setter)] fn setter() -> Html { let username = use_atom::(); @@ -59,7 +59,7 @@ fn setter() -> Html { } } -#[function_component(Resetter)] +#[component(Resetter)] fn resetter() -> Html { let set_username = use_atom_setter::(); @@ -68,7 +68,7 @@ fn resetter() -> Html { html! { } } -#[function_component(App)] +#[component(App)] fn app() -> Html { html! { diff --git a/examples/title/Cargo.toml b/examples/title/Cargo.toml index 678e7d9..17e6955 100644 --- a/examples/title/Cargo.toml +++ b/examples/title/Cargo.toml @@ -8,11 +8,11 @@ publish = false [dependencies] bounce = { path = "../../crates/bounce" } -yew = { version = "0.21", features = ["csr"] } +yew = { version = "0.22", features = ["csr"] } log = "0.4.19" console_log = { version = "1.0.0", features = ["color"] } wasm-bindgen = "0.2.87" -yew-router = "0.18" +yew-router = "0.19" gloo = { version = "0.10.0", features = ["futures"] } web-sys= "0.3.64" diff --git a/examples/title/index.html b/examples/title/index.html index e0131d6..2b9428b 100644 --- a/examples/title/index.html +++ b/examples/title/index.html @@ -3,5 +3,7 @@ Title Example + + diff --git a/examples/title/src/main.rs b/examples/title/src/main.rs index 2a99cad..77a532c 100644 --- a/examples/title/src/main.rs +++ b/examples/title/src/main.rs @@ -19,7 +19,7 @@ pub struct Title { } /// A component to apply the title when it changes. -#[function_component(TitleApplier)] +#[component(TitleApplier)] pub fn title_applier() -> Html { let titles = use_artifacts::(); @@ -47,7 +47,7 @@ pub enum Route { Home, } -#[function_component(A)] +#[component(A)] fn a() -> Html { html! { <> @@ -57,14 +57,14 @@ fn a() -> Html { } } -#[function_component(B)] +#[component(B)] fn b() -> Html { html! { <div>{"This is page B. This page does not have a specific title, so default title will be used instead."}</div> } } -#[function_component(Home)] +#[component(Home)] fn home() -> Html { html! { <> @@ -74,7 +74,7 @@ fn home() -> Html { } } -#[function_component(Links)] +#[component(Links)] fn links() -> Html { html! { <> @@ -93,7 +93,7 @@ fn render_fn(route: Route) -> Html { } } -#[function_component(App)] +#[component(App)] fn app() -> Html { html! { <BounceRoot>