Liking cljdoc? Tell your friends :D

Routing Documentation / Contract Audit Matrix

Date: 2026-02-18 Scope: Guide.adoc "Hierarchical Routing" section (lines 1035–1186) vs shipped code

Slice A: Claim-to-Implementation Matrix

#Guide Claim (line)Implementation StatusNotes
1uir/session-id is a well-known constant (1041)Matchessession-id = ::session in ui_routes.cljc:30
2uir/routes + uir/rstate define routing regions (1045)Matchesroutes and rstate are public fns
3uir/routing-regions wraps routes in parallel state (1056)MatchesReturns state {:id :state/route-root} with parallel node
4:route/segment overrides URL path segment (1059, 1141)Matcheselement-segment in route_url.cljc:204-210 checks :route/segment first
5Segments compose hierarchically (1065)Matchesleaf-route-path-segments walks up collecting segments; compute-segment-chain does same
6uir/istate invokes child statechart (1067-1073)Matchesistate uses ele/invoke with :type :statechart
7:route/reachable enables cross-chart transitions (1075)Matchesroutes generates cross-transitions from reachable sets
8uir/start! takes 2 args: (start! app statechart) (1081)Matches2-arity and 3-arity (with options map)
9No session-id or registration key needed (1084)MatchesUses session-id constant for both machine and session-id
10uir/route-to! navigates (1091)MatchesDelegates to scf/send! with route-to event
11uir/install-url-sync! after start! for URL sync (1096-1101)MatchesThrows if no routing session found
12url-sync-on-save required in :on-save (1104-1111)MatchesDispatches to registered handlers
13Deep busy-checking across invocation tree (1116)Matchesdeep-busy? recursive fn in ui_routes.cljc:457-481
14route-denied? / force-continue-routing! / abandon-route-change! (1120-1126)MatchesAll three are public fns
15send-to-self! sends events to child chart (1130-1135)MatchesWalks parent chain to find nearest co-located chart, then uses scf/send!
16Route params via _p query parameter (1155-1162)Matchesencode-params/decode-params use transit+base64
17:route/params extracts keys into data model (1165-1173)Matchesestablish-route-params-node assigns to [:routing/parameters id]
18element-segment returns segment or (name target) (1179)Matchesroute_url.cljc:204-210
19path-from-configuration builds URL path (1180)Matchesroute_url.cljc:254-263
20configuration->url combines path + params (1181)Matchesroute_url.cljc:287-295
21url->route-target parses URL (1182)Matchesroute_url.cljc:352-377
22find-target-by-leaf-name finds element by segment (1183)Matchesroute_url.cljc:379-388

Slice A: Missing from Guide (shipped but undocumented)

#FeatureLocationPriority
M1:routing/checks validation option (:warn/:strict)start! and install-url-sync! 3rd-arg optionsHigh — users should know about validation
M2active-leaf-routes — walks invocation tree for true deep leavesui_routes.cljc:758-769Medium — useful for UI rendering decisions
M3URLHistoryProvider protocol — headless URL syncroute_url.cljc:41-49Medium — needed for SSR/testing
M4SimulatedURLHistory — cross-platform testing providerroute_url.cljc:97-151Medium — needed for test setup
M5validate-route-configuration — standalone validationui_routes.cljc:207-218Low — mainly internal
M6reachable-targets — utility for generating :route/reachableui_routes.cljc:808-822Medium — useful helper
M7deep-configuration->url — full invocation-tree URL buildingroute_url.cljc:297-337Low — internal to install-url-sync!
M8current-invocation-configuration — query child chart stateui_routes.cljc:799-806Medium
M9:route/segment on istateistate docstring, line 379High — already on rstate but istate equally supports it
M10ro/initialize:once/:always/:never initialization modesui_routes_options.cljc:4-7High — critical for forms

Slice A: Deprecated/Removed (cleaned up)

ItemStatus
:route/pathFully removed from source. Not in Guide. Clean.
3-arg start! with statechart-idRemoved. Guide correctly shows 2-arg form.

Slice A: Verdict

All 22 Guide claims match shipped behavior. No false claims found. The primary gap is undocumented features (M1-M10), not incorrect documentation.


Slice C: Release-Gate Verification Checklist

Before releasing routing changes, verify:

  • [ ] Every Guide routing claim has a matching public function with compatible signature
  • [ ] :route/segment override works on both rstate and istate
  • [ ] :routing/checks :warn logs and :strict throws for duplicate leaf names, segment chain collisions, reachable collisions, and invalid routing roots
  • [ ] start! signature is (start! app statechart) or (start! app statechart opts)
  • [ ] install-url-sync! throws if called before start!
  • [ ] url-sync-on-save dispatches for both root and child sessions
  • [ ] active-leaf-routes returns true deep leaves across invocation boundaries
  • [ ] URL sync: programmatic navigation pushes URL, browser back/forward restores route or reverts on denial
  • [ ] :route/params are encoded in _p query param and decoded on URL restoration
  • [ ] deep-configuration->url produces correct hierarchical paths across chart boundaries
  • [ ] URLHistoryProvider protocol is satisfied by both BrowserURLHistory and SimulatedURLHistory

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close