Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'] }
11 changes: 7 additions & 4 deletions crates/bounce/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
Expand All @@ -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)'] }
2 changes: 1 addition & 1 deletion crates/bounce/src/helmet/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn render_tags(
/// }
/// # }
/// ```
#[function_component(HelmetBridge)]
#[component(HelmetBridge)]
pub fn helmet_bridge(props: &HelmetBridgeProps) -> Html {
#[cfg(debug_assertions)]
{
Expand Down
4 changes: 2 additions & 2 deletions crates/bounce/src/helmet/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion crates/bounce/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct BounceRootProps {
/// }
///
/// ```
#[function_component(BounceRoot)]
#[component(BounceRoot)]
pub fn bounce_root(props: &BounceRootProps) -> Html {
let BounceRootProps {
children,
Expand Down
2 changes: 1 addition & 1 deletion crates/bounce/src/query/query_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/bounce/src/states/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ where
///
/// let rendered = html! {<Artifact<Title> value={artifact} />};
/// ```
#[function_component(Artifact)]
#[component(Artifact)]
pub fn artifact<T>(props: &ArtifactProps<T>) -> Html
where
T: PartialEq + 'static,
Expand Down
6 changes: 3 additions & 3 deletions crates/bounce/tests/init_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct State {
inner: u32,
}

#[function_component(Comp)]
#[component(Comp)]
fn comp() -> Html {
let a = use_atom_value::<State>();

Expand All @@ -40,7 +40,7 @@ fn comp() -> Html {

#[test]
async fn test_without_init_states() {
#[function_component(Root)]
#[component(Root)]
fn root() -> Html {
html! {
<BounceRoot>
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions crates/bounce/tests/notion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn test_notion_generic() {
}
}

#[function_component(Comp)]
#[component(Comp)]
fn comp() -> Html {
let a = use_atom::<State<u32>>();
let b = use_atom::<State<u64>>();
Expand All @@ -66,7 +66,7 @@ async fn test_notion_generic() {
}
}

#[function_component(Root)]
#[component(Root)]
fn root() -> Html {
html! {
<BounceRoot>
Expand Down
4 changes: 2 additions & 2 deletions crates/bounce/tests/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<MyQuery>(().into());
let set_my_state = use_atom_setter();
Expand All @@ -80,7 +80,7 @@ async fn test_query_requery_upon_state_change() {
}
}

#[function_component(App)]
#[component(App)]
fn app() -> Html {
html! {
<BounceRoot>
Expand Down
4 changes: 2 additions & 2 deletions examples/divisibility-input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions examples/divisibility-input/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<head>
<meta charset="utf-8">
<title>Divisibility Input Example</title>
<link data-trunk rel="rust"/>
</head>
<body></body>
</html>
4 changes: 2 additions & 2 deletions examples/divisibility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions examples/divisibility/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<head>
<meta charset="utf-8">
<title>Divisibility Example</title>
<link data-trunk rel="rust"/>
</head>
<body></body>
</html>
4 changes: 2 additions & 2 deletions examples/helmet-ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions examples/helmet-ssr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum Route {
Home,
}

#[function_component(A)]
#[component(A)]
fn a() -> Html {
html! {
<>
Expand All @@ -32,14 +32,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! {
<>
Expand All @@ -52,7 +52,7 @@ fn home() -> Html {
}
}

#[function_component(Links)]
#[component(Links)]
fn links() -> Html {
html! {
<>
Expand All @@ -75,7 +75,7 @@ fn format_title(s: AttrValue) -> AttrValue {
format!("{s} - Example").into()
}

#[function_component(App)]
#[component(App)]
pub fn app() -> Html {
html! {
<BounceRoot>
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/helmet-title/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions examples/helmet-title/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<head>
<meta charset="utf-8">
<title>Helmet Title Example</title>
<link data-trunk rel="rust"/>
</head>
<body></body>
</html>
10 changes: 5 additions & 5 deletions examples/helmet-title/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Route {
Home,
}

#[function_component(A)]
#[component(A)]
fn a() -> Html {
html! {
<>
Expand All @@ -33,14 +33,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! {
<>
Expand All @@ -53,7 +53,7 @@ fn home() -> Html {
}
}

#[function_component(Links)]
#[component(Links)]
fn links() -> Html {
html! {
<>
Expand All @@ -76,7 +76,7 @@ fn format_title(s: AttrValue) -> AttrValue {
format!("{s} - Example").into()
}

#[function_component(App)]
#[component(App)]
fn app() -> Html {
html! {
<BounceRoot>
Expand Down
4 changes: 2 additions & 2 deletions examples/notion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions examples/notion/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<head>
<meta charset="utf-8">
<title>Notion Example</title>
<link data-trunk rel="rust"/>
</head>
<body></body>
</html>
4 changes: 2 additions & 2 deletions examples/partial-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions examples/partial-render/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<head>
<meta charset="utf-8">
<title>Partial Render Example</title>
<link data-trunk rel="rust"/>
</head>
<body></body>
</html>
2 changes: 1 addition & 1 deletion examples/persist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading