Skip to content

Fix/router child dynamic prefix 0.7#5683

Open
rjharmon wants to merge 7 commits into
DioxusLabs:v0.7from
rjharmon:fix/router-child-dynamic-prefix-0.7
Open

Fix/router child dynamic prefix 0.7#5683
rjharmon wants to merge 7 commits into
DioxusLabs:v0.7from
rjharmon:fix/router-child-dynamic-prefix-0.7

Conversation

@rjharmon

Copy link
Copy Markdown

Same as #5655 but on main branch

Includes a resync of the Cargo.lock that seems like it was misplaced during the path to 0.7.9

JOSEPHGILBY and others added 7 commits July 4, 2026 12:48
…Labs#5613)

* fix(router): preserve query and hash segments on child routes

* fix double encoding

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
* widen ChildRouteMapping.format_route_as_root_route to Arc<dyn Fn>
* add parse_route_via_chain helper for depth-2+ child router chains
* add format_route_via_chain helper, symmetric to parse_route_via_chain,
  so format-side closure composition walks through multiple outer
  ChildRouteMapping<R> mappings at depth 3 or more
* walk parent dynamic segments before delegating to child::from_str,
  preserving DioxusLabs#5613's raw_query and raw_hash forwarding
* emit catch-all writes through a Display wrapper so
  composes with children that have only query or hash specs
* drain catch-all without consuming the source segments iterator
* parsing: dynamic-prefix child round-trip via to_string, including
  a percent-encoded value subcase
* parsing: dynamic-prefix child preserves the query channel
* parsing: dynamic-prefix child preserves the hash channel
* parsing: catch-all parent composes with query-only child
* parsing: catch-all parent with typed element type round-trips
* parsing: typed parent dynamic segment surfaces parent parse error
* via_ssr: render under dynamic parent prefix
* via_ssr: depth-2 chain preserves the deepest dynamic, and Link href
  captures parent dynamic at depth 2
* via_ssr: depth-3 chain preserves the deepest dynamic two hops down
* via_ssr: depth-3 Link href captures both parent dynamics
…le derive

Given [#nest("/with/:param")]... #[end_nest] when a layout opened inside
the nest is still open; requires explicit #[end_layout] before a
following variant.

- #[end_layout]/#[end_nest] aren't needed unless there's another variant
- a following variant was generated with the nesting parameter expected,
  producing a unbound-identifier E0425 (mysterious looking because it's
  in generated code)
- gives a direct diagnostic instead of the mystery error
@rjharmon
rjharmon requested a review from a team as a code owner July 16, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants