Skip to content

Commit 430d4a2

Browse files
committed
fix(website): updated #[component] annotations
The latest Sycamore update properly breaks the old syntax, which was still being used in some places. This has been breaking CI tests across branches.
1 parent e678d44 commit 430d4a2

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

website/src/components/container.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub struct ContainerProps<'a, G: Html> {
99
pub footer: bool,
1010
}
1111

12-
#[component(Container<G>)]
12+
#[component]
1313
pub fn Container<'a, G: Html>(cx: Scope<'a>, props: ContainerProps<'a, G>) -> View<G> {
1414
let children = props.children.call(cx);
1515

website/src/templates/comparisons.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct ComparisonRowProps<'a> {
2020
comparison_val: &'a ReadSignal<String>,
2121
name: String,
2222
}
23-
#[component(ComparisonRow<G>)]
23+
#[component]
2424
fn ComparisonRow<'a, G: Html>(cx: Scope<'a>, props: ComparisonRowProps<'a>) -> View<G> {
2525
let show_details = create_signal(cx, false);
2626
let name = create_ref(cx, props.name);
@@ -67,7 +67,7 @@ struct ComparisonTableProps<'a> {
6767
comparison: &'a ReadSignal<Comparison>,
6868
perseus_comparison: Comparison,
6969
}
70-
#[component(ComparisonTable<G>)]
70+
#[component]
7171
fn ComparisonTable<'a, G: Html>(cx: Scope<'a>, props: ComparisonTableProps<'a>) -> View<G> {
7272
let comparison = props.comparison;
7373
let Comparison {
@@ -279,7 +279,7 @@ pub struct ComparisonsPageProps {
279279
}
280280

281281
#[perseus::template(ComparisonsPage)]
282-
#[component(ComparisonsPage<G>)]
282+
#[component]
283283
pub fn comparisons_page<G: Html>(cx: Scope, props: ComparisonsPageProps) -> View<G> {
284284
let comparisons = props.comparisons.clone();
285285
let perseus_comparison = props.perseus_comparison;

website/src/templates/docs/container.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct DocsVersionSwitcherProps {
1515
manifest: DocsManifest,
1616
current_version: String,
1717
}
18-
#[component(DocsVersionSwitcher<G>)]
18+
#[component]
1919
fn DocsVersionSwitcher<G: Html>(cx: Scope, props: DocsVersionSwitcherProps) -> View<G> {
2020
// We'll fill this in from the reactive scope
2121
// Astonishingly, this actually works...
@@ -100,7 +100,7 @@ pub struct DocsContainerProps<G: GenericNode> {
100100
pub current_version: String,
101101
}
102102

103-
#[component(DocsContainer<G>)]
103+
#[component]
104104
pub fn DocsContainer<G: Html>(cx: Scope, props: DocsContainerProps<G>) -> View<G> {
105105
let docs_links = props.docs_links.clone();
106106
let docs_links_clone = docs_links.clone();

website/src/templates/docs/search_bar.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use sycamore::prelude::*;
2727
// }
2828
// }
2929

30+
#[component]
3031
pub fn SearchBar<G: Html>(_cx: Scope) -> View<G> {
3132
View::empty()
3233
}

website/src/templates/docs/template.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct DocsPageProps {
1919
}
2020

2121
#[perseus::template(DocsPage)]
22-
#[component(DocsPage<G>)]
22+
#[component]
2323
pub fn docs_page<G: Html>(cx: Scope, props: DocsPageProps) -> View<G> {
2424
// These come pre-translated for the current locale
2525
// Note that all the docs files have a title emblazoned at the top already, so

website/src/templates/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn AnimatedCircularProgressBar<G: Html>(
382382
}
383383

384384
#[perseus::template(IndexPage)]
385-
#[component(IndexPage<G>)]
385+
#[component]
386386
pub fn index_page<G: Html>(cx: Scope, examples: CodeExamples) -> View<G> {
387387
// // Fix these on mobile
388388
// let nav_buttons = match props.nav_buttons {

website/src/templates/plugins.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct PluginDetails {
4646
}
4747

4848
#[perseus::template(PluginsPage)]
49-
#[component(PluginsPage<G>)]
49+
#[component]
5050
fn plugins_page<G: Html>(cx: Scope, props: PluginsPageProps) -> View<G> {
5151
let plugins = create_signal(cx, props.plugins);
5252
// This will store the plugins relevant to the user's search (all of them by

0 commit comments

Comments
 (0)