Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/spread-event-handlers' into spre…
Browse files Browse the repository at this point in the history
…ad-event-handlers
  • Loading branch information
lpotthast committed Apr 5, 2024
2 parents 206f528 + e670f03 commit 8116b01
Show file tree
Hide file tree
Showing 176 changed files with 401 additions and 1,266 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-changed-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: nightly-2024-03-31
2 changes: 1 addition & 1 deletion .github/workflows/ci-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: nightly-2024-03-31
4 changes: 2 additions & 2 deletions .github/workflows/ci-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
test:
needs: [get-leptos-changed]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
name: Run semver check (nightly-2024-01-29)
name: Run semver check (nightly-2024-03-31)
runs-on: ubuntu-latest

steps:
Expand All @@ -25,4 +25,4 @@ jobs:
- name: Semver Checks
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
rust-toolchain: nightly-2024-01-29
rust-toolchain: nightly-2024-03-31
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-01-29
toolchain: nightly-2024-03-31
2 changes: 2 additions & 0 deletions .github/workflows/get-leptos-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get source files that changed
id: changed-source
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/run-cargo-make-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
- name: Install wasm-bindgen
run: cargo binstall wasm-bindgen-cli --no-confirm

- name: Install wasm-pack
run: cargo binstall wasm-pack --no-confirm

- name: Install cargo-leptos
run: cargo binstall cargo-leptos --no-confirm

Expand Down
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ members = [
exclude = ["benchmarks", "examples"]

[workspace.package]
version = "0.6.9"
version = "0.6.10"
rust-version = "1.75"

[workspace.dependencies]
leptos = { path = "./leptos", version = "0.6.9" }
leptos_dom = { path = "./leptos_dom", version = "0.6.9" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.9" }
leptos_macro = { path = "./leptos_macro", version = "0.6.9" }
leptos_reactive = { path = "./leptos_reactive", version = "0.6.9" }
leptos_server = { path = "./leptos_server", version = "0.6.9" }
server_fn = { path = "./server_fn", version = "0.6.9" }
server_fn_macro = { path = "./server_fn_macro", version = "0.6.9" }
leptos = { path = "./leptos", version = "0.6.10" }
leptos_dom = { path = "./leptos_dom", version = "0.6.10" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.10" }
leptos_macro = { path = "./leptos_macro", version = "0.6.10" }
leptos_reactive = { path = "./leptos_reactive", version = "0.6.10" }
leptos_server = { path = "./leptos_server", version = "0.6.10" }
server_fn = { path = "./server_fn", version = "0.6.10" }
server_fn_macro = { path = "./server_fn_macro", version = "0.6.10" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.6" }
leptos_config = { path = "./leptos_config", version = "0.6.9" }
leptos_router = { path = "./router", version = "0.6.9" }
leptos_meta = { path = "./meta", version = "0.6.9" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.9" }
leptos_config = { path = "./leptos_config", version = "0.6.10" }
leptos_router = { path = "./router", version = "0.6.10" }
leptos_meta = { path = "./meta", version = "0.6.10" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.10" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion cargo-make/check.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ alias = "check-all"

[tasks.check-all]
command = "cargo"
args = ["+nightly-2024-01-29", "check-all-features"]
args = ["+nightly-2024-03-31", "check-all-features"]
install_crate = "cargo-all-features"
8 changes: 3 additions & 5 deletions cargo-make/lint.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
dependencies = ["install-clippy"]
command = "cargo"
args = [
"hack",
"clippy",
"--all",
"--each-feature",
"--no-dev-deps",
"--all-features",
"--no-deps",
"--",
"-D",
"clippy::print_stdout"
"clippy::print_stdout",
]
2 changes: 1 addition & 1 deletion cargo-make/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ alias = "test-all"

[tasks.test-all]
command = "cargo"
args = ["+nightly-2024-01-29", "test-all-features"]
args = ["+nightly-2024-03-31", "test-all-features"]
install_crate = "cargo-all-features"
2 changes: 1 addition & 1 deletion examples/animated_show/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
codegen-units = 1
lto = true

[dependencies]
[dependencies]
leptos = { path = "../../leptos", features = ["csr"] }
console_log = "1"
log = "0.4"
Expand Down
4 changes: 2 additions & 2 deletions examples/cargo-make/cargo-leptos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ clear = true
dependencies = ["check-debug", "check-release"]

[tasks.check-debug]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"

[tasks.check-release]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
Expand Down
4 changes: 2 additions & 2 deletions examples/cargo-make/compile.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tasks.build]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["build-all-features"]
install_crate = "cargo-all-features"

[tasks.check]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
4 changes: 2 additions & 2 deletions examples/cargo-make/deno-build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ clear = true
dependencies = ["check-debug", "check-release"]

[tasks.check-debug]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"

[tasks.check-release]
toolchain = "nightly-2024-01-29"
toolchain = "nightly-2024-03-31"
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
2 changes: 1 addition & 1 deletion examples/counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ codegen-units = 1
lto = true

[dependencies]
leptos = { path = "../../leptos", features = ["csr", "nightly"] }
leptos = { path = "../../leptos", features = ["csr"] }
console_log = "1"
log = "0.4"
console_error_panic_hook = "0.1.7"
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2024-01-29"
channel = "nightly-2024-03-31"
4 changes: 2 additions & 2 deletions examples/counter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pub fn SimpleCounter(

view! {
<div>
<button on:click=move |_| set_value(0)>"Clear"</button>
<button on:click=move |_| set_value.set(0)>"Clear"</button>
<button on:click=move |_| set_value.update(|value| *value -= step)>"-1"</button>
<span>"Value: " {value} "!"</span>
<span>"Value: " {move || value.get()} "!"</span>
<button on:click=move |_| set_value.update(|value| *value += step)>"+1"</button>
</div>
}
Expand Down
3 changes: 1 addition & 2 deletions examples/counter_isomorphic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ simple_logger = "4.3"
tracing = { version = "0.1", optional = true }

[features]
default = ["nightly"]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
ssr = [
"dep:actix-files",
Expand All @@ -45,7 +44,7 @@ ssr = [
nightly = ["leptos/nightly", "leptos_router/nightly"]

[package.metadata.cargo-all-features]
denylist = ["actix-files", "actix-web", "leptos_actix", "nightly"]
denylist = ["actix-files", "actix-web", "leptos_actix"]
skip_feature_sets = [["ssr", "hydrate"]]

[package.metadata.leptos]
Expand Down
2 changes: 1 addition & 1 deletion examples/counter_url_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ codegen-units = 1
lto = true

[dependencies]
leptos = { path = "../../leptos", features = ["csr", "nightly"] }
leptos = { path = "../../leptos", features = ["csr"] }
leptos_router = { path = "../../router", features = ["csr"] }
console_log = "1"
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/counter_url_query/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2024-01-29"
channel = "stable"
14 changes: 7 additions & 7 deletions examples/counter_url_query/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ use leptos_router::*;
#[component]
pub fn SimpleQueryCounter() -> impl IntoView {
let (count, set_count) = create_query_signal::<i32>("count");
let clear = move |_| set_count(None);
let decrement = move |_| set_count(Some(count().unwrap_or(0) - 1));
let increment = move |_| set_count(Some(count().unwrap_or(0) + 1));
let clear = move |_| set_count.set(None);
let decrement = move |_| set_count.set(Some(count.get().unwrap_or(0) - 1));
let increment = move |_| set_count.set(Some(count.get().unwrap_or(0) + 1));

let (msg, set_msg) = create_query_signal::<String>("message");
let update_msg = move |ev| {
let new_msg = event_target_value(&ev);
if new_msg.is_empty() {
set_msg(None);
set_msg.set(None);
} else {
set_msg(Some(new_msg));
set_msg.set(Some(new_msg));
}
};

view! {
<div>
<button on:click=clear>"Clear"</button>
<button on:click=decrement>"-1"</button>
<span>"Value: " {move || count().unwrap_or(0)} "!"</span>
<span>"Value: " {move || count.get().unwrap_or(0)} "!"</span>
<button on:click=increment>"+1"</button>

<br />

<input
prop:value=move || msg().unwrap_or_default()
prop:value=move || msg.get().unwrap_or_default()
on:input=update_msg
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/counter_without_macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use leptos::{ev, html::*, *};
use leptos::{html::*, *};

/// A simple counter view.
// A component is really just a function call: it runs once to create the DOM and reactive system
Expand Down
2 changes: 1 addition & 1 deletion examples/counters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
leptos = { path = "../../leptos", features = ["csr", "nightly"] }
leptos = { path = "../../leptos", features = ["csr"] }
log = "0.4"
console_log = "1"
console_error_panic_hook = "0.1.7"
Expand Down
2 changes: 1 addition & 1 deletion examples/counters/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2024-01-29"
channel = "nightly-2024-03-31"
15 changes: 8 additions & 7 deletions examples/counters/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use leptos::{For, *};
use leptos::*;

const MANY_COUNTERS: usize = 1000;

Expand All @@ -16,14 +16,14 @@ pub fn Counters() -> impl IntoView {
provide_context(CounterUpdater { set_counters });

let add_counter = move |_| {
let id = next_counter_id();
let id = next_counter_id.get();
let sig = create_signal(0);
set_counters.update(move |counters| counters.push((id, sig)));
set_next_counter_id.update(|id| *id += 1);
};

let add_many_counters = move |_| {
let next_id = next_counter_id();
let next_id = next_counter_id.get();
let new_counters = (next_id..next_id + MANY_COUNTERS).map(|id| {
let signal = create_signal(0);
(id, signal)
Expand Down Expand Up @@ -53,17 +53,17 @@ pub fn Counters() -> impl IntoView {
<span>{move ||
counters.get()
.iter()
.map(|(_, (count, _))| count())
.map(|(_, (count, _))| count.get())
.sum::<i32>()
.to_string()
}</span>
" from "
<span>{move || counters().len().to_string()}</span>
<span>{move || counters.get().len().to_string()}</span>
" counters."
</p>
<ul>
<For
each=counters
each=move||counters.get()
key=|counter| counter.0
children=move |(id, (value, set_value)): (usize, (ReadSignal<i32>, WriteSignal<i32>))| {
view! {
Expand All @@ -85,7 +85,8 @@ fn Counter(
let CounterUpdater { set_counters } = use_context().unwrap();

let input = move |ev| {
set_value(event_target_value(&ev).parse::<i32>().unwrap_or_default())
set_value
.set(event_target_value(&ev).parse::<i32>().unwrap_or_default())
};

// this will run when the scope is disposed, i.e., when this row is deleted
Expand Down
20 changes: 0 additions & 20 deletions examples/counters_stable/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions examples/counters_stable/Cargo.toml

This file was deleted.

Loading

0 comments on commit 8116b01

Please sign in to comment.