statechart-id parameter from ui-routes APIStatus: backlog Priority: P1 Created: 2026-02-18 Owner: AI
After the session-id simplification (spec ui-routing2-simplify-session-id), install-url-sync! and active-leaf-routes derive the statechart registration key from working memory (::sc/statechart-src). But start! still forces the caller to invent a statechart-id that is never referenced again — the only consumer was install-url-sync!, which no longer needs it.
The root issue: start! takes statechart-id as a parameter, registers the chart under that key, then hardcodes the well-known session-id constant for the session. The caller must track a key they never use again.
start! signatureBefore: (start! app statechart-id statechart)
After: (start! app statechart)
Register the chart under session-id (the existing constant ::session). This makes the registration key and session key the same well-known value — which is fine since there's exactly one routing session per app.
(defn start!
"Registers the routing `statechart` and starts a routing session.
No URL history integration is performed."
[app statechart]
(scf/register-statechart! app session-id statechart)
(scf/start! app {:machine session-id
:session-id session-id
:data {}}))
routing_demo2/app.cljs: Remove (def chart-key ::routing-chart), change (uir/start! app-instance chart-key demo-chart/routing-chart) → (uir/start! app-instance demo-chart/routing-chart)url_sync_headless_spec.cljc: Change all (uir/start! app ::test-chart test-routing-chart) → (uir/start! app test-routing-chart)Change (uir/start! app :my-app/routing routing-chart) → (uir/start! app routing-chart) (line ~1079).
Update ui-routing2-simplify-session-id.md API table row for start!.
src/main/com/fulcrologic/statecharts/integration/fulcro/ui_routes.cljc — start! function (~line 627)src/routing-demo2/com/fulcrologic/statecharts/routing_demo2/app.cljs — remove chart-key, update start! callsrc/test/com/fulcrologic/statecharts/integration/fulcro/url_sync_headless_spec.cljc — update start! callsGuide.adoc — update exampledocs/ai/specs/ui-routing2-simplify-session-id.md — update API tableistate child chart registration — istate uses target-key as both the registry key and invocation tracking key. This is intentional: each child chart needs a unique registry key, and the component key serves that purpose. Different concept from the root routing chart.app-ish — route-to!, force-continue-routing!, etc. need app-ish to access the Fulcro app's event queue. The app-ish parameter is not redundant.ui-routes namespace in REPLurl-sync-headless-spec tests — expect 15 assertions, 0 failuresui-routes-test — expect same results as before (the "Route entry" error is pre-existing)Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |