Commit graph

548 commits

Author SHA1 Message Date
Greg Johnston
00a536a5dc don't over-rerender nested router 2024-08-01 19:40:57 -04:00
Greg Johnston
a7b1152910 initial async routing work (to support bundle splitting) 2024-08-01 19:40:57 -04:00
Greg Johnston
cfba7a2797 noop attribute 'spreading' for routers 2024-08-01 19:40:57 -04:00
Greg Johnston
b24eaedfe9 reorganizing exports and updating examples 2024-08-01 19:40:56 -04:00
Greg Johnston
4336051f78 prep for preview release 2024-08-01 19:40:56 -04:00
Greg Johnston
420dccda60 provide params properly in FlatRouter 2024-08-01 19:40:56 -04:00
Greg Johnston
75d6763f4e move router crates 2024-08-01 19:40:56 -04:00
Saber Haj Rabiee
d50012f8d4
chore: update gloo-net and reqwest to http 1.0 (closes #2688) (leptos 0.6) (#2751) 2024-08-01 19:39:54 -04:00
Greg Johnston
8848eb8b87 0.6.13 2024-07-24 08:00:11 -04:00
Oleg Shatov
b3db094618
chore: remove cfg-related warnings (#2654) 2024-07-03 06:49:32 -04:00
Chris
fb5d8513ff
docs: generate link to definition (#2656) 2024-07-03 06:46:02 -04:00
Greg Johnston
ff0c8252b0
fix: do not unescape / and other route characters when following a link (#2651) 2024-06-28 14:29:05 -04:00
Hamir Mahal
c9d0ef5033
chore: simplify string interpolation (#2626) 2024-06-21 07:51:38 -04:00
Greg Johnston
a59561f796 chore: clippy 2024-06-02 15:37:54 -04:00
Greg Johnston
96b448805d v0.6.12 2024-06-02 14:08:08 -04:00
Luxalpa
2ef27cb0bb
fix: URL encoding issue (closes #2602) (#2601) 2024-06-02 14:06:41 -04:00
Greg Johnston
da9711a743
docs: add caveats for ProtectedRoute (#2558) 2024-05-01 07:06:54 -04:00
kryesh
c1ebaf9d04
feat: add create_query_signal_with_options to leptos_router (#2517) 2024-04-17 19:23:33 -04:00
Ben Wishovich
c8186eea13
Add id to ActionForm and MultiActionForm (#2535) 2024-04-16 14:52:51 -07:00
Greg Johnston
fe06c6b91b fix: do not submit <ActionForm> on formmethod="dialog" submission (closes #2523) 2024-04-15 16:49:02 -04:00
martin frances
9a51fb17fc
Minor: Bumped serde_qs to 0.13. (#2512) 2024-04-14 14:39:44 -07:00
Greg Johnston
e29d31e686 0.6.11 2024-04-10 09:33:22 -04:00
Greg Johnston
e68f1bbad5
fix: stable Router IDs (closes #2514) (#2515) 2024-04-10 09:31:34 -04:00
Lukas Potthast
119c9ea23f
feat: allow spreading of both attributes and event handlers (#2432) 2024-04-05 14:30:34 -04:00
Greg Johnston
c750f57ddc v0.6.10 2024-04-02 09:39:53 -04:00
Greg Johnston
41f3c46830
chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
martin frances
f3d19ca744
Minor: Ran cargo clippy --fix (#2461)
Manually reviewed the changes. All look like reasonable nudges.

A summary :-

In one place removed a redundant call to .clone().

In two places, now using clone_from() which clippy says
**MAY** be an optimisation.
2024-03-23 18:27:31 -07:00
Greg Johnston
480d741749
chore: update to gloo-net 0.5 (closes #2411) (#2416) 2024-03-08 15:22:12 -05:00
Álvaro Mondéjar
7928f61401
chore: add lint to disallow prints to stdout (#2404) 2024-03-08 13:18:37 -05:00
benwis
3e93a686f4
Fix and release deps 2024-03-03 17:04:34 -08:00
benwis
9e2fb62857
0.6.8 2024-03-02 18:01:10 -08:00
benwis
59d3cce3be
0.6.7 2024-02-29 13:38:09 -08:00
Paul Hansen
6a83161368
chore: add MSRV (#2360) 2024-02-28 07:19:09 -05:00
haslersn
6d6019b956
fix: do not strip query in redirect hook when using client-side navigation (#2376) 2024-02-27 09:06:48 -08:00
zoomiti
4809cf473e
feat: provide leptos_router::Method via context (#1808) (#2315) 2024-02-26 21:25:53 -05:00
Tadas Dailyda
aa977001c1
feat: add support for trailing slashes (closes #2154) (#2217) 2024-02-26 20:56:44 -05:00
benwis
330ebdb018
v0.6.6 2024-02-19 13:48:32 -08:00
haslersn
001ca5148e
fix: handle cross-origin redirects in server function redirect hook (#2329)
In client-side navigation we now handle redirects returned from
server functions by resolving the location against the current
origin as a base. The base is only relevant if the location
doesn't already include an origin. This fixes cross-origin
redirects.

Note: in order to handle redirects in the same way as the browser
would handle them, we need to use the server function's URL
(typically `<origin>/api/something`) as a base. I leave this as
a TODO for a future leptos version, because it probably
requires changing the signature of the `server_fn` redirect hook.

In order to not be affected by a future breaking change, users
should already start making sure that their redirect locations
either include an origin or at least start with a single slash
(e.g. `Location: /foo`).
2024-02-17 13:09:39 -05:00
Greg Johnston
7dc0441f6c
docs: log error on failing to convert form to ServerFn type, in addition to setting action value (#2319) 2024-02-16 17:11:14 -05:00
haslersn
d4bdc36062
fix: add key/value pair from submit button when parsing form event (#2268) 2024-02-07 11:09:01 -05:00
Greg Johnston
701e3077fb chore: cargo fmt 2024-02-05 06:38:02 -05:00
zoomiti
85c3755f6d
fix: bug with percent decoding of url params (#2251) 2024-02-04 19:24:02 -05:00
Joris Hartog
b0b3c21285
docs: fix broken link in leptos_router (#2256) 2024-02-04 15:29:34 -05:00
martin frances
5029b8f315
Chore: Minor, ran ``cargo fmt`` (#2254) 2024-02-03 14:24:12 -08:00
Greg Johnston
f1bc734dcf 0.6.5 2024-01-31 19:40:41 -05:00
Greg Johnston
595013579c 0.6.4 2024-01-30 09:17:52 -05:00
Greg Johnston
8a2ae7fc7c \v0.6.3\ 2024-01-26 21:00:21 -05:00
Greg Johnston
9de34b74cf 0.6.2 2024-01-26 18:07:04 -05:00
benwis
2bf09384df
0.6.1
Signed-off-by: benwis <ben@celcyon.com>
2024-01-26 12:32:14 -08:00
benwis
ac12e1a411
0.6.0
Signed-off-by: benwis <ben@celcyon.com>
2024-01-26 11:54:07 -08:00
Greg Johnston
ca3806e6bc v0.6.0-rc1 2024-01-24 21:35:14 -05:00
Niklas Eicker
997b99081b
change: for static routes, remove .static and provide additional context for static_params closures (#2207) 2024-01-21 13:33:05 -05:00
Greg Johnston
3f22906053 fix warning 2024-01-19 14:17:26 -05:00
Greg Johnston
320179bc04 remove misleading warning 2024-01-19 14:17:26 -05:00
Greg Johnston
7a086ad159 update version number 2024-01-19 14:17:25 -05:00
Greg Johnston
cc6f65cd83 initial version of server action error handling without JS 2024-01-19 14:16:58 -05:00
Greg Johnston
a5cbfa0aad remove viz integration (see #2177) 2024-01-19 14:16:58 -05:00
Greg Johnston
738eeefe73 chore: clear warnings 2024-01-19 14:16:18 -05:00
Greg Johnston
f5c007df7b use server fns directly in ActionForm and MultiActionForm 2024-01-19 14:16:18 -05:00
Greg Johnston
db1497b9c2 set version, input, etc. correctly 2024-01-19 14:16:18 -05:00
Greg Johnston
4e3f1c834c handle client-side and server-side redirects correctly (in Axum) 2024-01-19 14:16:18 -05:00
Greg Johnston
566df034ff actually use server functions in ActionForm 2024-01-19 14:16:17 -05:00
Greg Johnston
fd97e2e027 Restore the previous full functionality of Form 2024-01-19 14:16:17 -05:00
Greg Johnston
c3e3ce7878 changes to get todo_app_sqlite_axum example working 2024-01-19 14:16:17 -05:00
Greg Johnston
0c4cf5471d v0.5.7 2024-01-19 13:03:44 -05:00
Greg Johnston
5cacb57283 chore: new clippy warnings 2024-01-19 11:14:36 -05:00
Greg Johnston
ae1de88916 Revert "Better handling for trailing slashes. (#2154) (#2172)"
This reverts commit 1eaf886481.
2024-01-19 10:27:38 -05:00
benwis
98f18e7c31 release: version 0.5.6 2024-01-16 16:57:07 -08:00
Greg Johnston
3a5730800c v0.5.5 2024-01-15 17:10:49 -05:00
Greg Johnston
d71feada7e
change: change all tracing levels to trace to reduce verbosity (#2176) 2024-01-13 08:19:12 -08:00
Cody Casterline
1eaf886481
Better handling for trailing slashes. (#2154) (#2172)
* retain trailing slashes in paths but leave matching trail-slash-insensitive

* fix: Allow trailing slashes to remain in leptos_path.

* Better handling for trailing slashes. (#2154)

This adds a trailing_slash option to <Router> and <Route>.

By default, this option is backward compatible with current Leptos
behavior, but users can opt into two new modes for handling trailing
slashes.

* cargo fmt

* Fix redirect routes for wildcard patterns.

* Clippy fixies

* (Re)Reduce the scope of PossibleBranchContext's internals.

* Test real code, not copied code.

* Test TrailingSlash redirects.

* Fixes and more tests for matching "" && "/".

This path is the exception to the rule and *should* be treated
as equivalent regardless of its trailing slash.

* cargo fmt

---------

Co-authored-by: Tadas Dailyda <tadas@dailyda.com>
2024-01-11 13:51:31 -08:00
Luxalpa
10bbeea697
fix: remember router state (fixes #2164) (#2165) 2024-01-10 19:51:37 -05:00
Simon Bihel
f5bf539148
fix: allow multiple SSRed Leptos apps on same server (closes #1806) (#2135) 2024-01-07 15:28:50 -05:00
martin frances
ea80a21a54
chore: remove duplicate itertools versions (#2124)
The root cause is the family of leptos modules requiring both versions 0.10.5 and 0.11.0
This PR will fix that. ( Also needs a bump to 0.12.0 )

```
warning: multiple versions for dependency `itertools`: 0.10.5, 0.11.0
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
note: the lint level is defined here
 --> src/lib.rs:4:9
  |
4 | #![warn(clippy::cargo)]
  |         ^^^^^^^^^^^^^
  = note: `#[warn(clippy::multiple_crate_versions)]` implied by `#[warn(clippy::cargo)]`
```
2023-12-20 19:10:00 -05:00
Greg Johnston
33590d487b
chore: clean up warnings causing CI issues (#2119) 2023-12-18 08:15:46 -05:00
Niklas Eicker
fb0a62f3f6
fix: support additional context for route generation (#2113) 2023-12-17 20:37:27 -05:00
Greg Johnston
6014a70d0d
fix: support complete URLs in <A/> and <Form/> (closes #2076) (#2096) 2023-12-01 19:20:43 -05:00
itowlson
9bbd881757
feat: support spawn_local on Spin WASI (#2066)
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
2023-12-01 15:34:29 -05:00
Greg Johnston
b95a79240e v0.5.4 2023-11-28 18:46:51 -05:00
Alexis Fontaine
8e374efe8d
fix: invalid attribute value for aria-current (#2089) 2023-11-28 15:23:16 -05:00
Greg Johnston
d6ee2a37f4 v0.5.3 2023-11-27 19:38:33 -05:00
Greg Johnston
d531848db5
fix: dispose previous route or outlet before rendering new one (closes #2070) (#2071) 2023-11-24 14:51:51 -05:00
martin frances
362e3bc603
chore: stop using std::fmt, instead used core::fmt. (#2033) 2023-11-17 15:36:13 -05:00
Chris
85dd726d43
docs: ActionForm examples for indexing into struct fields (#2017)
Co-authored-by: chrisp60 <gh@cperry.me>
2023-11-17 15:22:11 -05:00
Chris
3adfd334df
fix: leptos_router::params_map! (#1973)
Fixing implementation comes with the benefit of knocking a crate out of
the deps tree (`common_macros`).
2023-11-02 16:29:50 -04:00
Chris
67bdb3498f
docs: switch feature flag stable to nightly (#1959) 2023-10-29 21:48:53 -04:00
Greg Johnston
777095670e
fix: add leptos_axum::build_static_routes (closes #1843) (#1855) 2023-10-27 17:09:52 -04:00
koopa
a11c6303e2
feat: allow arbitrary attributes for <A/> component (#1953) 2023-10-27 15:30:30 -04:00
Greg Johnston
5f53a1459e v0.5.2 2023-10-24 21:03:29 -04:00
Greg Johnston
db1113e5b3
fix: use separate key in hydration ID for router outlets (closes #1909) (#1939) 2023-10-24 15:42:30 -04:00
Greg Johnston
fdd4b3d919 chore: cargo fmt 2023-10-24 15:01:33 -04:00
martin frances
d999ff857d
chore: remove cargo doc lint warnings (#1936) 2023-10-24 14:28:01 -04:00
koopa
a7330d61b6
feat: add replace prop to Form component (#1923) 2023-10-24 14:24:23 -04:00
martin frances
05b4f8e617
chore: use .first() [not .get(0)] (#1929) 2023-10-23 21:02:42 -04:00
Greg Johnston
bf14999eb2
fix: router should still scroll to hash even if path didn't change (closes #1907) (#1917) 2023-10-20 14:57:35 -04:00
Greg Johnston
33e166a462
allow construction by making data public 2023-10-18 19:16:08 -04:00
Greg Johnston
8994154b23
fix: maintain hash when setting query signal (closes #1902) (#1908) 2023-10-17 20:28:57 -04:00
luoxiaozero
7b88df32d1
feat: add a target prop to the <A/> component (#1906) 2023-10-17 20:28:37 -04:00
PianoPrinter
0d6ddfb71e
fix: properly handle trailing / in more routes (#1900) 2023-10-17 12:45:22 -04:00
Greg Johnston
ad208ec473
fix: bug with client-side routing no longer working due to different origin (#1899) 2023-10-15 20:39:03 -04:00
Greg Johnston
8eed999611
fix: properly handle trailing / in splat routes (closes #1764) (#1890) 2023-10-14 08:37:31 -04:00
Greg Johnston
f3508cef36
feat: add reasonable fallback behavior for ActionForm in an island (#1888) 2023-10-11 18:59:49 -04:00
Greg Johnston
9af1c7e1a3
fix: hydration ID clash with Suspense > Outlet > Suspense (closes #1863) (#1864) 2023-10-09 16:22:43 -04:00
Greg Johnston
be2d014f08 v0.5.1 2023-10-06 09:40:23 -04:00
Greg Johnston
32e8213ebf v0.5.0 2023-09-29 17:13:56 -04:00
Greg Johnston
ae986e71fa
change: only run create_local_resource in the browser (#1777) 2023-09-23 11:10:50 -04:00
Village
3b864ac1a0
feat: Static Site Generation (#1649) 2023-09-22 13:32:09 -04:00
Danik Vitek
baa5ea83fa
fix: reimplement Oco cloning (#1749) 2023-09-22 13:31:04 -04:00
Gabriel de Perthuis
d651400fa2
docs: better document the interaction of SsrModes with blocking resources (#1765)
Meant to address users making the same mistake as
https://github.com/leptos-rs/leptos/issues/1119
2023-09-22 12:58:28 -04:00
Fangdun Tsai
b729a658df
chore(leptos_router): improve docs (#1769) 2023-09-22 12:56:49 -04:00
Greg Johnston
7e5169e66d 0.5.0-rc2 2023-09-15 20:06:56 -04:00
Greg Johnston
73a85b4955
feat: use attr: syntax rather than AdditionalAttributes (#1728) 2023-09-15 18:36:54 -04:00
Greg Johnston
20e5db22b8
fix: replace uses of create_effect internally with create_isomorphic_effect (closes #1709) (#1723) 2023-09-15 17:23:36 -04:00
Greg Johnston
fe42ac11a8 0.5.0-rc1 2023-09-11 21:08:14 -04:00
Greg Johnston
66dfef8729
Merge pull request #1681 from leptos-rs/docs 2023-09-08 17:11:47 -04:00
Greg Johnston
238d61ce1e
feat: experimental islands (#1660) 2023-09-08 16:33:00 -04:00
Greg Johnston
6c24061c82 docs: emphasize that you should only render <Routes/> once (closes #1552, #1620) 2023-09-08 15:48:41 -04:00
Greg Johnston
de44b1f91f
Merge pull request #1673 from martinfrances107/router_version_bump
Router version bump
2023-09-08 07:43:47 -04:00
Greg Johnston
689022661d
change: move logging macros into a logging module to avoid name conflicts with log and tracing (#1658) 2023-09-08 07:42:58 -04:00
martinfrances107
5585f20940
chore: Bumped a few outdated packages.
-cached = { version = "0.44.0", optional = true }
+cached = { version = "0.45.0", optional = true }
-lru = { version = "0.10", optional = true }
+lru = { version = "0.11", optional = true }
2023-09-08 09:30:13 +01:00
Florian Wickert
db20be5576
fix: compare path components to detect active link in router (#1656) 2023-09-06 06:49:10 -04:00
Greg Johnston
2ca24883ac
fix: memoize Suspense readiness to avoid rerendering children/fallback (#1642) 2023-09-03 20:07:20 -04:00
Greg Johnston
bee9bd8f67 0.5.0-beta2 2023-08-29 21:23:59 -04:00
Jon Cahill
e0a132bde3
fix: don't try to parse as JSON the result from a server function redirect (#1604) 2023-08-29 20:42:19 -04:00
Danik Vitek
793c191619
feat: Oco (Owned Clones Once) smart pointer (#1480) 2023-08-26 11:43:51 -04:00
Greg Johnston
8f067dcde7 chore: clear release-mode warnings 2023-08-25 17:16:00 -04:00
Greg Johnston
dbc707adcd
feat/change: adopt reactive ownership model and drop cx/Scope (#918) 2023-08-21 19:31:37 -04:00
Greg Johnston
e9deff52a7 v0.4.9 2023-08-20 14:27:49 -04:00
Greg Johnston
8ec3fb95f0
docs: typos in NavigateOptions docs (#1525) 2023-08-09 20:44:39 -04:00
Danik Vitek
3a98bdb3c2
fix: use current pathname for create_query_signal (#1508) 2023-08-07 20:25:22 -04:00
Greg Johnston
2f860b37bd v0.4.8 2023-08-02 19:25:32 -04:00
Greg Johnston
54733e1b34 v0.4.7 2023-08-02 17:03:38 -04:00
Greg Johnston
7ef7546fa9 v0.4.6 2023-07-25 06:08:53 -04:00
mforsb
e67bc2083a
feat: add noscroll attribute to Form, ActionForm (#1432) 2023-07-25 06:07:37 -04:00
Ari Seyhun
2e559d6a06
feat: add create_query_signal for URL-synced signals (#1377) 2023-07-23 12:20:15 -04:00
Greg Johnston
cc52c94348
docs/examples: use shorthand form for <Route/> views when possible (#1375) 2023-07-20 16:28:43 -04:00
Greg Johnston
338d2ab839
Merge pull request #1379 from agilarity/lint-with-clippy
ci: lint with clippy
2023-07-20 14:15:16 -04:00
Joseph Cruz
fb52cfa73e fix: needless_raw_string_hashes 2023-07-19 08:43:57 -04:00
Ari Seyhun
b2c75d215b
chore: remove unnecessary string allocation in TryFrom for Url (#1376) 2023-07-19 07:04:06 -04:00
Joseph Cruz
14bda76b30 fix: needless_raw_string_hashes (allow) 2023-07-18 20:56:39 -04:00
Greg Johnston
c1c49ce53b v0.4.5 2023-07-18 14:02:56 -04:00
Greg Johnston
3036cd223e v0.4.4 2023-07-17 17:33:44 -04:00
Greg Johnston
5af2f4e98d
docs/warning: fix <ActionForm/> docs and add runtime warning for incorrect encodings (#1360) 2023-07-15 19:09:03 -04:00
Greg Johnston
10d51a854a v0.4.3 2023-07-14 09:22:19 -04:00
Joseph Cruz
3481a6ee53
build: run tasks from workpace or member directory (#1339) 2023-07-13 16:46:51 -04:00
Greg Johnston
8a90f97959
fix: routing logic to scroll to top was broken (#1335) 2023-07-13 06:43:49 -04:00
Greg Johnston
e9665b34e5
feat: add active_class prop on <A/> (#1323) 2023-07-12 16:21:07 -04:00
Greg Johnston
ec3a26dfbc
fix: <ActionForm/> should set value even if redirected (#1321) 2023-07-11 09:37:13 -04:00
Ari Seyhun
aef7c4ce8e
perf: use lazy thread local for regex in router match_optionals (#1309) 2023-07-08 08:47:52 -04:00
Greg Johnston
b29eb8e032
fix: <ActionForm/> should check origin correctly before doing a full-page refresh (#1304) 2023-07-08 08:00:48 -04:00