Compare commits

...

774 Commits

Author SHA1 Message Date
autofix-ci[bot]
549f6c16ff [autofix.ci] apply automated fixes 2025-12-13 19:32:42 +00:00
Greg Johnston
9c1efcf267 chore: add a regression test to ensure correct behavior for keyed store
fields (see discussion in #4473)
2025-12-13 14:01:04 -05:00
Greg Johnston
7864a12967 chore: resolve new warnings (#4485) 2025-12-13 14:00:19 -05:00
dependabot[bot]
9733cdcfe1 chore(deps): bump actions/checkout from 5 to 6 (#4461)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-28 12:28:14 -05:00
Marc-Stefan Cassola
1aaa716dfc examples: use ShowLet where appropriate in examples (#4467) 2025-11-28 12:00:26 -05:00
Greg Johnston
779b2f2a9f chore: bump versions after recent release 2025-11-24 19:49:03 -05:00
Greg Johnston
72e0abc75c chore: bump versions after recent release (#4462) 2025-11-24 17:29:23 -05:00
zakstucke
a7a8970150 feat: resupport From<Fn() -> T> for Signal<T>, ArcSignal<T>, Callback<T, _> and similar (#4273) 2025-11-24 13:50:11 -05:00
Tyler Earls
2e09f3d102 fix: make class attribute overwrite behavior consistent between SSR and CSR (closes #4248) (#4439)
Fixes #4248

During SSR, multiple `class` attributes were incorrectly concatenating
instead of overwriting like they do in browsers. This inconsistency
caused code that appeared to work in SSR to fail in CSR/hydration.

The fix distinguishes between two types of class attributes:
- `class="..."` attributes should overwrite (clear previous values)
- `class:name=value` directives should merge (append to existing classes)

Implementation:
- Added `should_overwrite()` method to `IntoClass` trait (defaults to `false`)
- Modified `Class::to_html()` to clear buffer before rendering if `should_overwrite()` returns `true`
- Implemented `should_overwrite() -> true` for string types (`&str`, `String`, `Cow<'_, str>`, `Arc<str>`)
- Tuple type `(&'static str, bool)` keeps default `false` for merge behavior

Added comprehensive tests to verify:
- `class="foo" class:bar=true` produces `"foo bar"` (merge)
- `class:foo=true` works standalone
- Correct behavior with macro attribute sorting
- Global class application

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-22 13:12:10 -05:00
tqq1994516
e6fe7fef07 fix: add response headers for leptos_axum static files #4377 (#4394) 2025-11-22 13:11:53 -05:00
Greg Johnston
629f4f9d0f fix: do not unescape query and hash in URLs when clicking links (closes (#4454) 2025-11-21 13:16:24 -05:00
Ægir Örn Símonarson
ff5b612e12 chore: removed duplicate workspace member oco (#4445) 2025-11-19 19:59:14 -05:00
Greg Johnston
61571ed24b fix: improve marker-node filtering when using islands router (closes #4443) (#4446) 2025-11-19 19:56:44 -05:00
Greg Johnston
4f3a26ce88 fix: track resources in Suspense that are read conditionally behind other resource reads (see #4430) (#4444) 2025-11-17 21:36:56 -05:00
Greg Johnston
83a848b5ec chore: clean up up warning behavior for resources that depend on other resources (#4415) (closes #3372) 2025-11-17 21:00:41 -05:00
Greg Johnston
eec9edf517 Update README.md 2025-11-11 15:51:21 -05:00
Marco Kuoni
861dcf354c docs: add --split to command for lazy_routes example (#4440) 2025-11-09 20:23:40 -05:00
Greg Johnston
af3d6cba22 fix: remove possibility of SendWrapper errors on server by using conditional compilation instead of overloading .dry_resolve() (closes #4432, #4402) (#4433) 2025-11-07 13:43:18 -05:00
Alexis Fontaine
a0d657f9b1 chore: relax Debug trait bound on tuples PossibleRouteMatch implementation (#4428) 2025-11-04 08:42:38 -05:00
Greg Johnston
cddb24ebd3 fix: check custom element tag name when rebuilding (#4413) 2025-11-02 14:49:51 -05:00
Greg Johnston
e8afd11995 Merge pull request #4427 from zakstucke/zak/root-owner-cleanup
Force cleanup even if there are other references to the root owner
2025-11-02 14:49:29 -05:00
Zak Stucke
4d01d95175 Clippy 2025-11-02 16:16:03 +02:00
Zak Stucke
9bf5b22633 Force cleanup even if there are other references to the root owner 2025-11-02 15:24:26 +02:00
Greg Johnston
da4a7d5285 examples: clarify behavior of upload-with-progress demo (closes #4397) (#4420) 2025-10-29 21:07:52 -04:00
Tim Sweña (Swast)
2af6c6353c chore: add homepage to leptos cargo metadata (#4417)
This updates the links at Are We Web Yet.
2025-10-29 08:35:13 -04:00
Greg Johnston
7f4b5eb4d1 chore: publish patch versions 2025-10-27 20:05:04 -04:00
WorldSEnder
fbf46ca58c feat: replace vendored wasm-split with out-of-repository version (#4369) 2025-10-24 21:13:55 -04:00
Greg Johnston
0edbd9b3b5 chore: publish patch versions 2025-10-24 13:06:04 -04:00
arpad voros
43359694b6 feat: add bitcode encoding/decoding to server functions (#4376) 2025-10-24 12:42:01 -04:00
dependabot[bot]
9dd5501b1a chore(deps): bump playwright (#4399)
Bumps the npm_and_yarn group with 1 update in the /projects/hexagonal-architecture/end2end directory: [playwright](https://github.com/microsoft/playwright).


Updates `playwright` from 1.44.1 to 1.56.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.44.1...v1.56.1)

---
updated-dependencies:
- dependency-name: playwright
  dependency-version: 1.56.1
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-24 12:41:27 -04:00
dependabot[bot]
6843f654ff chore(deps): bump actions/setup-node from 5 to 6 (#4398)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-24 12:41:11 -04:00
Greg Johnston
cb7c648400 fix: adding missing dry_resolve() call on Suspend (closes #4402) (#4404) 2025-10-23 14:00:29 -04:00
Greg Johnston
d3148ac9c9 leptos_actix-v0.8.6 (#4396)
* leptos_actix-v0.8.6

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-23 12:50:48 -04:00
Greg Johnston
6d7e203efe Merge pull request #4389 from leptos-rs/4385
fix: correctly track ancestors for `AtIndex` (closes #4385)
2025-10-18 10:25:07 -04:00
arpad voros
b5c69937b4 chore: propagate features from leptos to server_fn to avoid need to explicitly add dependency 2025-10-17 13:14:31 -04:00
Greg Johnston
0b45ff5116 Merge remote-tracking branch 'origin' into 4385 2025-10-17 11:42:48 -04:00
Greg Johnston
13dc6f474d chore: add regression test for #4385 2025-10-17 11:42:43 -04:00
Greg Johnston
21218fc802 chore: add regression test for #3523 2025-10-17 11:42:32 -04:00
Greg Johnston
65b5be2748 Merge pull request #4383 from leptos-rs/3957
fix: patching keyed store fields (closes #3957)
2025-10-15 09:45:35 -04:00
Greg Johnston
7c30bb92f7 fix: correctly track ancestors for AtIndex (closes #4385) 2025-10-13 17:31:45 -04:00
autofix-ci[bot]
edf369f035 [autofix.ci] apply automated fixes 2025-10-13 15:40:12 +00:00
Greg Johnston
eb02304ee1 chore: bump reactive_stores minor version number 2025-10-13 11:05:40 -04:00
Greg Johnston
578b672f14 fix: patching keyed store fields (closes #3957) 2025-10-13 10:52:45 -04:00
Greg Johnston
b20902aaa1 fix: use correct/full type names for matched routes to fix islands-router issues (closes #4378) (#4380) 2025-10-11 08:04:21 -04:00
Michael Kadziela
d3ad0c67b6 fix: clean up window router events on unmount (improves subsecond support for router)
Clean up window router events on unmount
2025-10-10 12:03:31 -04:00
Greg Johnston
62d8ec9cc5 feat: effect::immediate::batch (#4344)
* feat: `ImmediateEffect::new_mut_scoped`

* fix: `ImmediateEffect` debug info

* feat: `effect::immediate::batch`
2025-10-10 11:31:57 -04:00
Antoine Büsch
0d2523190d feat: allow anyhow::Error (and similar types) to be converted to throw_error::Error (#4359)
* Allow more types to be converted to throw_error::Error

## Context

At the moment it is quite difficult to get crates like `anyhow` to play
well with leptos, in particular because it is _very_ difficult to
convert an `anyhow::Error` type to a `leptos::Error` type. This is
because the only way to construct a `leptos::Error` currently is via its
`From` implementation, which exists for any type that implements the
standard `Error` trait, but `anyhow::Error` does not implement
`StdError` directly. It can however be converted to a boxed trait object
via its [`.into_boxed_dyn_error()`][4] method, and you would think that `Box<dyn
Error>` implements `Error`, but [that is sadly not the case][1].

## Solution

Change the blanket implementation of `From` for `throw_error::Error`
from "any type that implements the Error trait" to "any type that can be
converted to a boxed Error trait object".

This works because:
- A `Box` [can be converted][2] to an `Arc` for any type (including unsized
  types like trait objects),
- Any type that implements the standard `Error` trait [can be
  converted][3] to a `Box<dyn Error>`, so the new `From` blanket
  implementation covers a strict superset of what was previously
  allowed.

This change now allows types like `anyhow::Error`, but also `String`, to
be easily converted to a leptos `Error`, therefore making them play well
with things like `<ErrorBoundary>`.

[1]: https://stackoverflow.com/questions/65151237/why-doesnt-boxdyn-error-implement-error
[2]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#impl-From%3CBox%3CT,+A%3E%3E-for-Arc%3CT,+A%3E
[3]: https://doc.rust-lang.org/stable/std/error/trait.Error.html#impl-From%3CE%3E-for-Box%3Cdyn+Error%3E
[4]: https://docs.rs/anyhow/latest/anyhow/struct.Error.html#method.into_boxed_dyn_error

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-10 11:29:23 -04:00
mahdi739
338da18ed2 chore: re-export debug_log and debug_error in logging module (#4335)
* chore: re-export `debug_log` and `debug_error` in logging module

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-10 11:26:54 -04:00
Greg Johnston
616aae4c3c fix: allow setting NodeRef by implementing IsDisposed (#4367) 2025-10-10 11:26:07 -04:00
dependabot[bot]
c6e59eeb43 chore(deps): bump the rust-dependencies group with 43 updates (#4368)
Bumps the rust-dependencies group with 43 updates:

| Package | From | To |
| --- | --- | --- |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.16` | `2.0.17` |
| [const_format](https://github.com/rodrimati1992/const_format_crates) | `0.2.34` | `0.2.35` |
| [parking_lot](https://github.com/Amanieu/parking_lot) | `0.12.4` | `0.12.5` |
| [axum](https://github.com/tokio-rs/axum) | `0.8.4` | `0.8.6` |
| [quote](https://github.com/dtolnay/quote) | `1.0.40` | `1.0.41` |
| [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) | `0.27.0` | `0.28.0` |
| [camino](https://github.com/camino-rs/camino) | `1.2.0` | `1.2.1` |
| [rkyv](https://github.com/rkyv/rkyv) | `0.8.11` | `0.8.12` |
| [regex](https://github.com/rust-lang/regex) | `1.11.2` | `1.11.3` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.22.0` | `3.23.0` |
| [attribute-derive](https://github.com/ModProg/attribute-derive) | `0.10.3` | `0.10.5` |
| [actix-http](https://github.com/actix/actix-web) | `3.11.1` | `3.11.2` |
| [attribute-derive-macro](https://github.com/ModProg/attribute-derive) | `0.10.3` | `0.10.5` |
| [axum-core](https://github.com/tokio-rs/axum) | `0.5.2` | `0.5.5` |
| [backtrace](https://github.com/rust-lang/backtrace-rs) | `0.3.75` | `0.3.76` |
| [bytecheck](https://github.com/rkyv/bytecheck) | `0.8.1` | `0.8.2` |
| [bytecheck_derive](https://github.com/rkyv/bytecheck) | `0.8.1` | `0.8.2` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.38` | `1.2.40` |
| [collection_literals](https://github.com/staedoix/collection_literals) | `1.0.2` | `1.0.3` |
| [deranged](https://github.com/jhpratt/deranged) | `0.5.3` | `0.5.4` |
| [find-msvc-tools](https://github.com/rust-lang/cc-rs) | `0.1.2` | `0.1.3` |
| [flate2](https://github.com/rust-lang/flate2-rs) | `1.1.2` | `1.1.4` |
| [gimli](https://github.com/gimli-rs/gimli) | `0.31.1` | `0.32.3` |
| [libc](https://github.com/rust-lang/libc) | `0.2.175` | `0.2.176` |
| [lock_api](https://github.com/Amanieu/parking_lot) | `0.4.13` | `0.4.14` |
| [memchr](https://github.com/BurntSushi/memchr) | `2.7.5` | `2.7.6` |
| [miniserde](https://github.com/dtolnay/miniserde) | `0.1.42` | `0.1.43` |
| [munge](https://github.com/djkoloski/munge) | `0.4.6` | `0.4.7` |
| [munge_macro](https://github.com/djkoloski/munge) | `0.4.6` | `0.4.7` |
| [object](https://github.com/gimli-rs/object) | `0.36.7` | `0.37.3` |
| [parking_lot_core](https://github.com/Amanieu/parking_lot) | `0.9.11` | `0.9.12` |
| [ptr_meta](https://github.com/rkyv/ptr_meta) | `0.3.0` | `0.3.1` |
| [ptr_meta_derive](https://github.com/rkyv/ptr_meta) | `0.3.0` | `0.3.1` |
| [rancor](https://github.com/rkyv/rancor) | `0.1.0` | `0.1.1` |
| redox_syscall | `0.5.17` | `0.5.18` |
| [regex-automata](https://github.com/rust-lang/regex) | `0.4.10` | `0.4.11` |
| [rend](https://github.com/djkoloski/rend) | `0.5.2` | `0.5.3` |
| [rkyv_derive](https://github.com/rkyv/rkyv) | `0.8.11` | `0.8.12` |
| [rustls-webpki](https://github.com/rustls/webpki) | `0.103.6` | `0.103.7` |
| [tokio-rustls](https://github.com/rustls/tokio-rustls) | `0.26.3` | `0.26.4` |
| [tungstenite](https://github.com/snapview/tungstenite-rs) | `0.26.2` | `0.27.0` |
| [typenum](https://github.com/paholg/typenum) | `1.18.0` | `1.19.0` |
| [zeroize](https://github.com/RustCrypto/utils) | `1.8.1` | `1.8.2` |


Updates `thiserror` from 2.0.16 to 2.0.17
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.16...2.0.17)

Updates `const_format` from 0.2.34 to 0.2.35
- [Release notes](https://github.com/rodrimati1992/const_format_crates/releases)
- [Changelog](https://github.com/rodrimati1992/const_format_crates/blob/master/Changelog.md)
- [Commits](https://github.com/rodrimati1992/const_format_crates/commits)

Updates `parking_lot` from 0.12.4 to 0.12.5
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/parking_lot-v0.12.4...parking_lot-v0.12.5)

Updates `axum` from 0.8.4 to 0.8.6
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/axum/compare/axum-v0.8.4...axum-v0.8.6)

Updates `quote` from 1.0.40 to 1.0.41
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.40...1.0.41)

Updates `tokio-tungstenite` from 0.27.0 to 0.28.0
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.27.0...v0.28.0)

Updates `camino` from 1.2.0 to 1.2.1
- [Release notes](https://github.com/camino-rs/camino/releases)
- [Changelog](https://github.com/camino-rs/camino/blob/main/CHANGELOG.md)
- [Commits](https://github.com/camino-rs/camino/compare/camino-1.2.0...camino-1.2.1)

Updates `rkyv` from 0.8.11 to 0.8.12
- [Release notes](https://github.com/rkyv/rkyv/releases)
- [Commits](https://github.com/rkyv/rkyv/commits)

Updates `regex` from 1.11.2 to 1.11.3
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.2...1.11.3)

Updates `tempfile` from 3.22.0 to 3.23.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.22.0...v3.23.0)

Updates `attribute-derive` from 0.10.3 to 0.10.5
- [Release notes](https://github.com/ModProg/attribute-derive/releases)
- [Changelog](https://github.com/ModProg/attribute-derive/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ModProg/attribute-derive/compare/v0.10.3...v0.10.5)

Updates `actix-http` from 3.11.1 to 3.11.2
- [Release notes](https://github.com/actix/actix-web/releases)
- [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md)
- [Commits](https://github.com/actix/actix-web/compare/http-v3.11.1...http-v3.11.2)

Updates `attribute-derive-macro` from 0.10.3 to 0.10.5
- [Release notes](https://github.com/ModProg/attribute-derive/releases)
- [Changelog](https://github.com/ModProg/attribute-derive/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ModProg/attribute-derive/compare/v0.10.3...v0.10.5)

Updates `axum-core` from 0.5.2 to 0.5.5
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/axum/compare/axum-core-v0.5.2...axum-core-v0.5.5)

Updates `backtrace` from 0.3.75 to 0.3.76
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Changelog](https://github.com/rust-lang/backtrace-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.75...backtrace-v0.3.76)

Updates `bytecheck` from 0.8.1 to 0.8.2
- [Release notes](https://github.com/rkyv/bytecheck/releases)
- [Commits](https://github.com/rkyv/bytecheck/commits)

Updates `bytecheck_derive` from 0.8.1 to 0.8.2
- [Release notes](https://github.com/rkyv/bytecheck/releases)
- [Commits](https://github.com/rkyv/bytecheck/commits)

Updates `cc` from 1.2.38 to 1.2.40
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.38...cc-v1.2.40)

Updates `collection_literals` from 1.0.2 to 1.0.3
- [Commits](https://github.com/staedoix/collection_literals/commits)

Updates `deranged` from 0.5.3 to 0.5.4
- [Commits](https://github.com/jhpratt/deranged/commits)

Updates `find-msvc-tools` from 0.1.2 to 0.1.3
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/find-msvc-tools-v0.1.2...find-msvc-tools-v0.1.3)

Updates `flate2` from 1.1.2 to 1.1.4
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.1.2...1.1.4)

Updates `gimli` from 0.31.1 to 0.32.3
- [Changelog](https://github.com/gimli-rs/gimli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/gimli/compare/0.31.1...0.32.3)

Updates `libc` from 0.2.175 to 0.2.176
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.176/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.175...0.2.176)

Updates `lock_api` from 0.4.13 to 0.4.14
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/lock_api-v0.4.13...lock_api-v0.4.14)

Updates `memchr` from 2.7.5 to 2.7.6
- [Commits](https://github.com/BurntSushi/memchr/compare/2.7.5...2.7.6)

Updates `miniserde` from 0.1.42 to 0.1.43
- [Release notes](https://github.com/dtolnay/miniserde/releases)
- [Commits](https://github.com/dtolnay/miniserde/compare/0.1.42...0.1.43)

Updates `munge` from 0.4.6 to 0.4.7
- [Release notes](https://github.com/djkoloski/munge/releases)
- [Commits](https://github.com/djkoloski/munge/commits)

Updates `munge_macro` from 0.4.6 to 0.4.7
- [Release notes](https://github.com/djkoloski/munge/releases)
- [Commits](https://github.com/djkoloski/munge/commits)

Updates `object` from 0.36.7 to 0.37.3
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.7...0.37.3)

Updates `parking_lot_core` from 0.9.11 to 0.9.12
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/parking_lot_core-v0.9.11...parking_lot_core-v0.9.12)

Updates `ptr_meta` from 0.3.0 to 0.3.1
- [Release notes](https://github.com/rkyv/ptr_meta/releases)
- [Changelog](https://github.com/rkyv/ptr_meta/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rkyv/ptr_meta/commits)

Updates `ptr_meta_derive` from 0.3.0 to 0.3.1
- [Release notes](https://github.com/rkyv/ptr_meta/releases)
- [Changelog](https://github.com/rkyv/ptr_meta/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rkyv/ptr_meta/commits)

Updates `rancor` from 0.1.0 to 0.1.1
- [Release notes](https://github.com/rkyv/rancor/releases)
- [Commits](https://github.com/rkyv/rancor/commits)

Updates `redox_syscall` from 0.5.17 to 0.5.18

Updates `regex-automata` from 0.4.10 to 0.4.11
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

Updates `rend` from 0.5.2 to 0.5.3
- [Release notes](https://github.com/djkoloski/rend/releases)
- [Commits](https://github.com/djkoloski/rend/commits)

Updates `rkyv_derive` from 0.8.11 to 0.8.12
- [Release notes](https://github.com/rkyv/rkyv/releases)
- [Commits](https://github.com/rkyv/rkyv/commits)

Updates `rustls-webpki` from 0.103.6 to 0.103.7
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](https://github.com/rustls/webpki/compare/v/0.103.6...v/0.103.7)

Updates `tokio-rustls` from 0.26.3 to 0.26.4
- [Release notes](https://github.com/rustls/tokio-rustls/releases)
- [Commits](https://github.com/rustls/tokio-rustls/compare/v/0.26.3...v/0.26.4)

Updates `tungstenite` from 0.26.2 to 0.27.0
- [Changelog](https://github.com/snapview/tungstenite-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tungstenite-rs/compare/v0.26.2...v0.27.0)

Updates `typenum` from 1.18.0 to 1.19.0
- [Release notes](https://github.com/paholg/typenum/releases)
- [Changelog](https://github.com/paholg/typenum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paholg/typenum/compare/v1.18.0...v1.19.0)

Updates `zeroize` from 1.8.1 to 1.8.2
- [Commits](https://github.com/RustCrypto/utils/compare/zeroize-v1.8.1...zeroize-v1.8.2)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: const_format
  dependency-version: 0.2.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: parking_lot
  dependency-version: 0.12.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: axum
  dependency-version: 0.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: quote
  dependency-version: 1.0.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio-tungstenite
  dependency-version: 0.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: camino
  dependency-version: 1.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rkyv
  dependency-version: 0.8.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex
  dependency-version: 1.11.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tempfile
  dependency-version: 3.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: attribute-derive
  dependency-version: 0.10.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: actix-http
  dependency-version: 3.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: attribute-derive-macro
  dependency-version: 0.10.5
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: axum-core
  dependency-version: 0.5.5
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: backtrace
  dependency-version: 0.3.76
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: bytecheck
  dependency-version: 0.8.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: bytecheck_derive
  dependency-version: 0.8.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-version: 1.2.40
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: collection_literals
  dependency-version: 1.0.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: deranged
  dependency-version: 0.5.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: find-msvc-tools
  dependency-version: 0.1.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: flate2
  dependency-version: 1.1.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: gimli
  dependency-version: 0.32.3
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: libc
  dependency-version: 0.2.176
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: lock_api
  dependency-version: 0.4.14
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: memchr
  dependency-version: 2.7.6
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: miniserde
  dependency-version: 0.1.43
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge
  dependency-version: 0.4.7
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge_macro
  dependency-version: 0.4.7
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: object
  dependency-version: 0.37.3
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: parking_lot_core
  dependency-version: 0.9.12
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: ptr_meta
  dependency-version: 0.3.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: ptr_meta_derive
  dependency-version: 0.3.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rancor
  dependency-version: 0.1.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: redox_syscall
  dependency-version: 0.5.18
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex-automata
  dependency-version: 0.4.11
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rend
  dependency-version: 0.5.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rkyv_derive
  dependency-version: 0.8.12
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustls-webpki
  dependency-version: 0.103.7
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio-rustls
  dependency-version: 0.26.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tungstenite
  dependency-version: 0.27.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: typenum
  dependency-version: 1.19.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: zeroize
  dependency-version: 1.8.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-10 11:25:54 -04:00
Adam Doyle
c025ae59ac chore: add scrollend event to view macro (#4379) 2025-10-10 09:56:23 -04:00
Brett Etter
df46feee5d fixed: removed excess bound on MaybeProp ReadUntracked implementation. (#4360) 2025-10-04 09:07:04 -04:00
Greg Johnston
bbf5bf9170 chore: publish patch releases 2025-09-29 15:21:22 -04:00
QuartzLibrary
7a3556bf34 feat: effect::immediate::batch 2025-09-27 22:59:05 +01:00
QuartzLibrary
d13936cab5 fix: ImmediateEffect debug info 2025-09-27 22:57:18 +01:00
QuartzLibrary
b303a35d76 feat: ImmediateEffect::new_mut_scoped 2025-09-27 22:57:18 +01:00
Greg Johnston
a453b7d1bd fix: correctly poll all out-of-order streaming chunks (closes #4326) (#4333)
* fix: correctly poll all out-of-order streaming chunks (closes #4326)

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-26 07:45:41 -04:00
Greg Johnston
3b9ccdf57e Merge pull request #4334 from leptos-rs/4324
Correctly manage path stack during back navigation
2025-09-26 07:45:25 -04:00
Greg Johnston
27cd423ebc fix: correctly update path stack when navigating backwards (closes #4324) 2025-09-24 19:39:31 -04:00
Greg Johnston
b3907baf49 test: add regression test for #4324 2025-09-24 19:23:20 -04:00
Greg Johnston
9a8bb7eb75 test: add regression test for #4251 2025-09-24 19:23:13 -04:00
Greg Johnston
95db8c939e chore: add missing attributes (#4308)
* chore: add missing `dirname` attribute to `input` element

* chore: add missing `exportparts` global attribute
2025-09-24 17:05:38 -04:00
zakstucke
2bfa9952af feat: allow accessing a parent owner from a child (#4325) 2025-09-24 17:04:26 -04:00
Greg Johnston
4e445f43d6 fix: correctly import scoped slots (closes #4311) (#4318) 2025-09-24 17:01:25 -04:00
dependabot[bot]
5f544f67ae chore(deps): bump the rust-dependencies group across 1 directory with 11 updates (#4319)
Bumps the rust-dependencies group with 3 updates in the / directory: [anyhow](https://github.com/dtolnay/anyhow), [subsecond](https://github.com/dioxuslabs/dioxus) and [libloading](https://github.com/nagisa/rust_libloading).


Updates `anyhow` from 1.0.99 to 1.0.100
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.99...1.0.100)

Updates `subsecond` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/dioxuslabs/dioxus/releases)
- [Commits](eef4db67b1...2e7e0696a3)

Updates `dioxus-cli-config` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/dioxuslabs/dioxus/releases)
- [Commits](eef4db67b1...2e7e0696a3)

Updates `dioxus-devtools` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/dioxuslabs/dioxus/releases)
- [Commits](eef4db67b1...2e7e0696a3)

Updates `dioxus-core` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

Updates `dioxus-core-types` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

Updates `dioxus-devtools-types` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

Updates `dioxus-signals` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

Updates `generational-box` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

Updates `libloading` from 0.8.8 to 0.8.9
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.8...0.8.9)

Updates `subsecond-types` from `eef4db6` to `2e7e069`
- [Release notes](https://github.com/DioxusLabs/dioxus/releases)
- [Commits](https://github.com/DioxusLabs/dioxus/commits)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.100
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: subsecond
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: direct:production
  dependency-group: rust-dependencies
- dependency-name: dioxus-cli-config
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: direct:production
  dependency-group: rust-dependencies
- dependency-name: dioxus-devtools
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: direct:production
  dependency-group: rust-dependencies
- dependency-name: dioxus-core
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
- dependency-name: dioxus-core-types
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
- dependency-name: dioxus-devtools-types
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
- dependency-name: dioxus-signals
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
- dependency-name: generational-box
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
- dependency-name: libloading
  dependency-version: 0.8.9
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: subsecond-types
  dependency-version: 2e7e0696a320a2a98a07e405603f59c8296b0b42
  dependency-type: indirect
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-24 17:01:08 -04:00
Greg Johnston
68477d2b76 fix: preload correct __wasm_split.*.js file (closes #4322) (#4327) 2025-09-24 17:00:55 -04:00
Greg Johnston
5bd9469b93 fix: remove event listeners correctly when dropping handles (closes #4313) (#4314) 2025-09-23 10:59:04 -04:00
Greg Johnston
4bca70dc2f chore: specify Tailwind version in Trunk.toml (closes #4315) (#4317) 2025-09-21 14:38:13 -04:00
dependabot[bot]
d0295009cf chore(deps): bump tj-actions/changed-files from 46 to 47 (#4297)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 46 to 47.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v46...v47)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-version: '47'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-20 11:40:53 -04:00
dependabot[bot]
3e8b5c9805 chore(deps): bump actions/setup-node from 4 to 5 (#4283)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-20 11:40:41 -04:00
Greg Johnston
924efa8ac1 feat: minimal support for subsecond and an example (#4307) 2025-09-20 11:40:28 -04:00
Adam Doyle
b92a14228c chore: add missing exportparts global attribute 2025-09-20 08:40:17 -04:00
Adam Doyle
68967fdad3 chore: add missing dirname attribute to input element 2025-09-19 16:00:05 -04:00
Ægir Örn Símonarson
44bc4fbc31 Locking dependencies in cargo-leptos install example (#4295)
This limits dependencies errors on install
2025-09-19 11:35:51 -04:00
Greg Johnston
646cfc12ed leptos v0.8.9 2025-09-18 15:49:46 -04:00
Greg Johnston
62977a68b0 fix: support const generic static strs on nightly versions with conflicting feature names (closes #4300) (#4301) 2025-09-18 09:09:36 -04:00
Adam Doyle
e9ee90c78f chore: add referrerpolicy attribute to a element (#4299) 2025-09-18 09:05:27 -04:00
Greg Johnston
73e728f145 Merge pull request #4294 from leptos-rs/4285
fix: prevent double-rebuild and correctly navigate multiple times to same lazy route (closes #4285)
2025-09-17 10:05:49 -04:00
Greg Johnston
6f047a2271 test: add regression test for #4296 2025-09-16 16:22:42 -04:00
Greg Johnston
7c942b8b47 chore: correct name for test 2025-09-16 16:07:00 -04:00
Greg Johnston
d4bf6d9cb6 test: add regression test for #4285 2025-09-15 21:05:12 -04:00
Greg Johnston
9deb96ea01 fix: provide correct URL/query/params to preloaders (closes #4296) 2025-09-15 19:46:52 -04:00
Greg Johnston
d1899cde1c during SSR, don't dispose of preload owners until whole request is done 2025-09-15 18:54:11 -04:00
Greg Johnston
ee731d7a3a fix: create individual owners for each preload 2025-09-12 18:51:46 -04:00
Greg Johnston
59cbcfa0fb fix: prevent infinite rebuild loop 2025-09-12 18:00:13 -04:00
Greg Johnston
0939cf63ad Revert "fix: prevent double-rebuild and correctly navigate multiple times to same lazy route (closes #4285)"
This reverts commit d37512bebd.
2025-09-12 17:59:14 -04:00
Greg Johnston
d37512bebd fix: prevent double-rebuild and correctly navigate multiple times to same lazy route (closes #4285) 2025-09-12 17:20:52 -04:00
Greg Johnston
7dd44919cf docs: document some missing features (#4281) 2025-09-10 09:53:35 -07:00
Raffaele Fontana
3eaabf85ea docs: fix broken link in suspense (#4276) 2025-09-03 08:34:08 -04:00
Greg Johnston
d60c632c90 fix: correctly propagate visibility on lazy functions (closes #4256) (#4259) 2025-09-03 08:33:38 -04:00
Greg Johnston
f5ad4f4b88 fix: clear old attributes when replacing a Vec<AnyAttribute> (closes #4268) (#4270) 2025-09-01 07:41:54 -04:00
zakstucke
f3a053f99b feat: standardize ScopedFuture::new_untracked like untrack() and untrack_with_diagnostics() (#4269) 2025-08-31 12:30:16 -04:00
Greg Johnston
06573cbca1 Merge pull request #4272 from leptos-rs/4271
fix: revert changes to raw text parsing (closes #4271)
2025-08-30 11:25:13 -04:00
autofix-ci[bot]
9f4d826533 [autofix.ci] apply automated fixes 2025-08-30 11:25:00 +00:00
Greg Johnston
a305ae7227 chore: update leptos_macro version 2025-08-30 06:53:42 -04:00
Greg Johnston
65557c5723 leptos_macro-v0.8.8 2025-08-30 06:47:57 -04:00
Greg Johnston
a529f87ee2 Revert "fix: correctly parse unquoted text with punctuation in stable (closes #4137) (#4238)"
This reverts commit 99c3d8f9e9.
2025-08-30 06:46:36 -04:00
zakstucke
c0ca97e42f feat: impl From<RwSignal/ReadSignal/Memo> for ArcSignal (#4258) 2025-08-29 16:09:41 -04:00
dependabot[bot]
9a4e93ab07 chore(deps): bump the rust-dependencies group across 1 directory with 33 updates (#4262)
Bumps the rust-dependencies group with 32 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [serde_json](https://github.com/serde-rs/json) | `1.0.142` | `1.0.143` |
| [typed-builder](https://github.com/idanarye/rust-typed-builder) | `0.21.0` | `0.21.2` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.12` | `2.0.16` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.10.0` | `2.11.0` |
| [cfg-if](https://github.com/rust-lang/cfg-if) | `1.0.1` | `1.0.3` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.96` | `1.0.101` |
| [syn](https://github.com/dtolnay/syn) | `2.0.104` | `2.0.106` |
| [async-trait](https://github.com/dtolnay/async-trait) | `0.1.88` | `0.1.89` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.98` | `1.0.99` |
| [prettyplease](https://github.com/dtolnay/prettyplease) | `0.2.36` | `0.2.37` |
| [inventory](https://github.com/dtolnay/inventory) | `0.3.20` | `0.3.21` |
| [config](https://github.com/rust-cli/config-rs) | `0.15.13` | `0.15.14` |
| [regex](https://github.com/rust-lang/regex) | `1.11.1` | `1.11.2` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.20.0` | `3.21.0` |
| [percent-encoding](https://github.com/servo/rust-url) | `2.3.1` | `2.3.2` |
| [hyper](https://github.com/hyperium/hyper) | `1.6.0` | `1.7.0` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.22` | `0.12.23` |
| [actix-http](https://github.com/actix/actix-web) | `3.11.0` | `3.11.1` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.9.1` | `2.9.3` |
| [brotli](https://github.com/dropbox/rust-brotli) | `8.0.1` | `8.0.2` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.32` | `1.2.34` |
| [form_urlencoded](https://github.com/servo/rust-url) | `1.2.1` | `1.2.2` |
| [idna](https://github.com/servo/rust-url) | `1.0.3` | `1.1.0` |
| [io-uring](https://github.com/tokio-rs/io-uring) | `0.7.9` | `0.7.10` |
| [jobserver](https://github.com/rust-lang/jobserver-rs) | `0.1.33` | `0.1.34` |
| [regex-automata](https://github.com/rust-lang/regex) | `0.4.9` | `0.4.10` |
| [regex-lite](https://github.com/rust-lang/regex) | `0.1.6` | `0.1.7` |
| [regex-syntax](https://github.com/rust-lang/regex) | `0.8.5` | `0.8.6` |
| [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) | `2.3.4` | `2.4.0` |
| [tinyvec](https://github.com/Lokathor/tinyvec) | `1.9.0` | `1.10.0` |
| [winapi-util](https://github.com/BurntSushi/winapi-util) | `0.1.9` | `0.1.10` |
| [winnow](https://github.com/winnow-rs/winnow) | `0.7.12` | `0.7.13` |



Updates `serde_json` from 1.0.142 to 1.0.143
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.142...v1.0.143)

Updates `typed-builder` from 0.21.0 to 0.21.2
- [Release notes](https://github.com/idanarye/rust-typed-builder/releases)
- [Changelog](https://github.com/idanarye/rust-typed-builder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/idanarye/rust-typed-builder/compare/v0.21.0...v0.21.2)

Updates `thiserror` from 2.0.12 to 2.0.16
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.12...2.0.16)

Updates `indexmap` from 2.10.0 to 2.11.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.10.0...2.11.0)

Updates `cfg-if` from 1.0.1 to 1.0.3
- [Release notes](https://github.com/rust-lang/cfg-if/releases)
- [Changelog](https://github.com/rust-lang/cfg-if/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cfg-if/compare/v1.0.1...v1.0.3)

Updates `proc-macro2` from 1.0.96 to 1.0.101
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.96...1.0.101)

Updates `syn` from 2.0.104 to 2.0.106
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.104...2.0.106)

Updates `async-trait` from 0.1.88 to 0.1.89
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.88...0.1.89)

Updates `typed-builder-macro` from 0.21.0 to 0.21.2
- [Release notes](https://github.com/idanarye/rust-typed-builder/releases)
- [Changelog](https://github.com/idanarye/rust-typed-builder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/idanarye/rust-typed-builder/compare/v0.21.0...v0.21.2)

Updates `anyhow` from 1.0.98 to 1.0.99
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.98...1.0.99)

Updates `prettyplease` from 0.2.36 to 0.2.37
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.36...0.2.37)

Updates `inventory` from 0.3.20 to 0.3.21
- [Release notes](https://github.com/dtolnay/inventory/releases)
- [Commits](https://github.com/dtolnay/inventory/compare/0.3.20...0.3.21)

Updates `config` from 0.15.13 to 0.15.14
- [Changelog](https://github.com/rust-cli/config-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/config-rs/compare/v0.15.13...v0.15.14)

Updates `regex` from 1.11.1 to 1.11.2
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.11.2)

Updates `tempfile` from 3.20.0 to 3.21.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

Updates `percent-encoding` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/commits)

Updates `hyper` from 1.6.0 to 1.7.0
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v1.6.0...v1.7.0)

Updates `reqwest` from 0.12.22 to 0.12.23
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.22...v0.12.23)

Updates `actix-http` from 3.11.0 to 3.11.1
- [Release notes](https://github.com/actix/actix-web/releases)
- [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md)
- [Commits](https://github.com/actix/actix-web/compare/http-v3.11.0...http-v3.11.1)

Updates `bitflags` from 2.9.1 to 2.9.3
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.9.1...2.9.3)

Updates `brotli` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/dropbox/rust-brotli/releases)
- [Commits](https://github.com/dropbox/rust-brotli/commits/8.0.2)

Updates `cc` from 1.2.32 to 1.2.34
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.32...cc-v1.2.34)

Updates `form_urlencoded` from 1.2.1 to 1.2.2
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v1.2.1...v1.2.2)

Updates `idna` from 1.0.3 to 1.1.0
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/commits)

Updates `io-uring` from 0.7.9 to 0.7.10
- [Commits](https://github.com/tokio-rs/io-uring/commits)

Updates `jobserver` from 0.1.33 to 0.1.34
- [Commits](https://github.com/rust-lang/jobserver-rs/compare/0.1.33...0.1.34)

Updates `regex-automata` from 0.4.9 to 0.4.10
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-automata-0.4.9...regex-automata-0.4.10)

Updates `regex-lite` from 0.1.6 to 0.1.7
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-lite-0.1.6...regex-lite-0.1.7)

Updates `regex-syntax` from 0.8.5 to 0.8.6
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.5...regex-syntax-0.8.6)

Updates `scc` from 2.3.4 to 2.4.0
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

Updates `tinyvec` from 1.9.0 to 1.10.0
- [Changelog](https://github.com/Lokathor/tinyvec/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Lokathor/tinyvec/compare/v1.9.0...v1.10.0)

Updates `winapi-util` from 0.1.9 to 0.1.10
- [Commits](https://github.com/BurntSushi/winapi-util/compare/0.1.9...0.1.10)

Updates `winnow` from 0.7.12 to 0.7.13
- [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md)
- [Commits](https://github.com/winnow-rs/winnow/compare/v0.7.12...v0.7.13)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.143
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: typed-builder
  dependency-version: 0.21.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: thiserror
  dependency-version: 2.0.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: indexmap
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: cfg-if
  dependency-version: 1.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: proc-macro2
  dependency-version: 1.0.101
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: syn
  dependency-version: 2.0.106
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: async-trait
  dependency-version: 0.1.89
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: typed-builder-macro
  dependency-version: 0.21.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: anyhow
  dependency-version: 1.0.99
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: prettyplease
  dependency-version: 0.2.37
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: inventory
  dependency-version: 0.3.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: config
  dependency-version: 0.15.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tempfile
  dependency-version: 3.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: percent-encoding
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: hyper
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: reqwest
  dependency-version: 0.12.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: actix-http
  dependency-version: 3.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: bitflags
  dependency-version: 2.9.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: brotli
  dependency-version: 8.0.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-version: 1.2.34
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: form_urlencoded
  dependency-version: 1.2.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: idna
  dependency-version: 1.1.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: io-uring
  dependency-version: 0.7.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: jobserver
  dependency-version: 0.1.34
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex-automata
  dependency-version: 0.4.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex-lite
  dependency-version: 0.1.7
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: regex-syntax
  dependency-version: 0.8.6
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: scc
  dependency-version: 2.4.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: tinyvec
  dependency-version: 1.10.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: winapi-util
  dependency-version: 0.1.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: winnow
  dependency-version: 0.7.13
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-29 16:08:39 -04:00
zakstucke
bee2b5ea1c feat: impl From<View<C>> for ViewFn where View<C>: Clone (#4266) 2025-08-29 16:02:00 -04:00
Spencer Ferris
3b058e77f1 fix: set Content-Type header for server function errors (closes #4209) (#4215) 2025-08-29 08:56:26 -04:00
zakstucke
7adb11ec49 Preserve owner in Actions and event listeners (#4267)
* Preserve Owner for Action's, allowing context retrieval

* Preserve owner for event listeners, allowing context retrieval

* CI

* Refactor

---------

Co-authored-by: Zak Stucke <zakstucke@hotmail.c.uk>
2025-08-29 11:50:33 +12:00
Greg Johnston
1af5f66ee6 fix: when navigating, only add new URL to history stack if it's different from current URL (closes #4251) (#4252) 2025-08-26 21:08:00 -04:00
Gabriel Lopes Veiga
956f1836ec fix: use wss for live reload if on https (#4257) 2025-08-26 21:07:28 -04:00
Greg Johnston
b54f80f529 chore: publish new patch releases for changed packages 2025-08-26 17:13:21 -04:00
Greg Johnston
a48a2994ee Merge pull request #4255 from leptos-rs/4254
Revert recent broken changes
2025-08-26 17:09:01 -04:00
Greg Johnston
aedcd5148c Revert "feat: add default "auto" live reload protocol option (#4224)"
This reverts commit a97eceacf1.
2025-08-26 13:25:49 -04:00
Greg Johnston
9160d8aaa6 Revert "made <Show> accept signals in addition to closures (#4236)"
This reverts commit db9f323f8d.
2025-08-26 13:24:44 -04:00
Greg Johnston
274fe07dae Merge remote-tracking branch 'origin' 2025-08-26 13:23:17 -04:00
Greg Johnston
7add26fc41 docs: correctly document additional serialization features for leptos_server (#4250) 2025-08-25 20:46:40 -04:00
Greg Johnston
d9213850f7 chore: publish new patch releases for changed packages 2025-08-25 20:40:32 -04:00
Marc-Stefan Cassola
db9f323f8d made <Show> accept signals in addition to closures (#4236) 2025-08-25 14:50:20 -07:00
Greg Johnston
1d0f668dc3 Merge pull request #4235 from leptos-rs/4217
Special-case `value` property to support quirky `<select>` behavior
2025-08-25 09:05:29 -04:00
Gabriel Lopes Veiga
a97eceacf1 feat: add default "auto" live reload protocol option (#4224)
* feat: add default "auto" live reload protocol option

* fix: make "auto" live reload protocol option last
2025-08-23 17:29:22 -07:00
Greg Johnston
3d6ea6d285 Merge pull request #4242 from leptos-rs/4239
Fixes for two server function issues
2025-08-22 21:00:54 -04:00
Greg Johnston
99c3d8f9e9 fix: correctly parse unquoted text with punctuation in stable (closes #4137) (#4238) 2025-08-22 21:00:39 -04:00
Greg Johnston
a394eb211f fix: transposed Accept/Content-Type headers in server function requests (closes #4240) 2025-08-22 16:32:42 -04:00
Greg Johnston
ceb7dd8ae5 fix: parse body rather than query string for PatchUrl and PutUrl (closes #4239) 2025-08-22 16:20:21 -04:00
Greg Johnston
f50adc00bc chore: rename changed method to avoid breaking user code that called set_property 2025-08-21 19:47:02 -04:00
Greg Johnston
1340deee96 chore: typo in name of feature test 2025-08-21 19:20:41 -04:00
Greg Johnston
8da3011a7f fix: special-case value prop so that it waits for children, if any, before being set (closes #4217) 2025-08-20 22:07:32 -04:00
Greg Johnston
959677f018 chore: move queue_microtask implementation into tachys 2025-08-20 22:06:38 -04:00
Greg Johnston
03529b3992 chore: add regression test for #4005 2025-08-20 21:19:35 -04:00
Greg Johnston
8bfd0ce143 chore: add regression test for #4217 2025-08-20 21:11:16 -04:00
Marc-Stefan Cassola
47199bbbf3 <ShowLet> component similar to <Show> but for Option (#4227)
* added the <Map> component

* chore: rustfmt

* removed support for `Result` from `<Map>` and added possibility to use
both closures and signals in the `value` prop.
2025-08-20 11:24:31 -07:00
Greg Johnston
9ed7e9de61 chore: remove lockfiles accidentally included in repo (#4234) 2025-08-20 10:34:42 -04:00
yescallop
26ecbf4df5 fix: allow non_snake_case and dead_code lints to run within component functions (#3198)
* fix: allow `non_snake_case` and `dead_code` lints to run within component functions

* Fixed component type name

* Update lib.rs

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Rakshith Ravi <rakshith.ravi@gmx.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-17 10:45:33 -07:00
dependabot[bot]
b3885c7be4 chore(deps): bump actions/checkout from 4 to 5 (#4221)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-14 11:39:37 -07:00
dependabot[bot]
436e5aa141 chore(deps): bump the rust-dependencies group with 32 updates (#4222)
Bumps the rust-dependencies group with 32 updates:

| Package | From | To |
| --- | --- | --- |
| [serde_json](https://github.com/serde-rs/json) | `1.0.141` | `1.0.142` |
| [trybuild](https://github.com/dtolnay/trybuild) | `1.0.106` | `1.0.110` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.46.1` | `1.47.1` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.95` | `1.0.96` |
| [prettyplease](https://github.com/dtolnay/prettyplease) | `0.2.35` | `0.2.36` |
| [camino](https://github.com/camino-rs/camino) | `1.1.10` | `1.1.11` |
| [rkyv](https://github.com/rkyv/rkyv) | `0.8.10` | `0.8.11` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.17.0` | `1.18.0` |
| [futures-lite](https://github.com/smol-rs/futures-lite) | `2.6.0` | `2.6.1` |
| [const-str](https://github.com/Nugine/const-str) | `0.6.3` | `0.6.4` |
| [postcard](https://github.com/jamesmunns/postcard) | `1.1.2` | `1.1.3` |
| [rustversion](https://github.com/dtolnay/rustversion) | `1.0.21` | `1.0.22` |
| [async-lock](https://github.com/smol-rs/async-lock) | `3.4.0` | `3.4.1` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.30` | `1.2.32` |
| [cfg-expr](https://github.com/EmbarkStudios/cfg-expr) | `0.20.1` | `0.20.2` |
| [derive-where](https://github.com/ModProg/derive-where) | `1.5.0` | `1.6.0` |
| [event-listener](https://github.com/smol-rs/event-listener) | `5.4.0` | `5.4.1` |
| [glob](https://github.com/rust-lang/glob) | `0.3.2` | `0.3.3` |
| [hyper-util](https://github.com/hyperium/hyper-util) | `0.1.15` | `0.1.16` |
| [io-uring](https://github.com/tokio-rs/io-uring) | `0.7.8` | `0.7.9` |
| [libc](https://github.com/rust-lang/libc) | `0.2.174` | `0.2.175` |
| [munge](https://github.com/djkoloski/munge) | `0.4.5` | `0.4.6` |
| [munge_macro](https://github.com/djkoloski/munge) | `0.4.5` | `0.4.6` |
| redox_syscall | `0.5.15` | `0.5.17` |
| [rkyv_derive](https://github.com/rkyv/rkyv) | `0.8.10` | `0.8.11` |
| [rustc-demangle](https://github.com/rust-lang/rustc-demangle) | `0.1.25` | `0.1.26` |
| [rustls](https://github.com/rustls/rustls) | `0.23.29` | `0.23.31` |
| [signal-hook-registry](https://github.com/vorner/signal-hook) | `1.4.5` | `1.4.6` |
| [slab](https://github.com/tokio-rs/slab) | `0.4.10` | `0.4.11` |
| [tokio-util](https://github.com/tokio-rs/tokio) | `0.7.15` | `0.7.16` |
| [toml_parser](https://github.com/toml-rs/toml) | `1.0.1` | `1.0.2` |
| [zerovec](https://github.com/unicode-org/icu4x) | `0.11.2` | `0.11.4` |


Updates `serde_json` from 1.0.141 to 1.0.142
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.141...v1.0.142)

Updates `trybuild` from 1.0.106 to 1.0.110
- [Release notes](https://github.com/dtolnay/trybuild/releases)
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.106...1.0.110)

Updates `tokio` from 1.46.1 to 1.47.1
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.46.1...tokio-1.47.1)

Updates `proc-macro2` from 1.0.95 to 1.0.96
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.95...1.0.96)

Updates `prettyplease` from 0.2.35 to 0.2.36
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.35...0.2.36)

Updates `camino` from 1.1.10 to 1.1.11
- [Release notes](https://github.com/camino-rs/camino/releases)
- [Changelog](https://github.com/camino-rs/camino/blob/main/CHANGELOG.md)
- [Commits](https://github.com/camino-rs/camino/compare/camino-1.1.10...camino-1.1.11)

Updates `rkyv` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/rkyv/rkyv/releases)
- [Commits](https://github.com/rkyv/rkyv/commits)

Updates `uuid` from 1.17.0 to 1.18.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.17.0...v1.18.0)

Updates `futures-lite` from 2.6.0 to 2.6.1
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.6.0...v2.6.1)

Updates `const-str` from 0.6.3 to 0.6.4
- [Release notes](https://github.com/Nugine/const-str/releases)
- [Commits](https://github.com/Nugine/const-str/compare/v0.6.3...v0.6.4)

Updates `postcard` from 1.1.2 to 1.1.3
- [Release notes](https://github.com/jamesmunns/postcard/releases)
- [Commits](https://github.com/jamesmunns/postcard/compare/postcard/v1.1.2...postcard/v1.1.3)

Updates `rustversion` from 1.0.21 to 1.0.22
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.21...1.0.22)

Updates `async-lock` from 3.4.0 to 3.4.1
- [Release notes](https://github.com/smol-rs/async-lock/releases)
- [Changelog](https://github.com/smol-rs/async-lock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-lock/compare/v3.4.0...v3.4.1)

Updates `cc` from 1.2.30 to 1.2.32
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.30...cc-v1.2.32)

Updates `cfg-expr` from 0.20.1 to 0.20.2
- [Release notes](https://github.com/EmbarkStudios/cfg-expr/releases)
- [Changelog](https://github.com/EmbarkStudios/cfg-expr/blob/main/CHANGELOG.md)
- [Commits](https://github.com/EmbarkStudios/cfg-expr/compare/0.20.1...0.20.2)

Updates `derive-where` from 1.5.0 to 1.6.0
- [Release notes](https://github.com/ModProg/derive-where/releases)
- [Changelog](https://github.com/ModProg/derive-where/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ModProg/derive-where/compare/v1.5.0...v1.6.0)

Updates `event-listener` from 5.4.0 to 5.4.1
- [Release notes](https://github.com/smol-rs/event-listener/releases)
- [Changelog](https://github.com/smol-rs/event-listener/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/event-listener/compare/v5.4.0...v5.4.1)

Updates `glob` from 0.3.2 to 0.3.3
- [Release notes](https://github.com/rust-lang/glob/releases)
- [Changelog](https://github.com/rust-lang/glob/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/glob/compare/v0.3.2...v0.3.3)

Updates `hyper-util` from 0.1.15 to 0.1.16
- [Release notes](https://github.com/hyperium/hyper-util/releases)
- [Changelog](https://github.com/hyperium/hyper-util/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper-util/compare/v0.1.15...v0.1.16)

Updates `io-uring` from 0.7.8 to 0.7.9
- [Commits](https://github.com/tokio-rs/io-uring/commits)

Updates `libc` from 0.2.174 to 0.2.175
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.175/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.174...0.2.175)

Updates `munge` from 0.4.5 to 0.4.6
- [Release notes](https://github.com/djkoloski/munge/releases)
- [Commits](https://github.com/djkoloski/munge/commits)

Updates `munge_macro` from 0.4.5 to 0.4.6
- [Release notes](https://github.com/djkoloski/munge/releases)
- [Commits](https://github.com/djkoloski/munge/commits)

Updates `redox_syscall` from 0.5.15 to 0.5.17

Updates `rkyv_derive` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/rkyv/rkyv/releases)
- [Commits](https://github.com/rkyv/rkyv/commits)

Updates `rustc-demangle` from 0.1.25 to 0.1.26
- [Release notes](https://github.com/rust-lang/rustc-demangle/releases)
- [Changelog](https://github.com/rust-lang/rustc-demangle/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rustc-demangle/commits/rustc-demangle-v0.1.26)

Updates `rustls` from 0.23.29 to 0.23.31
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.29...v/0.23.31)

Updates `signal-hook-registry` from 1.4.5 to 1.4.6
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/registry-v1.4.5...registry-v1.4.6)

Updates `slab` from 0.4.10 to 0.4.11
- [Release notes](https://github.com/tokio-rs/slab/releases)
- [Changelog](https://github.com/tokio-rs/slab/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/slab/compare/v0.4.10...v0.4.11)

Updates `tokio-util` from 0.7.15 to 0.7.16
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.15...tokio-util-0.7.16)

Updates `toml_parser` from 1.0.1 to 1.0.2
- [Commits](https://github.com/toml-rs/toml/compare/toml_parser-v1.0.1...toml_parser-v1.0.2)

Updates `zerovec` from 0.11.2 to 0.11.4
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits/ind/zerovec@0.11.4)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.142
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: trybuild
  dependency-version: 1.0.110
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio
  dependency-version: 1.47.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: proc-macro2
  dependency-version: 1.0.96
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: prettyplease
  dependency-version: 0.2.36
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: camino
  dependency-version: 1.1.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rkyv
  dependency-version: 0.8.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: uuid
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: futures-lite
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: const-str
  dependency-version: 0.6.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: postcard
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustversion
  dependency-version: 1.0.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: async-lock
  dependency-version: 3.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-version: 1.2.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cfg-expr
  dependency-version: 0.20.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: derive-where
  dependency-version: 1.6.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: event-listener
  dependency-version: 5.4.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: glob
  dependency-version: 0.3.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: hyper-util
  dependency-version: 0.1.16
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: io-uring
  dependency-version: 0.7.9
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: libc
  dependency-version: 0.2.175
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge
  dependency-version: 0.4.6
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge_macro
  dependency-version: 0.4.6
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: redox_syscall
  dependency-version: 0.5.17
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rkyv_derive
  dependency-version: 0.8.11
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustc-demangle
  dependency-version: 0.1.26
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustls
  dependency-version: 0.23.31
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: signal-hook-registry
  dependency-version: 1.4.6
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: slab
  dependency-version: 0.4.11
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio-util
  dependency-version: 0.7.16
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: toml_parser
  dependency-version: 1.0.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: zerovec
  dependency-version: 0.11.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-14 11:39:20 -07:00
Greg Johnston
05cafa8b06 fix: support islands routing in 404 routes (#4218) 2025-08-11 21:46:10 -04:00
Greg Johnston
9e3c0cc402 fix: pass hydrate_async through OwnedView properly (closes #4219) (#4220) 2025-08-11 21:06:02 -04:00
Gabriel Lopes Veiga
30141293f6 feat: implement IntoProperty for Oco (#4174) 2025-08-09 15:34:51 -04:00
Saber Haj Rabiee
8f623a2d5b feat: improving the bump script (#4187) 2025-08-09 15:31:50 -04:00
Greg Johnston
f2fe791f6b perf: use a set instead of Vec<_> to optimize large subscriber sets (see #4138) (#4201) 2025-08-09 15:31:05 -04:00
Greg Johnston
30dbb7ccc8 fix: ensure task::spawn maintains reactive ownership (closes #4203) (#4206) 2025-08-09 15:30:23 -04:00
Aleksander Heintz
b986fe11dc make is_server and is_browser public (#4204) 2025-08-05 17:10:10 -07:00
mskorkowski
e2e28ef180 fix: allowing deriving Patch for a struct with generic argument (closes #4163) (#4175) 2025-08-03 08:28:42 -04:00
Adam Doyle
a5e0053bab chore: add name attribute to details element (#4190) 2025-08-03 08:24:54 -04:00
Greg Johnston
6c04a1cd76 fix: only continue navigating to most recent page (closes #4195) (#4198) 2025-08-03 08:24:19 -04:00
Raffaele Fontana
87fb947465 docs: fix typo (#4202) 2025-08-01 11:12:42 -04:00
mskorkowski
5ba818132a feat: add command and commandfor attributes for button (closes #4193) (#4194) 2025-07-31 16:45:38 -04:00
Greg Johnston
30b917cfc3 v0.8.6 2025-07-27 08:59:22 -04:00
Greg Johnston
6cd731cbb1 Merge pull request #4186 from leptos-rs/4184
A few pieces of lazy island clean-up
2025-07-27 08:50:22 -04:00
Greg Johnston
f1b6b79e27 Enhancing members’ versioning (#4172)
* fix: decouple versioning for members

* feat: handy script to bump changed member crates from the last released tag
2025-07-27 08:50:08 -04:00
Greg Johnston
623ee08f82 chore: this does not need to be async 2025-07-27 08:34:59 -04:00
Greg Johnston
877849a5dd chore: new wasm_split version 2025-07-27 08:30:51 -04:00
Greg Johnston
fb59da90c2 fix: support file hashing when using lazy loading (#4182) 2025-07-26 15:46:31 -04:00
Greg Johnston
d33f5c9e77 feat: allow lazy server functions (#4169) 2025-07-24 07:30:05 -04:00
dependabot[bot]
deb8e96eb0 chore(deps): bump redox_syscall in the rust-dependencies group (#4171)
Bumps the rust-dependencies group with 1 update: redox_syscall.


Updates `redox_syscall` from 0.5.14 to 0.5.15

---
updated-dependencies:
- dependency-name: redox_syscall
  dependency-version: 0.5.15
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-22 12:33:31 -04:00
Greg Johnston
181e4d0566 chore: bump wasm-split version numbers (#4170) 2025-07-22 12:31:46 -04:00
Saber Haj Rabiee
525379a9b3 fix(CI): remove autofix CI timeout (#4173) 2025-07-22 12:31:04 -04:00
Saber Haj Rabiee
783a233167 feat: handy script to bump changed member crates from the last released tag 2025-07-21 22:44:40 -07:00
Saber Haj Rabiee
8079956d1b fix: decouple versioning for members 2025-07-21 22:43:58 -07:00
Greg Johnston
f5d3fbb091 0.8.5 2025-07-21 09:04:16 -04:00
Greg Johnston
fbe7cdc482 docs: update documentation for #[lazy] and #[lazy_route] 2025-07-21 08:53:38 -04:00
Greg Johnston
14884bc8ac Merge pull request #3988 from leptos-rs/wasm-splitting-support
feat: wasm-splitting library support for future cargo-leptos integration
2025-07-21 07:17:29 -04:00
Greg Johnston
2c93e1a185 fix: avoid name conflict between lazy route struct type and split view function 2025-07-20 19:59:10 -04:00
Greg Johnston
64b8c3dfd5 fix: use dummy macro output to improve rust-analyzer experience for #[lazy_route] 2025-07-20 19:58:41 -04:00
martin frances
5f2d511553 chore: bump oco_ref version number (#4168) 2025-07-20 18:44:09 -04:00
Greg Johnston
d7cdc6c489 chore: fix Cargo.lock 2025-07-20 13:12:03 -04:00
Greg Johnston
ebb33b6f41 Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-20 13:09:26 -04:00
Greg Johnston
809c0b532c chore: cargo update 2025-07-20 13:07:47 -04:00
Greg Johnston
b13f2420fb chore: change name of wasm_split due to namesquatting 2025-07-20 12:54:30 -04:00
Greg Johnston
77de264615 chore: publish wasm_split and wasm_split_macros 2025-07-20 12:54:14 -04:00
Greg Johnston
1524386346 v0.8.4 2025-07-20 11:11:29 -04:00
Greg Johnston
426b079709 Merge pull request #4167 from shadr/hot-reload-fixes
fix(hot-reload): hot-reload stops working when number of views changes in a file + small fixes
2025-07-20 11:00:05 -04:00
shadr
c6f176e2b0 Merge branch 'leptos-rs:main' into hot-reload-fixes 2025-07-20 16:23:48 +03:00
Greg Johnston
75662d08e7 Merge pull request #4162 from shadr/hot-reload-myers-diff
fix(hot-reload): implement Myers diffing algorithm
2025-07-20 08:23:58 -04:00
mahdi739
4448b77cde feat: add debug_log!, debug_error!, console_debug_log and console_debug_error (#4160) 2025-07-20 08:11:17 -04:00
Dylan Anthony
956af8e466 feat: allow using Actix without default features (#3921) 2025-07-20 08:03:49 -04:00
Nesterov Nikita
8c469b85d6 fix(hot-reload): ignore clippy::needless_range_loop lint 2025-07-20 07:49:26 +03:00
Saber Haj Rabiee
7f93dd224d fix(CI): check latest commit for version release instead of version tag (#4150) 2025-07-19 21:38:56 -04:00
martin frances
777b5e1e54 chore: examples - bumped version numbers for sqlx and this error. (#4126) 2025-07-19 21:19:32 -04:00
Greg Johnston
37cb102d53 fix: wait for preloaded route data as part of route transition 2025-07-19 13:46:30 -04:00
Nesterov Nikita
433f7284e6 fix(hot-reload): update view map when number of views mismatch 2025-07-19 16:25:33 +03:00
Greg Johnston
897e6ecc26 example: lazy routes in hackernews_axum 2025-07-19 08:53:02 -04:00
Greg Johnston
0c67f7d389 fix: properly support concurrent loading without breaking changes to ChooseView 2025-07-19 08:53:02 -04:00
Greg Johnston
232b603a25 feat: support both sync and async lazy functions 2025-07-19 08:53:02 -04:00
Nesterov Nikita
4a8a212d84 fix(hot-reload): ReplaceWith couldn't replace Fragment with an Element 2025-07-19 15:48:57 +03:00
Nesterov Nikita
1d7bc021af fix(hot-reload): ClearChildren couldn't clear fragment view 2025-07-19 15:46:18 +03:00
Nesterov Nikita
74055a7e13 fix(hot-reload): fix AppendChildren patch command 2025-07-19 15:06:13 +03:00
Nesterov Nikita
c98082de74 fix(hot-reload): insertion before/after fragment in a tag
Previous commits that aimed at fixing indexing for Myers algorithm broke
insertion before/after a fragment in a html tag, resulting in incorrect
ordering/error
2025-07-19 13:48:09 +03:00
autofix-ci[bot]
b8d44e20a9 [autofix.ci] apply automated fixes 2025-07-19 09:05:20 +00:00
Nesterov Nikita
00e83e0d70 fix(hot-reload): update InsertChild parent node logic 2025-07-19 10:12:58 +03:00
Nesterov Nikita
e89b1389ca fix(hot-reload): rebuild actual children before each patch 2025-07-19 08:05:48 +03:00
Nesterov Nikita
bd454d03e2 refactor(hot-reload): immediately apply patches 2025-07-19 08:05:11 +03:00
Nesterov Nikita
d7f4457ea4 feat(hot-reload): implement Myers diffing algorithm 2025-07-19 07:39:32 +03:00
Rakshith Ravi
17d357bcec chore(README): we're kinda prod-ready (#4148) 2025-07-18 10:33:45 -04:00
dependabot[bot]
66d1bead9a chore(deps): bump the rust-dependencies group across 1 directory with 15 updates (#4152)
---
updated-dependencies:
- dependency-name: trybuild
  dependency-version: 1.0.106
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tokio
  dependency-version: 1.46.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: config
  dependency-version: 0.15.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: const-str
  dependency-version: 0.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: reqwest
  dependency-version: 0.12.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cc
  dependency-version: 1.2.29
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: cfg-expr
  dependency-version: 0.20.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: collection_literals
  dependency-version: 1.0.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: crc32fast
  dependency-version: 1.5.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: h2
  dependency-version: 0.3.27
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: hyper-util
  dependency-version: 0.1.15
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustls
  dependency-version: 0.23.29
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: rustls-webpki
  dependency-version: 0.103.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: sdd
  dependency-version: 3.0.9
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: winnow
  dependency-version: 0.7.12
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-18 10:32:18 -04:00
Greg Johnston
69c918e813 Merge pull request #4154 from shadr/hot-reload-fixes
fix: three hot-reloading bugs ( closes #3191 )
2025-07-18 10:31:18 -04:00
TERRORW0LF
2817a261ce docs: add warning for reading hash on the server (#4158) 2025-07-18 10:25:17 -04:00
mahdi739
972b1ff90b feat: support conversion from signals and optional get extension for TextProp (#4159)
* feat: support conversion from signals and optional get extension for TextProp

* [autofix.ci] apply automated fixes

* remove unused import

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-18 10:24:32 -04:00
autofix-ci[bot]
10c13bbca2 [autofix.ci] apply automated fixes 2025-07-18 13:01:09 +00:00
Greg Johnston
e545b7c48a chore: remove unnecessary lifetime 2025-07-18 08:31:30 -04:00
Greg Johnston
839eb9ac1c fix: correctly handle preloads when they do or don't exist 2025-07-18 08:30:02 -04:00
Greg Johnston
ae9324e555 fix: use crossorigin rather than nonce for <link rel="modulepreload"> 2025-07-18 08:29:34 -04:00
shadr
3a66a1f3d3 Merge branch 'main' into hot-reload-fixes 2025-07-18 06:05:14 +03:00
Greg Johnston
f7c4a664d2 chore(ci): add new wasm-splitting crates to CI 2025-07-17 19:11:11 -04:00
Greg Johnston
d446474456 chore: clippy 2025-07-17 19:10:03 -04:00
Greg Johnston
d7bc6715a6 chore: clippy 2025-07-17 19:09:32 -04:00
Greg Johnston
4c95cddca8 chore: cargo fmt 2025-07-17 14:19:52 -04:00
Greg Johnston
437d61bed7 chore: allow non-snake-case name on LazyRoute::view() 2025-07-17 14:17:14 -04:00
Greg Johnston
3fdbae4314 Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-17 14:07:29 -04:00
Greg Johnston
7559b27361 feat: support preloading split WASM files from a manifest 2025-07-17 14:06:20 -04:00
Greg Johnston
b9bb14cfdc chore: clippy 2025-07-17 14:06:05 -04:00
Greg Johnston
504f983996 Merge pull request #4161 from leptos-rs/version-updates
Version updates + stable hot-reloading
2025-07-17 13:36:52 -04:00
Greg Johnston
c7a319db15 nested concurrent lazy routes 2025-07-17 11:21:05 -04:00
Greg Johnston
0862385816 fix: hot-reloading still only supported in debug 2025-07-17 09:29:29 -04:00
Greg Johnston
0d18da720b fix: rename arguments for lazy routes 2025-07-17 09:27:31 -04:00
Greg Johnston
12f5676bd1 fix/change: proper concurrent data loading for routes 2025-07-17 09:27:18 -04:00
Greg Johnston
0fa8155adc fix: correct async hydration for elements 2025-07-17 09:26:55 -04:00
Greg Johnston
f8fa6de987 preload lazy routes without creating data twice 2025-07-17 08:09:05 -04:00
Greg Johnston
81b37a3867 create a separate preload function for lazy functions 2025-07-17 08:08:56 -04:00
Greg Johnston
8319446d3f chore: update nightly error output for server function return types 2025-07-17 07:10:59 -04:00
Greg Johnston
efb1e945d9 hydrate lazy islands in correct order 2025-07-17 06:51:51 -04:00
Greg Johnston
5fa31941bb chore: remove unused type in test 2025-07-17 06:11:35 -04:00
Greg Johnston
f4bb87ea1e feat: support hot-reloading on stable 2025-07-16 21:34:32 -04:00
Greg Johnston
016fbf8da1 chore: bump nightly version in CI 2025-07-16 18:03:07 -04:00
Greg Johnston
21fd995468 change: set MSRV to 1.88 (proc-macro spans stabilized = stable hot-reloading) 2025-07-16 18:02:40 -04:00
Greg Johnston
17b9bec79a update test results 2025-07-16 18:01:19 -04:00
Greg Johnston
acd69daedb clippy 2025-07-16 17:40:45 -04:00
Greg Johnston
b8a3129396 support hot-reloading on stable 2025-07-16 17:34:05 -04:00
Greg Johnston
783b4c4b04 Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-16 17:25:34 -04:00
Greg Johnston
683e7177dd docs: update README to remove nightly note, as it has not been the default for the examples/book for a long time 2025-07-16 17:25:28 -04:00
Greg Johnston
eede2e9e6c unnecessary unsafe that had no safety comment in the POC! 2025-07-16 17:23:42 -04:00
Greg Johnston
31d51ea94f clippy 2025-07-16 17:23:32 -04:00
Greg Johnston
01fbd82edf use more recent nightly in CI 2025-07-16 17:20:34 -04:00
Greg Johnston
b276e703a8 unblock hot reloading on stable now that proc-macro spans are stabilized 2025-07-16 17:20:15 -04:00
Greg Johnston
d2409a22a7 update MSRV to allow deduplicating lazy function names 2025-07-16 17:19:46 -04:00
Greg Johnston
f6cd784088 clippy 2025-07-16 17:18:01 -04:00
Greg Johnston
eb9ebc870f regression tests for #4157 and for https://github.com/leptos-rs/cargo-leptos/issues/546 2025-07-16 07:47:30 -04:00
Greg Johnston
b746c2ac4e feat: deduplicate lazy function names with a hash (closes #4157) 2025-07-16 07:46:40 -04:00
Greg Johnston
4c1e7dc8c1 add README 2025-07-15 20:43:29 -04:00
Greg Johnston
f1fa4635c7 clippy 2025-07-15 09:37:50 -04:00
Greg Johnston
46c8a11eae infrastructure for testing with --split 2025-07-15 09:37:45 -04:00
Greg Johnston
6b72ce3c16 Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-15 09:10:50 -04:00
Nesterov Nikita
33b278c014 fix(hot-reload): fragments were not walked over properly 2025-07-15 09:35:06 +03:00
Nesterov Nikita
5fc56346f4 chore: format patch.js with prettier 2025-07-15 09:30:30 +03:00
Nesterov Nikita
afb37aaf4b fix(hot-reload): handle DOM-less views 2025-07-15 09:28:59 +03:00
Nesterov Nikita
f8fd79725a fix(hot-reload): parse RawText node 2025-07-15 09:28:19 +03:00
Greg Johnston
131251b361 fix: bump workspace dependency versions (closes #4146) (#4149) 2025-07-14 10:55:25 -04:00
Greg Johnston
91fb315fe0 v0.8.3 2025-07-12 20:10:21 -04:00
mskorkowski
6954b77b62 fix: generics on stores (closes #4136) (#4142)
Fixes the case when struct had a generic arguments by adding missing generic arguments into the generated trait and the said trait implementation.
2025-07-12 20:04:48 -04:00
Greg Johnston
299a4c161f clean up dependencies (see #3987) 2025-07-12 14:11:27 -04:00
Greg Johnston
b0ee946412 clean up example 2025-07-12 14:08:00 -04:00
Greg Johnston
b505892568 add lazy-routing example 2025-07-12 14:00:19 -04:00
Greg Johnston
b63cfa7935 support for lazy hydration 2025-07-12 13:22:12 -04:00
Greg Johnston
01a939e1e4 weird 2025-07-11 11:03:49 -04:00
Greg Johnston
995bc60c74 missing import 2025-07-11 11:00:57 -04:00
Greg Johnston
4c4869d33c support custom names for split functions 2025-07-11 10:59:06 -04:00
Greg Johnston
0ca8d32805 fix lazy_route 2025-07-11 10:53:30 -04:00
Greg Johnston
0d853fdb74 re-export lazy route macro 2025-07-11 10:37:18 -04:00
Greg Johnston
853f049d9f Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-11 10:37:00 -04:00
Saber Haj Rabiee
77176f8395 fix(examples): remove redundant cf-worker example (#4140)
Cloudflare has an official template for leptos https://github.com/cloudflare/workers-rs/blob/main/templates/leptos
2025-07-11 10:35:14 -04:00
autofix-ci[bot]
84136cafa5 [autofix.ci] apply automated fixes 2025-07-10 16:36:07 +00:00
Greg Johnston
bb3f1deb1f Merge remote-tracking branch 'origin' into wasm-splitting-support 2025-07-10 12:15:45 -04:00
Greg Johnston
344b79a01b chore: fix cargo-leptos command in README (closes #4134) 2025-07-06 08:51:20 -04:00
Greg Johnston
051059c761 Merge pull request #4115 from leptos-rs/4114-fix
Clean up nested routing ownership and add regression tests
2025-07-01 08:32:52 -04:00
Ryo Hirayama
3c540dd858 Add an example to show server_fn is capable to serve on Cloudflare Workers (#4052)
* Add reqwest-no-ws feature to server_fn

* Add dep:tokio to server_fn/reqwest-no-ws

* Fix

* Refactor reqwest-no-ws feature in server_fn crate for wasm32 support

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Ad cf-worker example

* Fix error messages for trybuild

* Revert "Fix error messages for trybuild"

This reverts commit 42658dd031.

* Fix CI error by disabling on reqwest-no-ws aslike other feature

* Compact deps and add ci

* Revert all server_fn changes as main

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-30 23:44:12 -07:00
Greg Johnston
4125688a0a fix: don't create an extra intermediate outlet (messes with context) 2025-06-30 16:55:19 -04:00
Greg Johnston
bd3b962cfb fix: dispose of all previous owners simultaneously when all routes are complete 2025-06-30 09:51:20 -04:00
Greg Johnston
5dd3c217c4 fix: don't dispose of view owners immediately when outlets rerun 2025-06-30 09:51:02 -04:00
Greg Johnston
ae00e5ae13 test: add regression test for nested context on server 2025-06-30 09:49:16 -04:00
Greg Johnston
1ce671ba08 test: fix signal disposal test 2025-06-30 09:46:22 -04:00
Greg Johnston
ec9f26bd9f chore: remove unused variable 2025-06-30 09:06:18 -04:00
Greg Johnston
831eae31bc fix: much better solution for nested route disposal 2025-06-30 09:05:22 -04:00
Greg Johnston
ff6ae5de25 test: add regression test for signal disposal issue 2025-06-30 08:49:25 -04:00
Greg Johnston
c21712ba04 chore: simplify element_by_id (see #4121) 2025-06-29 17:16:51 -04:00
Greg Johnston
45771b6fd3 fix: correctly rebuild AnyView when the current view doesn't appear in the DOM (closes #4122) 2025-06-29 17:10:32 -04:00
Greg Johnston
f3557970a7 fix: uses EXISTS to mark things that don't exist in the DOM 2025-06-29 17:10:05 -04:00
Greg Johnston
c87ef331b0 fix: fix: correctly construct child links during rebuild 2025-06-29 14:07:48 -04:00
martin frances
e767518142 chore: updated clippy rule affecting stores example (#4120)
status.done().then_some("line-through").unwrap_or_default()
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if status.done() { "line-through" } else { Default::default() }`
2025-06-28 14:53:27 -04:00
Greg Johnston
f94b681118 fix: correctly clear child route data 2025-06-28 14:31:57 -04:00
Greg Johnston
9c50e49253 test: add regression test for #4088 2025-06-28 14:15:49 -04:00
Greg Johnston
57c7097ede fix: disable InertElement when global class is provided (closes #4116) (#4119) 2025-06-28 13:53:58 -04:00
dependabot[bot]
1a06e0eee8 chore(deps): bump the rust-dependencies group across 1 directory with 18 updates (#4110)
---
updated-dependencies:
- dependency-name: syn
  dependency-version: 2.0.104
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: glib
  dependency-version: 0.20.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: prettyplease
  dependency-version: 0.2.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: autocfg
  dependency-version: 1.5.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: derive-where
  dependency-version: 1.5.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: errno
  dependency-version: 0.3.13
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: glib-macros
  dependency-version: 0.20.12
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: libc
  dependency-version: 0.2.174
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge
  dependency-version: 0.4.5
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: munge_macro
  dependency-version: 0.4.5
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: quinn-udp
  dependency-version: 0.5.13
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: r-efi
  dependency-version: 5.3.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: rust-dependencies
- dependency-name: rustls
  dependency-version: 0.23.28
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: slab
  dependency-version: 0.4.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: tracing-attributes
  dependency-version: 0.1.30
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: webpki-roots
  dependency-version: 1.0.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: zerocopy
  dependency-version: 0.8.26
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
- dependency-name: zerocopy-derive
  dependency-version: 0.8.26
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: rust-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-28 13:53:18 -04:00
bicarlsen
ce9af4a685 fix: use HTML-namespaced InertElement for top-level <svg> elements. (#4109) 2025-06-28 13:53:02 -04:00
martin frances
e0c79eb8d8 chore: bump syn and tokio-tungsenite. (#4117) 2025-06-28 13:52:20 -04:00
Greg Johnston
9fd972971e test: add regression test for back/forward behavior mentioned in #4114 2025-06-27 18:50:28 -04:00
Greg Johnston
9473220639 test: add regression test for #4015 2025-06-27 18:42:30 -04:00
Greg Johnston
ae11812dc6 fix: ensure cleanups run when navigating between sibling Routes in Outlet 2025-06-27 17:59:09 -04:00
Greg Johnston
4c55c25445 chore: clean up unused owner manipulation 2025-06-27 17:59:09 -04:00
Greg Johnston
649b5fbe9e Merge pull request #4114 from metatoaster/regression_examples
A place to put e2e tests for regression, plus reporting issue caused by #4091.
2025-06-27 08:28:20 -04:00
Tommy Yu
adb3e75efc test: e2e that demonstrates failure
- if b37900ec55 from #4091 is reverted the
  failure described in the `pr_4091.feature` will no longer happen.
2025-06-27 22:42:40 +12:00
Tommy Yu
f303aa6d5c test: leptos-rs/leptos#4091 regression 2025-06-27 22:42:40 +12:00
Tommy Yu
73ca3d7b04 Adding a basic regression example 2025-06-27 22:42:40 +12:00
Greg Johnston
235393bfbe chore: remove now-unused join_contexts API (#4113) 2025-06-26 08:58:01 -04:00
Greg Johnston
17d8e2bd09 fix: correctly provide context via nested outlets (closes #4088) (#4091) 2025-06-25 20:00:10 -04:00
Gabriel Lopes Veiga
f51c676e0d feat: add method take for BrowserFormData (#4102) 2025-06-22 13:55:48 -04:00
bicarlsen
cf0aa0e4d7 fix: create svg::InertElement templates in SVG namespace. (#4104) 2025-06-22 13:53:37 -04:00
bicarlsen
df09d4a7f6 fix: update svg::InertElement for dom cache. (#4100)
#4099 introduced caching for inert elements, changing the API for [`dom::Dom::create_element_from_html`](30b0a579ca/tachys/src/renderer/dom.rs (L495)). This updates `svg::InertElement` to match the new API.
2025-06-20 20:39:55 -04:00
TERRORW0LF
30b0a579ca enhance: handle ../ in aria-current for <A/> component (#4051) 2025-06-20 17:09:07 -04:00
dependabot[bot]
50a4c3b0d9 chore(deps): bump autofix-ci/action from 1.3.1 to 1.3.2 (#4072)
Bumps [autofix-ci/action](https://github.com/autofix-ci/action) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/autofix-ci/action/releases)
- [Commits](https://github.com/autofix-ci/action/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: autofix-ci/action
  dependency-version: 1.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 17:02:54 -04:00
bicarlsen
c76649d77b feat: add inert SVG elements. (#4085) 2025-06-20 17:02:38 -04:00
bicarlsen
911be5007e perf: add template cache for InertElement (#4099) 2025-06-20 17:01:19 -04:00
Greg Johnston
5227221c96 docs: add document on adding class and other attributes to <A/> component (#4086) 2025-06-16 20:00:45 -04:00
Greg Johnston
3f48b77256 feat: impl IntoFragment for AnyView (#4087) 2025-06-16 20:00:32 -04:00
foldedwave
99117f496f fix: correctly remove :capture listeners (closes #4081) (#4082)
Co-authored-by: foldedwave <anon@foldedwave.com>
2025-06-16 20:00:15 -04:00
Moritz Hedtke
cf12ea3404 fix: conflicting changes between #4035 and #4074 (#4090) 2025-06-16 19:59:30 -04:00
martin frances
d555c1e0ce Removed crate once_cell (#4083)
* Removed crate once_cell

As of rust_version 1.80.0 there are now equivalent options in std.

Async and sync changes are as follows.

-use once_cell::sync::Lazy;
+use std::sync::LazyLock;

-use once_cell::sync::Lazy;
+use std::sync::LazyLock;

* ran cargo fmt.

* fixed server_fn errors.

* cargo fmt fixes.

* "use srd::sync" becomes "use std::sync".

* fixed formatting issue.

* formatting issues.

* Fixed error in examples/server_fns_axum

* more formatting issues.

* more formatting issues.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-16 10:38:32 -07:00
Moritz Hedtke
40ea20057f Remove unnecessary Option wrapping (#4035)
* Remove unnecessary Option wrapping.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-16 10:37:26 -07:00
Greg Johnston
5587ccd1eb fix: don't render a comment node for () attributes in template (closes #4079) (#4080) 2025-06-14 15:47:48 -04:00
Greg Johnston
50a9df9eea Merge pull request #4078 from leptos-rs/4066
Fix updates to static class names
2025-06-13 22:49:51 -04:00
Greg Johnston
c46b1c4e25 feat: allow dereferencing LocalResource to an AsyncDerived (see #4063) (#4077) 2025-06-13 18:03:18 -04:00
Greg Johnston
e6f86408a1 fix: ensure that dynamic classes are replaced if they have changed 2025-06-13 18:01:42 -04:00
Greg Johnston
aa13ed9431 fix: ensure that classes are replaced if they have changed (closes #4066) 2025-06-13 18:01:27 -04:00
TERRORW0LF
607a7987e5 fix: unresolved path in server side redirect (closes #4054) (#4074)
* feat: resolve path on server redirect

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-06-13 15:50:18 -04:00
Greg Johnston
c0c3279cbb Merge pull request #4056 from elias098/fixes
Bugfixes to `reactive_stores`
2025-06-13 11:07:09 -04:00
Greg Johnston
ece6d9dd93 feat(CI): add checking minimal-versions on release (#3987)
* feat(CI): add checking minimal-versions

* chore: unify all deps + exact versioning in root workspace for better maintenance

* feat(CI): run minimal-versions only on release tag

* feat(CI): re-adding dependabot with grouped weekly updates
2025-06-13 10:47:53 -04:00
Álvaro Mondéjar Rubio
74ecf4763a docs: update Tauri project to Leptos v0.8.2 (#4020) 2025-06-13 10:47:24 -04:00
Greg Johnston
2c5c69c2fe Merge pull request #4065 from leptos-rs/3729pt2
fix: memory leak introduced by #4015
2025-06-13 10:37:27 -04:00
Tommy Yu
0c275d6540 fix: IntoMaybeErased hygiene on view macro (#4071) 2025-06-13 10:37:13 -04:00
Greg Johnston
6be3266a2e fix: ensure that arena is reestablished for cleanups 2025-06-12 17:13:12 -04:00
Greg Johnston
c3efb8e476 Merge remote-tracking branch 'origin' into 3729pt2 2025-06-11 21:31:38 -04:00
Greg Johnston
32e0551b10 fix: correct set up sandboxing for AsyncDerived futures 2025-06-11 21:31:31 -04:00
Greg Johnston
671ada36ab Merge pull request #4064 from metatoaster/pr_4061
Tests for #4061
2025-06-11 15:49:40 -04:00
Greg Johnston
a9ab4ea372 fix: memory leak introduced by #4015 2025-06-10 21:38:41 -04:00
Tommy Yu
1d72b75d03 test: chained resources as per #4061 2025-06-11 13:32:55 +12:00
Tommy Yu
798d8a4a9e fix: suspense_test corrected due to previous fix
- The `res_overview` previously being tracked inside the async caused an
  extra fetch to happen, and with that tracking being corrected, this no
  longer happens.
- Left a comment about how this is untracked.
2025-06-11 13:32:32 +12:00
Greg Johnston
f4e0be2d59 fix: do not track anything inside the async block of a Resource (closes #4060) (#4061) 2025-06-10 21:11:29 -04:00
Josiah Parry
05f50f7d27 chore: fix checkboxes in issue template (#4031) 2025-06-08 20:55:16 -04:00
Greg Johnston
a22d6f58be fix: allow nested untracked reads without false positives (closes #4032) (#4049) 2025-06-08 20:54:37 -04:00
Greg Johnston
ff21c9cae2 fix: suppress false-positive warning when adding children to a <For/> that is not currently mounted (closes #3385) (#4050)
* fix: suppress false-positive warning when adding children to a `<For/>` that is not currently mounted (closes #3385)

* remove track_caller
2025-06-08 20:54:25 -04:00
elias098
726b7b3116 fix: rework Subfield::track_field to remove duplicate track 2025-06-08 13:56:53 +02:00
elias098
6e91b6fada fix: fix triggers_for_path to prevent duplicate trigger on empty path 2025-06-08 13:40:49 +02:00
elias098
76f1c7a50c fix: triggers_for_path Vec capacity calculation changed to prevent reallocations 2025-06-08 13:19:19 +02:00
Greg Johnston
733a353820 fix: allow multiple #[middleware] macros (closes #4029) (#4048) 2025-06-06 20:50:52 -04:00
Greg Johnston
829b07b598 Merge pull request #4033 from leptos-rs/update_session_auth
Update `session_auth_axum` example
2025-06-02 19:44:21 -04:00
Saber Haj Rabiee
8c6059774f feat(CI): re-adding dependabot with grouped weekly updates 2025-06-01 09:20:10 -07:00
Saber Haj Rabiee
0e65034b01 feat(CI): run minimal-versions only on release tag 2025-06-01 09:18:41 -07:00
Saber Haj Rabiee
e1549c5ab3 chore: unify all deps + exact versioning in root workspace for better maintenance 2025-06-01 09:18:40 -07:00
Saber Haj Rabiee
624e91bb2a feat(CI): add checking minimal-versions 2025-06-01 08:55:41 -07:00
Greg Johnston
0df6cd74ee feat: simplify session_auth_axumby removing custom handlers 2025-05-30 18:32:22 -04:00
Greg Johnston
1da833a0aa fix: update session_auth_axum to Axum 0.8 2025-05-30 17:30:09 -04:00
Saikat Das
f37d124d6a Fix typo (#4025) 2025-05-29 12:39:32 -07:00
benwis
5d0e683b0f Update tachys to v0.2.3 2025-05-29 12:37:21 -07:00
lcnr
f34e3a5bc9 remove unnecessary where-clauses (#4023)
they may cause tachys to break with -Znext-solver
2025-05-29 12:35:50 -07:00
martin frances
d7dd6a1109 chore: bump rkyv to 0.8.10. (#4018) 2025-05-27 21:15:59 -04:00
Greg Johnston
ff81d34084 fix: fix <select> value by ensuring HTML children are mounted before building attributes (closes #4005) (#4008) 2025-05-27 21:15:41 -04:00
Soso
40a7aba3bc feat: impl AttributeValue for Cow<'_, str> (#4013) 2025-05-27 21:15:12 -04:00
Greg Johnston
d4dcafd908 Merge pull request #4015 from leptos-rs/3042v2
Fix context issues with nesting routing
2025-05-27 21:12:58 -04:00
Greg Johnston
82ccbbf806 copy-paste errors 2025-05-25 15:32:33 -04:00
Greg Johnston
5ba45bb1ed fix: allow Outlet to access context provided in parent view (closes #3042) 2025-05-24 17:51:22 -04:00
Greg Johnston
06dfa37eee feat: allow joining two context trees 2025-05-24 17:50:51 -04:00
Nicolas Cura
e82a0bbc7f chore: handle_response_inner public to be used in custom file_and_error_handler (closes #3996) (#3998) 2025-05-23 14:51:08 -04:00
Álvaro Mondéjar Rubio
4a972fc09e Merge pull request #4003 from mondeja/document-prop-attrs
docs: document `#[prop(default = ...)]` and `#[prop(name = ...)]`
2025-05-23 14:49:59 -04:00
Greg Johnston
5d9df592d5 fix: don't assume classList is unchanged when rebuilding a class effect for the first time (#3983 part two) 2025-05-21 21:53:50 -04:00
Greg Johnston
323de496f3 fix: don't use Arc::ptr_eq for string comparison (closes #3983) 2025-05-21 21:53:50 -04:00
Álvaro Mondéjar Rubio
c8df5b75ef fix: forward missing lint attributes passed to #[component] macro (#3989) 2025-05-21 21:53:50 -04:00
Dennis Waldherr
89cbf86595 docs: provide error message if file hashing is enabled but no hash file is present (#3990)
Co-authored-by: Dennis Waldherr <bytekeeper@mailbox.org>
2025-05-21 21:53:50 -04:00
mskorkowski
b78a6655f3 fix: smooshed static segments no longer matches the path #3968 (#3973)
* fix: smooshed static segments no longer matches the path #3968

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-21 21:53:50 -04:00
Greg Johnston
b5797ffe6a fix: meta tags not properly rendered inside synchronously-available Suspend (closes #3976) (#3991) 2025-05-21 21:53:50 -04:00
Greg Johnston
775e2eabed feat: #[island(lazy)] 2025-05-21 21:53:50 -04:00
autofix-ci[bot]
37405ec778 [autofix.ci] apply automated fixes 2025-05-21 20:32:35 +00:00
Greg Johnston
54890af875 add wasm-split workplace dependencies 2025-05-21 16:12:50 -04:00
Greg Johnston
07cf649e3b Merge pull request #3994 from leptos-rs/3983
fix: don't use `Arc::ptr_eq` for string comparison (closes #3983)
2025-05-19 19:15:17 -04:00
Greg Johnston
0e9598b799 fix: don't assume classList is unchanged when rebuilding a class effect for the first time (#3983 part two) 2025-05-19 09:42:33 -04:00
Greg Johnston
82303d7e33 fix: don't use Arc::ptr_eq for string comparison (closes #3983) 2025-05-19 09:27:17 -04:00
Álvaro Mondéjar Rubio
c4354ac965 fix: forward missing lint attributes passed to #[component] macro (#3989) 2025-05-18 20:38:16 -04:00
Dennis Waldherr
7de550685a docs: provide error message if file hashing is enabled but no hash file is present (#3990)
Co-authored-by: Dennis Waldherr <bytekeeper@mailbox.org>
2025-05-18 20:30:53 -04:00
mskorkowski
b1f3f6023e fix: smooshed static segments no longer matches the path #3968 (#3973)
* fix: smooshed static segments no longer matches the path #3968

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-18 20:29:40 -04:00
Greg Johnston
c189c3a45d fix: meta tags not properly rendered inside synchronously-available Suspend (closes #3976) (#3991) 2025-05-18 20:29:14 -04:00
Greg Johnston
5479ece865 Merge branch 'main' into wasm-splitting-support 2025-05-17 15:03:28 -04:00
Greg Johnston
f0b7e7445b feat: wasm-splitting library support for future cargo-leptos integration 2025-05-17 15:00:38 -04:00
Eric Roman
3903867f82 Fix spelling typos. (#3965) 2025-05-17 08:49:57 +02:00
Greg Johnston
a42fa452fc feat: add missing Resource::write() and similar functions (see #3959) (#3984) 2025-05-16 09:23:28 -04:00
Saber Haj Rabiee
cd48a6ac8c fix: remove non-existent feature dep in leptos_macro (#3985) 2025-05-16 09:23:04 -04:00
Greg Johnston
34c14adcb8 fix: render identical branch structure for out-of-order and async streaming of Suspense (closes #3970) (#3977) 2025-05-15 19:44:46 -04:00
Saber Haj Rabiee
50cee1d614 chore: upgrade rand and getrandom (#3840)
* chore: update rand and getrandom

* fix: use rng instead of thread_rng

* fix: enable getrandom wasm js backend in build.rs
2025-05-15 11:17:32 +02:00
Saber Haj Rabiee
7ca691305f chore: unify all deps with min occurrences of 2 (#3854) 2025-05-14 20:34:33 -04:00
Greg Johnston
830882f330 fix: allow rebuilding Vec<_> before it is mounted (closes #3962) (#3966) 2025-05-12 15:26:05 -04:00
Scott Little
13110a35e2 fix: add namespace to g in svg portals (closes #3958) (#3960) 2025-05-09 16:44:40 -04:00
Marcus Whybrow
304dc081a2 fix: correct doc comment for SsrMode::PartiallyBlocked (closes #3963) (#3964) 2025-05-09 09:39:00 -07:00
Serhii Shliakhov
14f6bc658e fix: deprecated parameters js warning (#3956) 2025-05-09 08:04:15 -04:00
Eric Roman
09894aaca9 Remove unnecessary "crate::" prefix in a documentation example. (#3952) 2025-05-08 07:43:27 -07:00
Greg Johnston
2ee4444bb4 v0.8.2 2025-05-06 14:09:35 -04:00
Luxalpa
03a1c1e7a6 fix: ensure unique style caching hashes (#3947) 2025-05-06 14:00:29 -04:00
Greg Johnston
12e49ed996 Merge pull request #3950 from leptos-rs/3945
fix: correct order of meta content relative to surrounding tags (closes #3945)
2025-05-06 13:59:28 -04:00
Greg Johnston
1e281e9e74 fix(examples): bugfix revealed a pre-existing bug with meta tags in the hackernews demo! 2025-05-06 11:49:43 -04:00
Greg Johnston
bd475f89d0 fix: correct order of meta content relative to surrounding tags (closes #3945) 2025-05-06 11:19:19 -04:00
Greg Johnston
3d91b5e90f v0.8.1 2025-05-05 21:39:43 -04:00
Greg Johnston
96d8d5218c Merge pull request #3942 from leptos-rs/3907
Some `islands_router` improvements
2025-05-05 21:33:57 -04:00
Greg Johnston
84caa35cef feat: add .map() and .and_then() on LocalResource (#3941) 2025-05-05 21:20:34 -04:00
Greg Johnston
fc8b55161c fix: remove extra marker node after text node when marking a branch (closes #3936) (#3940) 2025-05-05 21:20:16 -04:00
Greg Johnston
657052466b fix: use a runtime check rather than an unnecessary Either to determine how to render islands (see #3896; closes #3929) (#3938) 2025-05-05 19:41:29 -04:00
william light
efe8336363 reactive_stores: implement PartialEq and Eq for Store (#3915)
StoredValue also has these implemented and does the same thing.
2025-05-05 14:32:42 -04:00
Greg Johnston
770881842c fix: correctly provide context through islands to children (closes #3928) (#3933) 2025-05-05 13:00:40 -04:00
Greg Johnston
0d540ef02f fix: ensure that nested children of a RenderEffect are dropped while dropped a RenderEffect (closes #3922) (#3926) 2025-05-05 13:00:20 -04:00
Saber Haj Rabiee
dc1885ad92 feat: check the counter_isomorphic release build with the leptos_debuginfo flag (#3918) 2025-05-04 15:22:04 -04:00
Eric Roman
61bf87439a Fix some typos in the documentation/examples for reactive store. (#3924) 2025-05-03 20:50:13 -04:00
Greg Johnston
308568e520 fix(CI): prevent regreession from nightly clippy in autofix (#3917)
* fix(CI): prevent regreession from nightly clippy in autofix

* chore: format

* chore: update nightly to 2025-04-16 (proc-macro span, #3852)

* chore: improve the autofix ci workflow

* fix: adjust ServerFn macro test stderr based on nightly-2025-04-16

* fix: limit server_fn server macro trybuild tests nightly only
2025-05-03 20:47:42 -04:00
Greg Johnston
1b0f32dc4c fix: clear and re-throw errors in correct order (#3923) 2025-05-03 20:46:57 -04:00
Greg Johnston
2e0b3011d9 fix: correct issues with StaticVec::rebuild() by aligning implementation with Vec::rebuild() (closes #3906) (#3920) 2025-05-03 08:56:36 -04:00
Greg Johnston
680d4ccd07 fix: do not diff islands in islands_router mode (see #3907) 2025-05-02 21:20:16 -04:00
Greg Johnston
325f9cbe33 fix: don't handle ActionForm (et al) with the islands_router default <form> behavior (see #3907) 2025-05-02 21:12:20 -04:00
Greg Johnston
26ab392c95 fix: allow nested Suspense > ErrorBoundary > Suspense (closes #3908) (#3913) 2025-05-02 16:59:04 -04:00
Saber Haj Rabiee
3a4e2a19aa fix: limit server_fn server macro trybuild tests nightly only 2025-05-02 08:32:38 -07:00
Saber Haj Rabiee
eed3d21b40 fix: adjust ServerFn macro test stderr based on nightly-2025-04-16 2025-05-02 08:01:15 -07:00
Saber Haj Rabiee
7ae386285d chore: improve the autofix ci workflow 2025-05-02 07:27:45 -07:00
Saber Haj Rabiee
ebcc51136d chore: update nightly to 2025-04-16 (proc-macro span, #3852) 2025-05-02 07:13:34 -07:00
Saber Haj Rabiee
e10ded4fd0 chore: format 2025-05-02 06:58:01 -07:00
Saber Haj Rabiee
67be872f58 fix(CI): prevent regreession from nightly clippy in autofix 2025-05-02 06:31:39 -07:00
LeoniePhiline
e5b21ac0fc fix(docs): correct panic message in copied example code (#3911) 2025-05-02 08:14:36 -04:00
benwis
9b2e313d20 v0.8.0 2025-05-01 15:26:21 -07:00
Greg Johnston
bc79232033 feat: impl From<MappedSignal<T>> for Signal<T> (#3897) 2025-05-01 14:56:27 -04:00
Saber Haj Rabiee
a7bb2565c4 fix(examples): websocket tests fail (occasionally) second attemp (#3910)
do not check the label immediately
2025-05-01 14:54:57 -04:00
zakstucke
2e393aaca0 fix: leptos_debuginfo (#3899) 2025-05-01 14:54:24 -04:00
Greg Johnston
e37711cb85 fix: correct hydration for elements after island children (closes #3904) (#3905) 2025-05-01 09:44:40 -04:00
Greg Johnston
627b553e60 fix: prevent sibling context leakage in islands (closes #3902) (#3903) 2025-04-30 21:33:54 -04:00
Greg Johnston
e2f9aca466 Merge pull request #3901 from leptos-rs/3896
Fix some island-routing issues
2025-04-30 14:27:31 -04:00
Greg Johnston
970544ed0b fix: correctly hydrate branches inside islands when using islands-router (closes #3896) 2025-04-30 08:48:40 -04:00
Greg Johnston
0c3b3c440f chore: remove forgotten log 2025-04-30 08:36:23 -04:00
nickburlett
6578086e09 fix(examples): incorrect routes in hackernews example (closes #3892) (#3894)
* fix(examples): incorrect routes in hackernews example (closes #3892)

1. `Avoid calling category()` twice on the story type.
2. `get_static_file()` returns Err on not found, so don’t
   unconditionally `unwrap()` it

* cargo fmt

---------

Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2025-04-30 07:43:12 -04:00
Greg Johnston
113aba9666 docs: add note about file hashing in Stylesheet docs (#3898) 2025-04-29 19:03:18 -07:00
Greg Johnston
58d7475193 fix: don't render branching comments inside script/style tags 2025-04-29 20:32:56 -04:00
Greg Johnston
04d80ff8d0 chore: clippy 2025-04-29 20:31:44 -04:00
Greg Johnston
7971a2dccb fix: marking AnyView branches with out-of-order streaming (for islands_router) 2025-04-29 20:30:40 -04:00
Greg Johnston
e2ea4277bc fix(examples): broken favicons in hackernews examples (closes #3890) (#3891) 2025-04-28 09:52:15 -04:00
Greg Johnston
171c8e7ff7 v0.8.0-rc3 2025-04-26 15:53:20 -04:00
Greg Johnston
53ffbeeb67 chore: fmt 2025-04-26 15:49:32 -04:00
Greg Johnston
ee86844077 Merge pull request #3882 from leptos-rs/3871
fix: remove event listeners from Suspense fallback during SSR (closes #3871)
2025-04-26 12:48:45 -04:00
Greg Johnston
1cee3f2f52 Merge branch 'main' into 3871 2025-04-26 12:48:40 -04:00
Greg Johnston
23c89dbfe1 Merge pull request #3878 from leptos-rs/3828
fix: correctly calculate starting index for first new key (closes #3828)
2025-04-26 12:48:12 -04:00
Greg Johnston
9f71f39f89 Merge branch 'main' into 3828 2025-04-26 12:47:56 -04:00
Greg Johnston
ef1d0f108a Merge pull request #3880 from sabify/websocket-example
fix(examples): websocket example tests fail on latency
2025-04-26 12:47:17 -04:00
Greg Johnston
a7a78317b7 Merge pull request #3879 from huuff/prelude-textprop
chore: put `TextProp` in the prelude (closes #3877)
2025-04-26 12:46:53 -04:00
autofix-ci[bot]
5005cc3587 [autofix.ci] apply automated fixes (attempt 2/3) 2025-04-26 16:15:06 +00:00
autofix-ci[bot]
08708f3388 [autofix.ci] apply automated fixes 2025-04-26 16:03:45 +00:00
Greg Johnston
c19c1b32f1 fix: remove event listeners from Suspense fallback during SSR (closes #3871) 2025-04-26 11:48:59 -04:00
Saber Haj Rabiee
e70cc08e96 fix(examples): websocket example tests fail on latency 2025-04-26 07:06:50 -07:00
autofix-ci[bot]
97175663ef [autofix.ci] apply automated fixes 2025-04-26 00:05:33 +00:00
Haf
92524a93cd chore: put TextProp in the prelude (closes #3877) 2025-04-25 23:50:08 +02:00
autofix-ci[bot]
9449f41ca9 [autofix.ci] apply automated fixes (attempt 2/3) 2025-04-25 20:31:56 +00:00
autofix-ci[bot]
d979055b70 [autofix.ci] apply automated fixes 2025-04-25 20:18:03 +00:00
Greg Johnston
97686f71a5 fix: improve support for keyed fields in ArcField<_> 2025-04-25 16:04:01 -04:00
Greg Johnston
06a0c768dc fix: correctly calculate starting index for first new key (closes #3828) 2025-04-25 15:57:30 -04:00
Saber Haj Rabiee
fff6a508fc feat(examples): add WebSocket example (#3853) 2025-04-24 20:17:08 -04:00
Greg Johnston
e65fc23fc7 fix: prevent infinite loop when sending Result over websocket, remove Display bound (#3848)
* chore: easing `Display` bound on `FromServerFnError`, #3811 follow-up

* fix: send/receive websocket data

* fix: clippy warnings

* fix: server_fn_axum example

* fix: make de/serialize_result functions public

* fix: make websocket result ser/de private

* chore: make the doc a comment and remove allow dead_code
2025-04-23 07:52:42 -04:00
Saber Haj Rabiee
f83b14d76c feat: enhancing ByteStream error handling (#3869)
* feat: enhancing `ByteStream` error handling

* fix: easing unnecessary trait bound over some `TextStream` methods
2025-04-23 07:38:39 -04:00
zakstucke
62dac6fb8a fix: prevent ScopedFuture stopping owner cleanup (#3863) 2025-04-23 07:37:12 -04:00
Rakshith Ravi
b36dec8269 feat: add header generation method to BrowserResponse (#3873) 2025-04-23 07:33:18 -04:00
Fea
0c50852251 fix: Use stabilized ClipboardEvent (#3849) 2025-04-23 07:27:24 -04:00
Nikolai Morin
50cb6005a8 chore(examples): complete the migration to Tailwind 4 (#3861)
The tailwind_csr example was not working yet with version 4, and the
tailwind_actix example still had the no-longer-needed config file.

This also brings the three tailwind examples back in sync, mostly. I
don't know why the axum example has a packages.json and
packages-lock.json file, to be honest.
2025-04-23 07:26:56 -04:00
Sathish
b725291ce9 chore: forward lint attributes used with #[component] macro (#3864)
* Forward lint attributes used with #[component] macro

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-23 07:26:26 -04:00
Greg Johnston
ed6d45d92d Merge pull request #3870 from leptos-rs/3851
Error boundary fixes
2025-04-23 07:25:41 -04:00
Greg Johnston
73b5587738 fix: correctly insert out-of-order stream chunks when Ok 2025-04-21 13:12:30 -04:00
Greg Johnston
68813a5918 fix: clear old errors when going from error state to error state (closes #3850) 2025-04-21 12:10:47 -04:00
Greg Johnston
8f6a96341e fix: wait for any inner Suspense before rendering ErrorBoundary (closes #3851) 2025-04-21 09:29:33 -04:00
Greg Johnston
046d5286c3 fix: correctly flush synchronous parts of SSR stream when appending another StreamBuilder 2025-04-21 09:28:14 -04:00
Greg Johnston
b45f982feb fix: close Actix websocket stream when browser disconnects (closes #3865) (#3866) 2025-04-19 16:47:09 -04:00
Greg Johnston
2b50ddc0db v0.8.0-rc2 2025-04-18 08:43:16 -04:00
Saber Haj Rabiee
c743f0641c chore: make the doc a comment and remove allow dead_code 2025-04-17 06:45:40 -07:00
Saber Haj Rabiee
078c252e2e fix: make websocket result ser/de private 2025-04-17 03:38:04 -07:00
martin frances
410aedbba8 chore: ran cargo outdated. (#3722)
* chore: ran cargo outdated fixed issues.

In bumping the rand crate, calls to thread_rng() becomes rng().

* backed out changes to rand.
2025-04-16 16:42:01 -07:00
Saber Haj Rabiee
00e474599f fix: reactive_graph keymap impl and clippy warnings (#3843) 2025-04-16 16:39:07 -07:00
Greg Johnston
8f38559aa2 chore(nightly): update proc-macro span file name method name (#3852) 2025-04-16 16:35:59 -07:00
Greg Johnston
3934c8b162 Update issue templates 2025-04-16 09:15:10 -04:00
Saber Haj Rabiee
de3a558203 fix: make de/serialize_result functions public 2025-04-15 09:24:43 -07:00
Saber Haj Rabiee
4d20105760 fix: server_fn_axum example 2025-04-15 09:23:32 -07:00
Saber Haj Rabiee
b95e827b8b fix: clippy warnings 2025-04-15 08:31:42 -07:00
Saber Haj Rabiee
30c445a419 fix: send/receive websocket data 2025-04-15 07:43:47 -07:00
Saber Haj Rabiee
6d5ab73594 chore: easing Display bound on FromServerFnError, #3811 follow-up 2025-04-14 23:52:02 -07:00
Greg Johnston
e0bf5ec480 fix: don't try to move keyed elements within the DOM if they're not yet mounted (closes #3844) (#3846) 2025-04-14 20:06:31 -04:00
Greg Johnston
28d9b3676d fix: correctly decode base64-encoded error messages stored in URL (#3842) 2025-04-13 13:28:58 -04:00
Greg Johnston
bb47916ebe fix: call additional_context after providing other server context in all cases (#3841) 2025-04-12 20:29:43 -04:00
Greg Johnston
cf843a8349 v0.8.0-rc1 2025-04-11 12:03:17 -04:00
Saber Haj Rabiee
7637e586d5 feat: enhancing server_fn errors (#3811)
* feat: enhancing server_fn errors

* fix: `server_fn` `not_result.stderr` line numbers

* fix: example server_fns_axum

* fix: not need to force ser/de traits

* fix(docs): deserialize error comment

* fix: remove unneeded traits bounds
2025-04-10 14:04:16 -07:00
Mykyta
ba7bfd8bac feat: allow using different error types for req/resp with WebSockets, closes #3724 (#3766)
* feat: allow using different error types for request/response with WebSocket

* [autofix.ci] apply automated fixes

* chore: clean up merge issues

* chore: fix custom client example

* we can't use nightly features on stable

* update flake inputs

* include gcc and glib to flake dev shell

* update expected stderr outputs server_fn/tests/invalid

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2025-04-09 10:03:47 -07:00
Saber Haj Rabiee
8bc4fd4198 Introducing cargo all-features clippy|nextest part of build process (#3767)
* fix: intoducing cargo all-features clippy

* fix: change check to clippy for better diagnostics

* chore: build is redundant

* fix: lint task

* feat: speed up tests by 2x with cargo-nextest

* fix: re-add flags

* fix: router example build process

* fix: correct clippy arguments

* fix: adapt examples makefile to new tools

* fix(CI): add cargo-all-features part of CI dep

* fix: just warn if there is no tests

* fix(CI): add clippy and rustfmt components

* fix: nextest in examples

* fix: clippy should not run on empty set of features in examples
(quickfix)

* fix: pin cargo-all-features installation to a branch

* fix: nextest --no-tests=warn?

* fix: do not use built-in cargo-make workflows

* fix: remove --all-targets

* fix: do not run tests in parallel in certain examples

* fix: disable nextest for examples

* fix: properly override the make task

* chore: run tests with no-deps

* fix: hackernews_islands_axum

* fix(CI): properly use --no-deps

* fix(CI): --no-deps is not supported in tests

* fix(CI): run doctests separately due to stable rust limitation in nextest

* fix(examples): makefile lint recursion

* fix(CI): run tests correctly

* fix: remove unused clear in test makefile

* fix: --no-deps positional arg in clippy

* fix: run doctests for all-features

* fix: running cargo-all-features over doctests

* fix: improve playwright makefile
2025-04-07 08:57:01 -07:00
Alexander Krivács Schrøder
3254d38d2d Revert "Remove getrandom (#3589)" (#3830)
Restores `getrandom` dependency to avoid compilation error when
compiling for WASM with the `nonce` feature.
2025-04-07 08:42:13 -07:00
Greg Johnston
b4abac2614 chore: missing Copy/Clone impls for MappedSignal (#3827) 2025-04-06 19:24:21 -04:00
Greg Johnston
767147f4ab Merge pull request #3802 from sabify/any-spawner-race
fix: prevent race condition in executor initialization + docs, optimization and tests
2025-04-06 15:39:34 -04:00
Greg Johnston
9128545388 fix: do not match static segment with last character missing before slash (closes #3817) (#3823) 2025-04-05 21:58:50 -04:00
Greg Johnston
b8810ba42f fix: correctly establish root ownership for static site generation (closes #3822) (#3824) 2025-04-05 19:50:28 -04:00
Saber Haj Rabiee
6006c33307 Revert "fix: more atomic orderings"
This reverts commit 02f4cfe437.
2025-04-03 09:11:14 -07:00
Saber Haj Rabiee
e113c79fb8 Revert "fix: preserve the ordering of read/write operations on atomic variables"
This reverts commit 2ea0381bb5.
2025-04-03 09:10:20 -07:00
尹吉峰
bdc73594ea change: pass reference to key for Selector::selected (#3694) 2025-04-02 21:43:13 -04:00
Pico Bolero
a55e82afe3 chore: migrate Axum example from Tailwind 3 to Tailwind 4 (#3804)
documentation e.g., input.css and output.css.
Uses @tailwindcss/cli tool to build the output.css
Removes no longer needed tailwind.config.js as that configuration can be
embedded in input.css.
Removes src/style.css as it only included tailwind 3 configurations that
are no longer needed.
2025-04-02 20:58:36 -04:00
Greg Johnston
300d301c11 Merge pull request #3755 from ifiokjr/feat/support_aliased_results_in_server_fn
feat: support aliased `Result` return types for `server_fn`
2025-04-02 20:56:29 -04:00
Greg Johnston
98ee336d0c fix: remove SendOption from public API of actions (#3812) 2025-04-02 13:03:21 -04:00
mahdi739
f102b2f43b fix: Move several Into* trait impls for store fields out of stable module for wider use (#3807)
* Move several Into* trait impls for store fields out of stable module for wider use

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-04-02 09:29:23 -04:00
Greg Johnston
47aebf3e22 fix: allow custom status codes or redirects for route fallbacks (#3808) 2025-04-01 19:25:59 -04:00
jasper
7d3a9da577 chore: add track_caller to store field methods (#3805) 2025-03-30 16:13:44 -04:00
Saber Haj Rabiee
6d90e05c13 fix: do not expose any_spawner::Executor in prelude to encourage local
spawn/spawn_local* implementations
2025-03-30 03:41:48 -07:00
Saber Haj Rabiee
5d0fd5b693 fix: four more spawns usage 2025-03-30 01:52:18 -07:00
Saber Haj Rabiee
d665719b27 fix: no global spawn for wasm executor 2025-03-30 00:28:33 -07:00
Saber Haj Rabiee
ae373b5a52 fix: revert back tick implementation to respect global executor 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
02f4cfe437 fix: more atomic orderings 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
40710adfd5 fix: glib test 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
d0f26ac64b chore: use futures_lite yield_now in glib test 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
9d2ac0a18f fix: improving tick logic in any_spawner 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
ab0832ad68 fix: correctly using executator tick instead of timer 2025-03-29 23:19:45 -07:00
Saber Haj Rabiee
2ea0381bb5 fix: preserve the ordering of read/write operations on atomic variables 2025-03-29 23:19:38 -07:00
Saber Haj Rabiee
94acdc24c7 fix: wasm-bindgen unused tests warnings 2025-03-29 23:17:35 -07:00
Saber Haj Rabiee
c175357e69 fix: lib docs 2025-03-29 23:17:35 -07:00
Saber Haj Rabiee
ef86a50c68 fix: wasm in spawn_local condition 2025-03-29 23:17:35 -07:00
Saber Haj Rabiee
e8e0808684 fix: run tests sequentially for glib 2025-03-29 23:17:35 -07:00
Saber Haj Rabiee
4973cc9eff fix: prevent race condition in executor + docs, optimization and tests 2025-03-29 23:17:35 -07:00
Greg Johnston
1a83a78980 Merge pull request #3803 from leptos-rs/store-test-fixes
Store test fixes
2025-03-29 14:55:36 -04:00
ChosunOne
4c6c79da40 feat: add support for more HTTP methods in server fn codecs (#3797) 2025-03-29 14:55:08 -04:00
Greg Johnston
c204df2ff3 Merge pull request #3785 from sabify/fix-portal-example
fix: portal example
2025-03-29 13:56:16 -04:00
zakstucke
0794681011 feat: derive_local for ArcSignal<T, LocalStorage> (#3798) 2025-03-29 13:55:11 -04:00
Greg Johnston
45dc1f4690 chore: update Store Option patch tests to reflect correct behavior 2025-03-29 13:45:39 -04:00
Greg Johnston
b80d58039e fix: prevent sibling over-notification due to #3799) 2025-03-29 13:20:52 -04:00
Greg Johnston
a7619c63bf Merge pull request #3793 from leptos-rs/3783
Improved handling of `<Title/>`
2025-03-28 15:43:45 -04:00
Greg Johnston
4038438cb4 Merge pull request #3799 from leptos-rs/3790
Fix Store notification order for nested keyed fields
2025-03-28 15:43:29 -04:00
Greg Johnston
f23335278b fix: allow repeated class= for all tuples, not only static ones (closes #3794) (#3801) 2025-03-28 15:43:13 -04:00
Greg Johnston
7f51a46b1a fix: correctly notify parent fields when patching 2025-03-27 20:20:04 -04:00
Greg Johnston
a54e3fdb40 fix: notify keyed Store fields from the top down (closes #3790) 2025-03-27 20:19:46 -04:00
Greg Johnston
64ba9b9dd4 fix: do not re-create effect when building a new route 2025-03-27 17:21:16 -04:00
Greg Johnston
568a16b880 chore: clippy 2025-03-26 22:07:32 -04:00
autofix-ci[bot]
d9179f0b19 [autofix.ci] apply automated fixes (attempt 2/3) 2025-03-26 20:05:52 +00:00
autofix-ci[bot]
62161c83c5 [autofix.ci] apply automated fixes 2025-03-26 19:58:41 +00:00
Greg Johnston
97f31f1af5 fix: smarter handling of <Title/> (closes #3783) 2025-03-26 15:46:55 -04:00
Greg Johnston
aa4dd53890 fix: correct insertion of a list of items when the first one doesn't exist in the DOM 2025-03-26 15:46:37 -04:00
Saber Haj Rabiee
a0c6f2b7ac fix: there is no way in cargo-make to override external task, so run
ordinary test for every examples
2025-03-26 08:25:28 -07:00
Ifiok Jr.
753d02a14c chore: fix formatting 2025-03-26 15:12:32 +00:00
Ifiok Jr.
ae23364ef8 chore: add comment explaining annotation 2025-03-26 15:12:32 +00:00
Ifiok Jr.
a74713a371 fix: only use diagnostic attribute on versions after 1.78 2025-03-26 15:12:31 +00:00
Ifiok Jr.
72e84f4e38 feat: support aliased Result return types for server_fn
- Enhanced error messages for better clarity when server functions do not meet the expected return type requirements.
- Added `trybuild` tests to ensure behaviour is not broken in future releases.
2025-03-26 15:12:31 +00:00
Ifiok Jr.
0a13ebd94d fix: also include ServerFnErrorErr in prelude 2025-03-26 15:12:30 +00:00
Ifiok Jr.
23c6f548ec fix: add FromServerFnError to leptos::prelude::* 2025-03-26 15:12:30 +00:00
Saber Haj Rabiee
543063ac24 fix: run cargo test for portal eample (minify tests) 2025-03-26 08:07:43 -07:00
Saber Haj Rabiee
04da08f82d fix: portal example makefile to run cargo test 2025-03-25 23:45:14 -07:00
Saber Haj Rabiee
c8ee4b3e05 fix: portal minify test 2025-03-25 23:42:09 -07:00
Saber Haj Rabiee
999a09d064 fix: quoting strings in portal example 2025-03-25 23:27:29 -07:00
Saber Haj Rabiee
9a32ae7bd5 fix: write simple minifier for portal tests 2025-03-25 23:12:19 -07:00
zakstucke
a96ef29d9e feat: re-export the codee crate to make custom encodings for resources easier (#3761) 2025-03-25 21:40:48 -04:00
Saber Haj Rabiee
0553c2af30 fix: signal CI to install chromedriver 2025-03-25 12:58:14 -07:00
Saber Haj Rabiee
668b7b4adb fix: limit opt-level to test 2025-03-25 12:57:51 -07:00
Saber Haj Rabiee
0a90def2da fix: portal example too many locals 2025-03-25 12:32:44 -07:00
Saber Haj Rabiee
d095879ef2 fix: portal example 2025-03-25 12:16:19 -07:00
Saber Haj Rabiee
2508b016d5 fix(CI): run only the exact examples on the only examples change (#3782)
* fix(CI): run only the exact examples on the only examples change

* chore: format html (retrigger ci)

* fix: missing the right field

* fix(CI): add missing output key

* fix(CI): properly set matrix directory for test-only-examples

* fix(CI): missing bracket token

* fix(CI): do not run semver check on examples only tests

* fix(CI): semver logic
2025-03-25 09:38:25 -07:00
Saber Haj Rabiee
bf35298708 fix: router example build process (#3779)
* fix: router example build process

* fix: a working router example
2025-03-24 23:53:45 -07:00
Greg Johnston
1a1e436cff fix: correctly handle optional parameters in ParentRoute (#3784) 2025-03-24 20:15:31 -04:00
Greg Johnston
b4731e61c6 Merge pull request #3781 from leptos-rs/partialeq-sendoption
Tweaks to `MaybeSendWrapperOption<_>`
2025-03-24 20:12:06 -04:00
autofix-ci[bot]
5bdc68a2f2 [autofix.ci] apply automated fixes 2025-03-24 21:56:27 +00:00
Greg Johnston
0a6cd9e33f update example 2025-03-24 17:40:52 -04:00
Greg Johnston
eca8e3cc72 chore: update tests 2025-03-23 20:33:51 -04:00
Greg Johnston
e0856eee33 chore: remove duplicate implementation due to merge 2025-03-23 20:20:30 -04:00
Greg Johnston
514cf62bf6 docs: add some more documentation to SendOption 2025-03-23 20:20:12 -04:00
Greg Johnston
26522666d5 chore: rename MaybeSendWrapperOption to SendOption 2025-03-23 20:19:30 -04:00
Greg Johnston
dcb3f202cd fix: correctly handle == and similar traits for MaybeSendWrapperOption 2025-03-23 20:14:43 -04:00
Greg Johnston
b032c15a84 Merge pull request #3762 from leptos-rs/reduce-local-signals
Reduce use local signals for `Action::new_local` and similar primitives
2025-03-23 15:55:02 -04:00
Saber Haj Rabiee
f24e804985 fix(CI): toolchain will be determined and test against by CI (#3778)
* fix(CI): toolchain will be determined and test against by CI

* chore: formatting examples

* fix: clippy
2025-03-23 10:10:52 -07:00
Alexander Krivács Schrøder
2c1194a71a docs: correct docs for default value for hash_files (closes #3774) (#3775)
Resolves #3774
2025-03-23 09:08:20 -04:00
Greg Johnston
fcdc9a07e4 Merge pull request #3777 from sabify/fix-ci-examples-logic
fix(CI): conditional executions of only changed examples
2025-03-23 09:07:16 -04:00
Greg Johnston
3d5b0127c2 Merge pull request #3776 from sabify/remove-ci-cache
fix(CI): remove caching
2025-03-23 09:06:59 -04:00
Saber Haj Rabiee
1cbbcda48b fix(CI): conditional executions of only changed examples 2025-03-23 01:42:53 -07:00
Saber Haj Rabiee
d9b998ed0c fix(CI): add was32 target in rust-toolchain setup 2025-03-23 01:12:46 -07:00
Saber Haj Rabiee
79f0482325 fix(CI): install trunk with bininstall 2025-03-23 01:12:13 -07:00
Saber Haj Rabiee
78d70fc400 fix(CI): caching may not be needed 2025-03-23 01:11:27 -07:00
Saber Haj Rabiee
2a011dd89c fix(CI): install deno only if needed, #3768 follow-up (#3773) 2025-03-23 00:04:07 -07:00
Saber Haj Rabiee
bc7c59d880 fix: clippy errors (#3772)
* fix: use map instead of if else

* fix: needless lifetime
2025-03-22 23:44:49 -07:00
Greg Johnston
a5d158765f fix: support IntoFragment for single element (closes #3757) (#3759) 2025-03-22 19:55:16 -04:00
Saber Haj Rabiee
999c8be6a0 fix(CI): install deps only if needed, speeds up CI (#3768) 2025-03-22 15:30:53 -07:00
Greg Johnston
5cfb16c79f feat: consolidate sync/unsync Action APIs 2025-03-22 15:24:10 -04:00
Greg Johnston
fd95f11dff Revert "fix: use signals rather than Action::new_local() (closes #3746) (#3749)"
This reverts commit 2658ae8b40.
2025-03-22 15:24:10 -04:00
Greg Johnston
2d8336ac91 feat: consolidate sync/unsync Action APIs 2025-03-22 15:24:10 -04:00
Saber Haj Rabiee
bb0c352f75 fix: remove duplicate semver (#3764) 2025-03-22 11:50:43 -07:00
Saber Haj Rabiee
b6eddca2c1 fix(CI): optimize CI workflow (#3758)
* chore: optimize CI

* chore: fomratting makefile to retrigger ci

* fix: run tests against both stable and nightly toolchains

* chore: simplify workflow

* fix(CI): remove unused inputs

* fix(CI): correctly indicating erased mode

* fix(CI): replace input with the name

* fix(CI): fixed logic of running cargo cmake on workspace on each example
and memeber!

* fix(CI): organized, simplified and unified CI jobs

* chore: change CI name

* fix(CI): keyword

* fix(CI): wait for dependent jobs
2025-03-22 09:48:54 -07:00
Saber Haj Rabiee
57272926ad fix: properly feature gating ui macro tests (Closes #3742) (#3756)
* fix: properly feature gating ui macro tests (Closes #3742)

* fix: wrongly gated main in test and added more gates

* docs: formatting
2025-03-22 09:48:08 -07:00
Greg Johnston
e903c297a9 chore: add SignalSetter to prelude (closes #3547) (#3753) 2025-03-21 16:58:00 -04:00
Nicolas Cura
b6e6588c8d fix: make trailing comma optional for either!() macro (#3736) 2025-03-21 16:39:52 -04:00
Greg Johnston
713abb3072 chore: ensure WASM target is installed for examples with provided rust-toolchain.toml (closes #3717) (#3752) 2025-03-21 16:38:35 -04:00
Greg Johnston
fce202db39 Merge pull request #3529 from leptos-rs/leptos_0.8
Leptos 0.8
2025-03-21 16:18:55 -04:00
Greg Johnston
1fe39bf7c8 Merge remote-tracking branch 'origin' into leptos_0.8 2025-03-21 16:18:01 -04:00
Jérôme MEVEL
fb5fdfc429 docs: in Effect::watch, refer to 'dependency_fn' and 'handler' in doc (#3731) 2025-03-21 16:01:56 -04:00
Alexander Krivács Schrøder
c738c5d81b feat: switch extract() helper to use ServerFnErrorErr (closes #3745) (#3750)
* feat: switch `extract()` helper to use `ServerFnErrorErr`

This provides much better compatibility with server functions using
custom errors while still working as before with server functions using
`ServerFnError`

* style: apply autofix diff
2025-03-21 16:01:12 -04:00
Greg Johnston
2658ae8b40 fix: use signals rather than Action::new_local() (closes #3746) (#3749) 2025-03-21 15:51:44 -04:00
Saber Haj Rabiee
a0d75fda03 chore: no need to filter out "nightly" feature as of #3735 (#3747)
* chore: no need to filter out "nightly" feature as of #3735

* fix: enable hot-reload only if in all debug mode, nightly feature and
nightly rustc

* fix: do not build/test against nightly feature alone

* fix: don not test against nightly feature alone

* fix: add trace-components to denylist
2025-03-21 10:16:16 -07:00
Saber Haj Rabiee
716c770a45 fix(CI): sermver job name (#3748) 2025-03-21 06:42:42 -07:00
Saber Haj Rabiee
a2d268606c fix(CI): cleanup directory no matter of results (#3743) 2025-03-20 17:53:25 -07:00
zakstucke
90fc727d60 ArcLocalResource fix (#3740) 2025-03-20 16:20:05 -07:00
zakstucke
aae827923c ArcLocalResource fix (0.8) (#3741) 2025-03-20 16:19:32 -07:00
Saber Haj Rabiee
52c770c7da fix(CI): free-up disk, properly gate nightly feature and pre-install deps (#3735)
* fix(CI): pre-install tailwind and sass

* chore: retrigger CI

* fix(CI): properly set `erased_mode` in examples

* fix(CI): workflow logic install deps locally

* chore(CI): organized tailwind and sass versions

* fix: properly ignore nightly features on stable rustc

* fix(CI): typo

* fix: missing cfg attr

* fix: properly gate nightly module in `reactive_graph``

* fix: complete `rustc_nightly` cfg gate

* fix(CI): making even more space for CI workers

* fix: missing one more rustc_nightly gated feature

* fix: maximize the speed of cargo-all-features by limiting combinations to 2
2025-03-20 14:28:07 -07:00
Saber Haj Rabiee
9210636266 fix(CI): cancel in-group inflight and pending jobs on new pushes in CI (#3739) 2025-03-20 13:02:17 -07:00
Saber Haj Rabiee
012616c4d8 fix(CI): switch to stable in semver for most compatibility (#3737) 2025-03-20 13:01:45 -07:00
Evan Almloff
6b9520f1a9 More flexible server fn macro api (#3725)
* Split up the server function expansion into multiple functions

* Use LitStr instead of Literal

* Refactor out more of the expansion

* Fix the parse example

* Expose some of the parsed server function arguments and body fields

* mark ServerFnBody as non_exhaustive

* [autofix.ci] apply automated fixes

* Fix server function paths

* rename from impl

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-20 09:55:38 -07:00
benwis
9052804ab4 v0.7.8 2025-03-20 08:21:11 -07:00
benwis
e95c903e85 v0.7.7 2025-03-19 18:19:37 -07:00
Greg Johnston
2faae43d5f v0.8.0-beta 2025-03-19 21:02:10 -04:00
Nicolas Cura
6760c87e83 Merge pull request #3727 from NCura/patch-1
Fix typo
2025-03-19 21:02:10 -04:00
bimoadityar
8a179e6f45 examples: update example tailwind input css to v4 (#3702) 2025-03-19 21:01:03 -04:00
Greg Johnston
e765f99016 fix: matching optional params after an initial static param (closes #3730) (#3732) 2025-03-19 20:59:41 -04:00
autofix-ci[bot]
e19e42c650 [autofix.ci] apply automated fixes 2025-03-19 23:42:02 +00:00
zakstucke
fb4be49ebf feat: remove SendWrapper from the external interface of LocalResource (#3715) 2025-03-19 19:26:14 -04:00
Nicolas Cura
30548eca31 Merge pull request #3727 from NCura/patch-1
Fix typo
2025-03-18 14:30:23 -04:00
Greg Johnston
0b4cbbc17d Merge remote-tracking branch 'origin' into leptos_0.8 2025-03-16 14:27:23 -04:00
Greg Johnston
dbbeb7c6ef fix: don't retrigger rendering when only param has changed (closes #3719( 2025-03-16 14:26:23 -04:00
Greg Johnston
36aef2565d chore: merge issues 2025-03-16 14:25:31 -04:00
Greg Johnston
a2a7eb8a2a Merge remote-tracking branch 'origin' into leptos_0.8 2025-03-16 14:21:21 -04:00
Zak Stucke
97e22e2506 Extra trait impls for MaybeSendWrapper 2025-03-16 14:20:35 -04:00
autofix-ci[bot]
8bedacb0c7 [autofix.ci] apply automated fixes 2025-03-16 14:20:35 -04:00
Zak Stucke
56b7b9a16a Remove SendWrapper from the external interface of LocalResource, by internalising a MaybeSendWrapper inside ArcAsyncDerived 2025-03-16 14:20:35 -04:00
Greg Johnston
d04d4c77f9 Merge pull request #3720 from metatoaster/regression_tests_3502
test: regression from #3502
2025-03-16 14:16:05 -04:00
Tommy Yu
5c75928b5b test: avoiding testdriver browser contention
- The number of tests have increased sufficiently that the browser test
  instances spawned by the driver are choked out on CI.
2025-03-16 22:43:21 +13:00
Tommy Yu
abc5631654 test: regression from #3502
- Also as reported in #3719, which has an actual minimum example.
- The "quicker" test had a reset but that runs into timing issue with
  the way this reset is done too soon after resource usage, so leaving
  this out and we will just trust the bigger counters.
2025-03-16 22:43:21 +13:00
Tommy Yu
40e5288ac1 fix instrumented use_context
- It shouldn't be in on_cleanup, move into it from the component to
  avoid BorrowMut error.
2025-03-16 22:43:21 +13:00
Greg Johnston
335934d40e Merge pull request #3716 from zakstucke/string-opt
view!{} macro optimisation: don't wrap string types in closures when passing to ToChildren
2025-03-15 10:56:40 -04:00
Greg Johnston
6ee72f42e2 Merge pull request #3687 from leptos-rs/3671
Various issues related to setting signals and context in cleanups
2025-03-15 10:34:53 -04:00
Thomas Versteeg
93af23a970 feat: allow closures for shell parameter in file_and_error_handler* (#3711) 2025-03-15 10:24:09 -04:00
Danik Vitek
95e8ae84af feat(reactive_stores): Replace AsRef bound of StoreFieldIterator blanket impl with Len bound (#3701) 2025-03-15 10:23:09 -04:00
Danik Vitek
5cfe7f6b5e fix: make tuple struct field locator in Patch impl Index instead of usize (#3700) 2025-03-15 10:19:41 -04:00
Greg Johnston
0404efd5c3 fix: ensure that store subfield mutations notify from the root down (closes #3704) (#3714) 2025-03-15 10:04:52 -04:00
Zak Stucke
93173c1400 view!} macro optimisation: don't wrap string types in closures when passing to ToChildren 2025-03-15 03:17:20 +00:00
Tommy Yu
cd2904f6a6 chore: prep common base to share example with 0.8 2025-03-15 14:35:55 +13:00
Greg Johnston
6b453845f9 fix: allow NodeRef to work with AttributeInterceptor (closes #3697) 2025-03-13 21:38:28 -04:00
zakstucke
111b84ce3b feat: allow LocalResource sync methods to be used outside Suspense (#3708) 2025-03-13 21:36:51 -04:00
zakstucke
5633148047 feat: allow LocalResource sync methods to be used outside Suspense (#3708) 2025-03-13 09:28:00 -04:00
autofix-ci[bot]
4edb012de3 [autofix.ci] apply automated fixes 2025-03-13 01:16:55 +00:00
Greg Johnston
b2bea2e6b7 fix: support for websockets under default features 2025-03-12 21:06:52 -04:00
Greg Johnston
acbd6378a8 chore: bump version for 0.8 2025-03-12 20:29:46 -04:00
Greg Johnston
b7462aab10 fix: broken type inference for Action::new_unsync (closes #3328) (#3705) 2025-03-12 19:12:46 -04:00
Greg Johnston
7593540774 Merge remote-tracking branch 'origin' into leptos_0.8 2025-03-12 16:16:10 -04:00
Greg Johnston
ed915f8e06 Merge pull request #3656 from ealmloff/websockets
Add websocket support for server functions
2025-03-12 16:13:41 -04:00
Greg Johnston
f65d87d566 chore: allow dead code in example 2025-03-10 21:07:41 -04:00
Greg Johnston
5034539411 chore: update server_fns_axum example 2025-03-10 21:06:36 -04:00
Greg Johnston
bc48aa4228 chore: reexport Bytes to make it easier to implement Client 2025-03-10 21:06:26 -04:00
Greg Johnston
d2c81fe955 change: enable url and json by default on server_fn 2025-03-10 16:02:50 -04:00
Greg Johnston
28eb96831a chore: fix up doctests on server_fn crate 2025-03-10 15:57:59 -04:00
Greg Johnston
330920eae2 chore: clippy 2025-03-10 10:14:46 -04:00
Greg Johnston
a94bc0a6da fix: only store a weak reference to an Owner in the current thread (see #3671) 2025-03-10 10:14:46 -04:00
Greg Johnston
f85e01f4d6 fix: do not panic unnecessarily in try_ methods on Arena (closes #3671) 2025-03-10 10:14:46 -04:00
autofix-ci[bot]
599c87c88a [autofix.ci] apply automated fixes 2025-03-10 14:03:07 +00:00
Evan Almloff
3ca98279e1 forward server fn visibility 2025-03-10 08:52:32 -05:00
mahdi739
a730bffe13 fix: Ensure reactive functions passed to TextProp are kept reactive (closes: #3689) (#3690) 2025-03-09 19:40:28 -04:00
Greg Johnston
d0bf843821 Merge pull request #3692 from QuartzLibrary/immediate-effect
`ImmediateEffect` follow up
2025-03-09 13:50:26 -04:00
QuartzLibrary
7250bc312e docs: clarify need for ThreadId 2025-03-09 11:49:23 +00:00
QuartzLibrary
0e8242f94c feat: simplify ImmediateEffect 2025-03-08 18:40:52 +00:00
QuartzLibrary
439b41f0e8 test: parallel ImmediateEffect r/w access 2025-03-08 18:35:16 +00:00
Evan Almloff
18570e970c Fix clippy 2025-03-07 17:19:24 -06:00
autofix-ci[bot]
787bf385d3 [autofix.ci] apply automated fixes 2025-03-07 23:18:19 +00:00
Evan Almloff
b6d2808671 Document the protocol trait and implementations 2025-03-07 17:12:49 -06:00
Evan Almloff
2e4d94b6c6 Add encoding suffix to the encoding types and revert renaming the post encodings 2025-03-07 17:12:49 -06:00
autofix-ci[bot]
66f9c8c999 [autofix.ci] apply automated fixes 2025-03-07 21:26:39 +00:00
Greg Johnston
352080d91a fix: don't use ws feature of Axum on JS-fetch/no-default platform 2025-03-07 16:19:11 -05:00
Greg Johnston
1e579614a5 chore: remove unused import 2025-03-07 15:55:28 -05:00
Greg Johnston
a4e47d4086 Merge pull request #3650 from QuartzLibrary/immediate-effect
`ImmediateEffect`
2025-03-07 15:18:50 -05:00
Greg Johnston
3164721fdb fix: untrack in NodeRef::on_load() to avoid re-triggering it if you read something reactively (closes #3684) (#3686) 2025-03-07 12:07:46 -05:00
Evan Almloff
fee4bccb32 Create post type aliases for encodings 2025-03-07 08:40:08 -06:00
mahdi739
4ba9f67440 feat: implement IntoClass for store fields (#3670)
* Implement `IntoClass` for store fields

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-07 08:22:59 -05:00
Saber Haj Rabiee
2242ad1847 fix: semver and feature handy script for update nightly (#3674) 2025-03-07 08:21:21 -05:00
Greg Johnston
131b18bddb Merge pull request #3677 from sabify/fix-enum-stack
fix: enum stack size
2025-03-07 08:20:20 -05:00
Greg Johnston
5e9d6e2dfd fix: point bind:group to correct location (closes #3678) (#3680) 2025-03-07 08:04:53 -05:00
Saber Haj Rabiee
d76e5bb4ea fix: moved value 2025-03-05 21:21:29 -08:00
Saber Haj Rabiee
f752e32ae3 fix: clippy on large enum variant (https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant) 2025-03-05 21:10:30 -08:00
Saber Haj Rabiee
a9197102a6 fix: clippy warning on match usage 2025-03-05 21:08:10 -08:00
Saber Haj Rabiee
58f1bf95e1 fix: clippy clone_on_copy (https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy) 2025-03-05 21:07:37 -08:00
autofix-ci[bot]
d84ab6d9bf [autofix.ci] apply automated fixes (attempt 2/3) 2025-03-05 16:23:48 +00:00
autofix-ci[bot]
f069d4478e [autofix.ci] apply automated fixes 2025-03-05 15:20:59 +00:00
Evan Almloff
65b5d55d62 deny missing docs 2025-03-05 09:01:22 -06:00
Evan Almloff
860ad7a221 return an error when the sever doesn't support spawning tasks 2025-03-05 09:00:26 -06:00
Evan Almloff
901e038aa0 update form integration 2025-03-05 08:53:54 -06:00
Evan Almloff
f49f0965bc remove default actix feature 2025-03-05 08:51:31 -06:00
Evan Almloff
bb62d08d3f implement actix integration 2025-03-05 08:47:06 -06:00
Greg Johnston
bfe04593fd Merge pull request #3658 from mahdi739/impl-several-into-traits-for-store-fields-0.8
Implement several into traits for store fields (0.8)
2025-03-04 08:54:02 -05:00
Greg Johnston
38a3aae28e Merge branch 'main' into immediate-effect 2025-03-03 21:02:43 -05:00
martin frances
5eaaff045f chore(clippy): replace mem::replace with Option::replace (#3668) 2025-03-03 18:01:19 -05:00
autofix-ci[bot]
5b484eaec4 [autofix.ci] apply automated fixes (attempt 3/3) 2025-03-03 22:02:22 +00:00
autofix-ci[bot]
e9384e3286 [autofix.ci] apply automated fixes 2025-03-03 21:42:06 +00:00
autofix-ci[bot]
5149ad54db [autofix.ci] apply automated fixes (attempt 2/3) 2025-03-03 21:36:44 +00:00
autofix-ci[bot]
4d9ec54ad1 [autofix.ci] apply automated fixes 2025-03-03 21:22:46 +00:00
Evan Almloff
a1cd7ae9a1 implement reqwest websocket integration 2025-03-03 14:58:37 -06:00
autofix-ci[bot]
083f9c663f [autofix.ci] apply automated fixes 2025-03-03 14:02:22 +00:00
Greg Johnston
63c9549120 fix: ensure cleanups run for all replaced nested routes (closes #3665) (#3666) 2025-03-03 08:19:05 -05:00
Greg Johnston
6232f6482a fix: param segments should not match an empty string that contains only / separator (closes #3527) (#3662) 2025-03-01 12:05:17 -05:00
Greg Johnston
825e89f25c fix: do not double-insert hash character in URLs (closes #3647) (#3661) 2025-03-01 12:05:05 -05:00
Greg Johnston
3dbb251853 fix: tweak bounds on For for backwards-compat (#3663) 2025-03-01 11:50:09 -05:00
zakstucke
98e00fcb3b Erased mode in CI (#3640)
* Erased mode in CI

* Trigger CI

* Rename dev_mode erased_mode plus add to more matrices

* nested routes in separate component fix

* Fix lint

* Small fixes

* Fixes

* proc-macro rustflags cross-compilation workaround with internal erasure feature for leptos_macro

* Re-trigger CI

* fix unrelated doc CI and remove unneeded IntoAttribute trait

* Fix StaticVec rebuild() fn

* Conflict fixes

* Maybe fix

* Bump example toolchain
2025-03-01 07:43:13 -08:00
martin frances
5da4c438d9 chore: examples/server_fns_axum - Bumped various packages (not axum). (#3655)
tower-http
tower
thiserror
strum
notify

axum has breaking changes and so will addressed in a separate PR.
2025-02-28 14:30:03 -05:00
mahdi739
80ed74c075 chore: implement Debug for ArcField and Field (#3660) 2025-02-28 14:29:35 -05:00
Greg Johnston
cdee2a9476 feat: "islands router" for client-side navigations when in islands mode (#3502) 2025-02-28 14:01:33 -05:00
autofix-ci[bot]
c97ab9a72c [autofix.ci] apply automated fixes 2025-02-28 15:27:34 +00:00
Evan Almloff
4fc8972f2b make the into websocket function async 2025-02-28 09:26:37 -06:00
QuartzLibrary
79e9340a9b refactor: improve naming and docs after changes 2025-02-27 23:26:36 +00:00
QuartzLibrary
41d01cedb2 fix: parallel execution in ImmediateEffect 2025-02-27 23:10:08 +00:00
Evan Almloff
b800c009c7 Integrate the websocket protocol with the server function macro 2025-02-27 16:31:06 -06:00
QuartzLibrary
374a020d84 feat: do not store user state in ImmediateEffect 2025-02-27 22:17:06 +00:00
QuartzLibrary
83fcf8663c feat: make ImmediateEffect more robust
The goal here is to make the behavior under recursion better defined.
2025-02-27 22:12:55 +00:00
Greg Johnston
e7a73595de chore: remove unnecessary Debug bound 2025-02-27 17:00:00 -05:00
autofix-ci[bot]
a9a988e0e1 [autofix.ci] apply automated fixes 2025-02-27 14:46:56 +00:00
Mahdi
db10d961df Implement Render, RenderHtml, AttributeValue for store fields 2025-02-27 17:44:07 +03:30
Mahdi
fb608158cb Implement IntoSplitSignal for AtKeyed, AtIndex and DerefedField 2025-02-27 17:16:51 +03:30
Mahdi
1a472ebad1 Implement InnerHtmlValue for store fields 2025-02-27 17:09:34 +03:30
Mahdi
2d1b66a5c6 Implement IntoProperty for store fields 2025-02-27 17:00:33 +03:30
Mahdi
c524b0aefc rename style_store_field macro to style_reactive 2025-02-27 16:55:37 +03:30
Mahdi
e4c977911c Implement IntoStyle and IntoStyleValue for store fields 2025-02-27 16:41:53 +03:30
autofix-ci[bot]
f488d4b5b7 [autofix.ci] apply automated fixes 2025-02-26 19:58:25 +00:00
Evan Almloff
d4cfd0e2cb Move content type to a separate trait 2025-02-26 13:56:59 -06:00
autofix-ci[bot]
a4b0d3408c [autofix.ci] apply automated fixes 2025-02-26 15:44:01 +00:00
Evan Almloff
2037bf12cb Merge branch 'leptos_0.8' into websockets 2025-02-26 09:40:58 -06:00
Evan Almloff
2747a496fc fix formatting 2025-02-26 09:40:22 -06:00
Evan Almloff
c286812116 move the server request and response into a separate trait 2025-02-26 09:36:02 -06:00
Greg Johnston
1e0a9ef189 fix: avoid hydration issues with HashedStylesheet (closes #3633) (#3654) 2025-02-26 09:18:23 -05:00
TERRORW0LF
1363b941bc feat: .map() and .and_then() for OnceResource and LocalResource (#3652) 2025-02-26 09:16:50 -05:00
Evan Almloff
7479010f84 unified http protocol for non-websocket sever functions 2025-02-25 16:20:33 -06:00
QuartzLibrary
f7a1a2cab2 feat: introduce ImmediateEffect 2025-02-25 21:45:28 +00:00
QuartzLibrary
92b82688a6 fix: relax bounds on OrPoisoned blanket impls 2025-02-25 20:59:47 +00:00
Evan Almloff
9b9983af79 expose encoding types 2025-02-25 08:36:04 -06:00
Greg Johnston
04e79a0dc4 chore: clean up fetch example a bit 2025-02-25 08:06:47 -05:00
Greg Johnston
f64951126e chore: merge issues 2025-02-25 07:42:39 -05:00
Greg Johnston
0a29071779 Merge remote-tracking branch 'origin' into leptos_0.8 2025-02-25 07:39:43 -05:00
Greg Johnston
efcb6f6d21 feat: support IntoSplitSignal for (Signal<T>, SignalSetter<T>) (closes #3634) (#3643) 2025-02-25 07:32:37 -05:00
Greg Johnston
42988b1bc1 chore: fix Axum test setup (#3651) 2025-02-25 07:22:12 -05:00
Evan Almloff
6904eec207 remove into/from request/response bounds on server fn 2025-02-24 13:05:37 -06:00
Evan Almloff
7eb8ca702d switch most encodings into the new system 2025-02-24 12:00:02 -06:00
QuartzLibrary
c75397ea75 chore: small refactor 2025-02-23 17:27:40 +00:00
Greg Johnston
848fd724dd Merge pull request #3644 from leptos-rs/nightly-ci-update 2025-02-22 15:19:44 -05:00
Greg Johnston
5bc254d49f chore: better way of not running whole doc tests 2025-02-22 14:29:25 -05:00
Greg Johnston
885f4a1654 chore: ignore type complexity lint 2025-02-22 08:39:00 -05:00
Greg Johnston
ddd243d07a chore: better way of not running whole doc tests 2025-02-22 08:38:39 -05:00
Greg Johnston
362c300eac chore: clippy doc comment indentation 2025-02-22 08:28:26 -05:00
Greg Johnston
284a724e5f chore(ci): update pinned nightly version 2025-02-22 07:35:09 -05:00
Evan Almloff
1a7b40b507 implement gloo websockets 2025-02-21 15:48:41 -06:00
Evan Almloff
73dd677843 switch to async fn for get implementation 2025-02-20 17:02:19 -06:00
Evan Almloff
131f414fdc move run client into the protocol trait 2025-02-20 17:01:51 -06:00
Evan Almloff
c3ed874d4d Create websocket protocol trait 2025-02-19 14:49:57 -06:00
benwis
f003e50446 Update throw_error to v0.3 2025-02-19 08:08:21 -08:00
Greg Johnston
ea29685c92 change: remove unused Result alias (#3543) 2025-02-19 07:22:20 -08:00
Greg Johnston
6ecc681cdd fix: allow decoding already-decoded URI components (closes #3606) (#3628)
* fix: allow decoding already-decoded URI components (closes #3606)

* clippy
2025-02-19 06:04:18 -08:00
zakstucke
49e44a2ec2 Erased routing, codegen opts (#3623) 2025-02-18 12:39:30 -08:00
Greg Johnston
7c34b4a4a5 fix: only render meta tags when rendered, not when created (closes #3629) (#3630) 2025-02-18 09:06:51 -05:00
Greg Johnston
7157958822 feat: support Option<_> in style: (closes #3568) (#3618) 2025-02-15 16:47:21 -05:00
martin frances
37cf25fba5 serde_json is common to (#3610)
integrations/actix
leptos/server
oco
server_fn

This is a defensive PR - Putting the crate definition into the root
workspcace makes it less likely to get difficult to trace version
slip bugs.

This does not help where sede_json is optional so care manual review
is required.
2025-02-15 10:24:07 -08:00
Greg Johnston
f975b8d33b fix: hydration of () (#3615) 2025-02-15 13:23:09 -05:00
zakstucke
d37450d12f Internally erase html elements (#3614) 2025-02-15 09:58:43 -08:00
Greg Johnston
4804dac32d chore: update either_of minimum version in workspace (#3612) 2025-02-15 08:19:05 -05:00
martin frances
a9f27d6128 chore: update syntax in README example (#3611) 2025-02-15 08:18:48 -05:00
Greg Johnston
04cb036a7d fix: reorder pause check in new_isomorphic (#3613) 2025-02-15 08:18:23 -05:00
jasper
1d3784ed7b feat: impl Into<Signal> for store subfields (#3579) 2025-02-14 17:14:49 -05:00
Greg Johnston
8cc1a34c00 feat: allow pausing and resuming effects (#3599) 2025-02-14 14:48:27 -05:00
mahdi739
68f4d46c5f feat: add invert to OptionStoreExt (#3534) 2025-02-14 13:52:38 -05:00
martin frances
590728e47e projects/bevy3d_ui: Bevy - Bugfix, clippy and crate bump (#3603)
The bugfix is related to access to a signal

"
bevy3d_ui-b20a0a6a298e7144.js:2637 At src/routes/demo1.rs:24:23, you access a
reactive_graph::signal::read::ReadSignal<bevy3d_ui::demos::bevydemo1::scene::Scene>
(defined at src/routes/demo1.rs:19:39) outside a reactive tracking context.
This might mean your app is not responding to changes in signal values in the way you expect.
"

The solution is to use .get_untracked() inside an "effect" block.

Lots of small clippy fixes.

Also here are the crates that have been bumped

-wasm-bindgen = "0.2.92"
-wasm-bindgen-test = "0.3.42"
-web-sys = "0.3.69"
+wasm-bindgen = "0.2.100"
+wasm-bindgen-test = "0.3.50"
+web-sys = "0.3.77"
2025-02-13 15:37:23 -08:00
martin frances
e84b527743 Minor: Bump tokio to 1.43. (#3600) 2025-02-12 23:14:00 -08:00
martin frances
96b125d54f Remove getrandom (#3589)
* Resolved this warning see while running cargo outdated

warning: Feature js of package getrandom has been obsolete in version 0.3.1

Now using the feature "wasm_js"

* the crate "getrandom" needs special configuration.

* getrandom_backend - a more generic config.

* Removed the crate getrandom
2025-02-12 23:13:27 -08:00
martin frances
16d66362f8 Minor: "wasm-bindgen" - Moved the crate definition up to the root workspace (#3588)
* Minor: "wasm-bindgen" - Moved the crate definition up to the root workspace

This synchronizes the version number amongst all sub-projects.
[Where the definition is "optional" manual adjustment is still required]

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-12 12:25:22 -08:00
martin frances
e27801a2c2 Minor: Bumped version of convert_case to 0.7 (#3590) 2025-02-12 12:17:36 -08:00
martin frances
b81f71997b Minor: Bump itertools to "0.14.0" (#3593)
The crate is used by "leptos_macro","reactive_stores" and "tachys"

So the definition of itertools can be centralized up into the root workspace
2025-02-12 12:16:47 -08:00
martin frances
2a11325749 Minor: leptos_config - Bump the "config" crate to version 0.15.8 (#3594) 2025-02-12 12:15:57 -08:00
martin frances
5604f3e979 projects/bevy3d_ui: Bevy migration (#3597)
-bevy = "0.14.1"
+bevy = "0.15.2"

<https://bevyengine.org/learn/migration-guides/0-14-to-0-15/>
2025-02-12 12:14:33 -08:00
martin frances
3a9a0891a3 projects/bevy3d_ui Migrate to leptos 0.7.7 (#3596)
* projects/bevy3d_ui Migrate to leptos 0.7.7

* Minor: projects/bevy3d_ui - Better Meta.
2025-02-12 12:13:32 -08:00
Greg Johnston
a39add50c0 fix: occasional use-after-disposed panic in Suspense (#3595) 2025-02-12 14:59:44 -05:00
Greg Johnston
2a2675dd36 fix: remove extra placeholder in Vec of text nodes (closes #3583) (#3592) 2025-02-12 10:45:56 -05:00
zakstucke
6ad300c592 Binary size wins (#3566)
* Random binary size opts

* [autofix.ci] apply automated fixes

* Stop autofixer removing an import

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-10 15:18:26 -08:00
zakstucke
b4e683d969 RenderHtml::into_owned (#3580) 2025-02-10 12:53:33 -08:00
Greg Johnston
c2289b23a7 fix: Actix stream error handling with 0.8 error types (#3574) 2025-02-10 08:32:44 -05:00
Greg Johnston
299acd25f3 implement AddAnyAttr for AnyView (#3562) 2025-02-09 20:46:41 -05:00
zakstucke
287fc47163 "Update axum paths to 0.8 syntax" (#3555)
* Update axum paths to 0.8 syntax

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-06 16:17:12 -08:00
zakstucke
8f74a6d8a0 AddAnyAttr static (#3553) 2025-02-06 14:00:25 -08:00
starmaker
597175a54b Fixing closing brace (#3539)
Most likely confglict merge artefact
2025-02-01 09:40:03 -08:00
Chris
ede25b9e3d fix: remove Default impl for LeptosOptions and ConfFile (#3522)
* fix: remove `Default` impl for `LeptosOptions` and `ConfFile`

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-01 09:41:44 -05:00
Greg Johnston
8f636e354a change: allow IntoFuture for Suspend::new() (closes #3509) (#3532) 2025-01-31 14:25:35 -05:00
Greg Johnston
7da64f22c4 Merge branch 'main' into leptos_0.8 2025-01-30 21:32:58 -05:00
Greg Johnston
0073ae7d8a chore: update version numbers preparing for 0.8.0-alpha 2025-01-30 21:29:54 -05:00
benwis
8465716a19 Fix formatting 2025-01-26 09:51:22 -08:00
zakstucke
0e24b2e63f AddAnyAttr working with erase_components (#3518)
* AddAnyAttr working with erase_components

* CI fixes
2025-01-26 09:51:22 -08:00
Danik Vitek
c64d205984 feat (either_of): Extent API; Implement other iterator methods; Update deps (#3478)
* Implement other iterator methods. Update deps

* Formatting

* Update Cargo.lock

* [autofix.ci] apply automated fixes

* Formatting

* Move `Either` declaration into the `tuples` macro

* Comment out non-MSRV-compliant methods

* [autofix.ci] apply automated fixes

* Formatting

* Implement mapping functions

* Fix clippy warnings

* Impl `Error`; Impl `From<Result<A, B>> for Either<B, A>`

* Fix `Error` impl

* Move `Error` impl under `#[cfg(not(feature="no_std"))] until MSRV >= 1.81

* [autofix.ci] apply automated fixes

* Make `From<Result>` compliant with `EitherOr`. Add `impl EitherOr for Either`

* fix: use fully-qualified name

* fix: `EitherOf` test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-26 09:51:22 -08:00
Greg Johnston
f17cb98eb0 chore: update workspace dependency versions to latest (#3506) 2025-01-26 09:51:22 -08:00
Danik Vitek
30f3e82664 docs: Fix README.md & Add MSRV badge (#3480)
* Fix README.md

* Add MSRV badge

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-26 09:51:22 -08:00
starmaker
152d5a5c92 issue-3467 - bumping codee version to support rkyv 8 (#3504)
* issue-3467 - bumping codee version to support rkyv 8

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-26 09:51:22 -08:00
Sam Jude
669e1ba7fa hexagonal architecture (#3342)
Co-authored-by: Sam <@>
2025-01-26 09:51:22 -08:00
dcsturman
2ad6a086f9 Enhanced docs for reactive_stores (#3508)
Added docs on shadow traits, Option, Enum, Vec, and Box usage with Store.
2025-01-26 09:51:22 -08:00
Greg Johnston
32e58d6b66 fix: including node_ref after {..} on arbitrary components (#3503) 2025-01-26 09:51:22 -08:00
Greg Johnston
a107443104 chore(ci): add CI for leptos_0.8 branch (#3500) 2025-01-26 09:51:22 -08:00
Greg Johnston
c859b07901 feat: #[lazy] macros to support lazy loading and code splitting (#3477) 2025-01-26 09:51:22 -08:00
Greg Johnston
a9868bea2b chore: restore reactivity warning at top level of components (closes #3354) (#3499) 2025-01-26 09:51:22 -08:00
Greg Johnston
7183c2b993 fix: correctly handle ErrorBoundary through reactive views (closes #3487) (#3492) 2025-01-26 09:51:22 -08:00
Greg Johnston
7a03621db1 feat: implement unboxing support for recursive store nodes (closes #3491) (#3493) 2025-01-26 09:51:22 -08:00
Spencer Ferris
2b589fa61f feat: Add more options for generating server fn routes (#3438)
* feat: Allow disabling server fn hash and customizing the default prefix

Allow configuring the default prefix for server function API routes. This is useful to
override the default prefix (`/api`) for all server functions without needing to manually
specify via `#[server(prefix = "...")]` on every server function.

Also, allow disabling appending the server functions' hashes to the end of their API names.
This is useful when an app's client side needs a stable server API. For example, shipping
the CSR WASM binary in a Tauri app. Tauri app releases are dependent on each platform's
distribution method (e.g., the Apple App Store or the Google Play Store), which typically
are much slower than the frequency at which a website can be updated. In addition, it's
common for users to not have the latest app version installed. In these cases, the CSR WASM
app would need to be able to continue calling the backend server function API, so the API
path needs to be consistent and not have a hash appended.

* Mark public structs as `#[non_exhaustive]` and add doc comments

* Minor refactor to pull the fn hash logic out of the `path` statement

* feat: Use module path in prefix for server fn API route

Allow including the module path of the server function in the API route. This
is an alternative strategy to prevent duplicate server function API routes
(the default strategy is to add a hash to the end of the route). Each element
of the module path will be separated by a `/`. For example, a server function
with a fully qualified name of `parent:🧒:server_fn` would have an API
route of `/api/parent/child/server_fn` (possibly with a different prefix and
a hash suffix depending on the values of the other server fn configs).

* Fix `enable_hash` if statement

* Add missing import
2025-01-24 20:11:38 -08:00
Saber Haj Rabiee
35e6f17930 chore: upgrade axum to v0.8 (#3439) 2025-01-17 13:38:37 -05:00
Greg Johnston
d1513a4a0b feat(breaking): allow make PossibleRouteMatch dyn-safe (#3421) 2025-01-17 13:33:00 -05:00
Mario Carbajal
aa27b9e474 feat: impl Dispose for Callback types and add try_run to the Callable trait (#3371)
* impl Dispose for Callback types and add try_run to the Callable trait

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-17 13:32:04 -05:00
Ryo Hirayama
cfe925d58f feat: allow any type that implements FromServerFnError as a replacement of the ServerFnError in server_fn (#3274) 2025-01-17 13:30:12 -05:00
588 changed files with 32545 additions and 10324 deletions

View File

@@ -29,11 +29,15 @@ Steps to reproduce the behavior:
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Next Steps**
- [ ] I will make a PR
- [ ] I would like to make a PR, but need help getting started
- [ ] I want someone else to take the time to fix this
- [ ] This is a low priority for me and is just shared for your information
**Additional context**
Add any other context about the problem here.

19
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Grouping all dependencies in one PR weekly
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 1
allow:
- dependency-type: "all"
groups:
rust-dependencies:
patterns:
- "*"

View File

@@ -17,38 +17,23 @@ env:
jobs:
autofix:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: {toolchain: nightly, components: "rustfmt, clippy", target: "wasm32-unknown-unknown", rustflags: ""}
with: {toolchain: "nightly-2025-07-16", components: "rustfmt, clippy", target: "wasm32-unknown-unknown", rustflags: ""}
- name: Install Glib
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev
- name: Install cargo-all-features
run: cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
- name: Install jq
run: sudo apt-get install jq
- run: |
echo "Formatting the workspace"
cargo fmt --all
echo "Running Clippy against each member's features (default features included)"
for member in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | .name'); do
echo "Working on member $member":
echo -e "\tdefault-features/no-features:"
# this will also run on members with no features or default features
cargo clippy --allow-dirty --fix --lib --package "$member"
features=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.name == \"$member\") | .features | keys[]")
for feature in $features; do
if [ "$feature" = "default" ]; then
continue
fi
echo -e "\tfeature $feature"
cargo clippy --allow-dirty --fix --lib --package "$member" --features "$feature"
done
done
- uses: autofix-ci/action@v1.3.1
- name: Format the workspace
run: cargo fmt --all
- name: Clippy the workspace
run: cargo all-features clippy --allow-dirty --fix --lib --no-deps
- uses: autofix-ci/action@v1.3.2
if: ${{ always() }}
with:
fail-fast: false

View File

@@ -1,32 +0,0 @@
name: CI Changed Examples
on:
push:
branches:
- main
- leptos_0.6
- leptos_0.8
pull_request:
branches:
- main
- leptos_0.6
- leptos_0.8
jobs:
get-example-changed:
uses: ./.github/workflows/get-example-changed.yml
get-matrix:
needs: [get-example-changed]
uses: ./.github/workflows/get-changed-examples-matrix.yml
with:
example_changed: ${{ fromJSON(needs.get-example-changed.outputs.example_changed) }}
test:
name: CI
needs: [get-example-changed, get-matrix]
if: needs.get-example-changed.outputs.example_changed == 'true'
strategy:
matrix: ${{ fromJSON(needs.get-matrix.outputs.matrix) }}
fail-fast: false
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: stable

View File

@@ -1,29 +0,0 @@
name: CI Examples
on:
push:
branches:
- main
- leptos_0.6
- leptos_0.8
pull_request:
branches:
- main
- leptos_0.6
- leptos_0.8
jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml
get-examples-matrix:
uses: ./.github/workflows/get-examples-matrix.yml
test:
name: CI
needs: [get-leptos-changed, get-examples-matrix]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
strategy:
matrix: ${{ fromJSON(needs.get-examples-matrix.outputs.matrix) }}
fail-fast: false
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: stable

View File

@@ -1,33 +0,0 @@
name: CI semver
on:
push:
branches:
- main
- leptos_0.6
- leptos_0.8
pull_request:
branches:
- main
- leptos_0.6
- leptos_0.8
env:
DEBIAN_FRONTEND: noninteractive
jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml
test:
needs: [get-leptos-changed]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true' && github.event.pull_request.labels[0].name != 'breaking'
name: Run semver check (nightly-2024-08-01)
runs-on: ubuntu-latest
steps:
- name: Install Glib
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev
- name: Checkout
uses: actions/checkout@v4
- name: Semver Checks
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
rust-toolchain: nightly-2024-08-01

View File

@@ -10,13 +10,20 @@ on:
- main
- leptos_0.6
- leptos_0.8
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-leptos-changed:
uses: ./.github/workflows/get-leptos-changed.yml
get-leptos-matrix:
uses: ./.github/workflows/get-leptos-matrix.yml
test:
name: CI
get-example-changed:
uses: ./.github/workflows/get-example-changed.yml
get-examples-matrix:
uses: ./.github/workflows/get-examples-matrix.yml
test-members:
name: CI (members)
needs: [get-leptos-changed, get-leptos-matrix]
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
strategy:
@@ -25,5 +32,37 @@ jobs:
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
cargo_make_task: "ci"
toolchain: nightly-2024-08-01
test-examples:
name: CI (examples)
needs: [test-members, get-examples-matrix]
if: ${{ success() }}
strategy:
matrix: ${{ fromJSON(needs.get-examples-matrix.outputs.matrix) }}
fail-fast: false
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
test-only-examples:
name: CI (examples)
needs: [get-leptos-changed, get-example-changed]
if: needs.get-leptos-changed.outputs.leptos_changed != 'true' && needs.get-example-changed.outputs.example_changed == 'true'
strategy:
matrix: ${{ fromJSON(needs.get-example-changed.outputs.matrix) }}
fail-fast: false
uses: ./.github/workflows/run-cargo-make-task.yml
with:
directory: ${{ matrix.directory }}
semver-check:
name: SemVer check (stable)
needs: [get-leptos-changed, test-members, test-examples]
if: ${{ success() && needs.get-leptos-changed.outputs.leptos_changed == 'true' && !contains(github.event.pull_request.labels.*.name, 'breaking') }}
runs-on: ubuntu-latest
steps:
- name: Install Glib
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev
- name: Checkout
uses: actions/checkout@v6
- name: Semver Checks
uses: obi1kenobi/cargo-semver-checks-action@v2

View File

@@ -1,54 +0,0 @@
name: Changed Examples Matrix Call
on:
workflow_call:
inputs:
example_changed:
description: "Example Changed"
required: true
type: boolean
outputs:
matrix:
description: "Matrix"
value: ${{ jobs.get-example-changed.outputs.matrix }}
jobs:
get-example-changed:
name: Get Changed Example Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get example project directories that changed
id: changed-dirs
uses: tj-actions/changed-files@v45
with:
dir_names: true
dir_names_max_depth: "2"
files: |
examples/**
!examples/cargo-make/**
!examples/gtk/**
!examples/Makefile.toml
!examples/*.md
json: true
quotepath: false
- name: List example project directories that changed
run: echo '${{ steps.changed-dirs.outputs.all_changed_files }}'
- name: Set Matrix
id: set-matrix
run: |
if [ ${{ inputs.example_changed }} == 'true' ]; then
# Create matrix with changed directories
echo "matrix={\"directory\":${{ steps.changed-dirs.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
else
# Create matrix with one item to prevent an empty vector error
echo "matrix={\"directory\":[\"NO_CHANGE\"]}" >> "$GITHUB_OUTPUT"
fi

View File

@@ -5,20 +5,26 @@ on:
example_changed:
description: "Example Changed"
value: ${{ jobs.get-example-changed.outputs.example_changed }}
# This is for test-only-examples workflow in ci.yml
matrix:
description: "Example Changed Directories"
value: ${{ jobs.get-example-changed.outputs.matrix }}
jobs:
get-example-changed:
name: Get Example Changed
runs-on: ubuntu-latest
outputs:
example_changed: ${{ steps.set-example-changed.outputs.example_changed }}
# This is for test-only-examples workflow in ci.yml
matrix: ${{ steps.set-example-changed.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get example files that changed
id: changed-files
uses: tj-actions/changed-files@v45
uses: tj-actions/changed-files@v47
with:
files: |
examples/**
@@ -27,7 +33,11 @@ jobs:
!examples/*.md
- name: List example files that changed
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
- name: Install jq
run: sudo apt-get install jq
- name: Set example_changed
id: set-example-changed
run: |
echo "example_changed=${{ steps.changed-files.outputs.any_changed }}" >> "$GITHUB_OUTPUT"
# This is for test-only-examples workflow in ci.yml
echo "matrix={\"directory\": $(echo '${{ steps.changed-files.outputs.all_changed_files }}' | tr ' ' '\n' | awk -F'/' '{print $1 "/" $2}'| sort -u | jq -R -s -c 'split("\n") | .[:-1]')}" >> "$GITHUB_OUTPUT"

View File

@@ -17,7 +17,7 @@ jobs:
EXCLUDED_EXAMPLES: cargo-make
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install jq
run: sudo apt-get install jq
- name: Set Matrix

View File

@@ -13,12 +13,12 @@ jobs:
leptos_changed: ${{ steps.set-source-changed.outputs.leptos_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get source files that changed
id: changed-source
uses: tj-actions/changed-files@v45
uses: tj-actions/changed-files@v47
with:
files_ignore: |
.*/**/*

View File

@@ -13,7 +13,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Install jq
run: sudo apt-get install jq
- name: Set Matrix

View File

@@ -12,7 +12,7 @@ jobs:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install mdbook

View File

@@ -5,20 +5,21 @@ on:
directory:
required: true
type: string
cargo_make_task:
required: true
type: string
toolchain:
required: true
type: string
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
DEBIAN_FRONTEND: noninteractive
RUSTFLAGS: ${{ inputs.erased_mode && '--cfg erase_components' || '' }}
LEPTOS_TAILWIND_VERSION: v4.0.14
LEPTOS_SASS_VERSION: 1.86.0
jobs:
test:
name: Run ${{ inputs.cargo_make_task }} (${{ inputs.toolchain }})
name: "Run (${{ matrix.toolchain }}) (erased_mode: ${{ matrix.erased_mode && 'enabled' || 'disabled' }})"
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, nightly-2025-07-16]
erased_mode: [true, false]
steps:
- name: Free Disk Space
run: |
@@ -26,11 +27,25 @@ jobs:
df -h
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android/sdk/ndk
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo apt-get clean
sudo rm -rf /usr/local/lib/node_modules
# following lines currenly not needed as it takes too much time
# the new isolated CI doesn't need much space to test libraries
#
# uncommet only if nneded
#
# sudo apt-get clean
# sudo apt-get purge -y '^ghc-.*' '^dotnet-.*' '^llvm-.*' '^mono-.*' '^php.*' '^ruby.*'
# sudo apt-get autoremove -y
# sudo apt-get clean
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# docker system prune -af
# docker image prune -af
# docker volume prune -f
echo "Disk space after cleanup:"
df -h
# Setup environment
@@ -38,45 +53,58 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.toolchain }}
- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
- name: Setup cargo-make
uses: davidB/rust-cargo-make@v1
- name: Cargo generate-lockfile
run: cargo generate-lockfile
- uses: Swatinem/rust-cache@v2
toolchain: ${{ matrix.toolchain }}
targets: wasm32-unknown-unknown
components: clippy,rustfmt
- name: Install binstall
uses: cargo-bins/cargo-binstall@main
- name: Install wasm-bindgen
run: cargo binstall wasm-bindgen-cli --no-confirm
- name: Install cargo-leptos
run: cargo binstall cargo-leptos --locked --no-confirm
- name: Install cargo-make
run: cargo binstall cargo-make --no-confirm
- name: Install nextest
run: cargo binstall cargo-nextest --no-confirm
- name: Install cargo-all-features
run: cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
# Part of direct-minimal-versions check
- name: Install cargo-hack
if: contains(matrix.toolchain, 'nightly')
uses: taiki-e/install-action@cargo-hack
# Part of direct-minimal-versions check
- name: Install cargo-minimal-versions
if: contains(matrix.toolchain, 'nightly')
uses: taiki-e/install-action@cargo-minimal-versions
- name: Install Trunk
uses: jetli/trunk-action@v0.5.0
with:
version: "latest"
if: contains(inputs.directory, 'examples')
run: cargo binstall trunk --no-confirm
- name: Print Trunk Version
if: contains(inputs.directory, 'examples')
run: trunk --version
- name: Install Node.js
uses: actions/setup-node@v4
if: contains(inputs.directory, 'examples')
uses: actions/setup-node@v6
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
if: contains(inputs.directory, 'examples')
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
if: contains(inputs.directory, 'examples')
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
if: contains(inputs.directory, 'examples')
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
@@ -84,8 +112,9 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Maybe install chromedriver
if: contains(inputs.directory, 'examples')
run: |
project_makefile=${{inputs.directory}}/Makefile.toml
project_makefile='${{inputs.directory}}/Makefile.toml'
webdriver_count=$(cat $project_makefile | grep "cargo-make/webdriver.toml" | wc -l)
if [ $webdriver_count -eq 1 ]; then
if ! command -v chromedriver &>/dev/null; then
@@ -99,8 +128,9 @@ jobs:
echo chromedriver is not required
fi
- name: Maybe install playwright browser dependencies
if: contains(inputs.directory, 'examples')
run: |
for pw_path in $(find ${{inputs.directory}} -name playwright.config.ts)
for pw_path in $(find '${{inputs.directory}}' -name playwright.config.ts)
do
pw_dir=$(dirname $pw_path)
if [ ! -v $pw_dir ]; then
@@ -112,17 +142,47 @@ jobs:
fi
done
- name: Install Deno
if: contains(inputs.directory, 'examples')
uses: denoland/setup-deno@v2
with:
deno-version: v1.x
- name: Maybe install gtk-rs dependencies
if: contains(inputs.directory, 'gtk')
run: |
if [ ! -z $(echo ${{inputs.directory}} | grep gtk) ]; then
sudo apt-get update
sudo apt-get install -y libglib2.0-dev libgio2.0-cil-dev libgraphene-1.0-dev libcairo2-dev libpango1.0-dev libgtk-4-dev
fi
sudo apt-get install -y libglib2.0-dev libgio2.0-cil-dev libgraphene-1.0-dev libcairo2-dev libpango1.0-dev libgtk-4-dev
- name: Install Tailwind and Sass dependencies
if: contains(inputs.directory, 'examples')
run: |
cd '${{ inputs.directory }}'
tailwindcss_version=$(echo "$LEPTOS_TAILWIND_VERSION" | sed 's/^v//')
sass_version="$LEPTOS_SASS_VERSION"
pnpm add "tailwindcss@$tailwindcss_version" "@tailwindcss/cli@$tailwindcss_version" "sass@$sass_version"
echo "Tailwind CSS version:"
./node_modules/.bin/tailwindcss --version
echo "Sass version:"
./node_modules/.bin/sass --version
# Run Cargo Make Task
- name: ${{ inputs.cargo_make_task }}
run: |
cd ${{ inputs.directory }}
cargo make --profile=github-actions ${{ inputs.cargo_make_task }}
cd '${{ inputs.directory }}'
cargo make --no-workspace --profile=github-actions ci
# check the direct-minimal-versions on release
COMMIT_MSG=$(git log -1 --pretty=format:'%s')
# Supports: v1.2.3, v1.2.3-alpha, v1.2.3-beta1, v1.2.3-rc.1, etc.
if [[ "$COMMIT_MSG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+(\.?[0-9]+)?)?$ ]]; then
cargo make --no-workspace --profile=github-actions check-minimal-versions
fi
# Check if the counter_isomorphic can be built with leptos_debuginfo cfg flag in release mode
- name: ${{ inputs.cargo_make_task }} with --cfg=leptos_debuginfo
if: contains(inputs.directory, 'counter_isomorphic')
run: |
cd '${{ inputs.directory }}'
RUSTFLAGS="$RUSTFLAGS --cfg leptos_debuginfo" cargo leptos build --release
- name: Clean up ${{ inputs.directory }}
if: always()
run: |
cd '${{ inputs.directory }}'
cargo clean || true
rm -rf node_modules || true

2203
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,6 @@
resolver = "2"
members = [
# utilities
"oco",
"any_spawner",
"const_str_slice_concat",
"either_of",
@@ -40,36 +39,139 @@ members = [
exclude = ["benchmarks", "examples", "projects"]
[workspace.package]
version = "0.7.7"
edition = "2021"
rust-version = "1.76"
rust-version = "1.88"
[workspace.dependencies]
throw_error = { path = "./any_error/", version = "0.2.0" }
any_spawner = { path = "./any_spawner/", version = "0.2.0" }
# members
throw_error = { path = "./any_error/", version = "0.3.1" }
any_spawner = { path = "./any_spawner/", version = "0.3.0" }
const_str_slice_concat = { path = "./const_str_slice_concat", version = "0.1" }
either_of = { path = "./either_of/", version = "0.1.0" }
hydration_context = { path = "./hydration_context", version = "0.2.0" }
leptos = { path = "./leptos", version = "0.7.7" }
leptos_config = { path = "./leptos_config", version = "0.7.7" }
leptos_dom = { path = "./leptos_dom", version = "0.7.7" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.7.7" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.7.7" }
leptos_macro = { path = "./leptos_macro", version = "0.7.7" }
leptos_router = { path = "./router", version = "0.7.7" }
leptos_router_macro = { path = "./router_macro", version = "0.7.7" }
leptos_server = { path = "./leptos_server", version = "0.7.7" }
leptos_meta = { path = "./meta", version = "0.7.7" }
either_of = { path = "./either_of/", version = "0.1.6" }
hydration_context = { path = "./hydration_context", version = "0.3.0" }
leptos = { path = "./leptos", version = "0.8.14" }
leptos_config = { path = "./leptos_config", version = "0.8.8" }
leptos_dom = { path = "./leptos_dom", version = "0.8.7" }
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.8.5" }
leptos_integration_utils = { path = "./integrations/utils", version = "0.8.7" }
leptos_macro = { path = "./leptos_macro", version = "0.8.12" }
leptos_router = { path = "./router", version = "0.8.10" }
leptos_router_macro = { path = "./router_macro", version = "0.8.6" }
leptos_server = { path = "./leptos_server", version = "0.8.6" }
leptos_meta = { path = "./meta", version = "0.8.5" }
next_tuple = { path = "./next_tuple", version = "0.1.0" }
oco_ref = { path = "./oco", version = "0.2.0" }
oco_ref = { path = "./oco", version = "0.2.1" }
or_poisoned = { path = "./or_poisoned", version = "0.1.0" }
reactive_graph = { path = "./reactive_graph", version = "0.1.7" }
reactive_stores = { path = "./reactive_stores", version = "0.1.7" }
reactive_stores_macro = { path = "./reactive_stores_macro", version = "0.1.7" }
server_fn = { path = "./server_fn", version = "0.7.7" }
server_fn_macro = { path = "./server_fn_macro", version = "0.7.7" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.7.7" }
tachys = { path = "./tachys", version = "0.1.7" }
reactive_graph = { path = "./reactive_graph", version = "0.2.11" }
reactive_stores = { path = "./reactive_stores", version = "0.3.0" }
reactive_stores_macro = { path = "./reactive_stores_macro", version = "0.2.6" }
server_fn = { path = "./server_fn", version = "0.8.8" }
server_fn_macro = { path = "./server_fn_macro", version = "0.8.8" }
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.8.5" }
tachys = { path = "./tachys", version = "0.2.11" }
# members deps
async-once-cell = { default-features = false, version = "0.5.3" }
itertools = { default-features = false, version = "0.14.0" }
convert_case = { default-features = false, version = "0.8.0" }
serde_json = { default-features = false, version = "1.0.143" }
trybuild = { default-features = false, version = "1.0.110" }
typed-builder = { default-features = false, version = "0.22.0" }
typed-builder-macro = { default-features = false, version = "0.22.0" }
thiserror = { default-features = false, version = "2.0.17" }
wasm-bindgen = { default-features = false, version = "0.2.100" }
indexmap = { default-features = false, version = "2.11.0" }
rstml = { default-features = false, version = "0.12.1" }
rustc_version = { default-features = false, version = "0.4.1" }
guardian = { default-features = false, version = "1.3.0" }
rustc-hash = { default-features = false, version = "2.1.1" }
actix-web = { default-features = false, version = "4.11.0" }
tracing = { default-features = false, version = "0.1.41" }
slotmap = { default-features = false, version = "1.0.7" }
futures = { default-features = false, version = "0.3.31" }
dashmap = { default-features = false, version = "6.1.0" }
pin-project-lite = { default-features = false, version = "0.2.16" }
send_wrapper = { default-features = false, version = "0.6.0" }
tokio-test = { default-features = false, version = "0.4.4" }
html-escape = { default-features = false, version = "0.2.13" }
proc-macro-error2 = { default-features = false, version = "2.0.1" }
const_format = { default-features = false, version = "0.2.35" }
gloo-net = { default-features = false, version = "0.6.0" }
url = { default-features = false, version = "2.5.4" }
tokio = { default-features = false, version = "1.47.1" }
base64 = { default-features = false, version = "0.22.1" }
cfg-if = { default-features = false, version = "1.0.3" }
wasm-bindgen-futures = { default-features = false, version = "0.4.50" }
tower = { default-features = false, version = "0.5.2" }
proc-macro2 = { default-features = false, version = "1.0.101" }
serde = { default-features = false, version = "1.0.219" }
parking_lot = { default-features = false, version = "0.12.5" }
axum = { default-features = false, version = "0.8.6" }
serde_qs = { default-features = false, version = "0.15.0" }
syn = { default-features = false, version = "2.0.106" }
xxhash-rust = { default-features = false, version = "0.8.15" }
paste = { default-features = false, version = "1.0.15" }
quote = { default-features = false, version = "1.0.41" }
web-sys = { default-features = false, version = "0.3.77" }
js-sys = { default-features = false, version = "0.3.77" }
rand = { default-features = false, version = "0.9.1" }
serde-lite = { default-features = false, version = "0.5.0" }
tokio-tungstenite = { default-features = false, version = "0.28.0" }
serial_test = { default-features = false, version = "3.2.0" }
erased = { default-features = false, version = "0.1.2" }
glib = { default-features = false, version = "0.20.12" }
async-trait = { default-features = false, version = "0.1.89" }
linear-map = { default-features = false, version = "1.2.0" }
anyhow = { default-features = false, version = "1.0.100" }
walkdir = { default-features = false, version = "2.5.0" }
actix-ws = { default-features = false, version = "0.3.0" }
tower-http = { default-features = false, version = "0.6.4" }
prettyplease = { default-features = false, version = "0.2.37" }
inventory = { default-features = false, version = "0.3.21" }
config = { default-features = false, version = "0.15.14" }
camino = { default-features = false, version = "1.2.1" }
ciborium = { default-features = false, version = "0.2.2" }
bitcode = { default-features = false, version = "0.6.6" }
multer = { default-features = false, version = "3.1.0" }
leptos-spin-macro = { default-features = false, version = "0.2.0" }
sledgehammer_utils = { default-features = false, version = "0.3.1" }
sledgehammer_bindgen = { default-features = false, version = "0.6.0" }
wasm-streams = { default-features = false, version = "0.4.2" }
rkyv = { default-features = false, version = "0.8.12" }
temp-env = { default-features = false, version = "0.3.6" }
uuid = { default-features = false, version = "1.18.0" }
bytes = { default-features = false, version = "1.10.1" }
http = { default-features = false, version = "1.3.1" }
regex = { default-features = false, version = "1.11.3" }
drain_filter_polyfill = { default-features = false, version = "0.1.3" }
tempfile = { default-features = false, version = "3.23.0" }
futures-lite = { default-features = false, version = "2.6.1" }
log = { default-features = false, version = "0.4.27" }
percent-encoding = { default-features = false, version = "2.3.2" }
async-executor = { default-features = false, version = "1.13.2" }
const-str = { default-features = false, version = "0.6.4" }
http-body-util = { default-features = false, version = "0.1.3" }
hyper = { default-features = false, version = "1.7.0" }
postcard = { default-features = false, version = "1.1.3" }
rmp-serde = { default-features = false, version = "1.3.0" }
reqwest = { default-features = false, version = "0.12.23" }
tower-layer = { default-features = false, version = "0.3.3" }
attribute-derive = { default-features = false, version = "0.10.5" }
insta = { default-features = false, version = "1.43.1" }
codee = { default-features = false, version = "0.3.0" }
actix-http = { default-features = false, version = "3.11.2" }
wasm-bindgen-test = { default-features = false, version = "0.3.50" }
rustversion = { default-features = false, version = "1.0.22" }
getrandom = { default-features = false, version = "0.3.3" }
actix-files = { default-features = false, version = "0.6.6" }
async-lock = { default-features = false, version = "3.4.1" }
base16 = { default-features = false, version = "0.2.1" }
digest = { default-features = false, version = "0.10.7" }
sha2 = { default-features = false, version = "0.10.8" }
subsecond = { default-features = false, version = "0.7.0-rc.0" }
dioxus-cli-config = { default-features = false, version = "0.7.0-rc.0" }
dioxus-devtools = { default-features = false, version = "0.7.0-rc.0" }
wasm_split_helpers = { default-features = false, version = "0.2.0" }
[profile.release]
codegen-units = 1
@@ -78,6 +180,7 @@ opt-level = 'z'
[workspace.metadata.cargo-all-features]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
max_combination_size = 2
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [

View File

@@ -10,8 +10,8 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
workspace = false
clear = true
dependencies = [
{ name = "check", path = "examples/counter_without_macros" },
{ name = "check", path = "examples/counters_stable" },
{ name = "lint", path = "examples/counter_without_macros" },
{ name = "lint", path = "examples/counters_stable" },
]
[tasks.ci-examples]

View File

@@ -21,7 +21,7 @@ use leptos::*;
#[component]
pub fn SimpleCounter(initial_value: i32) -> impl IntoView {
// create a reactive signal with the initial value
let (value, set_value) = create_signal(initial_value);
let (value, set_value) = signal(initial_value);
// create event handlers for our buttons
// note that `value` and `set_value` are `Copy`, so it's super easy to move them into closures
@@ -46,7 +46,7 @@ pub fn SimpleCounter(initial_value: i32) -> impl IntoView {
pub fn SimpleCounterWithBuilder(initial_value: i32) -> impl IntoView {
use leptos::html::*;
let (value, set_value) = create_signal(initial_value);
let (value, set_value) = signal(initial_value);
let clear = move |_| set_value(0);
let decrement = move |_| set_value.update(|value| *value -= 1);
let increment = move |_| set_value.update(|value| *value += 1);
@@ -90,35 +90,13 @@ Here are some resources for learning more about Leptos:
- [API Documentation](https://docs.rs/leptos/latest/leptos/)
- [Common Bugs](https://github.com/leptos-rs/leptos/tree/main/docs/COMMON_BUGS.md) (and how to fix them!)
## `nightly` Note
Most of the examples assume youre using `nightly` version of Rust and the `nightly` feature of Leptos. To use `nightly` Rust, you can either set your toolchain globally or on per-project basis.
To set `nightly` as a default toolchain for all projects (and add the ability to compile Rust to WebAssembly, if you havent already):
```
rustup toolchain install nightly
rustup default nightly
rustup target add wasm32-unknown-unknown
```
If you'd like to use `nightly` only in your Leptos project however, add [`rust-toolchain.toml`](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) file with the following content:
```toml
[toolchain]
channel = "nightly"
targets = ["wasm32-unknown-unknown"]
```
The `nightly` feature enables the function call syntax for accessing and setting signals, as opposed to `.get()` and `.set()`. This leads to a consistent mental model in which accessing a reactive value of any kind (a signal, memo, or derived signal) is always represented as a function call. This is only possible with nightly Rust and the `nightly` feature.
## `cargo-leptos`
[`cargo-leptos`](https://github.com/leptos-rs/cargo-leptos) is a build tool that's designed to make it easy to build apps that run on both the client and the server, with seamless integration. The best way to get started with a real Leptos project right now is to use `cargo-leptos` and our starter templates for [Actix](https://github.com/leptos-rs/start) or [Axum](https://github.com/leptos-rs/start-axum).
```bash
cargo install cargo-leptos
cargo leptos new --git https://github.com/leptos-rs/start
cargo install cargo-leptos --locked
cargo leptos new --git https://github.com/leptos-rs/start-axum
cd [your project name]
cargo leptos watch
```
@@ -147,7 +125,7 @@ Yes, Im sure there are. You can see from the state of our issue tracker over
This may be the big one: “production ready” implies a certain orientation to a library: that you can basically use it, without any special knowledge of its internals or ability to contribute. Everyone has this at some level in their stack: for example I (@gbj) dont have the capacity or knowledge to contribute to something like `wasm-bindgen` at this point: I simply rely on it to work.
There are several people in the community using Leptos right now for internal apps at work, who have also become significant contributors. I think this is the right level of production use for now. There may be missing features that you need, and you may end up building them! But for internal apps, if youre willing to build and contribute missing pieces along the way, the framework is definitely usable right now.
There are several people in the community using Leptos right now for many websites at work, who have also become significant contributors. There may be missing features that you need, and you may end up building them! But, if you're willing to contribute a few missing pieces along the way, the framework is most definitely usable for production applications, especially given the ecosystem of libraries that have sprung up around it.
### Can I use this for native GUI?

View File

@@ -1,6 +1,6 @@
[package]
name = "throw_error"
version = "0.2.0"
version = "0.3.1"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
@@ -10,4 +10,7 @@ rust-version.workspace = true
edition.workspace = true
[dependencies]
pin-project-lite = "0.2.15"
pin-project-lite = { workspace = true, default-features = true }
[dev-dependencies]
anyhow.workspace = true

View File

@@ -9,7 +9,7 @@ use std::{
error,
fmt::{self, Display},
future::Future,
mem, ops,
ops,
pin::Pin,
sync::Arc,
task::{Context, Poll},
@@ -17,11 +17,6 @@ use std::{
/* Wrapper Types */
/// This is a result type into which any error can be converted.
///
/// Results are stored as [`Error`].
pub type Result<T, E = Error> = core::result::Result<T, E>;
/// A generic wrapper for any error.
#[derive(Debug, Clone)]
#[repr(transparent)]
@@ -50,10 +45,10 @@ impl fmt::Display for Error {
impl<T> From<T> for Error
where
T: error::Error + Send + Sync + 'static,
T: Into<Box<dyn error::Error + Send + Sync + 'static>>,
{
fn from(value: T) -> Self {
Error(Arc::new(value))
Error(Arc::from(value.into()))
}
}
@@ -109,7 +104,7 @@ pub fn get_error_hook() -> Option<Arc<dyn ErrorHook>> {
/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
pub fn set_error_hook(hook: Arc<dyn ErrorHook>) -> ResetErrorHookOnDrop {
ResetErrorHookOnDrop(
ERROR_HOOK.with_borrow_mut(|this| mem::replace(this, Some(hook))),
ERROR_HOOK.with_borrow_mut(|this| Option::replace(this, hook)),
)
}
@@ -163,3 +158,32 @@ where
this.inner.poll(cx)
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::error::Error as StdError;
#[derive(Debug)]
struct MyError;
impl Display for MyError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "MyError")
}
}
impl StdError for MyError {}
#[test]
fn test_from() {
let e = MyError;
let _le = Error::from(e);
let e = "some error".to_string();
let _le = Error::from(e);
let e = anyhow::anyhow!("anyhow error");
let _le = Error::from(e);
}
}

View File

@@ -1,6 +1,6 @@
[package]
name = "any_spawner"
version = "0.2.1"
version = "0.3.0"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
@@ -9,15 +9,25 @@ description = "Spawn asynchronous tasks in an executor-independent way."
edition.workspace = true
[dependencies]
async-executor = { version = "1.13.1", optional = true }
futures = "0.3.31"
glib = { version = "0.20.6", optional = true }
thiserror = "2.0"
tokio = { version = "1.41", optional = true, default-features = false, features = [
async-executor = { optional = true , workspace = true, default-features = true }
futures = { workspace = true, default-features = true }
glib = { optional = true , workspace = true, default-features = true }
thiserror = { workspace = true , default-features = true }
tokio = { optional = true, default-features = false, features = [
"rt",
] }
tracing = { version = "0.1.41", optional = true }
wasm-bindgen-futures = { version = "0.4.47", optional = true }
] , workspace = true }
tracing = { optional = true , workspace = true, default-features = true }
wasm-bindgen-futures = { optional = true , workspace = true, default-features = true }
[dev-dependencies]
futures-lite = { default-features = false , workspace = true }
tokio = { default-features = false, features = [
"rt",
"macros",
"time",
] , workspace = true }
wasm-bindgen-test = { workspace = true, default-features = true }
serial_test = { workspace = true, default-features = true }
[features]
async-executor = ["dep:async-executor"]
@@ -34,3 +44,4 @@ rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.cargo-all-features]
denylist = ["tracing"]
max_combination_size = 2

View File

@@ -1 +1,4 @@
extend = { path = "../cargo-make/main.toml" }
extend = [
{ path = "../cargo-make/main.toml" },
{ path = "../cargo-make/wasm-test.toml" },
]

View File

@@ -11,18 +11,16 @@
//! - no "join handle" or other result is returned from the spawn
//! - the `Future` must output `()`
//!
//! ```rust
//! ```no_run
//! use any_spawner::Executor;
//!
//! // make sure an Executor has been initialized with one of the init_ functions
//!
//! # if false {
//! // spawn a thread-safe Future
//! Executor::spawn(async { /* ... */ });
//!
//! // spawn a Future that is !Send
//! Executor::spawn_local(async { /* ... */ });
//! # }
//! ```
#![forbid(unsafe_code)]
@@ -37,15 +35,67 @@ pub type PinnedFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>;
/// A future that has been pinned.
pub type PinnedLocalFuture<T> = Pin<Box<dyn Future<Output = T>>>;
static SPAWN: OnceLock<fn(PinnedFuture<()>)> = OnceLock::new();
static SPAWN_LOCAL: OnceLock<fn(PinnedLocalFuture<()>)> = OnceLock::new();
static POLL_LOCAL: OnceLock<fn()> = OnceLock::new();
// Type alias for the spawn function pointer.
type SpawnFn = fn(PinnedFuture<()>);
// Type alias for the spawn_local function pointer.
type SpawnLocalFn = fn(PinnedLocalFuture<()>);
// Type alias for the poll_local function pointer.
type PollLocalFn = fn();
/// Holds the function pointers for the current global executor.
#[derive(Clone, Copy)]
struct ExecutorFns {
spawn: SpawnFn,
spawn_local: SpawnLocalFn,
poll_local: PollLocalFn,
}
// Use a single OnceLock to ensure atomic initialization of all functions.
static EXECUTOR_FNS: OnceLock<ExecutorFns> = OnceLock::new();
// No-op functions to use when an executor doesn't support a specific operation.
#[cfg(any(feature = "tokio", feature = "wasm-bindgen", feature = "glib"))]
#[cold]
#[inline(never)]
fn no_op_poll() {}
#[cfg(all(not(feature = "wasm-bindgen"), not(debug_assertions)))]
#[cold]
#[inline(never)]
fn no_op_spawn(_: PinnedFuture<()>) {
#[cfg(debug_assertions)]
eprintln!(
"Warning: Executor::spawn called, but no global 'spawn' function is \
configured (perhaps only spawn_local is supported, e.g., on wasm \
without threading?)."
);
}
// Wasm panics if you spawn without an executor
#[cfg(feature = "wasm-bindgen")]
#[cold]
#[inline(never)]
fn no_op_spawn(_: PinnedFuture<()>) {
panic!(
"Executor::spawn called, but no global 'spawn' function is configured."
);
}
#[cfg(not(debug_assertions))]
#[cold]
#[inline(never)]
fn no_op_spawn_local(_: PinnedLocalFuture<()>) {
panic!(
"Executor::spawn_local called, but no global 'spawn_local' function \
is configured."
);
}
/// Errors that can occur when using the executor.
#[derive(Error, Debug)]
pub enum ExecutorError {
/// The executor has already been set.
#[error("Executor has already been set.")]
#[error("Global executor has already been set.")]
AlreadySet,
}
@@ -54,150 +104,143 @@ pub struct Executor;
impl Executor {
/// Spawns a thread-safe [`Future`].
/// ```rust
/// use any_spawner::Executor;
/// # if false {
/// // spawn a thread-safe Future
/// Executor::spawn(async { /* ... */ });
/// # }
/// ```
///
/// Uses the globally configured executor.
/// Panics if no global executor has been initialized.
#[inline(always)]
#[track_caller]
pub fn spawn(fut: impl Future<Output = ()> + Send + 'static) {
if let Some(spawner) = SPAWN.get() {
spawner(Box::pin(fut))
let pinned_fut = Box::pin(fut);
if let Some(fns) = EXECUTOR_FNS.get() {
(fns.spawn)(pinned_fut)
} else {
#[cfg(all(debug_assertions, feature = "tracing"))]
tracing::error!(
"At {}, tried to spawn a Future with Executor::spawn() before \
the Executor had been set.",
std::panic::Location::caller()
);
#[cfg(all(debug_assertions, not(feature = "tracing")))]
panic!(
"At {}, tried to spawn a Future with Executor::spawn() before \
the Executor had been set.",
std::panic::Location::caller()
);
// No global executor set.
handle_uninitialized_spawn(pinned_fut);
}
}
/// Spawns a [`Future`] that cannot be sent across threads.
/// ```rust
/// use any_spawner::Executor;
///
/// # if false {
/// // spawn a thread-safe Future
/// Executor::spawn_local(async { /* ... */ });
/// # }
/// ```
/// Uses the globally configured executor.
/// Panics if no global executor has been initialized.
#[inline(always)]
#[track_caller]
pub fn spawn_local(fut: impl Future<Output = ()> + 'static) {
if let Some(spawner) = SPAWN_LOCAL.get() {
spawner(Box::pin(fut))
let pinned_fut = Box::pin(fut);
if let Some(fns) = EXECUTOR_FNS.get() {
(fns.spawn_local)(pinned_fut)
} else {
#[cfg(all(debug_assertions, feature = "tracing"))]
tracing::error!(
"At {}, tried to spawn a Future with Executor::spawn_local() \
before the Executor had been set.",
std::panic::Location::caller()
);
#[cfg(all(debug_assertions, not(feature = "tracing")))]
panic!(
"At {}, tried to spawn a Future with Executor::spawn_local() \
before the Executor had been set.",
std::panic::Location::caller()
);
// No global executor set.
handle_uninitialized_spawn_local(pinned_fut);
}
}
/// Waits until the next "tick" of the current async executor.
/// Respects the global executor.
#[inline(always)]
pub async fn tick() {
let (tx, rx) = futures::channel::oneshot::channel();
#[cfg(not(all(feature = "wasm-bindgen", target_family = "wasm")))]
Executor::spawn(async move {
_ = tx.send(());
});
#[cfg(all(feature = "wasm-bindgen", target_family = "wasm"))]
Executor::spawn_local(async move {
_ = tx.send(());
});
_ = rx.await;
}
/// Polls the current async executor.
/// Not all async executors support polling, so this function may not do anything.
/// Polls the global async executor.
///
/// Uses the globally configured executor.
/// Does nothing if the global executor does not support polling.
#[inline(always)]
pub fn poll_local() {
if let Some(poller) = POLL_LOCAL.get() {
poller()
if let Some(fns) = EXECUTOR_FNS.get() {
(fns.poll_local)()
}
// If not initialized or doesn't support polling, do nothing gracefully.
}
}
impl Executor {
/// Globally sets the [`tokio`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
/// Returns `Err(_)` if a global executor has already been set.
///
/// Requires the `tokio` feature to be activated on this crate.
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn init_tokio() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
let executor_impl = ExecutorFns {
spawn: |fut| {
tokio::spawn(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
},
spawn_local: |fut| {
tokio::task::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
},
// Tokio doesn't have an explicit global poll function like LocalPool::run_until_stalled
poll_local: no_op_poll,
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
/// Globally sets the [`wasm-bindgen-futures`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
/// Returns `Err(_)` if a global executor has already been set.
///
/// Requires the `wasm-bindgen` feature to be activated on this crate.
#[cfg(feature = "wasm-bindgen")]
#[cfg_attr(docsrs, doc(cfg(feature = "wasm-bindgen")))]
pub fn init_wasm_bindgen() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
let executor_impl = ExecutorFns {
// wasm-bindgen-futures only supports spawn_local
spawn: no_op_spawn,
spawn_local: |fut| {
wasm_bindgen_futures::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
wasm_bindgen_futures::spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
},
poll_local: no_op_poll,
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
/// Globally sets the [`glib`] runtime as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
/// Returns `Err(_)` if a global executor has already been set.
///
/// Requires the `glib` feature to be activated on this crate.
#[cfg(feature = "glib")]
#[cfg_attr(docsrs, doc(cfg(feature = "glib")))]
pub fn init_glib() -> Result<(), ExecutorError> {
SPAWN
.set(|fut| {
let executor_impl = ExecutorFns {
spawn: |fut| {
let main_context = glib::MainContext::default();
main_context.spawn(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
},
spawn_local: |fut| {
let main_context = glib::MainContext::default();
main_context.spawn_local(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
},
// Glib needs event loop integration, explicit polling isn't the standard model here.
poll_local: no_op_poll,
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
/// Globally sets the [`futures`] executor as the executor used to spawn tasks,
/// lazily creating a thread pool to spawn tasks into.
///
/// Returns `Err(_)` if an executor has already been set.
/// Returns `Err(_)` if a global executor has already been set.
///
/// Requires the `futures-executor` feature to be activated on this crate.
#[cfg(feature = "futures-executor")]
@@ -209,9 +252,11 @@ impl Executor {
};
use std::cell::RefCell;
// Keep the lazy-init ThreadPool and thread-local LocalPool for spawn_local impl
static THREAD_POOL: OnceLock<ThreadPool> = OnceLock::new();
thread_local! {
static LOCAL_POOL: RefCell<LocalPool> = RefCell::new(LocalPool::new());
// SPAWNER is derived from LOCAL_POOL, keep it for efficiency inside the closure
static SPAWNER: LocalSpawner = LOCAL_POOL.with(|pool| pool.borrow().spawner());
}
@@ -222,140 +267,248 @@ impl Executor {
})
}
SPAWN
.set(|fut| {
let executor_impl = ExecutorFns {
spawn: |fut| {
get_thread_pool()
.spawn(fut)
.expect("failed to spawn future");
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
.expect("failed to spawn future on ThreadPool");
},
spawn_local: |fut| {
// Use the thread_local SPAWNER derived from LOCAL_POOL
SPAWNER.with(|spawner| {
spawner.spawn_local(fut).expect("failed to spawn future");
spawner
.spawn_local(fut)
.expect("failed to spawn local future");
});
})
.map_err(|_| ExecutorError::AlreadySet)?;
POLL_LOCAL
.set(|| {
},
poll_local: || {
// Use the thread_local LOCAL_POOL
LOCAL_POOL.with(|pool| {
// Use try_borrow_mut to prevent panic during re-entrant calls
if let Ok(mut pool) = pool.try_borrow_mut() {
pool.run_until_stalled();
}
// If we couldn't borrow_mut, we're in a nested call to poll, so we don't need to do anything.
// If already borrowed, we're likely in a nested poll, so do nothing.
});
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
},
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
/// Globally sets the [`async_executor`] executor as the executor used to spawn tasks,
/// lazily creating a thread pool to spawn tasks into.
///
/// Returns `Err(_)` if an executor has already been set.
/// Returns `Err(_)` if a global executor has already been set.
///
/// Requires the `async-executor` feature to be activated on this crate.
#[cfg(feature = "async-executor")]
#[cfg_attr(docsrs, doc(cfg(feature = "async-executor")))]
pub fn init_async_executor() -> Result<(), ExecutorError> {
use async_executor::{Executor, LocalExecutor};
use async_executor::{Executor as AsyncExecutor, LocalExecutor};
static THREAD_POOL: OnceLock<Executor> = OnceLock::new();
// Keep the lazy-init global Executor and thread-local LocalExecutor for spawn_local impl
static ASYNC_EXECUTOR: OnceLock<AsyncExecutor<'static>> =
OnceLock::new();
thread_local! {
static LOCAL_POOL: LocalExecutor<'static> = const { LocalExecutor::new() };
static LOCAL_EXECUTOR_POOL: LocalExecutor<'static> = const { LocalExecutor::new() };
}
fn get_thread_pool() -> &'static Executor<'static> {
THREAD_POOL.get_or_init(Executor::new)
fn get_async_executor() -> &'static AsyncExecutor<'static> {
ASYNC_EXECUTOR.get_or_init(AsyncExecutor::new)
}
SPAWN
.set(|fut| {
get_thread_pool().spawn(fut).detach();
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
LOCAL_POOL.with(|pool| pool.spawn(fut).detach());
})
.map_err(|_| ExecutorError::AlreadySet)?;
POLL_LOCAL
.set(|| {
LOCAL_POOL.with(|pool| pool.try_tick());
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
let executor_impl = ExecutorFns {
spawn: |fut| {
get_async_executor().spawn(fut).detach();
},
spawn_local: |fut| {
LOCAL_EXECUTOR_POOL.with(|pool| pool.spawn(fut).detach());
},
poll_local: || {
LOCAL_EXECUTOR_POOL.with(|pool| {
// try_tick polls the local executor without blocking
// This prevents issues if called recursively or from within a task.
pool.try_tick();
});
},
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
/// Globally sets a custom executor as the executor used to spawn tasks.
///
/// Returns `Err(_)` if an executor has already been set.
/// Requires the custom executor to be `Send + Sync` as it will be stored statically.
///
/// Returns `Err(_)` if a global executor has already been set.
pub fn init_custom_executor(
custom_executor: impl CustomExecutor + Send + Sync + 'static,
) -> Result<(), ExecutorError> {
static EXECUTOR: OnceLock<Box<dyn CustomExecutor + Send + Sync>> =
OnceLock::new();
EXECUTOR
// Store the custom executor instance itself to call its methods.
// Use Box for dynamic dispatch.
static CUSTOM_EXECUTOR_INSTANCE: OnceLock<
Box<dyn CustomExecutor + Send + Sync>,
> = OnceLock::new();
CUSTOM_EXECUTOR_INSTANCE
.set(Box::new(custom_executor))
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN
.set(|fut| {
EXECUTOR.get().unwrap().spawn(fut);
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| EXECUTOR.get().unwrap().spawn_local(fut))
.map_err(|_| ExecutorError::AlreadySet)?;
POLL_LOCAL
.set(|| EXECUTOR.get().unwrap().poll_local())
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
// Now set the ExecutorFns using the stored instance
let executor_impl = ExecutorFns {
spawn: |fut| {
// Unwrap is safe because we just set it successfully or returned Err.
CUSTOM_EXECUTOR_INSTANCE.get().unwrap().spawn(fut);
},
spawn_local: |fut| {
CUSTOM_EXECUTOR_INSTANCE.get().unwrap().spawn_local(fut);
},
poll_local: || {
CUSTOM_EXECUTOR_INSTANCE.get().unwrap().poll_local();
},
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
// If setting EXECUTOR_FNS fails (extremely unlikely race if called *concurrently*
// with another init_* after CUSTOM_EXECUTOR_INSTANCE was set), we technically
// leave CUSTOM_EXECUTOR_INSTANCE set but EXECUTOR_FNS not. This is an edge case,
// but the primary race condition is solved.
}
/// Locally sets a custom executor as the executor used to spawn tasks
/// in the current thread.
/// Sets a custom executor *for the current thread only*.
///
/// Returns `Err(_)` if an executor has already been set.
/// This overrides the global executor for calls to `spawn`, `spawn_local`, and `poll_local`
/// made *from the current thread*. It does not affect other threads or the global state.
///
/// The provided `custom_executor` must implement [`CustomExecutor`] and `'static`, but does
/// **not** need to be `Send` or `Sync`.
///
/// Returns `Err(ExecutorError::AlreadySet)` if a *local* executor has already been set
/// *for this thread*.
pub fn init_local_custom_executor(
custom_executor: impl CustomExecutor + 'static,
) -> Result<(), ExecutorError> {
// Store the custom executor instance itself to call its methods.
// Use Box for dynamic dispatch.
thread_local! {
static EXECUTOR: OnceLock<Box<dyn CustomExecutor>> = OnceLock::new();
}
EXECUTOR.with(|this| {
static CUSTOM_EXECUTOR_INSTANCE: OnceLock<
Box<dyn CustomExecutor>,
> = OnceLock::new();
};
CUSTOM_EXECUTOR_INSTANCE.with(|this| {
this.set(Box::new(custom_executor))
.map_err(|_| ExecutorError::AlreadySet)
})?;
SPAWN
.set(|fut| {
EXECUTOR.with(|this| this.get().unwrap().spawn(fut));
})
.map_err(|_| ExecutorError::AlreadySet)?;
SPAWN_LOCAL
.set(|fut| {
EXECUTOR.with(|this| this.get().unwrap().spawn_local(fut));
})
.map_err(|_| ExecutorError::AlreadySet)?;
POLL_LOCAL
.set(|| {
EXECUTOR.with(|this| this.get().unwrap().poll_local());
})
.map_err(|_| ExecutorError::AlreadySet)?;
Ok(())
// Now set the ExecutorFns using the stored instance
let executor_impl = ExecutorFns {
spawn: |fut| {
// Unwrap is safe because we just set it successfully or returned Err.
CUSTOM_EXECUTOR_INSTANCE
.with(|this| this.get().unwrap().spawn(fut));
},
spawn_local: |fut| {
CUSTOM_EXECUTOR_INSTANCE
.with(|this| this.get().unwrap().spawn_local(fut));
},
poll_local: || {
CUSTOM_EXECUTOR_INSTANCE
.with(|this| this.get().unwrap().poll_local());
},
};
EXECUTOR_FNS
.set(executor_impl)
.map_err(|_| ExecutorError::AlreadySet)
}
}
/// A trait for custom executors.
/// Custom executors can be used to integrate with any executor that supports spawning futures.
///
/// All methods can be called recursively.
///
/// If used with `init_custom_executor`, the implementation must be `Send + Sync + 'static`.
///
/// All methods can be called recursively. Implementors should be mindful of potential
/// deadlocks or excessive resource consumption if recursive calls are not handled carefully
/// (e.g., using `try_borrow_mut` or non-blocking polls within implementations).
pub trait CustomExecutor {
/// Spawns a future, usually on a thread pool.
fn spawn(&self, fut: PinnedFuture<()>);
/// Spawns a local future. May require calling `poll_local` to make progress.
fn spawn_local(&self, fut: PinnedLocalFuture<()>);
/// Polls the executor, if it supports polling.
/// Polls the executor, if it supports polling. Implementations should ideally be
/// non-blocking or use mechanisms like `try_tick` or `try_borrow_mut` to handle
/// re-entrant calls safely.
fn poll_local(&self);
}
// Ensure CustomExecutor is object-safe
#[allow(dead_code)]
fn test_object_safety(_: Box<dyn CustomExecutor + Send + Sync>) {} // Added Send + Sync constraint here for global usage
/// Handles the case where `Executor::spawn` is called without an initialized executor.
#[cold] // Less likely path
#[inline(never)]
#[track_caller]
fn handle_uninitialized_spawn(_fut: PinnedFuture<()>) {
let caller = std::panic::Location::caller();
#[cfg(all(debug_assertions, feature = "tracing"))]
{
tracing::error!(
target: "any_spawner",
spawn_caller=%caller,
"Executor::spawn called before a global executor was initialized. Task dropped."
);
// Drop the future implicitly after logging
drop(_fut);
}
#[cfg(all(debug_assertions, not(feature = "tracing")))]
{
panic!(
"At {caller}, tried to spawn a Future with Executor::spawn() \
before a global executor was initialized."
);
}
// In release builds (without tracing), call the specific no-op function.
#[cfg(not(debug_assertions))]
{
no_op_spawn(_fut);
}
}
/// Handles the case where `Executor::spawn_local` is called without an initialized executor.
#[cold] // Less likely path
#[inline(never)]
#[track_caller]
fn handle_uninitialized_spawn_local(_fut: PinnedLocalFuture<()>) {
let caller = std::panic::Location::caller();
#[cfg(all(debug_assertions, feature = "tracing"))]
{
tracing::error!(
target: "any_spawner",
spawn_caller=%caller,
"Executor::spawn_local called before a global executor was initialized. \
Task likely dropped or panicked."
);
// Fall through to panic or no-op depending on build/target
}
#[cfg(all(debug_assertions, not(feature = "tracing")))]
{
panic!(
"At {caller}, tried to spawn a Future with \
Executor::spawn_local() before a global executor was initialized."
);
}
// In release builds (without tracing), call the specific no-op function (which usually panics).
#[cfg(not(debug_assertions))]
{
no_op_spawn_local(_fut);
}
}

View File

@@ -0,0 +1,24 @@
use any_spawner::{Executor, ExecutorError};
#[test]
fn test_already_set_error() {
struct SimpleExecutor;
impl any_spawner::CustomExecutor for SimpleExecutor {
fn spawn(&self, _fut: any_spawner::PinnedFuture<()>) {}
fn spawn_local(&self, _fut: any_spawner::PinnedLocalFuture<()>) {}
fn poll_local(&self) {}
}
// First initialization should succeed
Executor::init_custom_executor(SimpleExecutor)
.expect("First initialization failed");
// Second initialization should fail with AlreadySet error
let result = Executor::init_custom_executor(SimpleExecutor);
assert!(matches!(result, Err(ExecutorError::AlreadySet)));
// First local initialization should fail
let result = Executor::init_local_custom_executor(SimpleExecutor);
assert!(matches!(result, Err(ExecutorError::AlreadySet)));
}

View File

@@ -0,0 +1,74 @@
#![cfg(feature = "async-executor")]
use std::{
future::Future,
pin::Pin,
sync::{Arc, Mutex},
};
// A simple async executor for testing
struct TestExecutor {
tasks: Mutex<Vec<Pin<Box<dyn Future<Output = ()> + Send + 'static>>>>,
}
impl TestExecutor {
fn new() -> Self {
TestExecutor {
tasks: Mutex::new(Vec::new()),
}
}
fn spawn<F>(&self, future: F)
where
F: Future<Output = ()> + Send + 'static,
{
self.tasks.lock().unwrap().push(Box::pin(future));
}
fn run_all(&self) {
// Take all tasks out to process them
let tasks = self.tasks.lock().unwrap().drain(..).collect::<Vec<_>>();
// Use a basic future executor to run each task to completion
for mut task in tasks {
// Use futures-lite's block_on to complete the future
futures::executor::block_on(async {
unsafe {
let task_mut = Pin::new_unchecked(&mut task);
let _ = std::future::Future::poll(
task_mut,
&mut std::task::Context::from_waker(
futures::task::noop_waker_ref(),
),
);
}
});
}
}
}
#[test]
fn test_async_executor() {
let executor = Arc::new(TestExecutor::new());
let executor_clone = executor.clone();
// Create a spawner function that will use our test executor
let spawner = move |future| {
executor_clone.spawn(future);
};
// Prepare test data
let counter = Arc::new(Mutex::new(0));
let counter_clone = counter.clone();
// Use the spawner to spawn a task
spawner(async move {
*counter_clone.lock().unwrap() += 1;
});
// Run all tasks
executor.run_all();
// Check if the task completed correctly
assert_eq!(*counter.lock().unwrap(), 1);
}

View File

@@ -0,0 +1,63 @@
use any_spawner::Executor;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
#[test]
fn test_custom_executor() {
// Define a simple custom executor
struct TestExecutor {
spawn_called: Arc<AtomicBool>,
spawn_local_called: Arc<AtomicBool>,
poll_local_called: Arc<AtomicBool>,
}
impl any_spawner::CustomExecutor for TestExecutor {
fn spawn(&self, fut: any_spawner::PinnedFuture<()>) {
self.spawn_called.store(true, Ordering::SeqCst);
// Execute the future immediately (this works for simple test futures)
futures::executor::block_on(fut);
}
fn spawn_local(&self, fut: any_spawner::PinnedLocalFuture<()>) {
self.spawn_local_called.store(true, Ordering::SeqCst);
// Execute the future immediately
futures::executor::block_on(fut);
}
fn poll_local(&self) {
self.poll_local_called.store(true, Ordering::SeqCst);
}
}
let spawn_called = Arc::new(AtomicBool::new(false));
let spawn_local_called = Arc::new(AtomicBool::new(false));
let poll_local_called = Arc::new(AtomicBool::new(false));
let executor = TestExecutor {
spawn_called: spawn_called.clone(),
spawn_local_called: spawn_local_called.clone(),
poll_local_called: poll_local_called.clone(),
};
// Initialize with our custom executor
Executor::init_custom_executor(executor)
.expect("Failed to initialize custom executor");
// Test spawn
Executor::spawn(async {
// Simple task
});
assert!(spawn_called.load(Ordering::SeqCst));
// Test spawn_local
Executor::spawn_local(async {
// Simple local task
});
assert!(spawn_local_called.load(Ordering::SeqCst));
// Test poll_local
Executor::poll_local();
assert!(poll_local_called.load(Ordering::SeqCst));
}

View File

@@ -1,6 +1,7 @@
#[cfg(feature = "futures-executor")]
#![cfg(feature = "futures-executor")]
use any_spawner::{CustomExecutor, Executor, PinnedFuture, PinnedLocalFuture};
#[cfg(feature = "futures-executor")]
#[test]
fn can_create_custom_executor() {
use futures::{

View File

@@ -0,0 +1,28 @@
#![cfg(feature = "tokio")]
use any_spawner::Executor;
use std::{
sync::{Arc, Mutex},
time::Duration,
};
#[tokio::test]
async fn test_executor_tick() {
// Initialize the tokio executor
Executor::init_tokio().expect("Failed to initialize tokio executor");
let value = Arc::new(Mutex::new(false));
let value_clone = value.clone();
// Spawn a task that sets the value after a tick
Executor::spawn(async move {
Executor::tick().await;
*value_clone.lock().unwrap() = true;
});
// Allow some time for the task to complete
tokio::time::sleep(Duration::from_millis(50)).await;
// Check that the value was set
assert!(*value.lock().unwrap());
}

View File

@@ -0,0 +1,44 @@
#![cfg(feature = "futures-executor")]
use any_spawner::Executor;
use futures::channel::oneshot;
use std::{
sync::{Arc, Mutex},
time::Duration,
};
#[test]
fn test_futures_executor() {
// Initialize the futures executor
Executor::init_futures_executor()
.expect("Failed to initialize futures executor");
let (tx, rx) = oneshot::channel();
let result = Arc::new(Mutex::new(None));
let result_clone = result.clone();
// Spawn a task
Executor::spawn(async move {
tx.send(84).expect("Failed to send value");
});
// Spawn a task that waits for the result
Executor::spawn(async move {
match rx.await {
Ok(val) => *result_clone.lock().unwrap() = Some(val),
Err(_) => panic!("Failed to receive value"),
}
});
// Poll a few times to ensure the task completes
for _ in 0..10 {
Executor::poll_local();
std::thread::sleep(Duration::from_millis(10));
if result.lock().unwrap().is_some() {
break;
}
}
assert_eq!(*result.lock().unwrap(), Some(84));
}

View File

@@ -1,8 +1,8 @@
#[cfg(feature = "futures-executor")]
#![cfg(feature = "futures-executor")]
use any_spawner::Executor;
// All tests in this file use the same executor.
#[cfg(feature = "futures-executor")]
#[test]
fn can_spawn_local_future() {
use std::rc::Rc;
@@ -15,7 +15,6 @@ fn can_spawn_local_future() {
Executor::spawn(async {});
}
#[cfg(feature = "futures-executor")]
#[test]
fn can_make_local_progress() {
use std::sync::{

151
any_spawner/tests/glib.rs Normal file
View File

@@ -0,0 +1,151 @@
#![cfg(feature = "glib")]
use any_spawner::Executor;
use glib::{MainContext, MainLoop};
use serial_test::serial;
use std::{
cell::Cell,
future::Future,
rc::Rc,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
},
time::Duration,
};
// Helper to run a future to completion on a dedicated glib MainContext.
// Returns true if the future completed within the timeout, false otherwise.
fn run_on_glib_context<F>(fut: F)
where
F: Future<Output = ()> + Send + 'static,
{
let _ = Executor::init_glib();
let context = MainContext::default();
let main_loop = MainLoop::new(Some(&context), false);
let main_loop_clone = main_loop.clone();
Executor::spawn(async move {
fut.await;
main_loop_clone.quit();
});
main_loop.run();
}
// Helper to run a local (!Send) future on the glib context.
fn run_local_on_glib_context<F>(fut: F)
where
F: Future<Output = ()> + 'static,
{
let _ = Executor::init_glib();
let context = MainContext::default();
let main_loop = MainLoop::new(Some(&context), false);
let main_loop_clone = main_loop.clone();
Executor::spawn_local(async move {
fut.await;
main_loop_clone.quit();
});
main_loop.run();
}
// This test must run after a test that successfully initializes glib,
// or within its own process.
#[test]
#[serial]
fn test_glib_spawn() {
let success_flag = Arc::new(AtomicBool::new(false));
let flag_clone = success_flag.clone();
run_on_glib_context(async move {
// Simulate async work
futures_lite::future::yield_now().await;
flag_clone.store(true, Ordering::SeqCst);
// We need to give the spawned task time to run.
// The run_on_glib_context handles the main loop.
// We just need to ensure spawn happened correctly.
// Let's wait a tiny bit within the driving future to ensure spawn gets processed.
glib::timeout_future(Duration::from_millis(10)).await;
});
assert!(
success_flag.load(Ordering::SeqCst),
"Spawned future did not complete successfully"
);
}
// Similar conditions as test_glib_spawn regarding initialization state.
#[test]
#[serial]
fn test_glib_spawn_local() {
let success_flag = Rc::new(Cell::new(false));
let flag_clone = success_flag.clone();
run_local_on_glib_context(async move {
// Use Rc to make the future !Send
let non_send_data = Rc::new(Cell::new(10));
let data = non_send_data.get();
assert_eq!(data, 10, "Rc data should be accessible");
non_send_data.set(20); // Modify non-Send data
// Simulate async work
futures_lite::future::yield_now().await;
assert_eq!(
non_send_data.get(),
20,
"Rc data should persist modification"
);
flag_clone.set(true);
// Wait a tiny bit
glib::timeout_future(Duration::from_millis(10)).await;
});
assert!(
success_flag.get(),
"Spawned local future did not complete successfully"
);
}
// Test Executor::tick with glib backend
#[test]
#[serial]
fn test_glib_tick() {
run_on_glib_context(async {
let value = Arc::new(Mutex::new(false));
let value_clone = value.clone();
// Spawn a task that sets the value after a tick
Executor::spawn(async move {
Executor::tick().await;
*value_clone.lock().unwrap() = true;
});
// Allow some time for the task to complete
glib::timeout_future(Duration::from_millis(10)).await;
// Check that the value was set
assert!(*value.lock().unwrap());
});
}
// Test Executor::poll_local with glib backend (should be a no-op)
#[test]
#[serial]
fn test_glib_poll_local_is_no_op() {
// Ensure glib executor is initialized
let _ = Executor::init_glib();
// poll_local for glib is configured as a no-op
// Calling it should not panic or cause issues.
Executor::poll_local();
Executor::poll_local();
println!("Executor::poll_local called successfully (expected no-op).");
}

View File

@@ -0,0 +1,54 @@
use any_spawner::Executor;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
#[test]
fn test_local_custom_executor() {
// Define a thread-local custom executor
struct LocalTestExecutor {
spawn_called: Arc<AtomicBool>,
spawn_local_called: Arc<AtomicBool>,
}
impl any_spawner::CustomExecutor for LocalTestExecutor {
fn spawn(&self, fut: any_spawner::PinnedFuture<()>) {
self.spawn_called.store(true, Ordering::SeqCst);
futures::executor::block_on(fut);
}
fn spawn_local(&self, fut: any_spawner::PinnedLocalFuture<()>) {
self.spawn_local_called.store(true, Ordering::SeqCst);
futures::executor::block_on(fut);
}
fn poll_local(&self) {
// No-op for this test
}
}
let local_spawn_called = Arc::new(AtomicBool::new(false));
let local_spawn_local_called = Arc::new(AtomicBool::new(false));
let local_executor = LocalTestExecutor {
spawn_called: local_spawn_called.clone(),
spawn_local_called: local_spawn_local_called.clone(),
};
// Initialize a thread-local executor
Executor::init_local_custom_executor(local_executor)
.expect("Failed to initialize local custom executor");
// Test spawn - should use the thread-local executor
Executor::spawn(async {
// Simple task
});
assert!(local_spawn_called.load(Ordering::SeqCst));
// Test spawn_local - should use the thread-local executor
Executor::spawn_local(async {
// Simple local task
});
assert!(local_spawn_local_called.load(Ordering::SeqCst));
}

View File

@@ -0,0 +1,35 @@
#![cfg(feature = "tokio")]
use any_spawner::Executor;
use futures::channel::oneshot;
use std::sync::{Arc, Mutex};
#[tokio::test]
async fn test_multiple_tasks() {
Executor::init_tokio().expect("Failed to initialize tokio executor");
let counter = Arc::new(Mutex::new(0));
let tasks = 10;
let mut handles = Vec::new();
// Spawn multiple tasks that increment the counter
for _ in 0..tasks {
let counter_clone = counter.clone();
let (tx, rx) = oneshot::channel();
Executor::spawn(async move {
*counter_clone.lock().unwrap() += 1;
tx.send(()).expect("Failed to send completion signal");
});
handles.push(rx);
}
// Wait for all tasks to complete
for handle in handles {
handle.await.expect("Task failed");
}
// Verify that all tasks incremented the counter
assert_eq!(*counter.lock().unwrap(), tasks);
}

View File

@@ -0,0 +1,20 @@
#![cfg(feature = "tokio")]
use any_spawner::Executor;
use futures::channel::oneshot;
#[tokio::test]
async fn test_tokio_executor() {
// Initialize the tokio executor
Executor::init_tokio().expect("Failed to initialize tokio executor");
let (tx, rx) = oneshot::channel();
// Spawn a task that sends a value
Executor::spawn(async move {
tx.send(42).expect("Failed to send value");
});
// Wait for the spawned task to complete
assert_eq!(rx.await.unwrap(), 42);
}

View File

@@ -0,0 +1,88 @@
#![cfg(all(feature = "wasm-bindgen", target_family = "wasm"))]
use any_spawner::Executor;
use futures::channel::oneshot;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
async fn test_wasm_bindgen_spawn_local() {
// Initialize the wasm-bindgen executor
let _ = Executor::init_wasm_bindgen();
// Create a channel to verify the task completes
let (tx, rx) = oneshot::channel();
// Spawn a local task (wasm doesn't support sending futures between threads)
Executor::spawn_local(async move {
// Simulate some async work
Executor::tick().await;
tx.send(42).expect("Failed to send result");
});
// Wait for the task to complete
let result = rx.await.expect("Failed to receive result");
assert_eq!(result, 42);
}
#[wasm_bindgen_test]
async fn test_wasm_bindgen_tick() {
// Initialize the wasm-bindgen executor if not already initialized
let _ = Executor::init_wasm_bindgen();
let flag = Arc::new(AtomicBool::new(false));
let flag_clone = flag.clone();
// Spawn a task that will set the flag
Executor::spawn_local(async move {
flag_clone.store(true, Ordering::SeqCst);
});
// Wait for a tick, which should allow the spawned task to run
Executor::tick().await;
// Verify the flag was set
assert!(flag.load(Ordering::SeqCst));
}
#[wasm_bindgen_test]
async fn test_multiple_wasm_bindgen_tasks() {
// Initialize once for all tests
let _ = Executor::init_wasm_bindgen();
// Create channels for multiple tasks
let (tx1, rx1) = oneshot::channel();
let (tx2, rx2) = oneshot::channel();
// Spawn multiple tasks
Executor::spawn_local(async move {
tx1.send("task1").expect("Failed to send from task1");
});
Executor::spawn_local(async move {
tx2.send("task2").expect("Failed to send from task2");
});
// Wait for both tasks to complete
let (result1, result2) = futures::join!(rx1, rx2);
assert_eq!(result1.unwrap(), "task1");
assert_eq!(result2.unwrap(), "task2");
}
// This test verifies that spawn (not local) fails on wasm as expected
#[wasm_bindgen_test]
#[should_panic]
fn test_wasm_bindgen_spawn_errors() {
let _ = Executor::init_wasm_bindgen();
// Using should_panic to test that Executor::spawn panics in wasm
Executor::spawn(async {
// This should panic since wasm-bindgen doesn't support Send futures
});
}

View File

@@ -2,8 +2,6 @@
name = "benchmarks"
version = "0.1.0"
edition = "2021"
# std::sync::LazyLock is stabilized in Rust version 1.80.0
rust-version = "1.80.0"
[dependencies]
l0410 = { package = "leptos", version = "0.4.10", features = [
@@ -23,7 +21,7 @@ tokio-test = "0.4.0"
miniserde = "0.1.0"
gloo = "0.8.0"
uuid = { version = "1.0", features = ["serde", "v4", "wasm-bindgen"] }
wasm-bindgen = "0.2.0"
wasm-bindgen = "0.2.100"
lazy_static = "1.0"
log = "0.4.0"
strum = "0.24.0"

View File

@@ -0,0 +1,14 @@
[tasks.check-minimal-versions]
condition = { channels = ["nightly"] }
command = "cargo"
args = [
"all-features",
"minimal-versions",
"check",
"--ignore-private",
"--detach-path-deps",
"--direct",
]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''

View File

@@ -1,7 +0,0 @@
[tasks.check]
alias = "check-all"
[tasks.check-all]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"

View File

@@ -6,13 +6,15 @@ env = { LEPTOS_PROJECT_DIRECTORY = "../" }
args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
[tasks.clippy-each-feature]
dependencies = ["install-clippy"]
command = "cargo"
args = [
"clippy",
"--all-features",
"--no-deps",
"--",
"-D",
"clippy::print_stdout",
"all-features",
"clippy",
"--no-deps",
"--",
"-D",
"clippy::print_stdout",
]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''

View File

@@ -1,7 +1,7 @@
extend = [
{ path = "./check.toml" },
{ path = "./lint.toml" },
{ path = "./test.toml" },
{ path = "./lint.toml" },
{ path = "./test.toml" },
{ path = "./check-minimal-versions.toml" },
]
[env]
@@ -12,4 +12,4 @@ LEPTOS_OUTPUT_NAME = "ci" # allows examples to check/build without cargo-leptos
RUSTFLAGS = "-D warnings"
[tasks.ci]
dependencies = ["lint", "test"]
dependencies = ["lint", "test-each-feature", "doctests"]

View File

@@ -1,7 +1,16 @@
[tasks.test]
alias = "test-all"
[tasks.test-all]
[tasks.test-each-feature]
env = { "NEXTEST_NO_TESTS" = "warn" }
command = "cargo"
args = ["test-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "nextest", "run", "--all-targets"]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''
# This can be removed once doctests is supported in nextest
# https://github.com/nextest-rs/nextest/issues/16
[tasks.doctests]
command = "cargo"
args = ["all-features", "test", "--doc"]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''

View File

@@ -0,0 +1,7 @@
[tasks.post-test]
dependencies = ["test-wasm"]
[tasks.test-wasm]
env = { CARGO_MAKE_WASM_TEST_ARGS = "--headless --chrome --features=wasm-bindgen" }
command = "cargo"
args = ["make", "wasm-pack-test"]

View File

@@ -31,7 +31,7 @@ pub const fn const_concat(
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
// no mutable references in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;
@@ -59,7 +59,7 @@ pub const fn const_concat_with_prefix(
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
// no mutable references in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;
@@ -116,7 +116,7 @@ pub const fn const_concat_with_separator(
let mut i = 0;
// have it iterate over bytes manually, because, again,
// no mutable refernces in const fns
// no mutable references in const fns
while i < x.len() {
buffer[position] = x[i];
position += 1;

View File

@@ -1,6 +1,6 @@
[package]
name = "either_of"
version = "0.1.5"
version = "0.1.6"
authors = ["Greg Johnston"]
license = "MIT"
readme = "../README.md"
@@ -10,8 +10,8 @@ rust-version.workspace = true
edition.workspace = true
[dependencies]
pin-project-lite = "0.2.16"
paste = "1.0.15"
pin-project-lite = { workspace = true, default-features = true }
paste = { workspace = true, default-features = true }
[features]
default = ["no_std"]

View File

@@ -776,20 +776,20 @@ tuples!(EitherOf16 + EitherOf16Future + EitherOf16FutureProj {
/// ```
#[macro_export]
macro_rules! either {
($match:expr, $left_pattern:pat => $left_expression:expr, $right_pattern:pat => $right_expression:expr,) => {
($match:expr, $left_pattern:pat => $left_expression:expr, $right_pattern:pat => $right_expression:expr$(,)?) => {
match $match {
$left_pattern => $crate::Either::Left($left_expression),
$right_pattern => $crate::Either::Right($right_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf3::A($a_expression),
$b_pattern => $crate::EitherOf3::B($b_expression),
$c_pattern => $crate::EitherOf3::C($c_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf4::A($a_expression),
$b_pattern => $crate::EitherOf4::B($b_expression),
@@ -797,7 +797,7 @@ macro_rules! either {
$d_pattern => $crate::EitherOf4::D($d_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf5::A($a_expression),
$b_pattern => $crate::EitherOf5::B($b_expression),
@@ -806,7 +806,7 @@ macro_rules! either {
$e_pattern => $crate::EitherOf5::E($e_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf6::A($a_expression),
$b_pattern => $crate::EitherOf6::B($b_expression),
@@ -816,7 +816,7 @@ macro_rules! either {
$f_pattern => $crate::EitherOf6::F($f_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr, $g_pattern:pat => $g_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr, $g_pattern:pat => $g_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf7::A($a_expression),
$b_pattern => $crate::EitherOf7::B($b_expression),
@@ -827,7 +827,7 @@ macro_rules! either {
$g_pattern => $crate::EitherOf7::G($g_expression),
}
};
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr, $g_pattern:pat => $g_expression:expr, $h_pattern:pat => $h_expression:expr,) => {
($match:expr, $a_pattern:pat => $a_expression:expr, $b_pattern:pat => $b_expression:expr, $c_pattern:pat => $c_expression:expr, $d_pattern:pat => $d_expression:expr, $e_pattern:pat => $e_expression:expr, $f_pattern:pat => $f_expression:expr, $g_pattern:pat => $g_expression:expr, $h_pattern:pat => $h_expression:expr$(,)?) => {
match $match {
$a_pattern => $crate::EitherOf8::A($a_expression),
$b_pattern => $crate::EitherOf8::B($b_expression),

View File

@@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib", "rlib"]
[dependencies]
axum = { version = "0.7.5", optional = true }
axum = { version = "0.8.1", optional = true }
console_error_panic_hook = "0.1.7"
console_log = "1.0"
gloo-utils = "0.2.0"
@@ -19,19 +19,28 @@ leptos_meta = { path = "../../meta" }
leptos_axum = { path = "../../integrations/axum", optional = true }
leptos_router = { path = "../../router" }
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
tokio = { version = "1.39", features = [ "rt-multi-thread", "macros", "time" ], optional = true }
thiserror = "2.0.12"
tokio = { version = "1.39", features = [
"rt-multi-thread",
"macros",
"time",
], optional = true }
tower = { version = "0.4.13", optional = true }
tower-http = { version = "0.5.2", features = ["fs"], optional = true }
wasm-bindgen = "0.2.92"
web-sys = { version = "0.3.69", features = [ "AddEventListenerOptions", "Document", "Element", "Event", "EventListener", "EventTarget", "Performance", "Window" ], optional = true }
wasm-bindgen = "0.2.105"
web-sys = { version = "0.3.69", features = [
"AddEventListenerOptions",
"Document",
"Element",
"Event",
"EventListener",
"EventTarget",
"Performance",
"Window",
], optional = true }
[features]
hydrate = [
"leptos/hydrate",
"dep:js-sys",
"dep:web-sys",
]
hydrate = ["leptos/hydrate", "dep:js-sys", "dep:web-sys"]
ssr = [
"dep:axum",
"dep:http-body-util",
@@ -56,7 +65,7 @@ panic = "abort"
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "tower-http", "tokio", "sqlx", "leptos_axum"]
skip_feature_sets = [["ssr", "hydrate"]]
skip_feature_sets = [["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,2 +0,0 @@
[toolchain]
channel = "stable" # test change

View File

@@ -510,11 +510,9 @@ if (window.hljs) {
});
view! {
<pre><code class="language-rust">{code.await}</code></pre>
{
move || script.get().map(|script| {
view! { <Script>{script}</Script> }
})
}
<ShowLet some=script let:script>
<Script>{script}</Script>
</ShowLet>
}
})
};
@@ -567,11 +565,9 @@ if (window.hljs) {
});
view! {
<pre><code class="language-rust">{code.await}</code></pre>
{
move || script.get().map(|script| {
view! { <Script>{script}</Script> }
})
}
<ShowLet some=script let:script>
<Script>{script}</Script>
</ShowLet>
}
})
};

View File

@@ -26,8 +26,7 @@ async fn main() {
};
use axum_js_ssr::app::*;
use http_body_util::BodyExt;
use leptos::logging::log;
use leptos::prelude::*;
use leptos::{logging::log, prelude::*};
use leptos_axum::{generate_route_list, LeptosRoutes};
latency::LATENCY.get_or_init(|| [0, 4, 40, 400].iter().cycle().into());

View File

@@ -1,7 +1,3 @@
extend = [
{ path = "./lint.toml" }
]
[tasks.make-target-site-dir]
command = "mkdir"
args = ["-p", "target/site"]
@@ -24,21 +20,16 @@ clear = true
dependencies = ["check-debug", "check-release"]
[tasks.check-debug]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy"]
[tasks.check-release]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
[tasks.lint]
dependencies = ["make-target-site-dir", "check-style"]
args = ["all-features", "clippy", "--release"]
[tasks.start-client]
dependencies = ["install-cargo-leptos"]
command = "cargo"
args = ["leptos", "watch", "--release", "-P"]
args = ["leptos", "watch", "--release", "-P"]

View File

@@ -0,0 +1,11 @@
extend = [
{ path = "./cargo-leptos.toml" },
{ path = "../cargo-make/webdriver.toml" },
]
[tasks.integration-test]
dependencies = [
"install-cargo-leptos",
"start-webdriver",
"cargo-leptos-e2e-split",
]

View File

@@ -1,3 +1,8 @@
[tasks.cargo-all-features]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''
[tasks.install-cargo-leptos]
install_crate = { crate_name = "cargo-leptos", binary = "cargo-leptos", test_arg = "--help" }
args = ["--locked"]
@@ -6,6 +11,10 @@ args = ["--locked"]
command = "cargo"
args = ["leptos", "end-to-end"]
[tasks.cargo-leptos-e2e-split]
command = "cargo"
args = ["leptos", "end-to-end", "--split"]
[tasks.build]
clear = true
command = "cargo"
@@ -16,16 +25,14 @@ clear = true
dependencies = ["check-debug", "check-release"]
[tasks.check-debug]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy"]
[tasks.check-release]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy", "--release"]
[tasks.start-client]
dependencies = ["install-cargo-leptos"]

View File

@@ -1,11 +1,9 @@
[tasks.build]
toolchain = "stable"
command = "cargo"
args = ["build-all-features"]
install_crate = "cargo-all-features"
[tasks.cargo-all-features]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''
[tasks.check]
toolchain = "stable"
[tasks.build]
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "build"]

View File

@@ -1,3 +1,8 @@
[tasks.cargo-all-features]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''
[tasks.build]
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "--help" }
clear = true
@@ -14,13 +19,11 @@ clear = true
dependencies = ["check-debug", "check-release"]
[tasks.check-debug]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy"]
[tasks.check-release]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features", "--release"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy", "--release"]

View File

@@ -1,8 +1,15 @@
[tasks.pre-clippy]
env = { CARGO_MAKE_CLIPPY_ARGS = "--no-deps --all-targets --all-features -- -D warnings" }
[tasks.cargo-all-features]
install_script = '''
cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support
'''
[tasks.check-style]
dependencies = ["check-format-flow", "clippy-flow"]
[tasks.lint]
dependencies = ["check-format-flow", "clippy-each-feature"]
[tasks.clippy-each-feature]
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["all-features", "clippy", "--no-deps", "--", "-D", "warnings"]
[tasks.check-format]
env = { LEPTOS_PROJECT_DIRECTORY = "../../" }

View File

@@ -1,22 +1,19 @@
extend = [
{ path = "./compile.toml" },
{ path = "./clean.toml" },
{ path = "./lint.toml" },
{ path = "./node.toml" },
{ path = "./process.toml" },
{ path = "./compile.toml" },
{ path = "./clean.toml" },
{ path = "./lint.toml" },
{ path = "./node.toml" },
{ path = "./process.toml" },
]
# CI Stages
[tasks.ci]
dependencies = ["prepare", "lint", "build", "test-flow", "integration-test"]
dependencies = ["prepare", "lint", "test-flow", "integration-test"]
[tasks.prepare]
dependencies = ["setup-node"]
[tasks.lint]
dependencies = ["check-style"]
[tasks.integration-test]
# Support Local Runs

View File

@@ -1,22 +1,8 @@
extend = [
{ path = "../cargo-make/playwright.toml" },
{ path = "../cargo-make/trunk_server.toml" },
{ path = "../cargo-make/playwright.toml" },
{ path = "../cargo-make/trunk_server.toml" },
]
[tasks.integration-test]
dependencies = ["build", "start-client", "test-playwright"]
description = "Run integration test with automated start and stop of processes"
env = { SPAWN_CLIENT_PROCESS = "1" }
run_task = { name = ["start", "wait-test-stop"], parallel = true }
[tasks.wait-test-stop]
private = true
dependencies = ["wait-server", "test-playwright", "stop"]
[tasks.wait-server]
script = '''
for run in {1..12}; do
echo "Waiting to ensure server is started..."
sleep 10
done
echo "Times up, running tests"
'''

View File

@@ -6,5 +6,6 @@ command = "trunk"
args = ["build"]
[tasks.start-client]
command = "trunk"
args = ["serve", "${@}"]
script = '''
trunk serve -q "${@}" &
'''

View File

@@ -1,7 +1,3 @@
[tasks.test]
env = { RUN_CARGO_TEST = false }
condition = { env_true = ["RUN_CARGO_TEST"] }
[tasks.post-test]
dependencies = ["test-wasm"]

View File

@@ -1,8 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<link data-trunk rel="rust" data-wasm-opt="z"/>
<link data-trunk rel="icon" type="image/ico" href="/public/favicon.ico"/>
</head>
<body></body>
</html>
<head>
<link data-trunk rel="rust" data-wasm-opt="z" />
<link data-trunk rel="icon" type="image/ico" href="/public/favicon.ico" />
</head>
<body></body>
</html>

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,9 +1,7 @@
#![allow(dead_code)]
use counter::*;
use leptos::mount::mount_to;
use leptos::prelude::*;
use leptos::task::tick;
use leptos::{mount::mount_to, prelude::*, task::tick};
use wasm_bindgen::JsCast;
use wasm_bindgen_test::*;

View File

@@ -2,8 +2,6 @@
name = "counter_isomorphic"
version = "0.1.0"
edition = "2021"
# std::sync::LazyLock is stabilized in Rust version 1.80.0
rust-version = "1.80.0"
[lib]
crate-type = ["cdylib", "rlib"]
@@ -23,7 +21,6 @@ leptos = { path = "../../leptos" }
leptos_actix = { path = "../../integrations/actix", optional = true }
leptos_router = { path = "../../router" }
log = "0.4.22"
once_cell = "1.19"
gloo-net = { version = "0.6.0" }
wasm-bindgen = "0.2.93"
serde = { version = "1.0", features = ["derive"] }
@@ -44,7 +41,7 @@ ssr = [
[package.metadata.cargo-all-features]
denylist = ["actix-files", "actix-web", "leptos_actix"]
skip_feature_sets = [["ssr", "hydrate"]]
skip_feature_sets = [["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,17 +1,15 @@
extend = [
{ path = "../cargo-make/main.toml" },
{ path = "../cargo-make/wasm-test.toml" },
{ path = "../cargo-make/trunk_server.toml" },
{ path = "../cargo-make/main.toml" },
{ path = "../cargo-make/wasm-test.toml" },
{ path = "../cargo-make/trunk_server.toml" },
]
[tasks.build]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["build-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "build"]
[tasks.check]
toolchain = "stable"
dependencies = ["cargo-all-features"]
command = "cargo"
args = ["check-all-features"]
install_crate = "cargo-all-features"
args = ["all-features", "clippy"]

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -5,8 +5,7 @@ use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
use counters::Counters;
use leptos::prelude::*;
use leptos::task::tick;
use leptos::{prelude::*, task::tick};
use web_sys::HtmlElement;
#[wasm_bindgen_test]
@@ -24,8 +23,9 @@ async fn inc() {
assert_eq!(
div.inner_html(),
"<button>Add Counter</button><button>Add 1000 \
Counters</button><button>Clear Counters</button><p>Total: \
<span data-testid=\"total\">0</span> from <span data-testid=\"counters\">0</span> counters.</p><ul><!----></ul>"
Counters</button><button>Clear Counters</button><p>Total: <span \
data-testid=\"total\">0</span> from <span \
data-testid=\"counters\">0</span> counters.</p><ul><!----></ul>"
);
// add 3 counters
@@ -39,8 +39,9 @@ async fn inc() {
assert_eq!(
div.inner_html(),
"<button>Add Counter</button><button>Add 1000 \
Counters</button><button>Clear Counters</button><p>Total: \
<span data-testid=\"total\">0</span> from <span data-testid=\"counters\">3</span> \
Counters</button><button>Clear Counters</button><p>Total: <span \
data-testid=\"total\">0</span> from <span \
data-testid=\"counters\">3</span> \
counters.</p><ul><li><button>-1</button><input \
type=\"text\"><span>0</span><button>+1</button><button>x</button></\
li><li><button>-1</button><input \
@@ -81,8 +82,9 @@ async fn inc() {
assert_eq!(
div.inner_html(),
"<button>Add Counter</button><button>Add 1000 \
Counters</button><button>Clear Counters</button><p>Total: \
<span data-testid=\"total\">6</span> from <span data-testid=\"counters\">3</span> \
Counters</button><button>Clear Counters</button><p>Total: <span \
data-testid=\"total\">6</span> from <span \
data-testid=\"counters\">3</span> \
counters.</p><ul><li><button>-1</button><input \
type=\"text\"><span>1</span><button>+1</button><button>x</button></\
li><li><button>-1</button><input \
@@ -106,8 +108,9 @@ async fn inc() {
assert_eq!(
div.inner_html(),
"<button>Add Counter</button><button>Add 1000 \
Counters</button><button>Clear Counters</button><p>Total: \
<span data-testid=\"total\">5</span> from <span data-testid=\"counters\">2</span> \
Counters</button><button>Clear Counters</button><p>Total: <span \
data-testid=\"total\">5</span> from <span \
data-testid=\"counters\">2</span> \
counters.</p><ul><li><button>-1</button><input \
type=\"text\"><span>2</span><button>+1</button><button>x</button></\
li><li><button>-1</button><input \

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -13,12 +13,12 @@ leptos_axum = { path = "../../integrations/axum", optional = true }
leptos_meta = { path = "../../meta" }
leptos_router = { path = "../../router" }
serde = { version = "1.0", features = ["derive"] }
axum = { version = "0.7.5", optional = true }
axum = { version = "0.8.1", optional = true }
tower = { version = "0.4.13", optional = true }
tower-http = { version = "0.5.2", features = ["fs"], optional = true }
tokio = { version = "1.39", features = ["full"], optional = true }
http = { version = "1.1" }
thiserror = "1.0"
thiserror = "2.0.12"
wasm-bindgen = "0.2.93"
[features]
@@ -36,7 +36,7 @@ ssr = [
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "tower-http", "tokio", "leptos_axum"]
skip_feature_sets = [["ssr", "hydrate"]]
skip_feature_sets = [["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -45,7 +45,7 @@ async fn main() {
// build our application with a route
let app = Router::new()
.route("/special/:id", get(custom_handler))
.route("/special/{id}", get(custom_handler))
.leptos_routes(&leptos_options, routes, {
let leptos_options = leptos_options.clone();
move || shell(leptos_options.clone())

View File

@@ -15,7 +15,7 @@ serde = { version = "1.0", features = ["derive"] }
log = "0.4.22"
console_log = "1.0"
console_error_panic_hook = "0.1.7"
thiserror = "1.0"
thiserror = "2.0.12"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
tracing-subscriber-wasm = "0.1.0"

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,5 +1,4 @@
use leptos::prelude::*;
use leptos::tachys::html::style::style;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@@ -16,7 +15,7 @@ pub enum CatError {
type CatCount = usize;
async fn fetch_cats(count: CatCount) -> Result<Vec<String>> {
async fn fetch_cats(count: CatCount) -> Result<Vec<String>, Error> {
if count > 0 {
gloo_timers::future::TimeoutFuture::new(1000).await;
// make the request
@@ -42,11 +41,7 @@ async fn fetch_cats(count: CatCount) -> Result<Vec<String>> {
pub fn fetch_example() -> impl IntoView {
let (cat_count, set_cat_count) = signal::<CatCount>(1);
// we use new_unsync here because the reqwasm request type isn't Send
// if we were doing SSR, then
// 1) we'd want to use a Resource, so the data would be serialized to the client
// 2) we'd need to make sure there was a thread-local spawner set up
let cats = AsyncDerived::new_unsync(move || fetch_cats(cat_count.get()));
let cats = LocalResource::new(move || fetch_cats(cat_count.get()));
let fallback = move |errors: ArcRwSignal<Errors>| {
let error_list = move || {
@@ -66,8 +61,6 @@ pub fn fetch_example() -> impl IntoView {
}
};
let spreadable = style(("background-color", "AliceBlue"));
view! {
<div>
<label>
@@ -82,7 +75,7 @@ pub fn fetch_example() -> impl IntoView {
/>
</label>
<Transition fallback=|| view! { <div>"Loading..."</div> } {..spreadable}>
<Transition fallback=|| view! { <div>"Loading..."</div> }>
<ErrorBoundary fallback>
<ul>
{move || Suspend::new(async move {
@@ -92,7 +85,7 @@ pub fn fetch_example() -> impl IntoView {
.map(|s| {
view! {
<li>
<img src=s.clone()/>
<img src=s.clone() />
</li>
}
})

View File

@@ -7,7 +7,7 @@ pub fn main() {
fmt()
.with_writer(
// To avoide trace events in the browser from showing their
// To avoid trace events in the browser from showing their
// JS backtrace, which is very annoying, in my opinion
MakeConsoleWriter::default()
.map_trace_level_to(tracing::Level::DEBUG),

View File

@@ -25,7 +25,7 @@ log = "0.4.22"
serde = { version = "1.0", features = ["derive"] }
gloo-net = { version = "0.6.0", features = ["http"] }
reqwest = { version = "0.12.5", features = ["json"] }
wasm-bindgen = "0.2.93"
wasm-bindgen = "0.2.105"
web-sys = { version = "0.3.70", features = ["AbortController", "AbortSignal"] }
send_wrapper = "0.6.0"
@@ -43,15 +43,15 @@ codegen-units = 1
[package.metadata.cargo-all-features]
denylist = ["actix-files", "actix-web", "leptos_actix"]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
output-name = "hackernews"
# The site root folder is where cargo-leptos generate all output. WARNING: all content of this folder will be erased on a rebuild. Use it in your server setup.
site-root = "target/site"
# The site-root relative folder where all compiled output (JS, WASM and CSS) is written
# Defaults to pkg
# Defaults to pkg
site-pkg-dir = "pkg"
# [Optional] The source CSS file. If it ends with .sass or .scss then it will be compiled by dart-sass into CSS. The CSS is optimized by Lightning CSS before being written to <site-root>/<site-pkg>/app.css
style-file = "./style.css"

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,5 +1,4 @@
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
pub fn story(path: &str) -> String {
format!("https://node-hnapi.herokuapp.com/{path}")

View File

@@ -145,14 +145,11 @@ fn Story(story: api::Story) -> impl IntoView {
Either::Left(
view! {
<span>
{"by "}
{story
.user
.map(|user| {
view! {
<A href=format!("/users/{user}")>{user.clone()}</A>
}
})} {format!(" {} | ", story.time_ago)}
"by "
<ShowLet some=story.user let:user>
<A href=format!("/users/{user}")>{user.clone()}</A>
</ShowLet>
{format!(" {} | ", story.time_ago)}
<A href=format!(
"/stories/{}",
story.id,

View File

@@ -1,14 +1,12 @@
use crate::api;
use leptos::either::Either;
use leptos::prelude::*;
use leptos::{either::Either, prelude::*};
use leptos_meta::Meta;
use leptos_router::components::A;
use leptos_router::hooks::use_params_map;
use leptos_router::{components::A, hooks::use_params_map};
#[component]
pub fn Story() -> impl IntoView {
let params = use_params_map();
let story = Resource::new(
let story = Resource::new_blocking(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
@@ -32,17 +30,13 @@ pub fn Story() -> impl IntoView {
<h1>{story.title}</h1>
</a>
<span class="host">"(" {story.domain} ")"</span>
{story
.user
.map(|user| {
view! {
<p class="meta">
{story.points} " points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>
}
})}
<ShowLet some=story.user let:user>
<p class="meta">
{story.points} " points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>
</ShowLet>
</div>
<div class="item-view-comments">
<p class="item-view-comments-header">

View File

@@ -1,6 +1,5 @@
use crate::api::{self, User};
use leptos::server::Resource;
use leptos::{either::Either, prelude::*};
use leptos::{either::Either, prelude::*, server::Resource};
use leptos_router::hooks::use_params_map;
#[component]

View File

@@ -20,13 +20,13 @@ serde = { version = "1.0", features = ["derive"] }
tracing = "0.1.40"
gloo-net = { version = "0.6.0", features = ["http"] }
reqwest = { version = "0.12.5", features = ["json"] }
axum = { version = "0.7.5", optional = true }
axum = { version = "0.8.1", optional = true }
tower = { version = "0.4.13", optional = true }
tower-http = { version = "0.5.2", features = ["fs"], optional = true }
tokio = { version = "1.39", features = ["full"], optional = true }
http = { version = "1.1", optional = true }
web-sys = { version = "0.3.70", features = ["AbortController", "AbortSignal"] }
wasm-bindgen = "0.2.93"
wasm-bindgen = "0.2.105"
send_wrapper = { version = "0.6.0", features = ["futures"] }
[features]
@@ -47,7 +47,7 @@ ssr = [
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -1,6 +1,5 @@
use leptos::logging;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
pub fn story(path: &str) -> String {
format!("https://node-hnapi.herokuapp.com/{path}")

View File

@@ -4,7 +4,7 @@ mod routes;
use leptos_meta::{provide_meta_context, Link, Meta, MetaTags, Stylesheet};
use leptos_router::{
components::{FlatRoutes, Route, Router, RoutingProgress},
OptionalParamSegment, ParamSegment, StaticSegment,
Lazy, OptionalParamSegment, ParamSegment, StaticSegment,
};
use routes::{nav::*, stories::*, story::*, users::*};
use std::time::Duration;
@@ -44,8 +44,8 @@ pub fn App() -> impl IntoView {
<Nav />
<main>
<FlatRoutes fallback=|| "Not found.">
<Route path=(StaticSegment("users"), ParamSegment("id")) view=User/>
<Route path=(StaticSegment("stories"), ParamSegment("id")) view=Story/>
<Route path=(StaticSegment("users"), ParamSegment("id")) view={Lazy::<UserRoute>::new()}/>
<Route path=(StaticSegment("stories"), ParamSegment("id")) view={Lazy::<StoryRoute>::new()}/>
<Route path=OptionalParamSegment("stories") view=Stories/>
</FlatRoutes>
</main>

View File

@@ -1,7 +1,7 @@
#[cfg(feature = "ssr")]
#[tokio::main]
async fn main() {
use axum::Router;
use axum::{routing::get, Router};
use hackernews_axum::{shell, App};
use leptos::config::get_configuration;
use leptos_axum::{generate_route_list, LeptosRoutes};
@@ -13,6 +13,15 @@ async fn main() {
// build our application with a route
let app = Router::new()
.route(
"/favicon.ico",
get(|| async {
(
[("content-type", "image/x-icon")],
include_bytes!("../public/favicon.ico"),
)
}),
)
.leptos_routes(&leptos_options, routes, {
let leptos_options = leptos_options.clone();
move || shell(leptos_options.clone())

View File

@@ -133,7 +133,9 @@ fn Story(story: api::Story) -> impl IntoView {
Either::Left(view! {
<span>
{"by "}
{story.user.map(|user| view ! { <A href=format!("/users/{user}")>{user.clone()}</A>})}
<ShowLet some=story.user let:user>
<A href=format!("/users/{user}")>{user.clone()}</A>
</ShowLet>
{format!(" {} | ", story.time_ago)}
<A href=format!("/stories/{}", story.id)>
{if story.comments_count.unwrap_or_default() > 0 {

View File

@@ -1,26 +1,38 @@
use crate::api;
use leptos::either::Either;
use leptos::prelude::*;
use crate::api::{self, Story};
use leptos::{either::Either, prelude::*};
use leptos_meta::Meta;
use leptos_router::components::A;
use leptos_router::hooks::use_params_map;
use leptos_router::{
components::A, hooks::use_params_map, lazy_route, LazyRoute,
};
#[component]
pub fn Story() -> impl IntoView {
let params = use_params_map();
let story = Resource::new(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
None
} else {
api::fetch_api::<api::Story>(&api::story(&format!("item/{id}")))
#[derive(Debug)]
pub struct StoryRoute {
story: Resource<Option<Story>>,
}
#[lazy_route]
impl LazyRoute for StoryRoute {
fn data() -> Self {
let params = use_params_map();
let story = Resource::new_blocking(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
None
} else {
api::fetch_api::<api::Story>(&api::story(&format!(
"item/{id}"
)))
.await
}
},
);
}
},
);
Self { story }
}
Suspense(SuspenseProps::builder().fallback(|| "Loading...").children(ToChildren::to_children(move || Suspend::new(async move {
fn view(this: Self) -> AnyView {
let StoryRoute { story } = this;
Suspense(SuspenseProps::builder().fallback(|| "Loading...").children(ToChildren::to_children(move || Suspend::new(async move {
match story.await.clone() {
None => Either::Left("Story not found."),
Some(story) => {
@@ -28,18 +40,20 @@ pub fn Story() -> impl IntoView {
<Meta name="description" content=story.title.clone()/>
<div class="item-view">
<div class="item-view-header">
<a href=story.url target="_blank">
<h1>{story.title}</h1>
</a>
<span class="host">
"("{story.domain}")"
</span>
{story.user.map(|user| view! { <p class="meta">
{story.points}
" points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>})}
<a href=story.url target="_blank">
<h1>{story.title}</h1>
</a>
<span class="host">
"("{story.domain}")"
</span>
<ShowLet some=story.user let:user>
<p class="meta">
{story.points}
" points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>
</ShowLet>
</div>
<div class="item-view-comments">
<p class="item-view-comments-header">
@@ -63,7 +77,8 @@ pub fn Story() -> impl IntoView {
})
}
}
}))).build())
}))).build()).into_any()
}
}
#[component]

View File

@@ -1,47 +1,58 @@
use crate::api::{self, User};
use leptos::server::Resource;
use leptos::{either::Either, prelude::*};
use leptos_router::hooks::use_params_map;
use leptos::{either::Either, prelude::*, server::Resource};
use leptos_router::{hooks::use_params_map, lazy_route, LazyRoute};
#[component]
pub fn User() -> impl IntoView {
let params = use_params_map();
let user = Resource::new(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
None
} else {
api::fetch_api::<User>(&api::user(&id)).await
}
},
);
view! {
<div class="user-view">
<Suspense fallback=|| view! { "Loading..." }>
{move || Suspend::new(async move { match user.await.clone() {
None => Either::Left(view! { <h1>"User not found."</h1> }),
Some(user) => Either::Right(view! {
<div>
<h1>"User: " {user.id.clone()}</h1>
<ul class="meta">
<li>
<span class="label">"Created: "</span> {user.created}
</li>
<li>
<span class="label">"Karma: "</span> {user.karma}
</li>
<li inner_html={user.about} class="about"></li>
</ul>
<p class="links">
<a href=format!("https://news.ycombinator.com/submitted?id={}", user.id)>"submissions"</a>
" | "
<a href=format!("https://news.ycombinator.com/threads?id={}", user.id)>"comments"</a>
</p>
</div>
})
}})}
</Suspense>
</div>
#[derive(Debug)]
pub struct UserRoute {
user: Resource<Option<User>>,
}
#[lazy_route]
impl LazyRoute for UserRoute {
fn data() -> Self {
let params = use_params_map();
let user = Resource::new(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
None
} else {
api::fetch_api::<User>(&api::user(&id)).await
}
},
);
UserRoute { user }
}
fn view(this: Self) -> AnyView {
let UserRoute { user } = this;
view! {
<div class="user-view">
<Suspense fallback=|| view! { "Loading..." }>
{move || Suspend::new(async move { match user.await.clone() {
None => Either::Left(view! { <h1>"User not found."</h1> }),
Some(user) => Either::Right(view! {
<div>
<h1>"User: " {user.id.clone()}</h1>
<ul class="meta">
<li>
<span class="label">"Created: "</span> {user.created}
</li>
<li>
<span class="label">"Karma: "</span> {user.karma}
</li>
<li inner_html={user.about} class="about"></li>
</ul>
<p class="links">
<a href=format!("https://news.ycombinator.com/submitted?id={}", user.id)>"submissions"</a>
" | "
<a href=format!("https://news.ycombinator.com/threads?id={}", user.id)>"comments"</a>
</p>
</div>
})
}})}
</Suspense>
</div>
}.into_any()
}
}

View File

@@ -20,7 +20,7 @@ serde = { version = "1.0", features = ["derive"] }
tracing = "0.1.40"
gloo-net = { version = "0.6.0", features = ["http"] }
reqwest = { version = "0.12.5", features = ["json"] }
axum = { version = "0.7.5", optional = true, features = ["http2"] }
axum = { version = "0.8.1", optional = true, features = ["http2"] }
tower = { version = "0.4.13", optional = true }
tower-http = { version = "0.5.2", features = [
"fs",
@@ -57,7 +57,8 @@ ssr = [
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "tower-http", "tokio", "http", "leptos_axum"]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
max_combination_size = 2
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,8 +1,16 @@
extend = [
{ path = "../cargo-make/main.toml" },
{ path = "../cargo-make/cargo-leptos-compress.toml" },
{ path = "../cargo-make/main.toml" },
{ path = "../cargo-make/cargo-leptos-compress.toml" },
]
[tasks.ci]
dependencies = [
"prepare",
"make-target-site-dir",
"lint",
"test-flow",
"integration-test",
]
[env]
CLIENT_PROCESS_NAME = "hackernews_islands"

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

View File

@@ -3,6 +3,7 @@ use axum::{
http::{header, Request, Response, StatusCode, Uri},
response::{IntoResponse, Response as AxumResponse},
};
use rust_embed::Embed;
use std::borrow::Cow;
#[cfg(not(debug_assertions))]
@@ -11,7 +12,7 @@ const DEV_MODE: bool = false;
#[cfg(debug_assertions)]
const DEV_MODE: bool = true;
#[derive(rust_embed::RustEmbed)]
#[derive(Embed)]
#[folder = "target/site/"]
struct Assets;
@@ -25,12 +26,17 @@ pub async fn file_and_error_handler(
.map(|h| h.to_str().unwrap_or("none"))
.unwrap_or("none")
.to_string();
let res = get_static_file(uri.clone(), accept_encoding).await.unwrap();
let static_result = get_static_file(uri.clone(), accept_encoding).await;
if res.status() == StatusCode::OK {
res.into_response()
} else {
(StatusCode::NOT_FOUND, "Not found.").into_response()
match static_result {
Ok(res) => {
if res.status() == StatusCode::OK {
res.into_response()
} else {
(StatusCode::NOT_FOUND, "Not found.").into_response()
}
}
Err(e) => e.into_response(),
}
}

View File

@@ -1,6 +1,7 @@
#[cfg(feature = "ssr")]
#[tokio::main]
async fn main() {
use axum::routing::get;
pub use axum::Router;
use hackernews_islands::*;
pub use leptos::config::get_configuration;
@@ -25,6 +26,7 @@ async fn main() {
// build our application with a route
let app = Router::new()
.route("/favicon.ico", get(fallback::file_and_error_handler))
.leptos_routes(&leptos_options, routes, {
let leptos_options = leptos_options.clone();
move || shell(leptos_options.clone())

View File

@@ -47,7 +47,7 @@ pub fn Stories() -> impl IntoView {
let stories = Resource::new(
move || (page(), story_type()),
move |(page, story_type)| async move {
fetch_stories(category(&story_type), page).await.ok()
fetch_stories(story_type, page).await.ok()
},
);
let (pending, set_pending) = signal(false);
@@ -143,8 +143,10 @@ fn Story(story: api::Story) -> impl IntoView {
{if story.story_type != "job" {
Either::Left(view! {
<span>
{"by "}
{story.user.map(|user| view ! { <A href=format!("/users/{user}")>{user.clone()}</A>})}
"by "
<ShowLet some=story.user let:user>
<A href=format!("/users/{user}")>{user.clone()}</A>
</ShowLet>
{format!(" {} | ", story.time_ago)}
<A href=format!("/stories/{}", story.id)>
{if story.comments_count.unwrap_or_default() > 0 {

View File

@@ -1,9 +1,7 @@
use crate::api;
use leptos::either::Either;
use leptos::prelude::*;
use leptos::{either::Either, prelude::*};
use leptos_meta::Meta;
use leptos_router::components::A;
use leptos_router::hooks::use_params_map;
use leptos_router::{components::A, hooks::use_params_map};
#[server]
pub async fn fetch_story(
@@ -15,7 +13,7 @@ pub async fn fetch_story(
#[component]
pub fn Story() -> impl IntoView {
let params = use_params_map();
let story = Resource::new(
let story = Resource::new_blocking(
move || params.read().get("id").unwrap_or_default(),
move |id| async move {
if id.is_empty() {
@@ -34,18 +32,20 @@ pub fn Story() -> impl IntoView {
<Meta name="description" content=story.title.clone()/>
<div class="item-view">
<div class="item-view-header">
<a href=story.url target="_blank">
<h1>{story.title}</h1>
</a>
<span class="host">
"("{story.domain}")"
</span>
{story.user.map(|user| view! { <p class="meta">
{story.points}
" points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>})}
<a href=story.url target="_blank">
<h1>{story.title}</h1>
</a>
<span class="host">
"("{story.domain}")"
</span>
<ShowLet some=story.user let:user>
<p class="meta">
{story.points}
" points | by "
<A href=format!("/users/{user}")>{user.clone()}</A>
{format!(" {}", story.time_ago)}
</p>
</ShowLet>
</div>
<div class="item-view-comments">
<p class="item-view-comments-header">

View File

@@ -1,6 +1,5 @@
use crate::api;
use leptos::server::Resource;
use leptos::{either::Either, prelude::*};
use leptos::{either::Either, prelude::*, server::Resource};
use leptos_router::hooks::use_params_map;
#[server]

View File

@@ -23,7 +23,7 @@ serde = { version = "1.0", features = ["derive"] }
tracing = "0.1.40"
gloo-net = { version = "0.6.0", features = ["http"] }
reqwest = { version = "0.12.5", features = ["json"] }
axum = { version = "0.7.5", default-features = false, optional = true }
axum = { version = "0.8.1", default-features = false, optional = true }
tower = { version = "0.4.13", optional = true }
http = { version = "1.1", optional = true }
web-sys = { version = "0.3.70", features = [
@@ -57,7 +57,7 @@ ssr = [
[package.metadata.cargo-all-features]
denylist = ["axum", "tower", "http", "leptos_axum"]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"], []]
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name

View File

@@ -1,2 +1,2 @@
[toolchain]
channel = "stable" # test change
targets = ["wasm32-unknown-unknown"]

Some files were not shown because too many files have changed in this diff Show More